Browse Source

fix:商品成本

snow 1 year ago
parent
commit
e5c951ac70

+ 1 - 1
src/components/details/src/columns.js

@@ -24,7 +24,7 @@ export const productColumns = [
     span: 24,
   },
   {
-    prop: "company",
+    prop: "companyName",
     label: "业务公司",
     span: 12,
   },

+ 8 - 0
src/components/details/src/product.vue

@@ -111,6 +111,7 @@
 import { productColumns } from "./columns";
 import asyncRequest from "@/apis/components/details";
 import privateField from "@/mixins/privateField";
+import { add_sum } from "../../../utils/validate";
 
 export default {
   name: "Product",
@@ -121,6 +122,11 @@ export default {
       productColumns,
       productinfo: {},
       loading: false,
+      delivery_place: "",
+      origin_place: "",
+      ruleForm: {
+        usable_stock: ""
+      },
       options6: [
         { id: "1", name: "全国" },
         { id: "2", name: "全国除偏远" }
@@ -169,6 +175,8 @@ export default {
       this.ruleForm.spuCode = spuCode;
       this.delivery_place = await this.getArea("delivery_place");
       this.origin_place = await this.getArea("origin_place");
+
+      console.log();
       this.loading.product = false;
     }
   }

+ 22 - 6
src/components/globalComponents/show-goods-data-table/ShowDataTableColumns.js

@@ -4,9 +4,8 @@ const reColumns = [
     prop: 'good_name',
     label: '商品名称',
     _slot_: 'good_name',
-    span: 24
+    span: 18
   },
-
   {
     prop: 'cat',
     label: '分类',
@@ -102,9 +101,14 @@ const coveColumns = [
     prop: 'good_name',
     label: '商品名称',
     _slot_: 'good_name',
-    span: 24
+    span: 18
+  },
+  {
+    prop:'is_combind',
+    label:'组合类型',
+    _slot_:"is_combind",
+    span: 6
   },
-
   {
     prop: 'cat',
     label: '分类',
@@ -222,7 +226,13 @@ const onlineColumns = [
     prop: 'good_name',
     label: '商品名称',
     _slot_: 'good_name',
-    span: 24
+    span: 18
+  },
+  {
+    prop:'is_combind',
+    label:'组合类型',
+    _slot_:"is_combind",
+    span: 6
   },
 
   // {
@@ -516,7 +526,13 @@ const costColumns = [
     prop: 'good_name',
     label: '商品名称',
     _slot_: 'good_name',
-    span: 24
+    span: 18
+  },
+  {
+    prop:'is_combind',
+    label:'组合类型',
+    _slot_:"is_combind",
+    span: 6
   },
 
   // {

+ 106 - 86
src/components/globalComponents/show-goods-data-table/main.vue

@@ -11,6 +11,10 @@
       :columns="onlineColumns"
       :border="border"
     >
+      <template slot="is_combind">
+        <el-tag size="mini">{{String(sitem.is_combind) === "1" ? '组合商品' : '非组合商品'}}</el-tag>
+      </template>
+
       <template slot="good_name">
         <img
           v-if="sitem.good_thumb_img"
@@ -18,8 +22,8 @@
           style="width: 23px; height: 23px; margin: 0 5px 0 0"
           class="fl"
           :src="sitem.good_thumb_img"
-          alt=""
-        >
+          alt
+        />
         <span>{{ sitem.good_name }}</span>
         <span v-for="(si, i) in sitem.speclist" :key="si.spec_id + i">
           <span v-if="i !== 0">-</span>
@@ -29,7 +33,8 @@
         <el-popover placement="top" width="300" trigger="hover">
           <ul>
             <li>
-              <span>上线商品编号:</span><span>{{ sitem.skuCode }}</span>
+              <span>上线商品编号:</span>
+              <span>{{ sitem.skuCode }}</span>
             </li>
             <li
               v-if="
@@ -39,10 +44,12 @@
                     private_field.some((item) => item == '1')) || isSupertube)
               "
             >
-              <span>商品成本编号:</span><span>{{ sitem.spuCode }}</span>
+              <span>商品成本编号:</span>
+              <span>{{ sitem.spuCode }}</span>
             </li>
             <li>
-              <span>平台商品编码:</span><span>{{ sitem.platform_code_en }}</span>
+              <span>平台商品编码:</span>
+              <span>{{ sitem.platform_code_en }}</span>
             </li>
           </ul>
           <i slot="reference" class="el-icon-warning-outline fr" />
@@ -56,7 +63,7 @@
           class="fl"
           style="width: 23px; height: 23px; margin: 0 5px 0 0"
           :src="si"
-        >
+        />
       </template>
       <template slot="good_info_img">
         <img
@@ -66,14 +73,15 @@
           class="fl"
           style="width: 23px; height: 23px; margin: 0 5px 0 0"
           :src="si"
-        >
+        />
       </template>
       <template slot="company">
         <span>{{ sitem.companyName }}</span>
         <el-popover placement="top" width="300" trigger="hover">
           <ul>
             <li>
-              <span>业务企业编号:</span><span>{{ sitem.companyNo }}</span>
+              <span>业务企业编号:</span>
+              <span>{{ sitem.companyNo }}</span>
             </li>
           </ul>
           <i slot="reference" class="el-icon-warning-outline fr" />
@@ -82,7 +90,8 @@
 
       <template slot="exclusive">
         <span v-for="(si, sii) in sitem.exclusive" :key="si.id">
-          <span v-if="sii !== 0">/</span> <span>{{ si.name }}</span>
+          <span v-if="sii !== 0">/</span>
+          <span>{{ si.name }}</span>
         </span>
       </template>
       <template slot="supply_area">
@@ -117,15 +126,15 @@
         >{{ sitem.moq }}起订/工期{{ sitem.customized }}天</span>
       </template>
       <template slot="noble">
-        <span
-          v-if="sitem.noble_metal"
-        >{{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
+        <span v-if="sitem.noble_metal">
+          {{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
           sitem.noble_name
-        }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
+          }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
           sitem.is_gold_price + '' === "0" ? "不" : ""
-        }}启用实时金价-{{ sitem.is_diff + '' === "1" ? "有" : "无" }}工差-{{
+          }}启用实时金价-{{ sitem.is_diff + '' === "1" ? "有" : "无" }}工差-{{
           sitem.config
-        }}-{{ sitem.other_config }}</span>
+          }}-{{ sitem.other_config }}
+        </span>
       </template>
     </show-data-table>
     <show-data-table
