Selaa lähdekoodia

feat:库存解除

snow 1 vuosi sitten
vanhempi
commit
ccd8918cb4

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

@@ -3,7 +3,7 @@ import http from '@/apis/axios'
 const api = 'admin/'
 export default {
   // 添加
-  add: (data, params) => http(api + 'salezxcreate', data, 'post', params),
+  add: (data, params) => http(api + 'combindadd', data, 'post', params),
   // 删除
   delete: (data, params) => http(api + 'Consultdel', data, 'post', params),
   // 分页查询

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

@@ -38,7 +38,18 @@
                 </el-col>
 
                 <el-col :span="4" style="margin-left: 10px">
-                  <el-select style="width:100%" v-model="parmValue.status" size="mini">
+                  <el-select
+                    style="width:100%"
+                    placeholder="状态"
+                    v-model="parmValue.status"
+                    size="mini"
+                    clearable
+                    @change="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                  >
                     <el-option
                       v-for="s in statusOptions"
                       :label="s.label"
@@ -429,6 +440,7 @@ export default {
       const res = await asyncRequest.list({
         needRela: true,
         [key]: value,
+        flag: "1",
         ...rest
       });
 

+ 92 - 12
src/views/sellOut/combinedRemove/columns.js

@@ -1,30 +1,30 @@
 const columns = [
-
   {
-    prop: 'TODO',
+    prop: 'stockCode',
     label: '库存申请编码',
     fixed: 'left',
     minWidth: '152px'
   },
   {
-    prop: 'TODO',
+    prop: 'spuCode',
     label: '商品编码',
     minWidth: '125px'
   },
   {
-    prop: 'TODO',
     label: '商品分类',
-    minWidth: '125px'
+    minWidth: '125px',
+    _slot_:'catinfo'
   },
   {
-    prop: 'TODO',
+    prop: 'good_name',
     label: '商品名称',
-    minWidth: '125px'
+    minWidth: '125px',
   },
   {
-    prop: 'TODO',
+    prop: 'specInfo',
     label: '商品规格',
-    minWidth: '125px'
+    minWidth: '125px',
+    _slot_:'specInfo'
   },
   {
     prop: 'status',
@@ -33,12 +33,12 @@ const columns = [
     width: '100px'
   },
   {
-    prop: 'TODO',
+    prop: 'apply_name',
     label: '申请人',
     width: '90px'
   },
   {
-    prop: 'addtime',
+    prop: 'createtime',
     label: '创建时间',
     width: '155px'
   },
@@ -108,4 +108,84 @@ const showColumns = [
     span: 18
   }
 ]
-export { columns, showColumns }
+
+const detailColumns = [
+  {
+    prop: 'stockCode',
+    label: '库存申请编号',
+    span: 8
+  },
+  {
+    prop:'good_name',
+    label:'商品名称',
+    span:8
+  },
+  {
+    label: '状态',
+    prop: 'status',
+    span: 8,
+    _slot_: 'status'
+  },
+  {
+    label:'仓库名称',
+    prop:'wsm_name',
+    span:8
+  },
+  {
+    label:'添加库存数',
+    prop:'stock_num',
+    span:8
+  },
+  {
+    label:'创建时间',
+    prop:'createtime',
+    span:8
+  },
+  {
+    label: '备注',
+    prop: 'remark',
+    span: 24
+  }
+]
+
+const detailColumns_j = [
+  {
+    prop: 'stockCode',
+    label: '库存申请编号',
+    span: 8
+  },
+  {
+    prop:'good_name',
+    label:'商品名称',
+    span:8
+  },
+  {
+    label: '状态',
+    prop: 'status',
+    span: 8,
+    _slot_: 'status'
+  },
+  {
+    label:'仓库名称',
+    prop:'wsm_name',
+    span:8
+  },
+  {
+    label:'解除库存数',
+    prop:'stock_num',
+    span:8
+  },
+  {
+    label:'创建时间',
+    prop:'createtime',
+    span:8
+  },
+  {
+    label: '备注',
+    prop: 'remark',
+    span: 24
+  }
+]
+
+
+export { columns, showColumns, detailColumns,detailColumns_j }

+ 165 - 33
src/views/sellOut/combinedRemove/components/baseForm.vue

@@ -1,17 +1,41 @@
 <template>
-  <el-form label-width="90px" size="mini">
-    <el-row>
-      <el-form-item label="组合商品添加记录" label-width="130px">
-        <el-input placeholder="选择组合商品" />
-      </el-form-item>
-    </el-row>
+  <el-form
+    ref="ruleForm"
+    v-loading="loading.full"
+    label-width="90px"
+    size="mini"
+    :model="ruleForm"
+    :rules="rules"
+  >
+    <el-form-item v-loading="loading.product" label="组合商品添加记录" prop="spuCode" label-width="140px">
+      <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>
+            <el-tag
+              size="mini"
+              :type="productinfo.status == '1' ? 'warning' : ''"
+            >{{(statusOptions.find((item) => item.id == String(productinfo.status)) || {}).label || '--'}}</el-tag>
+          </template>
+        </show-data-table>
+
+        <el-tooltip v-if="type !== 'view'" content="重新选择组合商品" placement="top">
+          <i
+            class="el-icon-circle-close"
+            style="cursor:pointer;font-size:18px;margin-left:10px"
+            @click="resetProduct"
+          />
+        </el-tooltip>
+      </div>
+    </el-form-item>
 
     <el-row>
       <el-col :span="12">
-        <el-form-item label="解除库存数">
+        <el-form-item label="解除库存数" prop="stock_num" label-width="110px">
           <digital-input
-            :values="ruleForm.stock_moq"
-            :placeholder="'解除库存数'"
+            :values="ruleForm.stock_num"
+            :placeholder="'添加库存数'"
             :min="0"
             :max="100000000000"
             :position="'right'"
@@ -19,16 +43,16 @@
             :size="'mini'"
             :controls="false"
             :append="''"
-            @reschange="number_change($event, 'stock_moq')"
+            @reschange="number_change($event, 'stock_num')"
           />
         </el-form-item>
       </el-col>
 
       <el-col :span="12">
-        <el-form-item label="可用库存数">
+        <el-form-item label="可解除库存数" label-width="110px">
           <digital-input
-            :values="ruleForm.can_stock"
-            :placeholder="'可库存数'"
+            :values="ruleForm.usable_stock"
+            :placeholder="'可解除库存数'"
             :min="0"
             :max="100000000000"
             :position="'right'"
@@ -37,54 +61,162 @@
             :controls="false"
             :disabled="true"
             :append="''"
-            @reschange="number_change($event, 'can_stock')"
+            @reschange="number_change($event, 'usable_stock')"
           />
         </el-form-item>
       </el-col>
     </el-row>
 
     <el-form-item label="子商品库存情况" label-width="110px">
-      <el-table :data="childTableData" size="mini" border>
-        <el-table-column label="子商品成本编号" prop="childNo" min-width="160px" />
-        <el-table-column label="子商品名称" prop="goodName" min-width="180px" show-overflow-tooltip />
-        <el-table-column label="商品类型" prop="goodType" min-width="100px">
-          <template slot-scope="scope">
-            <el-tag size="mini">
-              {{
-              (isStockOptions.find(({value}) => value === scope.row.goodType) || {}).label || '--'
-              }}
-            </el-tag>
-          </template>
+      <el-table :data="productinfo ? productinfo.combindgood : []" 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>
         </el-table-column>
-        <el-table-column label="组合比例" />
-        <el-table-column label="锁定库存总数" />
-        <el-table-column label="锁定库存可用库存数" />
-        <el-table-column label="未锁定库存数" />
       </el-table>
     </el-form-item>
 
     <el-form-item>
       <div class="flex-end" style="width:100%;display:flex;justify-content:flex-end">
-        <el-button size="mini" type="primary">保存</el-button>
+        <el-button size="mini" type="primary" @click="submit">保存</el-button>
       </div>
     </el-form-item>
+
+    <stock-modal :visible.sync="sVisible" @selected="handleStockSelected" />
+    <product-modal :visible.sync="pVisible" @selected="handleProductSelected" />
   </el-form>
 </template>
 
 <script>
+import StockModal from "./stockModal.vue";
+import ProductModal from "./productModal.vue";
+import asyncRequest from "@/apis/service/sellOut/combinedAdd";
+import { stockColumns, productColumns } from "./columnsForm";
+import privateField from "@/mixins/privateField";
+import { detailColumns } from "./../columns";
+import { isnumber } from "@/utils/validate";
+
+const validateNum = (rule, value, callback) => {
+  if (value === "") {
+    callback(new Error("添加库存数不能为空!"));
+  } else {
+    const num = parseInt(value + "");
+    console.log(num);
+    if (!isnumber(value)) {
+      callback(new Error("添加库存数必须是整数!"));
+    } else if (num === NaN) {
+      callback(new Error("添加库存数必须是整数!"));
+    } else if (num === 0) {
+      callback(new Error("添加库存数不能为零!"));
+    } else {
+      callback();
+    }
+  }
+};
+
 export default {
   name: "BaseForm",
+  components: { StockModal, ProductModal },
+  mixins: [privateField],
   data() {
     return {
+      detailColumns,
+      stockColumns,
+      productColumns,
+      sVisible: false,
+      pVisible: false,
+      stockinfo: null,
+      productinfo: null,
+      loading: {
+        product: false,
+        stock: false,
+        full: false
+      },
       ruleForm: {
-        stock_moq: 0,
-        can_stock: 0
+        spuCode: "",
+        wsm_code: "",
+        stock_num: 0,
+        usable_stock: 0
+      },
+      statusOptions: [
+        { id: "1", label: "待审核" },
+        { id: "2", label: "审核通过" },
+        { id: "3", label: "审核驳回" }
+      ],
+      rules: {
+        spuCode: [
+          { required: true, trigger: "change", message: "请选择组合商品" }
+        ],
+        wsm_code: [
+          { required: true, trigger: "change", message: "请选择所在仓库" }
+        ],
+        stock_num: [
+          { required: true, trigger: "change", validator: validateNum }
+        ]
       }
     };
   },
   methods: {
-    number_change(e) {
+    async submit() {
+      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;
+          }
+        }
+        this.loading.full = true;
+        const { code, message } = await asyncRequest.add({
+          ...params,
+          flag: "0"
+        });
+
+        this.loading.full = false;
+        if (Number(code) === 0) {
+          this.$router.push("/sellOut/combinedRemove");
+          return;
+        } else if (code === 1004) {
+          this.$message.warning(message);
+        }
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    number_change(e, key) {
       this.ruleForm[key] = e;
+      this.$nextTick(() => {
+        this.$refs.ruleForm && this.$refs.ruleForm.validateField(key);
+      });
+    },
+    resetProduct() {
+      this.productinfo = null;
+      this.ruleForm.spuCode = "";
+      this.ruleForm.wsm_code = data.wsm_code;
+    },
+    async handleProductSelected(id) {
+      this.loading.product = true;
+      const { code, data } = await asyncRequest.detail({ id });
+      if (code !== 0) return;
+      this.productinfo = data;
+      this.ruleForm.spuCode = data.spuCode;
+      this.ruleForm.wsm_code = data.wsm_code;
+      this.loading.product = false;
     }
   }
 };

+ 248 - 38
src/views/sellOut/combinedRemove/components/columnsForm.js

@@ -1,39 +1,249 @@
-export default [
-    {
-        prop: "orderCode",
-        label: "竞价订单编号",
-        col: "8",
-    },
-    {
-        prop: "class_cat",
-        label: "商品分类",
-        col: "16",
-    },
-    {
-        prop: "good_code",
-        label: "商品编号",
-        col: "8",
-    },
-    {
-        prop: "good_name",
-        label: "商品名称",
-        col: "16",
-    },
+export const stockColumns = [
+  {
+    title:"仓库信息"
+  },
+  {
+    label: "仓库名称",
+    prop: "name",
+    span: "12",
+  },
+  {
+    label: "仓库负责人",
+    prop: "contactor_name",
+    span: "6",
+  },
+  {
+    label: "负责人电话",
+    prop: "mobile",
+    span: "6",
+  },
+  {
+    label: "所在业务公司",
+    prop: "companyName",
+    span: "12",
+  },
+  {
+    label: "所在供应商公司",
+    prop: "supplierName",
+    span: "12",
+  },
+  {
+    label: "仓库所在省市区",
+    prop: "source",
+    span: 12,
+  },
+  {
+    label: "仓库所在详细地址",
+    prop: "addr",
+    span: 6,
+  },
+  {
+    label: "仓库类型",
+    prop: "type_name",
+    span: 6,
+  },
+  {
+    title:"收发货信息"
+  },
+  {
+    label: "收发货联系人",
+    prop: "wsm_name",
+    span: 6,
+  },
+  {
+    label: "联系人职位",
+    prop: "position",
+    span: 6,
+  },
+  {
+    label: "联系人电话",
+    prop: "wsm_mobile",
+    span: 12,
+  },
+  {
+    label: "省市区",
+    prop: "target",
+    span: 12,
+  },
+  {
+    label: "详细地址",
+    prop: "wsm_addr",
+    span: 12,
+  },
+];
 
-
-    {
-        prop: "diff_price",
-        label: "工差总金额",
-        col: "8",
-    },
-    {
-        prop: "diff_weight",
-        label: "工差总重量",
-        col: "8",
-    },
-    {
-        prop: "gold_price",
-        label: "金价",
-        col: "8",
-    },
-]
+export const productColumns = [
+  {
+    prop: "cat_info",
+    label: "商品分类",
+    span: 8,
+    _slot_: "cat_info",
+  },
+  {
+    prop: "good_img",
+    label: "商品主图",
+    _slot_: "good_img",
+    span: 8,
+  },
+  {
+    prop: "good_info_img",
+    _slot_: "good_info_img",
+    label: "详情图片",
+    span: 8,
+  },
+  {
+    prop: "good_name",
+    label: "商品名称",
+    _slot_: "good_name",
+    span: 24,
+  },
+  {
+    prop: "company",
+    label: "业务公司",
+    span: 12,
+  },
+  {
+    prop: "supplierName",
+    label: "供应商",
+    span: 12,
+  },
+  {
+    prop: "brand_name",
+    label: "商品品牌",
+    span: 6,
+  },
+  {
+    prop: "is_auth",
+    label: "销售权限",
+    _slot_: "is_auth",
+    span: 6,
+  },
+  {
+    prop: "unit",
+    label: "单位",
+    span: 6,
+  },
+  {
+    prop: "tax",
+    label: "税点",
+    _slot_: "tax",
+    span: 6,
+  },
+  {
+    prop: "is_exclusive",
+    label: "专属类型",
+    _slot_: "is_exclusive",
+    span: 6,
+  },
+  {
+    prop: "weight",
+    label: "商品总重量",
+    _slot_: "weight",
+    span: 6,
+  },
+  {
+    prop: "is_stock",
+    label: "是否库存品",
+    _slot_: "is_stock",
+    span: 6,
+  },
+  {
+    prop: "is_combind",
+    label: "组合类型",
+    _slot_: "is_combind",
+    span: 6,
+  },
+  {
+    prop: "noble",
+    _slot_: "noble",
+    label: "贵金属信息",
+    span: 24,
+  },
+  {
+    prop: "after_sales",
+    label: "售后说明",
+    span: 24,
+  },
+  {
+    prop: "good_remark",
+    label: "商品备注",
+    span: 24,
+  },
+  {
+    prop: "craft_desc",
+    label: "工艺说明",
+    span: 24,
+  },
+  {
+    prop: "packing_way",
+    label: "包装方式",
+    span: 6,
+  },
+  {
+    prop: "packing_spec",
+    label: "装箱规格",
+    span: 6,
+  },
+  {
+    prop: "packing_weight",
+    label: "装箱重量",
+    _slot_: "packing_weight",
+    span: 6,
+  },
+  {
+    prop: "packing_size",
+    label: "装箱尺寸",
+    span: 6,
+  },
+  {
+    prop: "good_size",
+    label: "装箱尺寸",
+    span: 6,
+  },
+  {
+    prop: "good_bar",
+    label: "商品条形码",
+    span: 6,
+  },
+  {
+    prop: "packing_list",
+    label: "商品清单",
+    span: 12,
+  },
+  {
+    prop: "packing_spec",
+    label: "供货区域",
+    span: 6,
+    _slot_: "packing_spec",
+  },
+  {
+    prop: "delivery_day",
+    label: "物流天数",
+    _slot_: "delivery_day",
+    span: 6,
+  },
+  {
+    prop: "lead_time",
+    label: "供货周期",
+    _slot_: "lead_time",
+    span: 6,
+  },
+  {
+    prop: "sample_day",
+    label: "调样周期",
+    _slot_: "sample_day",
+    span: 6,
+  },
+  {
+    prop: "delivery_place",
+    label: "发货地",
+    span: 12,
+    _slot_: "delivery_place",
+  },
+  {
+    prop: "origin_place",
+    label: "产地",
+    span: 12,
+    _slot_: "origin_place",
+  },
+];

+ 382 - 0
src/views/sellOut/combinedRemove/components/productModal.vue

@@ -0,0 +1,382 @@
+<template>
+  <el-dialog
+    center
+    title="选择组合商品库存添加记录"
+    :visible="_visible"
+    :close-on-click-modal="false"
+    :append-to-body="true"
+    width="1024px"
+    top="5vh"
+    class="child-product"
+    @close="handleClose"
+  >
+    <ex-table
+      :table="table"
+      v-loading="loading"
+      :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();
+        "
+      @screen-submit="
+          pageInfo.curr = 1;
+          parmValue.page = 1;
+          searchList();
+        "
+    >
+      <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-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="4" style="width: 66px; float: right">
+                <el-button type="warning" class="fr" :size="searchSize" @click="restSearch">重置</el-button>
+              </el-col>
+            </el-col>
+          </el-row>
+          <el-row style="margin-top: 10px">
+            <el-col :span="6" style="width: 400px">
+              <el-input
+                v-model="value"
+                :size="searchSize"
+                placeholder="关键字"
+                clearable
+                :maxlength="40"
+                @change="
+                      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-button
+                  slot="appcreate_end"
+                  icon="el-icon-search"
+                  @click="
+                        pageInfo.curr = 1;
+                        parmValue.page = 1;
+                        searchList();
+                      "
+                ></el-button>
+              </el-input>
+            </el-col>
+          </el-row>
+        </div>
+      </template>
+      <template #status="{ scope }">
+        <el-tag
+          :size="tablebtnSize"
+          :type="scope.row.status == '0' ? 'warning' : ''"
+          v-text="
+              (statusOptions.find((item) => item.id == scope.row.status) || {})
+                .label || '--'
+            "
+        ></el-tag>
+      </template>
+
+      <template #order_source="{ scope }">
+        <el-tag
+          :size="tablebtnSize"
+          v-text="
+              (
+              xs_order_source_options.find(
+                  (item) => item.id == scope.row.order_source
+                ) || {}
+              ).label || '--'
+            "
+        ></el-tag>
+      </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>
+
+      <template #order_type="{ scope }">
+        <el-tag
+          :size="tablebtnSize"
+          v-text="
+              (
+              is_stock.find((item) => item.id == scope.row.is_stock) || {}
+              ).name || '--'
+            "
+        ></el-tag>
+      </template>
+    </ex-table>
+
+    <div style="display:flex;justify-content:flex-end">
+      <el-button size="mini" type="primary" @click="onSave">保 存</el-button>
+    </div>
+  </el-dialog>
+</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";
+
+export default {
+  name: "ProductListModal",
+  mixins: [mixinPage, resToken],
+  props: ["visible"],
+  data() {
+    return {
+      options1: [
+        { id: "0", name: "否" },
+        { id: "1", name: "是" }
+      ],
+      options4: [
+        { id: "0", name: "非库存品" },
+        { id: "1", name: "库存品" }
+      ],
+      table: {
+        stripe: true,
+        border: true,
+        _defaultHeader_: []
+      },
+      loading: false,
+      selected: [],
+      size: "mini",
+      searchSize: "mini",
+      tablebtnSize: "mini",
+      sinput: "",
+      select: "1",
+      parmValue: {
+        key: "spuCode",
+        value: "",
+        status: "",
+        create_start: "",
+        create_end: "",
+        page: 1, // 页码
+        size: 15 // 每页显示条数
+      },
+      has_account_list,
+      isStockOptions,
+      pageInfo: {
+        size: 10,
+        curr: 1,
+        total: 0
+      },
+      isonlineoptions: [
+        { id: "0", name: "未上线" },
+        { id: "1", name: "已上线" }
+      ],
+      statusOptions: [
+        { id: "1", label: "待审核" },
+        { id: "2", label: "审核通过" },
+        { id: "3", label: "审核驳回" }
+      ],
+      columns: [
+        { type: "selection", fixed: "left", _noset_: true },
+        {
+          prop: "stockCode",
+          label: "库存申请编码",
+          fixed: "left",
+          minWidth: "152px"
+        },
+        {
+          prop: "spuCode",
+          label: "商品编码",
+          minWidth: "125px"
+        },
+        {
+          label: "商品分类",
+          minWidth: "125px",
+          _slot_: "catinfo"
+        },
+        {
+          prop: "good_name",
+          label: "商品名称",
+          minWidth: "125px"
+        },
+        {
+          prop: "specInfo",
+          label: "商品规格",
+          minWidth: "125px",
+          _slot_: "specInfo"
+        },
+        {
+          prop: "status",
+          _slot_: "status",
+          label: "状态",
+          width: "100px"
+        },
+        {
+          prop: "apply_name",
+          label: "申请人",
+          width: "90px"
+        },
+        {
+          prop: "createtime",
+          label: "创建时间",
+          width: "155px"
+        }
+      ],
+      tableData: []
+    };
+  },
+  computed: {
+    _visible: {
+      get() {
+        return this.visible;
+      },
+      set(nV) {
+        this.$emit("update:visible", nV);
+      }
+    }
+  },
+  watch: {
+    visible(v) {
+      if (!v) return;
+      this.searchList();
+    }
+  },
+  methods: {
+    selectionChange(evt) {
+      const { list } = evt;
+      this.selected = list;
+    },
+    restSearch() {
+      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: "",
+        cat_id: [],
+        brandid: "",
+        good_type: "",
+        isonline: "",
+        companyNo: "",
+        supplierNo: ""
+      };
+      this.searchList();
+    },
+    handleClose() {
+      this.selected = [];
+      this._visible = false;
+    },
+    proportionChange(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;
+      }
+
+      const { id } = this.selected[0];
+      this.$emit("selected", id);
+      this._visible = false;
+    },
+    async searchList() {
+      if (
+        (this.parmValue.start !== "" && this.parmValue.end === "") ||
+        (this.parmValue.start === "" && this.parmValue.end !== "")
+      ) {
+        this.$message.warning("时间区间不完整!");
+        return;
+      }
+      this.loading = true;
+      const { key, value, ...rest } = this.parmValue;
+
+      const res = await asyncRequest.list({
+        needRela: true,
+        [key]: value,
+        flag: "1",
+        ...rest,
+        status: "2"
+      });
+
+      if (res && res.code === 0 && res.data) {
+        this.tableData = res.data.list;
+        this.tableData.forEach(a => {
+          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);
+      } else if (res && res.code >= 100 && res.code <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
+      }
+      this.loading = false;
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.child-product {
+  /deep/ .el-pagination {
+    float: left !important;
+  }
+}
+</style>

+ 355 - 0
src/views/sellOut/combinedRemove/components/stockModal.vue

@@ -0,0 +1,355 @@
+<template>
+  <el-dialog
+    class="stock-dialog"
+    top="8vh"
+    title="选择仓库"
+    center
+    :visible="_visible"
+    @close="handleClose"
+    width="1024px"
+  >
+    <ex-table
+      v-loading="loading"
+      :table="table"
+      :data="tableData"
+      :columns="columns"
+      :page="pageInfo"
+      :size="size"
+      @page-curr-change="handlePageChange"
+      @page-size-change="handleSizeChange"
+      @selection="handleSelection"
+      @screen-reset="
+          pageInfo.curr = 1;
+          parmValue.page = 1;
+          searchList();
+        "
+      @screen-submit="
+          pageInfo.curr = 1;
+          parmValue.page = 1;
+          searchList();
+        "
+    >
+      <template #table-header="{}">
+        <div style="width: 100%">
+          <el-row style="padding: 0 0 10px 0px">
+            <!-- 创建时间 -->
+            <el-col :span="18" style="width: 303px; padding: 0">
+              <period-date-picker
+                :start="parmValue.start"
+                :end="parmValue.end"
+                :type="1"
+                :width="'135px'"
+                :title="'创建'"
+                :size="searchSize"
+                @numReturned="numReturned($event, 0)"
+              />
+            </el-col>
+            <el-col :span="18" style="width: 340px; padding: 0">
+              <search-supplier
+                :value="supplierNo"
+                :size="searchSize"
+                :code="parmValue.supplierNo"
+                :placeholder="'供应商公司名称'"
+                :is-detail="false"
+                :disabled="false"
+                :names="''"
+                @searchChange="supplierChange"
+              />
+              <!-- <search-customer
+                  :value="supplierNo"
+                  :size="searchSize"
+
+                  :placeholder="'供应商公司名称'"
+                  :disabled="false"
+                  @searchChange="supplierChange"
+              />-->
+            </el-col>
+
+            <el-col :span="3" style="width: 56px; margin-left: 10px" class="fr">
+              <el-button :size="searchSize" type="primary" @click="searchList">刷新</el-button>
+            </el-col>
+          </el-row>
+          <el-row style="padding: 0">
+            <el-col :span="4" style="width: 120px; padding: 0">
+              <el-select
+                v-model="parmValue.wsm_type"
+                style="width: 100%"
+                clearable
+                :size="searchSize"
+                @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                placeholder="仓库类型"
+              >
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                ></el-option>
+              </el-select>
+            </el-col>
+            <el-col :span="18" style="width: 420px; padding: 0 0 0 10px">
+              <el-input
+                placeholder="关键字"
+                v-model="input"
+                maxlength="40"
+                :size="searchSize"
+                class="input-with-select"
+              >
+                <el-select v-model="select" slot="prepend" style="width: 125px" placeholder="关键字类型">
+                  <el-option label="仓库编码" value="1"></el-option>
+                  <el-option label="负责人姓名" value="2"></el-option>
+                  <el-option label="负责人手机号" value="3"></el-option>
+                  <el-option label="负责人部门" value="4"></el-option>
+                </el-select>
+                <el-button slot="append" icon="el-icon-search" @click="searchList"></el-button>
+              </el-input>
+            </el-col>
+            <el-col :span="4" style="width: 66px; padding-left: 10px" class="fr">
+              <el-button type="warning" class="fl" :size="searchSize" @click="restSearch">重置</el-button>
+            </el-col>
+          </el-row>
+        </div>
+      </template>
+      <template #status="{ scope }">
+        <el-tag
+          :size="tablebtnSize"
+          :type="scope.row.status == '0' ? 'warning' : ''"
+          v-text="
+              (statusOptions.find((item) => item.id == scope.row.status) || {}).label ||
+              '--'
+            "
+        ></el-tag>
+      </template>
+
+      <template
+        #wsm_type="{scope}"
+      >{{(options.find((item) => item.value === String(scope.row.wsm_type)) || {}).label || '--'}}</template>
+    </ex-table>
+
+    <div style="display:flex;justify-content:flex-end">
+      <el-button size="mini" type="primary" @click="submit">保 存</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import asyncRequest from "@/apis/service/sellOut/combindAdd";
+import mixinPage from "@/mixins/elPaginationHandle";
+export default {
+  name: "StockModal",
+  props: ["visible"],
+  mixins: [mixinPage],
+  computed: {
+    _visible: {
+      get() {
+        return this.visible;
+      },
+      set(nV) {
+        this.$emit("update:visible", nV);
+      }
+    }
+  },
+  data() {
+    return {
+      selected: [],
+      options: [
+        {
+          value: "5",
+          label: "销售仓"
+        },
+        {
+          value: "4",
+          label: "次品仓"
+        }
+      ],
+      searchSize: "mini",
+      select: "",
+      input: "",
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        _defaultHeader_: []
+      },
+      pageInfo: {
+        size: 10,
+        curr: 1,
+        total: 0
+      },
+      loading: false,
+      parmValue: {
+        supplierNo: "", //供应商编码
+        wsm_code: "", //仓库编码
+        wsm_type: "",
+        start: "", //新建起始时间
+        end: "", //新建结束时间
+        mobile: "", //手机号
+        contactor_name: "", //联系人
+        size: 10,
+        page: 1
+      },
+      tablebtnSize: "mini",
+      statusOptions: [
+        { id: "0", label: "禁用" },
+        { id: "1", label: "启用" }
+      ],
+      columns: [
+        {
+          type: "selection",
+          width: "80px",
+          fixed: 'left'
+        },
+        {
+          prop: "wsm_code",
+          label: "编号",
+          width: "170px"
+        },
+        {
+          prop: "name",
+          label: "仓库名称",
+          minWidth: "160px"
+        },
+        {
+          prop: "wsm_type",
+          label: "仓库类型",
+          width: "80px",
+          _slot_: "wsm_type"
+        },
+        {
+          prop: "companyNo",
+          label: "业务公司编码",
+          width: "140px"
+        },
+        {
+          prop: "company_name",
+          label: "业务公司",
+          "min-width": "140px"
+        },
+        {
+          prop: "status",
+          label: "状态",
+          width: "60px",
+          // ,
+          _slot_: "status"
+        },
+        {
+          prop: "contactor_name",
+          label: "负责人",
+          minWidth: "70px"
+        },
+        {
+          prop: "mobile",
+          label: "负责人电话",
+          width: "100px"
+        },
+        {
+          prop: "creater",
+          label: "创建人",
+          width: "70px"
+        },
+        {
+          prop: "addtime",
+          label: "创建时间",
+          width: "140px"
+        }
+      ]
+    };
+  },
+  watch: {
+    _visible(NV) {
+      if (!NV) return;
+      this.searchList();
+    }
+  },
+  methods: {
+    handleClose() {
+      this._visible = false;
+    },
+    submit() {
+      if (this.selected.length === 0 || this.selected.length > 1) {
+        const message =
+          this.selected.length === 0 ? "请选择一个仓库" : "只能选择一个仓库";
+        this.$message.warning(message);
+        return;
+      }
+
+      const { wsm_code, id } = this.selected[0];
+      this.$emit("selected", { code: wsm_code, id });
+      this._visible = false;
+    },
+    restSearch() {
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 10,
+        curr: 1,
+        total: 0
+      };
+      this.supplierNo = [];
+      this.input = "";
+      this.select = "1";
+      this.parmValue = {
+        supplierNo: "", //供应商编码
+        wsm_code: "", //仓库编码
+        wsm_type: "",
+        start: "", //新建起始时间
+        company_new_name: "", //负责人部门
+        end: "", //新建结束时间
+        mobile: "", //手机号
+        contactor_name: "", //联系人
+        page: 1, // 页码
+        size: 10 // 每页显示条数
+      };
+      this.searchList();
+    },
+    handleSelection(evt) {
+      const { list } = evt;
+      this.selected = list;
+    },
+    async searchList() {
+      if (
+        (this.parmValue.start !== "" && this.parmValue.end === "") ||
+        (this.parmValue.start == "" && this.parmValue.end != "")
+      ) {
+        this.$message.warning("开始时间和结束时间不能为空");
+        return;
+      }
+      this.loading = true;
+      this.parmValue.wsm_code = this.select === "1" ? this.input : "";
+      this.parmValue.contactor_name = this.select === "2" ? this.input : "";
+      this.parmValue.mobile = this.select === "3" ? this.input : "";
+      this.parmValue.company_new_name = this.select === "4" ? this.input : "";
+
+      const { code, data } = await asyncRequest.stock({
+        ...this.parmValue,
+        needRela: true
+      });
+
+      if (code === 0) {
+        const { list, count } = data ?? {};
+        console.log(list);
+        this.tableData = list;
+        this.pageInfo.total = Number(count ?? "0");
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
+      }
+      this.loading = false;
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.stock-dialog {
+  /deep/ .el-pagination {
+    float: left !important;
+  }
+}
+</style>

+ 15 - 6
src/views/sellOut/combinedRemove/components/waitApproval.vue

@@ -1,9 +1,9 @@
 <template>
-  <el-form label-width="80px" size="mini" :model="ruleForm" :rules="rules">
+  <el-form ref="ruleForm" label-width="80px" size="mini" :model="ruleForm" :rules="rules">
     <el-form-item label="状态" prop="status">
       <el-select v-model="ruleForm.status" style="width:100%">
-        <el-option value="1" label="通过" />
-        <el-option value="0" label="驳回" />
+        <el-option value="2" label="通过" />
+        <el-option value="3" label="驳回" />
       </el-select>
     </el-form-item>
 
@@ -13,7 +13,7 @@
 
     <el-form-item>
       <div class="fr">
-        <el-button type="primary">保 存</el-button>
+        <el-button type="primary" @click="submit">保 存</el-button>
       </div>
     </el-form-item>
   </el-form>
@@ -29,7 +29,7 @@ export default {
         status: [{ required: true, message: "请选择状态", trigger: "change" }],
         remark: [
           {
-            required: this.ruleForm.status === "0",
+            required: this.ruleForm.status === "3",
             message: "请输入备注",
             trigger: "change"
           }
@@ -40,10 +40,19 @@ export default {
   data() {
     return {
       ruleForm: {
-        status: "1",
+        status: "2",
         remark: ""
       }
     };
+  },
+  methods: {
+    submit() {
+      const { status, remark } = this.ruleForm;
+      this.$emit("confirm", {
+        status,
+        remark
+      });
+    }
   }
 };
 </script>

+ 91 - 22
src/views/sellOut/combinedRemove/detail.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="zxDiffOrderDetail pagePadding">
-    <div style="width: 100%" v-if="powers.some((i) => i == '007')">
+    <div style="width: 100%" v-if="powers.some((i) => i == '007')" v-loading="loading">
       <el-tabs v-model="activeTabs">
         <el-tab-pane label="业务详情" name="1">
           <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
@@ -9,9 +9,56 @@
             </el-collapse-item>
 
             <template v-else>
-              <el-collapse-item title="组合商品详情" name="2">TODO..</el-collapse-item>
-              <el-collapse-item title="待审核" name="3">
-                <wait-approval />
+              <el-collapse-item title="组合商品详情" name="2" v-if="sitem">
+                <show-data-table :sitem="sitem" :newTime="newTime" :columns="detailColumns_j">
+                  <template #status>
+                    <el-tag
+                      size="mini"
+                      :type="sitem.status == '1' ? 'warning' : ''"
+                    >{{(statusOptions.find((item) => item.id == String(sitem.status)) || {}).label || '--'}}</el-tag>
+                  </template>
+
+                  <template #wsmtype>
+                    <el-tag
+                      size="mini"
+                    >{{(wsm_options.find(({value}) => value === sitem.wsm_type) || {}).label || '--'}}</el-tag>
+                  </template>
+                </show-data-table>
+              </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" />
+                  <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) * ( 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>
+                  <el-table-column label="锁定库存可用库存数">
+                    <template slot-scope="scope">{{ scope.row.usable_stock || 0 }}</template>
+                  </el-table-column>
+                </el-table>
+              </el-collapse-item>
+
+              <el-collapse-item
+                v-if="Number(sitem.status) === 1 && !isSupertube"
+                title="待审核"
+                name="3"
+              >
+                <div style="width:600px">
+                  <wait-approval @confirm="setStatus" />
+                </div>
               </el-collapse-item>
             </template>
           </el-collapse>
@@ -25,17 +72,16 @@
   </div>
 </template>
 <script>
-import mixinPage from "@/mixins/elPaginationHandle";
-import resToken from "@/mixins/resToken";
-import asyncRequest from "@/apis/service/sellOut/zxDiffOrder";
-import { showColumns } from "./columns";
+import asyncRequest from "@/apis/service/sellOut/combinedAdd";
 import { xs_order_type_options } from "@/assets/js/statusList";
-
+import { showColumns, detailColumns_j } from "./columns";
+import WaitApproval from "./components/waitApproval";
+import mixinPage from "@/mixins/elPaginationHandle";
 import BaseForm from "./components/baseForm";
+import resToken from "@/mixins/resToken";
 import { mapGetters } from "vuex";
-import WaitApproval from "./components/waitApproval";
 export default {
-  name: "combinedAddDetail",
+  name: "combinedRemoveDetail",
   mixins: [mixinPage, resToken],
   components: { BaseForm, WaitApproval },
   computed: {
@@ -62,9 +108,11 @@ export default {
       activeTabs: "1",
       activeNames: ["-1", "0", "1", "2", "3", "4", "5", "10"],
       statusOptions: [
-        { value: "1", label: "待业务部门审核" },
-        { value: "2", label: "审批已完成" }
+        { id: "1", label: "待审核" },
+        { id: "2", label: "审核通过" },
+        { id: "3", label: "审核驳回" }
       ],
+      detailColumns_j,
       xs_order_type_options,
       customer_remark_options: [
         {
@@ -76,6 +124,28 @@ export default {
           label: "竞价订单不减工差"
         }
       ],
+      wsm_options: [
+        // {
+        //   value: "1",
+        //   label: "系统仓",
+        // },
+        //   {
+        //   value: "2",
+        //   label: "虚拟仓",
+        // },
+        //     {
+        //   value: "3",
+        //   label: "自建仓",
+        // },
+        {
+          value: "5",
+          label: "销售仓"
+        },
+        {
+          value: "4",
+          label: "次品仓"
+        }
+      ],
       is_act_options: [
         {
           value: "1",
@@ -96,29 +166,28 @@ export default {
   mounted() {
     this.status = "";
     this.queryId = this.$route.query.id;
-    this.initData();
+
+    if (this.queryId !== "add") {
+      this.initData();
+    }
   },
   methods: {
     getNewTime() {
       this.newTime = new Date().valueOf() + "";
     },
 
-    async setStatus() {
+    async setStatus(param) {
       if (!this.loading) {
         this.loading = true;
 
         let model = {
           id: this.queryId,
-          remark: "",
-          status: ""
+          ...param
         };
-        const res = await asyncRequest.fstatus(model);
+
+        const res = await asyncRequest.status(model);
         this.loading = false;
         if (res && res.code === 0) {
-          this.$notify.success({
-            title: "通知成功!",
-            message: ""
-          });
           this.initData();
         } else if (res && res.code >= 100 && res.code <= 104) {
           await this.logout();

+ 87 - 54
src/views/sellOut/combinedRemove/index.vue

@@ -2,8 +2,8 @@
   <div class="zxDiffOrder pagePadding">
     <div v-if=" powers.some((i) => i == '001')">
       <ex-table
-        v-loading="loading"
         :table="table"
+        v-loading="loading"
         :data="tableData"
         :columns="columns"
         :page="pageInfo"
@@ -25,12 +25,12 @@
           <div style="width: 100%">
             <el-row style="padding: 0 0 0 80px">
               <el-col :span="24">
-                <el-col :span="6" style="width: 293px;">
+                <el-col :span="6" style="width: 355px;">
                   <period-date-picker
-                    :start="parmValue.start"
-                    :end="parmValue.end"
+                    :create_start="parmValue.create_start"
+                    :create_end="parmValue.create_end"
                     :type="1"
-                    :width="'135px'"
+                    :width="'165px'"
                     :size="searchSize"
                     placeholder="创建"
                     @timeReturned="timeReturned($event)"
@@ -38,7 +38,18 @@
                 </el-col>
 
                 <el-col :span="4" style="margin-left: 10px">
-                  <el-select style="width:100%" v-model="parmValue.status" size="mini">
+                  <el-select
+                    style="width:100%"
+                    placeholder="状态"
+                    v-model="parmValue.status"
+                    size="mini"
+                    clearable
+                    @change="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                  >
                     <el-option
                       v-for="s in statusOptions"
                       :label="s.label"
@@ -50,10 +61,10 @@
 
                 <el-col :span="3" style="width: 66px; float: right">
                   <el-button
-                    :size="searchSize"
                     type="primary"
-                    style="float: right; margin-left: 5px"
+                    :size="searchSize"
                     @click="searchList"
+                    style="float: right; margin-left: 5px"
                   >刷新</el-button>
                 </el-col>
 
@@ -67,22 +78,32 @@
                 <el-input
                   v-model="value"
                   :size="searchSize"
+                  placeholder="关键字"
+                  clearable
                   :maxlength="40"
-                  @blur="
+                  @change="
                       pageInfo.curr = 1;
                       parmValue.page = 1;
                       searchList();
                     "
                 >
                   <template #prepend>
-                    <el-select v-model="parmValue.key" style="width:100px">
-                      <el-option label="商品名称" />
-                      <el-option label="商品编码" />
+                    <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-button
-                    slot="append"
+                    slot="appcreate_end"
                     icon="el-icon-search"
                     @click="
                         pageInfo.curr = 1;
@@ -127,6 +148,15 @@
           ></el-tag>
         </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>
+
         <template #order_type="{ scope }">
           <el-tag
             :size="tablebtnSize"
@@ -154,17 +184,18 @@
       </ex-table>
     </div>
     <div v-else>
-      <no-auth />
+      <no-auth></no-auth>
     </div>
   </div>
 </template>
 <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-import asyncRequest from "@/apis/service/sellOut/zxDiffOrder";
+import asyncRequest from "@/apis/service/sellOut/combinedAdd";
 import companyHelper from "@/mixins/companyHelper";
 import { mapGetters } from "vuex";
 import { columns } from "./columns";
+
 import {
   xs_order_source_options,
   xs_order_type_options
@@ -197,9 +228,9 @@ export default {
       sitem: null,
       // 状态
       statusOptions: [
-        { id: "0", label: "不限状态" },
-        { id: "1", label: "在售中" },
-        { id: "2", label: "已下架" }
+        { id: "1", label: "待审核" },
+        { id: "2", label: "审核通过" },
+        { id: "3", label: "审核驳回" }
       ],
       statusList: [
         "样品竞价单",
@@ -221,16 +252,11 @@ export default {
       isDetail: false,
       modelId: 0,
       parmValue: {
-        zxNo: "", // 竞价单编码
-        cpName: "", //商品名称
-        is_stock: "",
-        order_source: "",
-        customerName: "",
-        customer_code: "", // 客户编码
-        status: "", //竞价类型
-        salesman: "", //申请人
-        start: "",
-        end: "",
+        key: "spuCode",
+        value: "",
+        status: "",
+        create_start: "",
+        create_end: "",
         page: 1, // 页码
         size: 15 // 每页显示条数
       },
@@ -262,8 +288,8 @@ export default {
       this.parmValue = JSON.parse(back);
       console.log(this.parmValue);
       const { page, size } = this.parmValue;
-      // this.parmValue.start = start || last_start;
-      // this.parmValue.end = end || last_end;
+      // 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] ;
       // }
@@ -314,18 +340,21 @@ export default {
       }
     },
     async timeReturned(e) {
-      if (e.startTime !== "") {
-        this.parmValue.start = e.startTime;
+      if (e.create_startTime !== "") {
+        this.parmValue.create_start = e.create_startTime;
       } else {
-        this.parmValue.start = "";
+        this.parmValue.create_start = "";
       }
 
-      if (e.endTime !== "") {
-        this.parmValue.end = e.endTime;
+      if (e.create_endTime !== "") {
+        this.parmValue.create_end = e.create_endTime;
       } else {
-        this.parmValue.end = "";
+        this.parmValue.create_end = "";
       }
-      if (this.parmValue.start !== "" && this.parmValue.end !== "") {
+      if (
+        this.parmValue.create_start !== "" &&
+        this.parmValue.create_end !== ""
+      ) {
         this.parmValue.page = 1;
         await this.searchList();
       }
@@ -339,15 +368,12 @@ export default {
       };
       this.select = "1";
       this.input = "";
-      this.customerCode = [];
       this.parmValue = {
-        zxNo: "", // 竞价单编码
-        customer_code: "", // 客户编码
-        cpName: "", //商品名称
-        status: "", //竞价类型
-        salesman: "", //申请人
-        start: "",
-        end: "",
+        status: "",
+        key: "spuCode",
+        value: "",
+        create_start: "",
+        create_end: "",
         page: 1, // 页码
         size: 15 // 每页显示条数
       };
@@ -404,21 +430,29 @@ export default {
     },
     async searchList() {
       if (
-        (this.parmValue.start !== "" && this.parmValue.end === "") ||
-        (this.parmValue.start == "" && this.parmValue.end != "")
+        (this.parmValue.create_start !== "" &&
+          this.parmValue.create_end === "") ||
+        (this.parmValue.create_start == "" && this.parmValue.create_end != "")
       ) {
         this.$message.warning("开始时间和结束时间不能为空");
         return;
       }
       this.loading = true;
-      this.parmValue.zxNo = this.select === "1" ? this.input : ""; //竞价类型
-      this.parmValue.salesman = this.select === "2" ? this.input : ""; //申请人
-      this.parmValue.cpName = this.select === "3" ? this.input : ""; //商品名称
+
+      const { key, value, ...rest } = this.parmValue;
+
+      console.log({
+        needRela: true,
+        [key]: value,
+
+        ...rest
+      });
 
       const res = await asyncRequest.list({
-        ...this.parmValue,
-        [this.key]: this.value,
-        needRela: true
+        needRela: true,
+        [key]: value,
+        flag: "0",
+        ...rest
       });
 
       if (res && res.code === 0 && res.data) {
@@ -450,4 +484,3 @@ export default {
 .zxDiffOrder {
 }
 </style>
-