ソースを参照

feat:库存解除

snow 1 年間 前
コミット
b55c809a44

+ 4 - 1
src/apis/service/sellOut/combinedAdd/index.js

@@ -21,5 +21,8 @@ export default {
   stock: (data, params) => http(api + 'warelist', data, 'post', params),
   stockinfo: (data, params) => http(api + 'wareinfo', data, 'post', params),
   productinfo: (data, params) => http(api + 'goodupinfo', data, 'post', params),
-  addrquery: (data, params) => http(api + 'addrquery', data, 'post', params)
+  addrquery: (data, params) => http(api + 'addrquery', data, 'post', params),
+  area: (data, params) => http(api + 'area', data, 'post', params),
+  city: (data, params) => http(api + 'city', data, 'post', params),
+  province: (data, params) => http(api + 'province', data, 'post', params)
 }

+ 5 - 4
src/views/dataDashboard/stockCount/components/productWeido/index.vue

@@ -42,19 +42,20 @@
                   />
                 </el-col>
 
-                <el-col :span="4">
+                <el-col style="width:400px">
                   <company-select
+                    style="width:100%"
                     :value="parmValue.companyNo"
                     @change="handleCompanyChange"
                     size="mini"
                     clearable
-                    placeholder="请选择业务公司"
+                    placeholder="业务公司"
                     :noCompanyCode="true"
                   />
                 </el-col>
 
                 <!-- 搜索 -->
-                <el-col :span="4" style="width: 54px">
+                <el-col style="width: 54px">
                   <el-button
                     :size="searchSize"
                     type="primary"
@@ -65,7 +66,7 @@
                   />
                 </el-col>
                 <!-- 重置 -->
-                <el-col :span="4" style="width: 56px; margin-left: 10px" class="mr5">
+                <el-col style="width: 56px; margin-left: 10px" class="mr5">
                   <el-button :size="searchSize" class="fr" type="warning" @click="restSearch">重置</el-button>
                 </el-col>
               </el-col>

+ 4 - 3
src/views/goodStore/goodsCost/components/baseForm.vue

@@ -457,7 +457,6 @@
         <el-table :data="childTableData" size="mini" border max-height="350px">
           <el-table-column label="子商品成本编号" prop="childCode" min-width="160px" />
           <el-table-column label="子商品名称" prop="child_name" min-width="180px" show-overflow-tooltip />
-
           <el-table-column label="组合比例" prop="child_num" width="140px">
             <template slot-scope="scope">
               <span v-if="scope.$index !== editIndex">
@@ -485,7 +484,7 @@
             <template #header>
               <div>
                 <span>操作</span>
-                <el-tooltip class="item" effect="dark" content="添加" placement="top">
+                <el-tooltip class="item" effect="dark" content="添加" placement="top" v-if="type === 'add' || type === 'edit'">
                   <i
                     class="el-icon-circle-plus-outline fr"
                     style="font-size:18px;cursor: pointer"
@@ -505,7 +504,8 @@
                 <i class="el-icon-view tb-icon" @click="onChildProdChange(scope.$index, 'view')"></i>
               </el-tooltip>
 
-              <el-tooltip
+              <template v-if="type === 'add' || type === 'edit'">
+                <el-tooltip
                 effect="dark"
                 content="修改"
                 placement="top"
@@ -526,6 +526,7 @@
               >
                 <i class="el-icon-delete tb-icon" @click="onDeleteItem(scope.$index)"></i>
               </el-tooltip>
+              </template>
             </template>
           </el-table-column>
         </el-table>

+ 1 - 1
src/views/purchaseIn/wsmInOrder/detail.vue

@@ -150,7 +150,7 @@ export default {
     },
     ppowers() {
       const { roleProcess } = this.$store.getters;
-      const tran = roleProcess.find(i => i.process_type === "RKB") || {};
+      const tran = roleProcess.find(i => i.process_type === "RKD") || {};
       const { action } = tran ?? {};
       return action ?? [];
     }

+ 8 - 1
src/views/sellOut/combinedAdd/detail.vue

@@ -67,7 +67,7 @@
               </el-collapse-item>
 
               <el-collapse-item
-                v-if="sitem && Number(sitem.status) === 1 && !isSupertube"
+                v-if="sitem && Number(sitem.status) === 1 && !isSupertube && ppowers.includes('1')"
                 title="待审核"
                 name="3"
               >