@@ -146,8 +155,8 @@
           style="width: 23px; height: 23px; margin: 0 5px 0 0"
           class="fl"
           :src="sitem.good_thumb_img"
-          alt=""
-        >
+          alt
+        />
         <span>{{ sitem.good_name }}</span>
         <span v-for="(si, i) in sitem.speclist" :key="si.spec_id + i">
           <span v-if="i !== 0">-</span>
@@ -157,7 +166,8 @@
         <el-popover placement="top" width="300" trigger="hover">
           <ul>
             <li>
-              <span>商品成本编号:</span><span>{{ sitem.spuCode }}</span>
+              <span>商品成本编号:</span>
+              <span>{{ sitem.spuCode }}</span>
             </li>
           </ul>
           <i slot="reference" class="el-icon-warning-outline fr" />
@@ -171,7 +181,7 @@
           class="fl"
           style="width: 23px; height: 23px; margin: 0 5px 0 0"
           :src="si"
-        >
+        />
       </template>
       <template slot="good_info_img">
         <img
@@ -181,14 +191,15 @@
           class="fl"
           style="width: 23px; height: 23px; margin: 0 5px 0 0"
           :src="si"
-        >
+        />
       </template>
       <template slot="company">
         <span>{{ sitem.companyName }}</span>
         <el-popover placement="top" width="300" trigger="hover">
           <ul>
             <li>
-              <span>业务企业编号:</span><span>{{ sitem.companyNo }}</span>
+              <span>业务企业编号:</span>
+              <span>{{ sitem.companyNo }}</span>
             </li>
           </ul>
           <i slot="reference" class="el-icon-warning-outline fr" />
@@ -199,7 +210,8 @@
         <el-popover placement="top" width="300" trigger="hover">
           <ul>
             <li>
-              <span>供应商编号:</span><span>{{ sitem.supplierNo }}</span>
+              <span>供应商编号:</span>
+              <span>{{ sitem.supplierNo }}</span>
             </li>
           </ul>
           <i slot="reference" class="el-icon-warning-outline fr" />
@@ -207,7 +219,8 @@
       </template>
       <template slot="exclusive">
         <span v-for="(si, sii) in sitem.exclusive" :key="si.id">
-          <span v-if="sii !== 0">/</span> <span>{{ si.name }}</span>
+          <span v-if="sii !== 0">/</span>
+          <span>{{ si.name }}</span>
         </span>
       </template>
       <template slot="supply_area">
@@ -252,15 +265,15 @@
         >{{ sitem.moq }}起订/工期{{ sitem.customized }}天</span>
       </template>
       <template slot="noble">
-        <span
-          v-if="sitem.noble_metal"
-        >{{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
+        <span v-if="sitem.noble_metal">
+          {{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
           sitem.noble_name
-        }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
+          }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
           sitem.is_gold_price + '' === "0" ? "不" : ""
-        }}启用实时金价-{{ sitem.is_diff + '' === "1" ? "有" : "无" }}工差-{{
+          }}启用实时金价-{{ sitem.is_diff + '' === "1" ? "有" : "无" }}工差-{{
           sitem.config
-        }}-{{ sitem.other_config }}</span>
+          }}-{{ sitem.other_config }}
+        </span>
       </template>
     </show-data-table>
     <show-data-table
@@ -282,7 +295,7 @@
           v-if="sitem.good_img"
           :src="sitem.good_img"
           alt=""
-        /> -->
+        />-->
         <span>{{ sitem.good_name }}</span>
         <span v-for="(si, i) in sitem.specinfo" :key="si.spec_id + i">
           <span v-if="i !== 0">-</span>
@@ -292,7 +305,8 @@
         <el-popover placement="top" width="300" trigger="hover">
           <ul>
             <li>
-              <span>商品编号:</span><span>{{ sitem.spuCode }}</span>
+              <span>商品编号:</span>
+              <span>{{ sitem.spuCode }}</span>
             </li>
           </ul>
           <i slot="reference" class="el-icon-warning-outline fr" />
@@ -333,15 +347,15 @@
         />
       </template>
       <template slot="noble">
-        <span
-          v-if="sitem.noble_name"
-        >{{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
+        <span v-if="sitem.noble_name">
+          {{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
           sitem.noble_name
-        }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
+          }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
           sitem.is_gold_price === "0" ? "不" : ""
-        }}启用实时金价-{{ sitem.is_diff === "1" ? "有" : "无" }}工差-{{
+          }}启用实时金价-{{ sitem.is_diff === "1" ? "有" : "无" }}工差-{{
           sitem.config
-        }}-{{ sitem.other_config }}</span>
+          }}-{{ sitem.other_config }}
+        </span>
         <span v-else>--</span>
       </template>
       <template slot="good_img">
@@ -352,8 +366,8 @@
           style="width: 23px; height: 23px; margin: 0 5px 0 0"
           class="fl"
           :src="si"
-          alt=""
-        >
+          alt
+        />
       </template>
     </show-data-table>
     <show-data-table
@@ -367,6 +381,10 @@
       :columns="coveColumns"
       :border="border"
     >
+      <template slot="is_combind">
+        <el-tag size="mini">{{String(sitem.is_combind) === "1" ? '组合商品' : '非组合商品'}}</el-tag>
+      </template>
+
       <template slot="good_name">
         <span>{{ sitem.good_name }}</span>
         <span v-for="(si, i) in sitem.specinfo" :key="si.spec_id + i">
@@ -377,7 +395,8 @@
         <el-popover placement="top" width="300" trigger="hover">
           <ul>
             <li>
-              <span>商品编号:</span><span>{{ sitem.spuCode }}</span>
+              <span>商品编号:</span>
+              <span>{{ sitem.spuCode }}</span>
             </li>
           </ul>
           <i slot="reference" class="el-icon-warning-outline fr" />
@@ -421,15 +440,15 @@
         />
       </template>
       <template slot="noble">
-        <span
-          v-if="sitem.noble_name"
-        >{{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
+        <span v-if="sitem.noble_name">
+          {{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
           sitem.noble_name
-        }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
+          }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
           sitem.is_gold_price === "0" ? "不" : ""
-        }}启用实时金价-{{ sitem.is_diff === "1" ? "有" : "无" }}工差-{{
+          }}启用实时金价-{{ sitem.is_diff === "1" ? "有" : "无" }}工差-{{
           sitem.config
-        }}-{{ sitem.other_config }}</span>
+          }}-{{ sitem.other_config }}
+        </span>
         <span v-else>--</span>
       </template>
       <template slot="good_img">