@@ -116,6 +116,12 @@ export default {
         btnList.find(item => item.menu_route == "combinedAddDetail") || {};
       const { action } = tran ?? {};
       return action ?? [];
+    },
+    ppowers() {
+      const tran =
+        this.$store.getters.roleProcess.find((i) => i.process_type === "ZHTC") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
     }
   },
   data() {
@@ -192,6 +198,7 @@ export default {
 
         let model = {
           id: this.queryId,
+          flag:'1',
           ...param
         };
 

+ 174 - 50
src/views/sellOut/combinedRemove/components/baseForm.vue

@@ -7,17 +7,110 @@
     :model="ruleForm"
     :rules="rules"
   >
-    <el-form-item v-loading="loading.product" label="组合商品添加记录" prop="spuCode" label-width="140px">
+  <el-form-item v-loading="loading.product" label="组合商品" prop="spuCode">
       <el-input v-if="!productinfo" placeholder="选择组合商品" @focus="pVisible = true" />
 
       <div v-else key="product" style="display:flex">
-        <show-data-table border :columns="detailColumns" :sitem="productinfo">
-          <template #status>
+        <show-data-table border :columns="productColumns" :sitem="productinfo">
+          <template slot="packing_spec">
             <el-tag
               size="mini"
-              :type="productinfo.status == '1' ? 'warning' : ''"
-            >{{(statusOptions.find((item) => item.id == String(productinfo.status)) || {}).label || '--'}}</el-tag>
+            >{{ ( options6.find(({id}) => id === productinfo.supply_area) || {}).name || '--' }}</el-tag>
           </template>
+
+          <template slot="is_auth">
+            <el-tag
+              size="mini"
+            >{{ ( options3.find(({id}) => id === productinfo.is_auth) || {}).name || '--' }}</el-tag>
+          </template>
+
+          <template slot="good_info_img">
+            <div style="max-height: 24px; overflow: hidden">
+              <el-image
+                style="height: 24px; width: 24px"
+                :src="productinfo.good_info_img"
+                :preview-src-list="[productinfo.good_info_img]"
+              />
+            </div>
+          </template>
+
+          <template slot="cat_info">
+            {{
+            productinfo.cat_info
+            ? productinfo.cat_info.map(({ name }) => name).join("_")
+            : "--"
+            }}
+          </template>
+
+          <template slot="is_combind">
+            {{
+            String(productinfo.is_combind) === '1' ? '组合商品' : '非组合商品'
+            }}
+          </template>
+
+          <template slot="good_name">
+            <img
+              v-if="productinfo.good_thumb_img"
+              v-viewer
+              style="width: 23px; height: 23px; margin: 0 5px 0 0"
+              class="fl"
+              :src="productinfo.good_thumb_img"
+              alt
+            />
+            <span>{{ productinfo.good_name }}</span>
+            <span v-for="(si, i) in productinfo.speclist" :key="si.spec_id + i">
+              <span v-if="i !== 0">-</span>
+              <span v-else>_</span>
+              <span>{{ si.spec_name }}[{{ si.spec_value }}]</span>
+            </span>
+            <el-popover placement="top" width="300" trigger="hover">
+              <ul>
+                <li v-if="newTime !== '' && isDisplayPrivateField('1')">
+                  <span>商品成本编号:</span>
+                  <span>{{ productinfo.spuCode }}</span>
+                </li>
+              </ul>
+              <i slot="reference" class="el-icon-warning-outline fr" />
+            </el-popover>
+          </template>
+
+          <template slot="noble">
+            <span v-if="productinfo.noble_metal">
+              {{ productinfo.noble_weight ? productinfo.noble_weight : "0" }}g-{{
+              productinfo.noble_name
+              }}-{{ productinfo.gold_price ? productinfo.gold_price : "0" }}元/g-{{
+              productinfo.is_gold_price + "" === "0" ? "不" : ""
+              }}启用实时金价-{{ productinfo.is_diff + "" === "1" ? "有" : "无" }}工差-{{
+              productinfo.config
+              }}-{{ productinfo.other_config }}
+            </span>
+          </template>
+
+          <template slot="weight">{{ productinfo.weight }}g</template>
+          <template slot="tax">{{ productinfo.tax }}%</template>
+          <template slot="is_stock">{{ String(productinfo.is_stock) === "0" ? "非库存品" : "库存品" }}</template>
+          <template
+            slot="is_exclusive"
+          >{{ String(productinfo.is_exclusive) === "0" ? "非泰康" : "泰康" }}</template>
+          <template slot="noble_weight">{{ productinfo.noble_weight }}g</template>
+          <template slot="is_gold_price">
+            {{
+            String(productinfo.is_gold_price) === "1" ? "是" : "否"
+            }}
+          </template>
+          <template slot="is_diff">
+            {{
+            String(productinfo.is_diff) === "1" ? "有公差" : "无工差"
+            }}
+          </template>
+
+          <template slot="packing_weight">{{ productinfo.packing_weight }}g</template>
+
+          <template slot="delivery_day">{{ productinfo.delivery_day }}天</template>
+          <template slot="lead_time">{{ productinfo.lead_time }}天</template>
+          <template slot="sample_day">{{ productinfo.sample_day }}天</template>
+          <template slot="delivery_place">{{ delivery_place }}</template>
+          <template slot="origin_place">{{ origin_place }}</template>
         </show-data-table>
 
         <el-tooltip v-if="type !== 'view'" content="重新选择组合商品" placement="top">
@@ -30,14 +123,23 @@
       </div>
     </el-form-item>
 
+    <el-form-item label="所在仓库" prop="wsm_code" v-if="productinfo">
+      <el-table row-key="id" ref="table" :data="productinfo.wsm_list" border size="mini" @selection-change="handleSelection">
+        <el-table-column type="selection" />
+        <el-table-column label="仓库名称" prop="name" />
+        <el-table-column label="仓库编码" prop="wsm_code" />
+        <el-table-column label="可用库存" prop="usable_stock" />
+      </el-table>
+    </el-form-item>
+
     <el-row>
-      <el-col :span="24">
+      <el-col :span="12">
         <el-form-item label="解除库存数" prop="stock_num" label-width="110px">
           <digital-input
             :values="ruleForm.stock_num"
             :placeholder="'添加库存数'"
             :min="0"
-            :max="100000000000"
+            :max="ruleForm.usable_stock"
             :position="'right'"
             :precision="0"
             :size="'mini'"
@@ -48,41 +150,20 @@
         </el-form-item>
       </el-col>
 
-      <!-- <el-col :span="12">
-        <el-form-item label="可解除库存总数" label-width="110px">
-          <digital-input
-            :values="ruleForm.usable_stock"
-            :placeholder="'可解除库存数'"
-            :min="0"
-            :max="100000000000"
-            :position="'right'"
-            :precision="0"
-            :size="'mini'"
-            :controls="false"
-            :disabled="true"
-            :append="''"
-            @reschange="number_change($event, 'usable_stock')"
-          />
+      <el-col :span="12">
+        <el-form-item label="可解除库存数" prop="unstockTotal" label-width="110px">
+          <el-input placeholder="可解除库存数" v-model="ruleForm.usable_stock" disabled />
         </el-form-item>
-      </el-col>-->
+      </el-col>
     </el-row>
 
     <el-form-item label="子商品库存情况" label-width="110px">
-      <el-table :data="productinfo ? productinfo.combindgood : []" size="mini" border>
+      <el-table :data="productinfo ? productinfo.combind_list : []" size="mini" border>
         <el-table-column label="子商品成本编号" prop="childCode" min-width="160px" />
         <el-table-column label="子商品名称" prop="child_name" min-width="180px" show-overflow-tooltip />
         <el-table-column label="组合比例" prop="child_num" />
-        <el-table-column label="本次解除库存数">
-          <template
-            slot-scope="{ row }"
-          >{{ ((row.child_num || 0) * ( ruleForm.stock_num || 0)) || 0}}</template>
-        </el-table-column>
-
-        <!-- <el-table-column label="锁定库存总数">
-          <template slot-scope="{ row }">{{ row.stock || 0 }}</template>
-        </el-table-column>-->
         <el-table-column label="剩余可解除库存数">
-          <template slot-scope="{ row }">{{ row.usable_stock || 0 }}</template>
+          <template slot-scope="{ row }">{{ row.stock || 0 }}</template>
         </el-table-column>
       </el-table>
     </el-form-item>
@@ -143,12 +224,22 @@ export default {
         stock: false,
         full: false
       },
+      origin_place:"",
+      delivery_place:"",
       ruleForm: {
         spuCode: "",
         wsm_code: "",
         stock_num: 0,
         usable_stock: 0
       },
+      options6: [
+        { id: "1", name: "全国" },
+        { id: "2", name: "全国除偏远" }
+      ],
+      options3: [
+        { id: "0", name: "无销售权限" },
+        { id: "1", name: "有销售权限" }
+      ],
       statusOptions: [
         { id: "1", label: "待审核" },
         { id: "2", label: "审核通过" },
@@ -172,18 +263,25 @@ export default {
       try {
         await this.$refs.ruleForm.validate();
         const { usable_stock, ...params } = this.ruleForm;
-        for (let item of this.productinfo.combindgood) {
-          const { child_num, stock, child_name } = item;
-          if (child_num * params.stock_num > stock) {
-            this.$message.warning(
-              `子商品   ${child_name}   解除库存数不能超过锁定库存总数`
-            );
-            return;
-          }
-        }
+        // for (let item of this.productinfo.child) {
+        //   const { child_num, stock, child_name } = item;
+        //   if (child_num * params.stock_num > stock) {
+        //     this.$message.warning(
+        //       `子商品   ${child_name}   解除库存数不能超过锁定库存总数`
+        //     );
+        //     return;
+        //   }
+        // }
+        // console.log(usable_stock,params.stock_num)
+        // if(usable_stock > params.stock_num){
+        //   this.$message.warning('')
+        //   return
+        // }
+
         this.loading.full = true;
         const { code, message } = await asyncRequest.add({
           ...params,
+          wsm_code:this.productinfo.wsm_list[0].wsm_code,
           flag: "0"
         });
 
@@ -204,22 +302,48 @@ export default {
         this.$refs.ruleForm && this.$refs.ruleForm.validateField(key);
       });
     },
+    handleSelection(list){
+      this.$nextTick(() => {
+        const { wsm_code = "" , usable_stock = 0} = (list[list.length - 1] || {})
+        this.ruleForm.wsm_code = wsm_code
+       this.ruleForm.usable_stock = usable_stock;
+       this.$refs.ruleForm.validate("wsm_code")
+      })
+    },
+    async getArea(prop = "delivery_place") {
+      const chunks = this.productinfo[prop].split(",");
+      let { data: province } = await asyncRequest.province();
+      province = province.find(
+        ({ province_code }) => province_code === chunks[0]
+      );
+      let { data: city } = await asyncRequest.city({ code: chunks[0] });
+      city = city.find(({ city_code }) => city_code === chunks[1]);
+      let { data: area } = await asyncRequest.area({ code: chunks[1] });
+      area = area.find(({ area_code }) => area_code === chunks[2]) || {};
+      return [province, city, area].map(({ name }) => name).join("");
+    },
     resetProduct() {
       this.productinfo = null;
       this.ruleForm.spuCode = "";
-      this.ruleForm.wsm_code = data.wsm_code;
+      // this.ruleForm.wsm_code = data.wsm_code;
     },
-    async handleProductSelected(id) {
+    async handleProductSelected(spuCode) {
       this.loading.product = true;
-      const { code, data } = await asyncRequest.detail({ id });
-      (data.combindgood || []).forEach(({ stock }) => {
-        this.ruleForm.usable_stock = add_sum(stock, this.ruleForm.usable_stock);
-      });
+      const { code, data } = await asyncRequest.productinfo({ spuCode });
+
+      
+      // (data.combind_list || []).forEach(({ stock }) => {
+      //   this.ruleForm.usable_stock = add_sum(stock, this.ruleForm.usable_stock);
+      // });
+      
       if (code !== 0) return;
       this.productinfo = data;
       this.ruleForm.spuCode = data.spuCode;
-      this.ruleForm.wsm_code = data.wsm_code;
+      // this.ruleForm.wsm_code = data.wsm_code;
       this.loading.product = false;
+
+      this.delivery_place = await this.getArea("delivery_place");
+      this.origin_place = await this.getArea("origin_place");
     }
   }
 };

+ 1 - 1
src/views/sellOut/combinedRemove/components/columnsForm.js

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

+ 430 - 212
src/views/sellOut/combinedRemove/components/productModal.vue

@@ -1,7 +1,7 @@
 <template>
   <el-dialog
     center
-    title="选择组合商品库存添加记录"
+    title="选择子商品"
     :visible="_visible"
     :close-on-click-modal="false"
     :append-to-body="true"
@@ -11,141 +11,248 @@
     @close="handleClose"
   >
     <ex-table
-      :table="table"
       v-loading="loading"
+      :table="table"
       :data="tableData"
       :columns="columns"
       :page="pageInfo"
       :size="size"
       @page-curr-change="handlePageChange"
       @page-size-change="handleSizeChange"
-      @selection="selectionChange"
       @screen-reset="
-          pageInfo.curr = 1;
-          parmValue.page = 1;
-          searchList();
-        "
+        pageInfo.curr = 1;
+        parmValue.page = 1;
+        searchList();
+      "
       @screen-submit="
-          pageInfo.curr = 1;
-          parmValue.page = 1;
-          searchList();
-        "
+        pageInfo.curr = 1;
+        parmValue.page = 1;
+        searchList();
+      "
+      @selection="selectionChange"
     >
       <template #table-header="{}">
         <div style="width: 100%">
-          <el-row>
-            <el-col :span="24">
-              <el-col :span="6" style="width: 355px;">
-                <period-date-picker
-                  :create_start="parmValue.create_start"
-                  :create_end="parmValue.create_end"
-                  :type="1"
-                  :width="'165px'"
-                  :size="searchSize"
-                  placeholder="创建"
-                  @timeReturned="timeReturned($event)"
-                />
-              </el-col>
+          <el-row style="padding: 0 0 10px 0px">
+            <el-col :span="6" style="width: 303px">
+              <period-date-picker
+                :type="1"
+                :width="'135px'"
+                :size="searchSize"
+                :start="parmValue.start"
+                :end="parmValue.end"
+                @timeReturned="handleTime"
+              />
+            </el-col>
+            <el-col :span="4" style="width: 135px">
+              <search-brand
+                :value="brandid"
+                :disabled="false"
+                :size="'mini'"
+                :is-detail="true"
+                :names="parmValue.supplierName"
+                :placeholder="'商品品牌'"
+                @searchChange="brandidsearchChange"
+              />
+            </el-col>
+            <el-col :span="6" style="width: 310px; padding: 0 0 0 10px">
+              <good-class
+                :value="parmValue.cat_id"
+                :disabled="false"
+                :size="searchSize"
+                :is-detail="false"
+                :placeholder="'分类'"
+                @handleChange="goods_class_change"
+              />
+            </el-col>
 
-              <el-col :span="3" style="width: 66px; float: right">
-                <el-button
-                  type="primary"
-                  :size="searchSize"
-                  @click="searchList"
-                  style="float: right; margin-left: 5px"
-                >刷新</el-button>
-              </el-col>
+            <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
+              <el-button type="primary" :size="searchSize" @click="searchList">刷新</el-button>
+            </el-col>
 
-              <el-col :span="4" style="width: 66px; float: right">
-                <el-button type="warning" class="fr" :size="searchSize" @click="restSearch">重置</el-button>
-              </el-col>
+            <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
+              <el-button type="warning" :size="searchSize" @click="restSearch">重置</el-button>
             </el-col>
           </el-row>
-          <el-row style="margin-top: 10px">
-            <el-col :span="6" style="width: 400px">
-              <el-input
-                v-model="value"
+          <el-row>
+            <!-- <el-col :span="4" style="width: 226px">
+              <el-select
+                v-model="parmValue.status"
+                filterable
+                clearable
                 :size="searchSize"
-                placeholder="关键字"
+                placeholder="状态"
+                style="width: 100%"
+                @change="
+                  pageInfo.curr = 1;
+                  parmValue.page = 1;
+                  searchList();
+                "
+              >
+                <el-option
+                  v-for="item in statusList"
+                  :key="'status' + item.code"
+                  :label="item.name"
+                  :value="item.code"
+                />
+              </el-select>
+            </el-col>-->
+            <el-col :span="4" style="width: 145px; padding: 0 0 0 0px">
+              <el-select
+                v-model="parmValue.isonline"
+                filterable
+                clearable
+                :size="searchSize"
+                placeholder="是否上线"
+                style="width: 100%"
+                @change="
+                  pageInfo.curr = 1;
+                  parmValue.page = 1;
+                  searchList();
+                "
+              >
+                <el-option
+                  v-for="item in isonlineoptions"
+                  :key="'isonline' + item.id"
+                  :label="item.name"
+                  :value="item.id"
+                />
+              </el-select>
+            </el-col>
+
+            <!-- <el-col :span="4" style="width: 135px;margin-left:10px">
+              <el-select
+                v-model="parmValue.is_stock"
+                size="mini"
+                style="width: 100%"
+                placeholder="商品类型"
                 clearable
-                :maxlength="40"
                 @change="
-                      pageInfo.curr = 1;
-                      parmValue.page = 1;
-                      searchList();
-                    "
+                  pageInfo.curr = 1;
+                  parmValue.page = 1;
+                  searchList();
+                "
               >
-                <template #prepend>
-                  <el-select
-                    v-model="parmValue.key"
-                    style="width:100px"
-                    @change="
-                      pageInfo.curr = 1;
-                      parmValue.page = 1;
-                      searchList();
-                    "
-                  >
-                    <el-option label="商品名称" value="spuCode" />
-                    <el-option label="商品编码" value="good_name" />
-                  </el-select>
-                </template>
+                <el-option
+                  v-for="opt in isStockOptions"
+                  :key="opt.value"
+                  :value="opt.value"
+                  :label="opt.label"
+                />
+              </el-select>
+            </el-col>-->
+            <el-col :span="4" style="margin: 0 10px">
+              <search-supplier
+                :size="'mini'"
+                style="width: 165px"
+                :value="supplierNo"
+                :disabled="false"
+                :placeholder="'供应商名称'"
+                :is-detail="false"
+                :no-disabled="true"
+                :names="''"
+                @searchChange="supplierChange"
+              />
+            </el-col>
 
-                <el-button
-                  slot="appcreate_end"
-                  icon="el-icon-search"
-                  @click="
-                        pageInfo.curr = 1;
-                        parmValue.page = 1;
-                        searchList();
-                      "
-                ></el-button>
+            <el-col :span="4" style="width: 420px">
+              <el-input
+                v-model="sinput"
+                :size="searchSize"
+                :maxlength="40"
+                placeholder="关键字"
+                @blur="
+                  pageInfo.curr = 1;
+                  parmValue.page = 1;
+                  searchList();
+                "
+              >
+                <el-select
+                  slot="prepend"
+                  v-model="select"
+                  style="width: 135px"
+                  placeholder="关键字类型"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option label="商品编号" value="1" />
+                  <el-option label="商品名称" value="2" />
+                </el-select>
               </el-input>
             </el-col>
           </el-row>
         </div>
       </template>
+
+      <template #spuCode="{ scope }">
+        <div style="display:flex;align-items:center">
+          <p>{{ scope.row.spuCode }}</p>
+        </div>
+      </template>
+
+      <template #good_thumb_img="{ scope }">
+        <div
+          v-if="scope.row.good_thumb_img"
+          v-viewer
+          style="width: 20px; height: 20px"
+          class="hover"
+        >
+          <img
+            :src="scope.row.good_thumb_img"
+            style="display: inline-block; width: 100%; height: 100%"
+            alt
+          >
+        </div>
+      </template>
       <template #status="{ scope }">
         <el-tag
           :size="tablebtnSize"
-          :type="scope.row.status == '0' ? 'warning' : ''"
+          :type="
+            (statusList.find((item) => item.code == scope.row.status) || {}).type || '--'
+          "
           v-text="
-              (statusOptions.find((item) => item.id == scope.row.status) || {})
-                .label || '--'
-            "
-        ></el-tag>
+            (statusList.find((item) => item.code == scope.row.status) || {}).name || '--'
+          "
+        />
       </template>
-
-      <template #order_source="{ scope }">
+      <template #has_account="{ scope }">
         <el-tag
           :size="tablebtnSize"
+          :type="
+            (
+              has_account_list.find((item) => item.code == scope.row.has_account + '') ||
+              {}
+            ).type || '--'
+          "
           v-text="
-              (
-              xs_order_source_options.find(
-                  (item) => item.id == scope.row.order_source
-                ) || {}
-              ).label || '--'
-            "
-        ></el-tag>
+            (
+              has_account_list.find((item) => item.code == scope.row.has_account + '') ||
+              {}
+            ).name || '--'
+          "
+        />
       </template>
-
-      <template #catinfo="{ scope }">{{scope.row.catInfo.map(({name}) => name).join("-")}}</template>
-
-      <template #specInfo="{ scope }">
-        <span
-          v-for="(si, sii) in scope.row.specInfo"
-          :key="sii + si.spec_value_id"
-        >{{ sii === 0 ? "" : "-" }}{{ si.spec_name }}[{{ si.spec_value }}]</span>
+      <template #isonline="{ scope }">
+        <el-tag
+          :size="tablebtnSize"
+          :type="scope.row.is_online == '0' ? 'warning' : ''"
+          v-text="
+            (isonlineoptions.find((item) => item.id == scope.row.is_online) || {}).name ||
+              '--'
+          "
+        />
       </template>
-
-      <template #order_type="{ scope }">
+      <template #is_stock="{ scope }">
         <el-tag
           :size="tablebtnSize"
+          :type="scope.row.is_stock == '0' ? 'warning' : ''"
           v-text="
-              (
-              is_stock.find((item) => item.id == scope.row.is_stock) || {}
-              ).name || '--'
-            "
-        ></el-tag>
+            (options4.find((item) => item.id == scope.row.is_stock) || {}).name || '--'
+          "
+        />
       </template>
     </ex-table>
 
@@ -156,24 +263,24 @@
 </template>
 
 <script>
-import { has_account_list, isStockOptions } from "@/assets/js/statusList";
-import mixinPage from "@/mixins/elPaginationHandle";
-import resToken from "@/mixins/resToken";
-import asyncRequest from "@/apis/service/sellOut/combinedAdd";
+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 {
       options1: [
-        { id: "0", name: "否" },
-        { id: "1", name: "是" }
+        { id: '0', name: '否' },
+        { id: '1', name: '是' }
       ],
       options4: [
-        { id: "0", name: "非库存品" },
-        { id: "1", name: "库存品" }
+        { id: '0', name: '非库存品' },
+        { id: '1', name: '库存品' }
       ],
       table: {
         stripe: true,
@@ -182,19 +289,27 @@ export default {
       },
       loading: false,
       selected: [],
-      size: "mini",
-      searchSize: "mini",
-      tablebtnSize: "mini",
-      sinput: "",
-      select: "1",
+      size: 'mini',
+      searchSize: 'mini',
+      tablebtnSize: 'mini',
+      sinput: '',
+      select: '1',
       parmValue: {
-        key: "spuCode",
-        value: "",
-        status: "",
-        create_start: "",
-        create_end: "",
         page: 1, // 页码
-        size: 15 // 每页显示条数
+        size: 10, // 每页显示条数
+        is_stock: '',
+        start: '',
+        end: '',
+        status: '',
+        good_name: '',
+        spucode: '',
+        cat_id: [],
+        brandid: '',
+        good_type: '',
+        companyNo: '',
+        supplierNo: '',
+        isonline: '',
+        company_name: '' // 创建人部门
       },
       has_account_list,
       isStockOptions,
@@ -204,173 +319,276 @@ export default {
         total: 0
       },
       isonlineoptions: [
-        { id: "0", name: "未上线" },
-        { id: "1", name: "已上线" }
+        { id: '0', name: '未上线' },
+        { id: '1', name: '已上线' }
       ],
-      statusOptions: [
-        { id: "1", label: "待审核" },
-        { id: "2", label: "审核通过" },
-        { id: "3", label: "审核驳回" }
+      statusList: [
+        {
+          code: '0',
+          name: '新建待审核',
+          type: ''
+        },
+        {
+          code: '1',
+          name: '审核通过',
+          type: 'success'
+        },
+        {
+          code: '2',
+          name: '基础修改待审核',
+          type: ''
+        },
+        {
+          code: '3',
+          name: '成本修改待审核',
+          type: ''
+        },
+        {
+          code: '4',
+          name: '基础修改驳回',
+          type: 'danger'
+        },
+        {
+          code: '5',
+          name: '成本修改驳回',
+          type: 'danger'
+        },
+        {
+          code: '6',
+          name: '新建审核驳回',
+          type: 'danger'
+        },
+        {
+          code: '7',
+          name: '复制商品待编辑',
+          type: 'info'
+        },
+        {
+          code: '8',
+          name: '竞价商品待编辑',
+          type: 'info'
+        }
       ],
       columns: [
-        { type: "selection", fixed: "left", _noset_: true },
+        { type: 'selection', fixed: 'left', _noset_: true },
         {
-          prop: "stockCode",
-          label: "库存申请编码",
-          fixed: "left",
-          minWidth: "152px"
+          prop: 'spuCode',
+          label: '编号',
+          width: '180px',
+          _slot_: 'spuCode'
         },
         {
-          prop: "spuCode",
-          label: "商品编码",
-          minWidth: "125px"
+          prop: 'good_thumb_img',
+          label: '图片',
+          _slot_: 'good_thumb_img',
+          width: '45px'
         },
         {
-          label: "商品分类",
-          minWidth: "125px",
-          _slot_: "catinfo"
+          prop: 'good_name',
+          label: '名称',
+          'min-width': '160px'
         },
         {
-          prop: "good_name",
-          label: "商品名称",
-          minWidth: "125px"
+          prop: 'cat_name',
+          label: '分类'
         },
         {
-          prop: "specInfo",
-          label: "商品规格",
-          minWidth: "125px",
-          _slot_: "specInfo"
+          prop: 'brand_name',
+          label: '品牌'
         },
         {
-          prop: "status",
-          _slot_: "status",
-          label: "状态",
-          width: "100px"
+          prop: 'is_stock',
+          label: '库存类型',
+          _slot_: 'is_stock',
+          width: '85px'
         },
+        // {
+        //   prop: "is_combind",
+        //   label: "是否组合商品",
+        //   width: "105px",
+        //   _slot_: "is_combind"
+        // },
         {
-          prop: "apply_name",
-          label: "申请人",
-          width: "90px"
+          prop: 'isonline',
+          label: '是否上线',
+          _slot_: 'isonline',
+          width: '70px'
         },
         {
-          prop: "createtime",
-          label: "创建时间",
-          width: "155px"
+          prop: 'status',
+          label: '状态',
+          _slot_: 'status',
+          width: '118px'
+        },
+        {
+          prop: 'has_account',
+          label: '供应商账号',
+          _slot_: 'has_account',
+          width: '85px'
+        },
+        {
+          prop: 'supplierNo',
+          label: '供应商编号',
+          width: '110px'
+        },
+        {
+          prop: 'supplierName',
+          label: '供应商名称',
+          width: '110px'
+        },
+        {
+          prop: 'companyNo',
+          label: '业务公司编号',
+          width: '110px'
+        },
+        {
+          prop: 'companyName',
+          label: '业务公司名称',
+          width: '110px'
+        },
+        {
+          prop: 'charger_company_name',
+          label: '负责人部门',
+          minWidth: '150px'
+        },
+
+        {
+          prop: 'charger',
+          label: '负责人',
+          width: '70px'
+        },
+        {
+          prop: 'creater',
+          label: '创建人',
+          width: '70px'
+        },
+
+        {
+          prop: 'addtime',
+          label: '创建时间',
+          width: '140px'
         }
       ],
       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;
+          this.selected.length === 0 ? '请选择一条商品' : '只能选择一条商品'
+        this.$message.warning(message)
+        return
       }
 
-      const { id } = this.selected[0];
-      this.$emit("selected", id);
-      this._visible = false;
+      const { spuCode, id } = this.selected[0]
+      this.$emit('selected', spuCode, id)
+      this._visible = false
     },
     async searchList() {
+      console.log(this.parmValue)
       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 { key, value, ...rest } = this.parmValue;
-
+      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] : ''
       const res = await asyncRequest.list({
+        ...item,
+        supplierNo: Array.isArray(this.supplierNo) ? this.supplierNo[0] : '',
         needRela: true,
-        [key]: value,
-        flag: "1",
-        ...rest,
-        status: "2"
-      });
+        is_stock: '1',
+        status: '1',
+        is_combind: '1'
+      })
 
       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.loading = false;
+      // this.getresultlist();
+      this.loading = false
     }
   }