@@ -440,8 +459,8 @@
           style="width: 23px; height: 23px; margin: 0 5px 0 0"
           class="fl"
           :src="si"
-          alt=""
-        >
+          alt
+        />
       </template>
     </show-data-table>
     <div v-else>商品编号有误</div>
@@ -449,8 +468,8 @@
 </template>
 
 <script>
-import asyncRequest from '@/apis/components/show-goods-data-table'
-import { mapGetters } from 'vuex'
+import asyncRequest from "@/apis/components/show-goods-data-table";
+import { mapGetters } from "vuex";
 import {
   onlineColumns,
   reColumns,
@@ -468,22 +487,22 @@ import {
   options10,
   options11,
   options12
-} from './ShowDataTableColumns'
+} from "./ShowDataTableColumns";
 export default {
-  name: 'ShowGoodsDataTable',
+  name: "ShowGoodsDataTable",
 
   props: {
     newTime: {
       type: String,
-      default: ''
+      default: ""
     },
     type: {
       type: String,
-      default: ''
+      default: ""
     },
     skucode: {
       type: String,
-      default: ''
+      default: ""
     },
     iscgd: {
       type: Boolean,
@@ -491,7 +510,7 @@ export default {
     },
     spucode: {
       type: String,
-      default: ''
+      default: ""
     },
     border: {
       type: Boolean,
@@ -518,86 +537,87 @@ export default {
       reColumns,
       costColumns,
       coveColumns
-    }
+    };
   },
   computed: {
-    ...mapGetters(['isSupertube'])
+    ...mapGetters(["isSupertube"])
   },
   watch: {
     newTime: function(val) {
       if (val) {
-        this.initForm()
+        this.initForm();
       }
     }
   },
   mounted() {
-    this.initForm()
+    this.initForm();
   },
 
   methods: {
     async initForm() {
       console.log(
         `${this.type}---${this.skucode}---${this.spucode}---${this.iscgd}`
-      )
-      this.columns = []
-      this.loading = true
+      );
+      this.columns = [];
+      this.loading = true;
+
       if (this.type) {
-        let res = {}
+        let res = {};
         if (
-          this.type + '' === '0' ||
-          this.type + '' === '1' ||
-          this.type + '' === '2' ||
-          this.type + '' === '5' ||
-          this.type + '' === '6'
+          this.type + "" === "0" ||
+          this.type + "" === "1" ||
+          this.type + "" === "2" ||
+          this.type + "" === "5" ||
+          this.type + "" === "6"
         ) {
           if (this.iscgd) {
             res = await asyncRequest.cost_detail({
               spuCode: this.spucode
-            })
+            });
           } else {
             res = await asyncRequest.online_detail({
               skuCode: this.skucode
-            })
+            });
           }
         } else {
           if (this.iscgd) {
             res = await asyncRequest.cove_detail({
               spuCode: this.spucode
-            })
+            });
           } else {
             res = await asyncRequest.re_detail({
               spuCode: this.spucode
-            })
+            });
           }
         }
-        const { code, message, data } = res
-        this.loading = false
+        const { code, message, data } = res;
+        this.loading = false;
         if (code === 0) {
-          this.sitem = JSON.parse(JSON.stringify(data))
-          const { cat_info } = this.sitem
-          let cat = ''
+          this.sitem = JSON.parse(JSON.stringify(data));
+          const { cat_info } = this.sitem;
+          let cat = "";
           if (cat_info && cat_info.length > 0) {
             cat_info.forEach((e, i) => {
-              cat += i === 0 ? e.name : '_' + e.name
-            })
+              cat += i === 0 ? e.name : "_" + e.name;
+            });
           }
-          this.sitem.cat = cat
+          this.sitem.cat = cat;
           // 线上商品字段转换
           if (this.sitem && this.sitem.good_img) {
-            this.sitem.good_img = this.sitem.good_img.split(',')
+            this.sitem.good_img = this.sitem.good_img.split(",");
           }
           if (this.sitem && this.sitem.good_info_img) {
-            this.sitem.good_info_img = this.sitem.good_info_img.split(',')
+            this.sitem.good_info_img = this.sitem.good_info_img.split(",");
           }
         } else if (code >= 100 && code <= 104) {
-          await this.logout()
+          await this.logout();
         } else {
-          this.$message.warning(message)
+          this.$message.warning(message);
         }
       }
     }
   }
-}
+};
 </script>
 
 <style lang="scss" scoped>

+ 10 - 11
src/components/show-goods-data-table-modal/index.vue

@@ -14,7 +14,8 @@
     element-loading-background="rgba(0, 0, 0, 0.8)"
     append-to-body
   >
-    <show-goods-data-table style="margin:-20px 0 0 0"
+    <show-goods-data-table
+      style="margin:-20px 0 0 0"
       :newTime="newTime"
       v-if="newTime !== ''"
       :type="type"
@@ -22,26 +23,24 @@
       :spucode="spuCode"
       :iscgd="iscgd"
       :border="true"
-    >
-    </show-goods-data-table>
+    />
   </el-dialog>
 </template>
 
 <script>
 export default {
   name: "showGoodsDataTableModal",
-  props: ["showModel", 'title',"type", "skuCode", "spuCode", "iscgd"],
-
+  props: ["showModel", "title", "type", "skuCode", "spuCode", "iscgd"],
 
   data() {
     return {
       newTime: "",
       loading: true,
-      showModelThis:this.showModel
+      showModelThis: this.showModel
     };
   },
   watch: {
-    showModel: function (val) {
+    showModel: function(val) {
       this.showModelThis = val;
       if (val) {
         this.loading = true;
@@ -52,17 +51,17 @@ export default {
       if (!val) {
         this.$emit("cancel");
       }
-    },
+    }
   },
 
   methods: {
     getNewTime() {
       this.newTime = new Date().valueOf() + "";
       this.loading = false;
-    },
-  },
+    }
+  }
 };
 </script>
 
 <style>
-</style>
+</style>

+ 16 - 7
src/views/goodStore/goodsCost/components/baseForm.vue

@@ -1292,14 +1292,15 @@ export default {
 
       this[type === "view" ? "mVisible" : "visible"] = true;
     },