-};
+}
 </script>
 
 <style lang="scss" scoped>

+ 8 - 15
src/views/sellOut/combinedRemove/detail.vue

@@ -53,7 +53,6 @@
                       slot-scope="{ row }"
                     >{{ ((row.child_num || 0) * ( sitem.stock_num || 0)) || 0}}</template>
                   </el-table-column>
-
                   <el-table-column label="锁定库存总数">
                     <template slot-scope="scope">{{ scope.row.stock || 0 }}</template>
                   </el-table-column>
@@ -63,8 +62,8 @@
                 </el-table>
               </el-collapse-item>
 
-              <el-collapse-item
-                v-if="Number(sitem.status) === 1 && !isSupertube"
+             <el-collapse-item
+                v-if="Number(sitem.status) === 1 && !isSupertube && ppowers.includes('1')"
                 title="待审核"
                 name="3"
               >
@@ -114,6 +113,12 @@ export default {
         btnList.find(item => item.menu_route == "combinedRemoveDetail") || {};
       const { action } = tran ?? {};
       return action ?? [];
+    },
+    ppowers() {
+      const tran =
+        this.$store.getters.roleProcess.find((i) => i.process_type === "ZHJC") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
     }
   },
   data() {
@@ -140,18 +145,6 @@ export default {
         }
       ],
       wsm_options: [
-        // {
-        //   value: "1",
-        //   label: "系统仓",
-        // },
-        //   {
-        //   value: "2",
-        //   label: "虚拟仓",
-        // },
-        //     {
-        //   value: "3",
-        //   label: "自建仓",
-        // },
         {
           value: "5",
           label: "销售仓"