-    handleProductSelected(evt) {
-      const { childCode, child_name } = evt;
-      const item = { childCode, child_name, child_num: 1 };
+    handleProductSelected(selecteds = []) {
       const childCodes = this.childTableData.map(({ childCode }) => childCode);
-
-      if (!childCodes.includes(childCode)) {
-        this.childTableData.push(item);
-      }
+      selecteds.forEach(item => {
+        const { childCode, child_name } = item;
+        const _t = { childCode, child_name, child_num: 1 };
+        if (!childCodes.includes(childCode)) {
+          this.childTableData.push(_t);
+        }
+      });
     },
     onCompanyChange() {
       if (this.type === "add") {
@@ -1381,6 +1382,14 @@ export default {
         this.$message.warning("当前有正在编辑的子商品,请先保存");
         return;
       }
+
+      const { is_combind, is_gold_price } = this.ruleForm;
+
+      if (is_combind === "1" && is_gold_price === "1" && this.is_noble) {
+        this.$message.warning("组合商品不能启用实时金价");
+        return;
+      }
+
       this.sch_is_noble();
       this.good_type_change();
       this.ruleForm.good_remark = replaceTextWrapAndSpace(

+ 127 - 126
src/views/goodStore/goodsCost/components/productListModal.vue

@@ -11,6 +11,7 @@
     @close="handleClose"
   >
     <ex-table
+      style="margin-top:-20px"
       v-loading="loading"
       :table="table"
       :data="tableData"
@@ -44,7 +45,7 @@
                 @timeReturned="handleTime"
               />
             </el-col>
-            
+
             <el-col :span="4" style="width: 135px">
               <search-brand
                 :value="brandid"
@@ -205,7 +206,7 @@
             :src="scope.row.good_thumb_img"
             style="display: inline-block; width: 100%; height: 100%"
             alt
-          >
+          />
         </div>
       </template>
       <template #status="{ scope }">
@@ -270,16 +271,16 @@
 </template>
 
 <script>
-import { listCol, options1, options4 } from './../columns'
-import { has_account_list, isStockOptions } from '@/assets/js/statusList'
-import asyncRequest from '@/apis/service/goodStore/goodsCost'
-import mixinPage from '@/mixins/elPaginationHandle'
-import resToken from '@/mixins/resToken'
+import { listCol, options1, options4 } from "./../columns";
+import { has_account_list, isStockOptions } from "@/assets/js/statusList";
+import asyncRequest from "@/apis/service/goodStore/goodsCost";
+import mixinPage from "@/mixins/elPaginationHandle";
+import resToken from "@/mixins/resToken";
 
 export default {
-  name: 'ProductListModal',
+  name: "ProductListModal",
   mixins: [mixinPage, resToken],
-  props: ['visible'],
+  props: ["visible"],
   data() {
     return {
       table: {
@@ -289,213 +290,213 @@ export default {
       },
       loading: false,
       columns: listCol.filter(({ label }) => {
-        return !['操作'].includes(label)
+        return !["操作"].includes(label);
       }),
       selected: [],
       options1,
       options4,
-      size: 'mini',
-      searchSize: 'mini',
-      tablebtnSize: 'mini',
-      sinput: '',
-      select: '1',
+      size: "mini",
+      searchSize: "mini",
+      tablebtnSize: "mini",
+      sinput: "",
+      select: "1",
       parmValue: {
         page: 1, // 页码
-        size: 10, // 每页显示条数
-        is_stock: '',
-        start: '',
-        end: '',
-        status: '',
-        good_name: '',
-        spucode: '',
+        size: 15, // 每页显示条数
+        is_stock: "",
+        start: "",
+        end: "",
+        status: "",
+        good_name: "",
+        spucode: "",
         cat_id: [],
-        brandid: '',
-        good_type: '',
-        companyNo: '',
-        supplierNo: '',
-        isonline: '',
-        company_name: '' // 创建人部门
+        brandid: "",
+        good_type: "",
+        companyNo: "",
+        supplierNo: "",
+        isonline: "",
+        company_name: "" // 创建人部门
       },
       has_account_list,
       isStockOptions,
       pageInfo: {
-        size: 10,
+        size: 15,
         curr: 1,
         total: 0
       },
       isonlineoptions: [
-        { id: '0', name: '未上线' },
-        { id: '1', name: '已上线' }
+        { id: "0", name: "未上线" },
+        { id: "1", name: "已上线" }
       ],
       statusList: [
         {
-          code: '0',
-          name: '新建待审核',
-          type: ''
+          code: "0",
+          name: "新建待审核",
+          type: ""
         },
         {
-          code: '1',
-          name: '审核通过',
-          type: 'success'
+          code: "1",
+          name: "审核通过",
+          type: "success"
         },
         {
-          code: '2',
-          name: '基础修改待审核',
-          type: ''
+          code: "2",
+          name: "基础修改待审核",
+          type: ""
         },
         {
-          code: '3',
-          name: '成本修改待审核',
-          type: ''
+          code: "3",
+          name: "成本修改待审核",
+          type: ""
         },
         {
-          code: '4',
-          name: '基础修改驳回',
-          type: 'danger'
+          code: "4",
+          name: "基础修改驳回",
+          type: "danger"
         },
         {
-          code: '5',
-          name: '成本修改驳回',
-          type: 'danger'
+          code: "5",
+          name: "成本修改驳回",
+          type: "danger"
         },
         {
-          code: '6',
-          name: '新建审核驳回',
-          type: 'danger'
+          code: "6",
+          name: "新建审核驳回",
+          type: "danger"
         },
         {
-          code: '7',
-          name: '复制商品待编辑',
-          type: 'info'
+          code: "7",
+          name: "复制商品待编辑",
+          type: "info"
         },
         {
-          code: '8',
-          name: '竞价商品待编辑',
-          type: 'info'
+          code: "8",
+          name: "竞价商品待编辑",
+          type: "info"
         }
       ],
       tableData: []
-    }
+    };
   },
   computed: {
     _visible: {
       get() {
-        return this.visible
+        return this.visible;
       },
       set(nV) {
-        this.$emit('update:visible', nV)
+        this.$emit("update:visible", nV);
       }
     }
   },
   watch: {
     visible(v) {
-      if (!v) return
-      this.searchList()
+      if (!v) return;
+      this.searchList();
     }
   },
   methods: {
     selectionChange(evt) {
-      const { list } = evt
-      this.selected = list
+      const { list } = evt;
+      this.selected = list;
     },
     restSearch() {
-      this.select = '2'
-      this.sinput = ''
-      this.supplierNo = []
-      this.brandid = []
+      this.select = "2";
+      this.sinput = "";
+      this.supplierNo = [];
+      this.brandid = [];
       // 表格 - 分页
       this.pageInfo = {
         size: 15,
         curr: 1,
         total: 0
-      }
+      };
       this.parmValue = {
         page: 1, // 页码
         size: 15, // 每页显示条数
-        start: '',
-        end: '',
-        status: '',
-        good_name: '',
-        company_name: '', // 创建人部门
-        spucode: '',
+        start: "",
+        end: "",
+        status: "",
+        good_name: "",
+        company_name: "", // 创建人部门
+        spucode: "",
         cat_id: [],
-        brandid: '',
-        good_type: '',
-        isonline: '',
-        companyNo: '',
-        supplierNo: ''
-      }
-      this.searchList()
+        brandid: "",
+        good_type: "",
+        isonline: "",
+        companyNo: "",
+        supplierNo: ""
+      };
+      this.searchList();
     },
     handleClose() {
-      this.selected = []
-      this._visible = false
+      this.selected = [];
+      this._visible = false;
     },
     proportionChange(proportion) {
-      this.ruleForm.proportion = proportion
+      this.ruleForm.proportion = proportion;
     },
     onSave() {
-      if (this.selected.length === 0 || this.selected.length > 1) {
-        const message =
-          this.selected.length === 0 ? '请选择一条商品' : '只能选择一条商品'
-        this.$message.warning(message)
-        return
+      if (this.selected.length === 0) {
+        this.$message.warning("请选择至少一条商品");
+        return;
       }
 
-      const { spuCode, good_name } = this.selected[0]
-      this.$emit('selected', {
-        childCode: spuCode,
-        child_name: good_name
-      })
-      this._visible = false
+      this.$emit(
+        "selected",
+        this.selected.map(({ spuCode, good_name }) => ({
+          childCode: spuCode,
+          child_name: good_name
+        }))
+      );
+      this._visible = false;
     },
     async searchList() {
       if (
-        (this.parmValue.start !== '' && this.parmValue.end === '') ||
-        (this.parmValue.start === '' && this.parmValue.end !== '')
+        (this.parmValue.start !== "" && this.parmValue.end === "") ||
+        (this.parmValue.start === "" && this.parmValue.end !== "")
       ) {
-        this.$message.warning('时间区间不完整!')
-        return
+        this.$message.warning("时间区间不完整!");
+        return;
       }
-      this.loading = true
-      const item = JSON.parse(JSON.stringify(this.parmValue))
-      item.spucode = this.select === '1' ? this.sinput : ''
-      item.good_name = this.select === '2' ? this.sinput : ''
-      item.companyNo = this.select === '3' ? this.sinput : ''
-      item.supplierNo = this.select === '4' ? this.sinput : ''
-      item.company_name = this.select === '5' ? this.sinput : '' // 部门
+      this.loading = true;
+      const item = JSON.parse(JSON.stringify(this.parmValue));
+      item.spucode = this.select === "1" ? this.sinput : "";
+      item.good_name = this.select === "2" ? this.sinput : "";
+      item.companyNo = this.select === "3" ? this.sinput : "";
+      item.supplierNo = this.select === "4" ? this.sinput : "";
+      item.company_name = this.select === "5" ? this.sinput : ""; // 部门
       item.cat_id =
-        item.cat_id.length > 0 ? item.cat_id[item.cat_id.length - 1] : ''
+        item.cat_id.length > 0 ? item.cat_id[item.cat_id.length - 1] : "";
       const res = await asyncRequest.list({
         ...item,
-        supplierNo: Array.isArray(this.supplierNo) ? this.supplierNo[0] : '',
+        supplierNo: Array.isArray(this.supplierNo) ? this.supplierNo[0] : "",
         needRela: true,
-        is_stock: '1',
-        status: '1',
-        is_combind: '0'
-      })
+        is_stock: "1",
+        status: "1",
+        is_combind: "0"
+      });
 
       if (res && res.code === 0 && res.data) {
-        this.tableData = res.data.list
+        this.tableData = res.data.list;
         this.tableData.forEach(a => {
-          a.cat_name = ''
-          const list = a.cat_info || []
+          a.cat_name = "";
+          const list = a.cat_info || [];
           list.forEach((b, i) => {
-            a.cat_name += i == 0 ? b.name : '/' + b.name
-          })
-        })
-        this.pageInfo.total = Number(res.data.count)
+            a.cat_name += i == 0 ? b.name : "/" + b.name;
+          });
+        });
+        this.pageInfo.total = Number(res.data.count);
       } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout()
+        await this.logout();
       } else {
-        this.tableData = []
-        this.pageInfo.total = 0
+        this.tableData = [];
+        this.pageInfo.total = 0;
       }
       // this.getresultlist();
-      this.loading = false
+      this.loading = false;
     }
   }
-}
+};
 </script>
 
 <style lang="scss" scoped>

+ 15 - 5
src/views/sellOut/combinedAdd/columns.js

@@ -3,12 +3,17 @@ const columns = [
     prop: 'stockCode',
     label: '库存申请编码',
     fixed: 'left',
-    minWidth: '152px'
+    width: '160px'
   },
   {
     prop: 'spuCode',
     label: '商品编码',
-    minWidth: '125px'
+    width: '160px'
+  },
+  {
+    prop: 'good_name',
+    label: '商品名称',
+    minWidth: '125px',
   },
   {
     label: '商品分类',
@@ -16,9 +21,9 @@ const columns = [
     _slot_:'catinfo'
   },
   {
-    prop: 'good_name',
-    label: '商品名称',
-    minWidth: '125px',
+    prop:'stock_num',
+    label:'本次申请数量',
+    width:'100px'
   },
   {
     prop: 'specInfo',
@@ -32,6 +37,11 @@ const columns = [
     label: '状态',
     width: '100px'
   },
+  {
+    prop: 'TODO',
+    label: '业务公司',
+    width: '120px'
+  },
   {
     prop: 'apply_name',
     label: '申请人',

+ 13 - 7
src/views/sellOut/combinedAdd/detail.vue

@@ -25,15 +25,21 @@
                   </template>
                 </show-data-table>
               </el-collapse-item>
-
-              <el-collapse-item title="组合商品详情" name="5" v-if="sitem">
-                <ProductDetail :spuCode="sitem.spuCode" />
+              <el-collapse-item
+                title="组合商品详情"
+                name="5"
+                v-if="sitem && sitem.spuCode
+              "
+              >
+                <show-goods-data-table
+                  v-if="newTime !== ''"
+                  type="1"
+                  :iscgd="true"
+                  :newTime="newTime"
+                  :spucode="sitem.spuCode"
+                />
               </el-collapse-item>
 
-              <!-- <el-collapse-item title="仓库信息" name="6" v-if="sitem">
-                <StockDetail :wsmCode="sitem.wsm_code" />
-              </el-collapse-item>-->
-
               <el-collapse-item title="子商品信息" name="4">
                 <el-table :data="sitem ? sitem.combindgood : []" size="mini" border>
                   <el-table-column label="子商品成本编号" prop="childCode" min-width="160px" />

+ 0 - 1
src/views/sellOut/combinedAdd/index.vue

@@ -32,7 +32,6 @@
                     :type="1"
                     :width="'165px'"
                     :size="searchSize"
-                    placeholder="创建"
                     @timeReturned="timeReturned($event)"
                   />
                 </el-col>

+ 2 - 9
src/views/sellOut/combinedRemove/index.vue

@@ -103,7 +103,7 @@
                   </template>
 
                   <el-button
-                    slot="appcreate_end"
+                    slot="append"
                     icon="el-icon-search"
                     @click="
                         pageInfo.curr = 1;
@@ -286,26 +286,19 @@ export default {
     const { back } = this.$route.query;
     if (back) {
       this.parmValue = JSON.parse(back);
-      console.log(this.parmValue);
       const { page, size } = this.parmValue;
-      // this.parmValue.create_start = create_start || last_create_start;
-      // this.parmValue.create_end = create_end || last_create_end;
-      // if(this.parmValue.companyNo.length>0){
-      //     this.customerCode = [this.parmValue.companyNo] ;
-      // }
 
       this.pageInfo = {
         size: size,
         curr: page,
         total: 0
       };
+
       //多选条件
       this.select = this.parmValue.select;
-      // this.sselect = this.parmValue.sselect;
       this.s_input = this.parmValue.s_input;
     } else {
       this.select = "1";
-      //  this.sselect = "创建时间"
     }
     this.searchList();
   },