xiaodai2022 2 years ago
parent
commit
873f5114c9

+ 10 - 6
src/apis/service/purchaseIn/workbench/index.js

@@ -7,13 +7,16 @@ export default {
   // 任务详情
   detail: (data, params) => http(api + "consultzxinfo", data, "post", params),
   // 采返商品详情
-  good_detail: (data, params) => http(api + "consultfeadinfo", data, "post", params),
+  good_detail: (data, params) =>
+    http(api + "consultfeadinfo", data, "post", params),
   // 反馈商品添加
   good_add: (data, params) => http(api + "consultfeed", data, "post", params),
   // 反馈商品编辑
-  good_update: (data, params) => http(api + "consultfeededit", data, "post", params),
+  good_update: (data, params) =>
+    http(api + "consultfeededit", data, "post", params),
   // 反馈商品列表
-  good_list: (data, params) => http(api + "consultbidlist", data, "post", params),
+  good_list: (data, params) =>
+    http(api + "consultbidlist", data, "post", params),
   // 更新
   update: (data, params) => http(api + "customaredit", data, "post", params),
   // 新建
@@ -23,7 +26,8 @@ export default {
   // 状态
   status: (data, params) => http(api + "resultstatu", data, "post", params),
   // 获取实时金价
-  golpricelast: (data, params) => http(api + "golpricelast", data, "post", params),
-
-
+  golpricelast: (data, params) =>
+    http(api + "golpricelast", data, "post", params),
+  // 获取分类详情
+  catinfo: (data, params) => http(api + "catinfo", data, "post", params),
 };

+ 11 - 0
src/apis/service/sellOut/filing/index.js

@@ -0,0 +1,11 @@
+// 物业管理员
+import http from "@/apis/axios";
+const api = "admin/";
+export default {
+  // 分页查询
+  list: (data, params) => http(api + "filingList", data, "post", params),
+  // 详情
+  detail: (data, params) => http(api + "filingDetail", data, "post", params),
+  // 修改状态
+  status: (data, params) => http(api + "filingStatus", data, "post", params),
+};

+ 2 - 0
src/apis/service/sellOut/zixunOrder/index.js

@@ -31,4 +31,6 @@ export default {
   addrall: (data, params) => http(api + "addrall", data, "post", params),
   // 取实时金价
   golpricelast: (data, params) => http(api + "golpricelast", data, "post", params),
+   // 获取分类详情
+   catinfo: (data, params) => http(api + "catinfo", data, "post", params),
 };

+ 13 - 18
src/views/goodStore/goodsCost/components/baseForm.vue

@@ -1950,26 +1950,21 @@ export default {
     async set_must_spec() {
       const { cat_id } = this.ruleForm;
       let id = cat_id.length == 1 ? cat_id[0] : "";
-      let list1 =
-        this.spec_tableData && this.spec_tableData.length > 0
-          ? JSON.parse(JSON.stringify(this.spec_tableData))
-          : [];
-      let list2 = [];
       if (id) {
         const { code, message, data } = await asyncRequest.catinfo({ id: id });
         if (code === 0) {
           const { spec } = data;
           if (spec && spec.length > 0) {
-            if (list1 && list1.length > 0) {
-              list1.forEach((c) => {
+            if (this.spec_tableData && this.spec_tableData.length > 0) {
+              this.spec_tableData.forEach((c) => {
                 c.isMust = false;
               });
               spec.forEach((a, ai) => {
-                let findex = list1.findIndex((b) => b.spec_id === a.id);
+                let findex = this.spec_tableData.findIndex((b) => b.spec_id === a.id);
                 if (findex !== -1) {
-                  list1[findex].isMust = true;
+                  this.spec_tableData[findex].isMust = true;
                 } else {
-                  list1.push({
+                  this.spec_tableData.push({
                     id: "",
                     index: "1",
                     spec_id: a.id,
@@ -1991,26 +1986,26 @@ export default {
                   spec_value_value: "",
                   spec_value_id: "",
                 };
-                list1.push(model);
+                this.spec_tableData.push(model);
               });
             }
           }
-          list1.map((e, ei) => {
+          this.spec_tableData.map((e, ei) => {
             e.index = ei + "";
             return e;
           });
-          this.spec_tableData =
-            list1 && list1.length > 0 ? JSON.parse(JSON.stringify(list1)) : [];
+          this.spec_tableData.forEach((si, sii) => {
+            this.$set(this.spec_tableData, sii, si);
+          });
         } else if (code >= 100 && code <= 104) {
           await this.logout();
         } else {
           this.$message.warning(message);
         }
       } else {
-        list1.forEach((e) => {
-          if (!e.isMust) {
-            list2.push(e);
-          }
+        this.spec_tableData.forEach((si, sii) => {
+          si.isMust = false;
+          this.$set(this.spec_tableData, sii, si);
         });
       }
     },

+ 73 - 1
src/views/purchaseIn/workbench/components/baseForm.vue

@@ -209,7 +209,12 @@
                       @click="openEdit(scope.$index, scope.row)"
                     ></i>
                   </el-tooltip>
-                  <el-tooltip effect="dark" content="删除" placement="top">
+                  <el-tooltip
+                    effect="dark"
+                    v-if="!scope.row.isMust"
+                    content="删除"
+                    placement="top"
+                  >
                     <i
                       class="el-icon-delete tb-icon"
                       @click="openDelete(scope.$index)"
@@ -1070,6 +1075,7 @@ export default {
           if (this.type === "add") {
             this.spec_tableData = JSON.parse(JSON.stringify(this.askItem.specinfo));
           }
+          await this.set_must_spec();
         }
       });
     },
@@ -1110,7 +1116,73 @@ export default {
       if (this.is_noble) {
         this.ruleForm.nake_fee = "0";
       }
+
       this.computedCost();
+      await this.set_must_spec();
+    },
+    async set_must_spec() {
+      const { cat_id } = this.ruleForm;
+      let id = cat_id.length == 1 ? cat_id[0] : "";
+      if (id) {
+        const { code, message, data } = await asyncRequest.catinfo({ id: id });
+        if (code === 0) {
+          const { spec } = data;
+          if (spec && spec.length > 0) {
+            if (this.spec_tableData && this.spec_tableData.length > 0) {
+              this.spec_tableData.forEach((c) => {
+                c.isMust = false;
+              });
+              spec.forEach((a, ai) => {
+                let findex = this.spec_tableData.findIndex((b) => b.specid === a.id);
+                if (findex !== -1) {
+                  this.spec_tableData[findex].isMust = true;
+                } else {
+                  this.spec_tableData.push({
+                    id: "",
+                    index: "1",
+                    specid: a.id,
+                    spec_name: a.spec_name,
+                    isMust: true,
+                    spec_value_name: "",
+                    spec_value_id: "",
+                  });
+                }
+              });
+            } else {
+              spec.forEach((a, ai) => {
+                let model = {
+                  id: "",
+                  index: "1",
+                  specid: a.id,
+                  spec_name: a.spec_name,
+                  isMust: true,
+                  spec_value_name: "",
+                  spec_value_id: "",
+                };
+                this.spec_tableData.push(model);
+              });
+            }
+          }
+          this.spec_tableData.map((e, ei) => {
+            e.index = ei + "";
+            return e;
+          });
+
+          this.spec_tableData.forEach((si, sii) => {
+            this.$set(this.spec_tableData, sii, si);
+          });
+          console.log(this.spec_tableData);
+        } else if (code >= 100 && code <= 104) {
+          await this.logout();
+        } else {
+          this.$message.warning(message);
+        }
+      } else {
+        this.spec_tableData.forEach((si, sii) => {
+          si.isMust = false;
+          this.$set(this.spec_tableData, sii, si);
+        });
+      }
     },
     setrules() {
       let list1 = ["noble_weight", "is_gold_price", "is_diff"];

+ 3 - 5
src/views/purchaseIn/workbench/components/baseFormAddEdit.vue

@@ -29,7 +29,7 @@
             <el-form-item label="规格类型" prop="specid">
               <search-spec
                 :value="ruleForm.specid"
-                :disabled="false"
+                :disabled="sitem.isMust"
                 :size="'mini'"
                 :isDetail="false"
                 :placeholder="'规格类型'"
@@ -37,14 +37,12 @@
               />
             </el-form-item>
             <el-form-item label="规格值" prop="spec_value_id">
-              <div
-                v-if="specVlist.length > 0"
-              >
+              <div v-if="specVlist.length > 0">
                 <el-select
                   placeholder="请选择规格值"
                   v-model="ruleForm.spec_value_id"
                   @change="spec_value_id_change"
-                  style="width:100%"
+                  style="width: 100%"
                   filterable
                 >
                   <el-option

+ 476 - 0
src/views/sellOut/filing/columns.js

@@ -0,0 +1,476 @@
+//是否定制
+const options1 = [
+  { id: "0", name: "否" },
+  { id: "1", name: "是" },
+];
+//专属类型
+const options2 = [
+  { id: "0", name: "非泰康" },
+  { id: "1", name: "泰康" },
+];
+//销售权限
+const options3 = [
+  { id: "0", name: "无销售权限" },
+  { id: "1", name: "有销售权限" },
+];
+
+//是否库存品
+const options4 = [
+  { id: "0", name: "非库存品" },
+  { id: "1", name: "库存品" },
+];
+//是否启用实时金价
+const options5 = [
+  { id: "0", name: "否" },
+  { id: "1", name: "是" },
+];
+//供货区域
+const options6 = [
+  { id: "1", name: "全国" },
+  { id: "2", name: "全国除偏远" },
+];
+//是否启用阶梯
+const options7 = [
+  { id: "0", name: "否" },
+  { id: "1", name: "是" },
+];
+//有无工差
+const options8 = [
+  { id: "0", name: "无工差" },
+  { id: "1", name: "有工差" },
+];
+//配置要求
+const options9 = ["证书", "包装盒", "绒布袋", "标签", "其他"];
+//付款方式
+const options10 = [
+  { id: "0", name: "现结" },
+  { id: "1", name: "月清" },
+  { id: "2", name: "双月清" },
+];
+//发货方式
+const options11 = [
+  { id: "0", name: "公司自提" },
+  { id: "1", name: "供应商包邮" },
+];
+
+const options12 = [
+  { id: "0", name: "一地" },
+  { id: "1", name: "多地" },
+];
+const statusList = [
+  { id: "0", label: "待审核", type: "warning" },
+  { id: "1", label: "审核失败", type: "danger" },
+  { id: "2", label: "转单中", type: "" },
+  { id: "3", label: "转单成功", type: "success" },
+  { id: "4", label: "转单失败", type: "danger" },
+  { id: "5", label: "取消转单", type: "info" },
+];
+const is_determine_price_options = [
+  { id: "0", label: "否" },
+  { id: "1", label: "是" },
+];
+const editColumns = [
+  {
+    prop: "filingCode",
+    label: "报备单编号",
+    span: 6,
+  },
+  {
+    prop: "status",
+    label: "状态",
+    _slot_: "status",
+    span: 6,
+  },
+  {
+    prop: "apply_name",
+    label: "申请人",
+    span: 6,
+  },
+  {
+    prop: "addtime",
+    label: "申请时间",
+    span: 6,
+  },
+  {
+    prop: "supplierName",
+    label: "供应商名称",
+    _slot_: "supplierName",
+    span: 12,
+  },
+  {
+    prop: "customerName",
+    label: "业务公司名称",
+    _slot_: "customerName",
+    span: 12,
+  },
+  {
+    prop: "companyName",
+    label: "客户名称",
+    _slot_: "companyName",
+    span: 12,
+  },
+  {
+    prop: "num",
+    label: "销售数量",
+    span: 6,
+  },
+
+  {
+    prop: "is_determine_price",
+    label: "是否确认售价",
+    _slot_: "is_determine_price",
+    span: 6,
+  },
+ 
+
+  {
+    prop: "cgd_charge",
+    label: "采购单价",
+    span: 6,
+  },
+  {
+    prop: "price",
+    label: "销售单价",
+    span: 6,
+  },
+  {
+    prop: "expect_service",
+    label: "期望服务费",
+    span: 6,
+  },
+  {
+    prop: "service_proportion",
+    label: "期望服务费比例",
+    span: 6,
+  },
+
+  {
+    prop: "orderCode",
+    label: "订单编号",
+    span: 6,
+  },
+  {
+    prop: "plat_code",
+    label: "平台商品编号",
+    span: 6,
+  },
+  {
+    prop: "service_charge",
+    label: "最终服务费",
+    span: 6,
+  },
+  {
+    prop: "service_proportion",
+    label: "最终服务费比例",
+    span: 6,
+  },
+];
+//采返 采购商品字段
+const coveColumns = [
+  {
+    prop: "good_name",
+    label: "商品名称",
+    _slot_: "good_name",
+    span: 24,
+  },
+
+  {
+    prop: "cat",
+    label: "分类",
+    span: 8,
+  },
+
+  {
+    prop: "brand_name",
+    label: "品牌",
+    span: 8,
+  },
+
+
+
+  {
+    prop: "send_way",
+    label: "发货方式",
+    _slot_: "send_way",
+    span: 8,
+  },
+  {
+    prop: "unit",
+    label: "单位",
+    span: 4,
+  },
+  {
+    prop: "tax",
+    label: "税点",
+    append: '%',
+    span: 4,
+  },
+  {
+    prop: "pay_way",
+    label: "付款方式",
+    _slot_: "pay_way",
+    span: 4,
+  },
+
+
+  {
+    prop: "weight",
+    label: "商品总克重",
+    append: 'g',
+    span: 6,
+  },
+
+
+  {
+    prop: "addtime",
+    label: "反馈时间",
+    span: 6,
+  },
+
+
+
+
+
+  {
+    prop: "expire_day",
+    label: "竞价有效期",
+    append: '天',
+    span: 4
+  },
+
+  {
+    prop: "delivery_day",
+    label: "物流时间",
+    append: '天',
+    span: 4
+  },
+  {
+    prop: "work_day",
+    label: "生产工期",
+    append: '天',
+    span: 4
+  },
+  {
+    prop: "cgder",
+    label: "供应商负责人",
+    span: 4,
+  },
+  {
+    prop: "good_creater",
+    label: "商品创建人",
+    span: 4,
+  },
+ 
+
+
+  {
+    prop: "supply_area",
+    label: "供货区域",
+    _slot_: "supply_area",
+    span: 4,
+  },
+
+
+  {
+    prop: "good_img",
+    label: "商品图片",
+    _slot_: "good_img",
+    span: 24,
+
+  },
+  {
+    prop: "noble",
+    _slot_: "noble",
+    label: "贵金属信息",
+    span: 24,
+  },
+  {
+    prop: "cost_desc",
+    label: "工艺说明",
+    span: 24,
+  },
+  {
+    prop: "remark",
+    label: "采返备注",
+    span: 24,
+  },
+
+
+]
+const costArr = [
+  {
+    prop: "cert_fee",
+    label: "成本证书费",
+    append: "元",
+    span: 6,
+  },
+  {
+    prop: "pakge_fee",
+    label: "成本包装费",
+    append: "元",
+    span: 6,
+  },
+  {
+    prop: "cost_fee",
+    label: "成本工艺费",
+    append: "元",
+    span: 6,
+  },
+  {
+    prop: "mark_fee",
+    label: "成本加标费",
+    append: "元",
+    span: 6,
+  },
+
+  {
+    prop: "demo_fee",
+    label: "成本打样费",
+    append: "元",
+    span: 6,
+  },
+  {
+    prop: "open_fee",
+    label: "成本开模费",
+    append: "元",
+    span: 6,
+  },
+  {
+    prop: "delivery_fee",
+    label: "成本物流费",
+    append: "元",
+    span: 6,
+  },
+  {
+    prop: "nake_fee",
+    label: "成本裸价",
+    append: "元",
+    span: 6,
+  },
+  {
+    prop: "total_fee",
+    label: "采购成本合计",
+    append: "元",
+    span: 24,
+  },
+];
+
+const bargainingArr = [
+  {
+    prop: "before_rate",
+    label: "议价前毛利率",
+    append: "%",
+    span: 12,
+  },
+
+  {
+    prop: "after_rate",
+    label: "议价后毛利率",
+    append: "%",
+    span: 12,
+  },
+];
+
+const listCol = [
+  {
+    prop: "filingCode",
+    label: "报备单编码",
+    width: "155",
+  },
+  {
+    prop: "good_img",
+    label: "图片",
+    _slot_: "good_img",
+    width: "50",
+  },
+  {
+    prop: "good_name",
+    label: "商品名称",
+    width: "155",
+  },
+
+  {
+    prop: "status",
+    label: "状态",
+    _slot_: "status",
+    width: "120px",
+  },
+  {
+    prop: "num",
+    label: "数量",
+    width: "110",
+  },
+
+  {
+    prop: "price",
+    label: "销售价",
+    width: "110",
+  },
+  {
+    prop: "expect_service",
+    label: "期望服务费",
+    width: "110",
+  },
+
+  {
+    prop: "companyCode",
+    label: "客户编号",
+    width: "110",
+  },
+
+  {
+    prop: "companyName",
+    label: "客户名称",
+    width: "110",
+  },
+  {
+    prop: "orderCode",
+    label: "订单编号",
+    width: "150",
+  },
+
+  {
+    prop: "company_name",
+    label: "申请人部门",
+    minWidth: "150px",
+  },
+
+  {
+    prop: "",
+    label: "操作",
+    fixed: "right",
+    _noset_: true,
+    _slot_: "operation",
+    width: 50,
+  },
+];
+
+const rate_status_options = [
+  { id: "0", label: "全部无法通过" },
+  { id: "1", label: "业务主管通过" },
+  { id: "2", label: "财务主管通过" },
+  { id: "3", label: "boss通过" },
+];
+
+export {
+  listCol,
+  options1,
+  options2,
+  options3,
+  options4,
+  options5,
+  options6,
+  options7,
+  options8,
+  options9,
+  options10,
+  options11,
+  options12,
+  editColumns,
+  bargainingArr,
+  costArr,
+  statusList,
+  rate_status_options,
+  is_determine_price_options,
+  coveColumns
+};

+ 473 - 0
src/views/sellOut/filing/detail.vue

@@ -0,0 +1,473 @@
+<template>
+  <div class="filingDetail">
+    <div class="filingDetail-main" v-if="powers.some((i) => i == '007')">
+      <el-tabs v-model="projectTabs" v-loading="loading">
+        <el-tab-pane label="报备单详情" name="1">
+          <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
+            <el-collapse-item :title="'报备单详情'" name="1">
+              <show-data-table
+                style="padding: -5px 0 10px 0"
+                :newTime="newTime"
+                v-if="newTime !== ''"
+                :sitem="sitem"
+                :columns="editColumns"
+              >
+                <template slot="status">
+                  <el-tag
+                    :size="tablebtnSize"
+                    :type="
+                      (statusList.find((item) => item.id == sitem.status) || {}).type ||
+                      ''
+                    "
+                    v-text="
+                      (statusList.find((item) => item.id == sitem.status) || {}).label ||
+                      '--'
+                    "
+                  ></el-tag>
+                </template>
+
+                <template slot="supplierName">
+                  <span>{{ sitem.supplierName }}</span>
+                  <el-popover placement="top" width="300" trigger="hover">
+                    <ul>
+                      <li>
+                        <span>供应商编号:</span><span>{{ sitem.supplierNo }}</span>
+                      </li>
+                    </ul>
+                    <i class="el-icon-warning-outline fr" slot="reference"></i>
+                  </el-popover>
+                </template>
+                <template slot="customerName">
+                  <span>{{ sitem.customerName }}</span>
+                  <el-popover placement="top" width="300" trigger="hover">
+                    <ul>
+                      <li>
+                        <span>业务公司编号:</span><span>{{ sitem.customerNo }}</span>
+                      </li>
+                    </ul>
+                    <i class="el-icon-warning-outline fr" slot="reference"></i>
+                  </el-popover>
+                </template>
+                <template slot="companyName">
+                  <span>{{ sitem.companyName }}</span>
+                  <el-popover
+                    placement="top"
+                    width="300"
+                    trigger="hover"
+                    v-if="sitem.companyNo"
+                  >
+                    <ul>
+                      <li>
+                        <span>企业客户编号:</span><span>{{ sitem.companyNo }}</span>
+                      </li>
+                    </ul>
+                    <i class="el-icon-warning-outline fr" slot="reference"></i>
+                  </el-popover>
+                </template>
+
+                <template slot="is_determine_price">
+                  <el-tag
+                    :size="'mini'"
+                    v-text="
+                      (
+                        is_determine_price_options.find(
+                          (item) => item.id == sitem.is_determine_price + ''
+                        ) || {}
+                      ).label || '--'
+                    "
+                  ></el-tag>
+                </template>
+              </show-data-table>
+            </el-collapse-item>
+            <el-collapse-item title="商品信息" name="20">
+              <show-data-table
+                :newTime="newTime"
+                v-if="newTime !== ''"
+                :columns="coveColumns"
+                :sitem="sitem"
+              >
+                <template slot="good_name">
+                  <span>{{ sitem.good_name }}</span>
+                  <span v-for="(si, i) in sitem.specinfo" :key="si.spec_id + i">
+                    <span v-if="i !== 0">-</span>
+                    <span v-else>_</span>
+                    <span>{{ si.spec_name }}[{{ si.spec_value_name }}]</span>
+                  </span>
+                  <el-popover placement="top" width="300" trigger="hover">
+                    <ul>
+                      <li>
+                        <span>商品编号:</span><span>{{ sitem.spuCode }}</span>
+                      </li>
+                    </ul>
+                    <i class="el-icon-warning-outline fr" slot="reference"></i>
+                  </el-popover>
+                </template>
+
+                <template slot="send_way">
+                  <span>{{ sitem.send_way === "1" ? "供应商包邮" : "公司自提" }}</span>
+                </template>
+
+                <template slot="good_type">
+                  <el-tag
+                    :size="'mini'"
+                    v-text="
+                      (options1.find((item) => item.id == sitem.good_type) || {}).name ||
+                      '--'
+                    "
+                  />
+                  <span v-if="sitem.good_type === '1'" style="padding: 0 0 0 5px"
+                    >{{ sitem.moq }}起订/工期{{ sitem.customized }}天</span
+                  >
+                </template>
+                <template slot="supply_area">
+                  <el-tag
+                    :size="'mini'"
+                    v-text="
+                      (options6.find((item) => item.id === sitem.supply_area) || {})
+                        .name || '--'
+                    "
+                  ></el-tag>
+                </template>
+
+                <template slot="pay_way">
+                  <el-tag
+                    :size="'mini'"
+                    v-text="
+                      (options9.find((item) => item.id == sitem.pay_way) || {}).name ||
+                      '--'
+                    "
+                  />
+                </template>
+                <template slot="noble">
+                  <span v-if="sitem.noble_name"
+                    >{{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
+                      sitem.noble_name
+                    }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
+                      sitem.is_gold_price === "0" ? "不" : ""
+                    }}启用实时金价-{{ sitem.is_diff === "1" ? "有" : "无" }}工差-{{
+                      sitem.config
+                    }}-{{ sitem.other_config }}</span
+                  >
+                  <span v-else>--</span>
+                </template>
+                <template slot="good_img">
+                  <img
+                    v-viewer
+                    style="width: 23px; height: 23px; margin: 0 5px 0 0"
+                    class="fl"
+                    v-for="(si, sii) in sitem.good_img"
+                    :key="si + sii"
+                    :src="si"
+                    alt=""
+                  /> </template
+              ></show-data-table>
+            </el-collapse-item>
+
+            <el-collapse-item
+              title="审批"
+              name="2"
+              v-if="status == '0' && ppowers.some((i) => i == '0')"
+            >
+              <exam-forms
+                :newTime="newTime"
+                v-if="newTime !== ''"
+                :disabled="!(status == '0' && ppowers.some((i) => i == '0'))"
+                :sitem="orderItem"
+                @searchChange="examFormSubmit($event, '')"
+              />
+            </el-collapse-item>
+          </el-collapse>
+        </el-tab-pane>
+        <el-tab-pane label="审批记录" name="3">
+          <process-time-line
+            v-if="newTime !== ''"
+            :newTime="newTime"
+            :type="'YJD'"
+            :orderCode="queryId"
+          />
+        </el-tab-pane>
+
+        <!-- <el-tab-pane label="流程图" name="5">
+          <flow-chart process_id="13" :orderCode="queryId" />
+        </el-tab-pane> -->
+      </el-tabs>
+    </div>
+    <div v-else>
+      <no-auth></no-auth>
+    </div>
+  </div>
+</template>
+<script>
+import examForms from "./exam-form.vue";
+import asyncRequest from "@/apis/service/sellOut/filing";
+import resToken from "@/mixins/resToken";
+import { mapGetters } from "vuex";
+
+import {
+  editColumns,
+  costArr,
+  bargainingArr,
+  options1,
+  options2,
+  options3,
+  options4,
+  options5,
+  options6,
+  options7,
+  options8,
+  options9,
+  options10,
+  options11,
+  options12,
+  statusList,
+  rate_status_options,
+  coveColumns,
+  is_determine_price_options,
+} from "./columns";
+export default {
+  components: {
+    examForms,
+  },
+  name: "filingDetail",
+  mixins: [resToken],
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size", "private_field"]),
+    powers() {
+      const tran =
+        this.$store.getters.btnList.find((item) => item.menu_route == "filingDetail") ||
+        {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+    ppowers() {
+      const tran =
+        this.$store.getters.roleProcess.find((i) => i.process_type === "YJD") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+
+  data() {
+    return {
+      size: "small",
+      eaxmList: [],
+      costArr,
+      bargainingArr,
+      editColumns,
+      options1,
+      options2,
+      options3,
+      options4,
+      options5,
+      options6,
+      options7,
+      options8,
+      options9,
+      options10,
+      options11,
+      options12,
+      statusList,
+      rate_status_options,
+      is_determine_price_options,
+      coveColumns,
+      projectTabs: "1",
+      activeNames: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "20"],
+      newTime: "",
+      loading: false,
+      queryType: "",
+      queryId: "",
+      status: "",
+      sitem: null,
+
+      orderItem: {},
+      moneyDirItem: {},
+      moneyItem: {},
+      BossItem: {},
+    };
+  },
+  mounted() {
+    this.initForm();
+  },
+  methods: {
+    async initForm() {
+      const { id, type } = this.$route.query;
+      this.queryId = id;
+      this.queryType = type;
+      this.projectTabs = "1";
+      this.loading = true;
+      await this.initData();
+      this.loading = false;
+    },
+
+    handleClick(row) {
+      console.log(row);
+    },
+    async refresh() {
+      this.routeReGoto("filing", {});
+    },
+    async initData() {
+      this.loading = true;
+      const { code, message, data } = await asyncRequest.detail({
+        id: this.queryId,
+      });
+
+      this.eaxmList = [];
+      this.loading = false;
+      if (code === 0) {
+        this.sitem = JSON.parse(JSON.stringify(data));
+        this.sitem.good_img = this.sitem.good_img.split(",");
+
+        const { status, exam_info } = this.sitem;
+        this.orderItem = {};
+        this.moneyDirItem = {};
+        this.moneyItem = {};
+        this.BossItem = {};
+        if (exam_info && exam_info.length > 0) {
+          exam_info.forEach((e) => {
+            console.log(e.status);
+            switch (e.info_status + "") {
+              case "0":
+                this.orderItem = JSON.parse(JSON.stringify(e));
+                break;
+              case "2":
+                this.moneyDirItem = JSON.parse(JSON.stringify(e));
+                break;
+              case "4":
+                this.moneyItem = JSON.parse(JSON.stringify(e));
+                break;
+              case "7":
+                this.BossItem = JSON.parse(JSON.stringify(e));
+                break;
+              default:
+                this.orderItem = JSON.parse(JSON.stringify(e));
+            }
+          });
+          this.eaxmList = JSON.parse(JSON.stringify(exam_info));
+        }
+
+        this.status = status;
+
+        this.getNewTime();
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(message);
+      }
+    },
+    getNewTime() {
+      this.newTime = new Date().valueOf();
+    },
+
+    // 点击业务审核的保存按钮
+
+    async examFormSubmit(e, title) {
+      if (!this.loading) {
+        const { state, remark } = e;
+        let model = {
+          bargainNo: this.queryId,
+          status: state,
+          remark: remark,
+        };
+        await this.$confirm(`确定要提交${title}审批结果?`, {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+          .then(async () => {
+            const { after_price, lower_price } = this.sitem;
+            if (
+              this.status === "7" &&
+              after_price * 1 < lower_price * 1 &&
+              state + "" === "1"
+            ) {
+              this.loading = false;
+              await this.$confirm(
+                `当前商品同意议价后,售价已低于系统最低售价${this.sitem.lower_price}元!`,
+                `最终售价已低于系统最低售价!是否继续?`,
+
+                {
+                  confirmButtonText: "确定",
+                  cancelButtonText: "取消",
+                  type: "error",
+                }
+              )
+                .then(async () => {
+                  this.loading = true;
+                  await this.statusSubmit(model, title);
+                })
+                .catch(() => {
+                  this.loading = false;
+                  console.log("取消1");
+                });
+            } else {
+              await this.statusSubmit(model, title);
+            }
+          })
+          .catch(() => {
+            this.loading = false;
+            console.log("取消");
+          });
+      }
+    },
+    async statusSubmit(model, title) {
+      const { code, data, message } = await asyncRequest.status(model);
+      this.loading = false;
+      // console.log("res", data);
+      if (code === 0) {
+        this.$notify.success({
+          title: title + "成功!",
+          message: "",
+        });
+        await this.initForm();
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
+      } else {
+        this.$message.warning(message);
+      }
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.filingDetail {
+  position: relative;
+  height: 100%;
+  width: 100%;
+  box-sizing: border-box;
+  .filingDetail-main {
+    position: relative;
+    padding: 10px;
+    height: 100%;
+    width: 100%;
+  }
+  .filingDetail-title {
+    border-top: 1px solid #ebeef5;
+    span {
+      height: 50px;
+      line-height: 50px;
+      font-family: "微软雅黑", sans-serif;
+      font-weight: 400;
+      font-style: normal;
+      font-size: 16fpx;
+      text-align: left;
+    }
+  }
+  /deep/ .ddiv {
+    border-top: 1px solid #dcdfe6;
+  }
+  /deep/ .dtitle {
+    width: 40px;
+    text-align: center;
+    height: 100%;
+    min-height: 100%;
+    ul {
+      padding: 12px 0 0 0;
+    }
+  }
+  /deep/ .dmain {
+    padding: 20px 0 0 0;
+    width: calc(100% - 40px);
+    border-left: 1px solid #dcdfe6;
+  }
+}
+</style>

+ 164 - 0
src/views/sellOut/filing/exam-form.vue

@@ -0,0 +1,164 @@
+<template>
+  <el-form
+    v-loading="loading"
+    ref="ruleForm"
+    :model="ruleForm"
+    status-icon
+    :rules="rulesThis"
+    :label-width="labelWidth || '100px'"
+    class="demo-ruleForm"
+    :size="size || 'medium'"
+  >
+    <el-row>
+      <el-col :span="12"
+        ><el-form-item label="审核状态" prop="state">
+          <el-radio-group
+            v-model="ruleForm.state"
+            placeholder="审核状态"
+            style="width: 100%"
+            :disabled="disabled"
+            @change="stateChange"
+          >
+            <el-radio
+              v-for="item in stateList"
+              :key="item.value"
+              :label="item.value"
+              >{{ item.label }}</el-radio
+            >
+          </el-radio-group>
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-button
+          v-if="!disabled"
+          :size="'mini'"
+          type="primary"
+          class="fr"
+          @click="submitForm"
+          >保 存
+        </el-button>
+      </el-col>
+      <el-col :span="24">
+        <el-form-item label="审核备注" prop="remark">
+          <el-input
+            type="textarea"
+            placeholder="审核备注"
+            v-model="ruleForm.remark"
+            :disabled="disabled"
+            maxlength="250"
+            :autosize="{ minRows: 2, maxRows: 2 }"
+            show-word-limit
+          />
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+export default {
+  name: "exam-form",
+  props: ["size", "disabled", "labelWidth", "sitem"],
+  /**
+   * 属性集合
+   * @param {String}        size             : 组件大小             非必填
+   * @param {Array}         statusList       : 驳回至备选项          必填
+   * @param {Boolean}       disabled         : 是否禁用              必填
+   * @param {Boolean}       isMust           : 是否需要展示驳回节点   必填
+   *
+   *
+   */
+  /**
+   * 事件集合
+   * @searchChange             : 选中值变化调用   抛出选中数据
+   */
+  data() {
+    return {
+      loading: false,
+      stateList: [
+        {
+          value: "1",
+          label: "通过",
+        },
+        {
+          value: "0",
+          label: "驳回",
+        },
+      ],
+      showModelThis: this.showModel,
+      ruleForm: {
+        state: "1", // 通过or驳回
+        rebut: "", //驳回至
+        remark: "",
+      },
+      rulesThis: this.rules,
+      rules: {
+        state: [
+          {
+            required: true,
+            message: "请选择审核状态",
+            trigger: "change",
+          },
+        ],
+
+        remark: [
+          { required: true, message: "请输入审核备注", trigger: "blur" },
+        ],
+      },
+    };
+  },
+  watch: {
+    newTime: function () {
+      this.initForm();
+    },
+  },
+  mounted() {
+    this.initForm();
+  },
+  methods: {
+    async initForm() {
+      this.loading = true;
+      this.rulesThis = this.rules;
+      await this.resetForm();
+      this.stateChange();
+      this.loading = false;
+    },
+    stateChange() {
+      this.rulesThis.remark[0].required = this.ruleForm.state !== "1";
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          console.log(this.sitem);
+          const { status, remark } = this.sitem;
+          this.ruleForm = {
+            state: status + "" || "1", // 通过or驳回
+            remark: remark || "",
+          };
+        }
+      });
+    },
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          this.$emit("searchChange", this.ruleForm);
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.exa {
+  margin: 20px 0 0 30px;
+  font-size: 14px;
+  font-weight: bold;
+}
+</style>

+ 440 - 0
src/views/sellOut/filing/index.vue

@@ -0,0 +1,440 @@
+<template>
+  <div class="filing pagePadding">
+    <div v-if="powers.some((i) => i == '001')">
+      <ex-table
+        v-loading="loading"
+        :table="table"
+        :data="tableData"
+        :columns="columns"
+        :page="pageInfo"
+        :size="size"
+        @page-curr-change="handlePageChange"
+        @page-size-change="handleSizeChange"
+        @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 0 80px">
+              <el-col :span="4" style="width: 130px">
+                <el-select
+                  :size="searchSize"
+                  v-model="parmValue.status"
+                  clearable
+                  placeholder="状态"
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="item in statusList"
+                    :key="item.id"
+                    :label="item.label"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-col>
+              <el-col :span="4" style="width: 301px; padding: 0 0 0 10px">
+                <period-date-picker
+                  :start="parmValue.start_date"
+                  :end="parmValue.end_date"
+                  :width="'134px'"
+                  :size="searchSize"
+                  @timeReturned="handleTime"
+                />
+              </el-col>
+
+              <el-col :span="4" style="width: 420px; padding: 0 0 0 10px">
+                <el-input
+                  clearable
+                  :size="searchSize"
+                  placeholder="关键字"
+                  v-model="s_input"
+                  maxlength="40"
+                  @blur="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                  class="input-with-select"
+                >
+                  <el-select
+                    style="width: 140px"
+                    v-model="select"
+                    slot="prepend"
+                    placeholder="关键字类型"
+                  >
+                    <el-option label="报备单编码" value="1" />
+                    <el-option label="供应商编码" value="2" />
+                    <el-option label="商品名称" value="3" />
+                    <el-option label="客户名称" value="4" />
+                    <el-option label="客户编码" value="5" />
+                    <el-option label="订单编号" value="6" />
+                  </el-select>
+                  <el-button
+                    slot="append"
+                    icon="el-icon-search"
+                    @click="
+                      pageInfo.curr = 1;
+                      parmValue.page = 1;
+                      searchList();
+                    "
+                  ></el-button>
+                </el-input>
+              </el-col>
+
+              <el-col :span="3" style="width: 66px; float: right">
+                <el-button
+                  :size="searchSize"
+                  type="primary"
+                  style="float: right; margin-left: 5px"
+                  @click="searchList"
+                >
+                  刷新
+                </el-button>
+              </el-col>
+              <el-col :span="4" class="fr" style="width: 66px">
+                <el-button
+                  type="warning"
+                  class="fr"
+                  :size="searchSize"
+                  @click="restSearch"
+                >
+                  重置
+                </el-button>
+              </el-col>
+            </el-row>
+          </div>
+        </template>
+        <template #status="{ scope }">
+          <el-tag
+            :size="tablebtnSize"
+            :type="
+              (statusList.find((item) => item.id == scope.row.status) || {}).type || ''
+            "
+            v-text="
+              (statusList.find((item) => item.id == scope.row.status) || {}).label || '--'
+            "
+          ></el-tag>
+        </template>
+        <template #good_name="{ scope }">
+          <span>{{ scope.row.good_name }}</span>
+          <span v-for="(si, sii) in scope.row.specinfo" :key="si.spec_value_id + sii">
+            {{ sii == 0 ? "__" : "--" }}{{ si.spec_name }}[{{ si.spec_value_name }}]</span
+          >
+        </template>
+        <template #can="{ scope }">
+          <span v-for="(si, sii) in scope.row.can" :key="si.id + sii">
+            <span v-if="sii !== 0">_</span>{{ si.name }}</span
+          >
+        </template>
+        <template #operation="{ scope }">
+          <el-tooltip
+            v-if="powers.some((i) => i == '007')"
+            effect="dark"
+            content="详情"
+            placement="top"
+          >
+            <i
+              class="el-icon-view tb-icon"
+              @click="getRouter('filingDetail', scope.row.id)"
+            ></i>
+          </el-tooltip>
+        </template>
+      </ex-table>
+    </div>
+    <div v-else>
+      <no-auth></no-auth>
+    </div>
+  </div>
+</template>
+<script>
+import mixinPage from "@/mixins/elPaginationHandle";
+import resToken from "@/mixins/resToken";
+import asyncRequest from "@/apis/service/sellOut/filing";
+import { listCol, statusList } from "./columns";
+import { mapGetters } from "vuex";
+
+export default {
+  name: "filing",
+  mixins: [mixinPage, resToken],
+  computed: {
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      const tran =
+        this.$store.getters.btnList.find((item) => item.menu_route == "filing") || {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      select: "1",
+      s_input: "",
+      customerCode: [], //客户公司code
+      statusList,
+      sitem: null,
+
+      loading: true,
+      showModel: false,
+      isDetail: false,
+      modelId: 0,
+      parmValue: {
+        start_date: "",
+        end_date: "",
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        status: "", // 状态
+
+        filingCode: "", // 报备单编码
+        supplierNo: "", // 供应商编码
+
+        good_name: "", //商品名称
+        companyName: "", //客户名称
+        companyCode: "", //客户编码
+
+        orderCode: "", //客户编码
+      },
+      // 表格 - 数据
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        _defaultHeader_: ["setcol"],
+      },
+      // 表格 - 分页
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      // 表格 - 列参数
+      columns: listCol,
+
+      resultValue: "", //处理结果
+    };
+  },
+  mounted() {
+    const { back } = this.$route.query;
+    if (back) {
+      this.parmValue = JSON.parse(back);
+      console.log(this.parmValue);
+      const { page, size } = this.parmValue;
+
+      // if(this.parmValue.khNo.length>0){
+      //     this.customerCode = [this.parmValue.khNo] ;
+      // }
+
+      this.pageInfo = {
+        size: size,
+        curr: page,
+        total: 0,
+      };
+      //多选条件
+      this.select = this.parmValue.select;
+      // this.sselect = this.parmValue.sselect;
+      this.s_input = this.parmValue.s_input;
+    } else {
+      this.select = "1";
+      //  this.sselect = "创建时间"
+    }
+    this.searchList();
+  },
+
+  methods: {
+    getRouter(toRouter, queryId) {
+      if (toRouter && queryId) {
+        let model = {
+          id: queryId,
+          type: "view",
+        };
+
+        //有多选框的条件
+        this.parmValue.select = this.select;
+        // this.parmValue.sselect = this.sselect ;
+        this.parmValue.s_input = this.s_input;
+        //
+        let routerModel = {
+          options: JSON.parse(JSON.stringify(this.parmValue)),
+          router: this.$route.path,
+        };
+        model.preModel = JSON.stringify(routerModel);
+
+        this.routeGoto(toRouter, model);
+      } else {
+        this.$message.warning("暂未找到相关流程!");
+      }
+    },
+    restSearch() {
+      this.customerCode = [];
+      this.select = "1";
+      this.s_input = "";
+      this.parmValue = {
+        start_date: "",
+        end_date: "",
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+        status: "", // 状态
+
+        filingCode: "", // 报备单编码
+        supplierNo: "", // 供应商编码
+
+        good_name: "", //商品名称
+        companyName: "", //客户名称
+        companyCode: "", //客户编码
+
+        orderCode: "", //客户编码
+      };
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 15,
+        curr: 1,
+        total: 0,
+      };
+      this.searchList();
+    },
+
+    openModal(id, isDetail, sitem) {
+      this.showModel = true;
+      this.modelId = id;
+      this.isDetail = isDetail;
+      this.sitem = sitem;
+    },
+    // async deleteById(id, status) {
+    //   await this.$confirm("确定要删除?", {
+    //     confirmButtonText: "确定",
+    //     cancelButtonText: "取消",
+    //     type: "warning",
+    //   })
+    //     .then(async () => {
+    //       const model = {
+    //         id: id,
+    //         status: status === "1" ? "0" : "1",
+    //       };
+    //       const res = await asyncRequest.status(model);
+    //       if (res && res.code === 0) {
+    //         this.$notify.success({
+    //           title: "删除成功",
+    //           message: "",
+    //         });
+    //         this.searchList();
+    //       } else if (res && res.code >= 100 && res.code <= 104) {
+    //         await this.logout();
+    //       } else {
+    //         this.$message.warning(res.message);
+    //       }
+    //     })
+    //     .catch(() => {
+    //       console.log("取消");
+    //     });
+    // },
+    // 列表搜索
+    async searchList() {
+      if (
+        (this.parmValue.start !== "" && this.parmValue.end === "") ||
+        (this.parmValue.start === "" && this.parmValue.end !== "")
+      ) {
+        this.$message.warning("时间区间不完整!");
+        return;
+      }
+
+      this.loading = true;
+      this.parmValue.filingCode = this.select === "1" ? this.s_input : "";
+      // this.parmValue.supplierNo = this.select === "2" ? this.s_input : "";
+      this.parmValue.good_name = this.select === "3" ? this.s_input : "";
+      this.parmValue.companyName = this.select === "4" ? this.s_input : "";
+      this.parmValue.companyCode = this.select === "5" ? this.s_input : "";
+      this.parmValue.orderCode = this.select === "6" ? this.s_input : "";
+      const res = await asyncRequest.list(this.parmValue);
+      if (res && res.code === 0 && res.data) {
+        this.tableData = res.data.list;
+        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;
+    },
+
+    // async statusConfirm(id, status) {
+    //   let str = status === "1" ? "禁用" : "启用";
+    //   await this.$confirm("确定要改为" + str + "?", {
+    //     confirmButtonText: "确定",
+    //     cancelButtonText: "取消",
+    //     type: "warning",
+    //   })
+    //     .then(async () => {
+    //       this.loading = true;
+    //       const model = {
+    //         id: id,
+    //         status: status === "1" ? "0" : "1",
+    //       };
+    //       const res = await asyncRequest.status(model);
+    //       if (res && res.code === 0) {
+    //         this.loading = false;
+    //         this.$notify.success({
+    //           title: "状态修改成功!",
+    //           message: "",
+    //         });
+    //         await this.searchList();
+    //       } else if (res && res.code >= 100 && res.code <= 104) {
+    //         await this.logout();
+    //       } else {
+    //         this.$message.warning(res.message);
+    //       }
+    //     })
+    //     .catch(() => {
+    //       console.log("取消");
+    //     });
+    // },
+    // 时间选择事件
+    async handleTime(e) {
+      if (e.startTime !== "") {
+        this.parmValue.start_date = e.startTime;
+      } else {
+        this.parmValue.start_date = "";
+      }
+      if (e.endTime !== "") {
+        this.parmValue.end_date = e.endTime;
+      } else {
+        this.parmValue.end_date = "";
+      }
+      if (this.parmValue.start_date !== "" && this.parmValue.end_date !== "") {
+        this.pageInfo.curr = 1;
+        this.parmValue.page = 1;
+        await this.searchList();
+      }
+    },
+    async customerChange(e) {
+      if (e && e.id) {
+        this.customerCode = [e.code];
+        this.parmValue.customer_code = e.code;
+      } else {
+        this.customerCode = [];
+        this.parmValue.customer_code = "";
+      }
+      this.pageInfo.curr = 1;
+      this.parmValue.page = 1;
+      await this.searchList();
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.filing {
+}
+</style>

+ 0 - 0
src/views/sellOut/filing/报备单管理


+ 74 - 3
src/views/sellOut/zixunOrder/components/addEditGoodModal.vue

@@ -230,7 +230,12 @@
                           @click="openEdit(scope.$index, scope.row)"
                         ></i>
                       </el-tooltip>
-                      <el-tooltip effect="dark" content="删除" placement="top">
+                      <el-tooltip
+                        effect="dark"
+                        content="删除"
+                        v-if="!scope.row.isMust"
+                        placement="top"
+                      >
                         <i
                           class="el-icon-delete tb-icon"
                           @click="openDelete(scope.$index)"
@@ -566,15 +571,78 @@ export default {
     priceAccMul(a, b) {
       return accMul(a, b);
     },
+    async set_must_spec() {
+      const { cat_id } = this.ruleForm;
+      let id = cat_id.length == 1 ? cat_id[0] : "";
+      if (id) {
+        const { code, message, data } = await asyncRequest.catinfo({ id: id });
+        if (code === 0) {
+          const { spec } = data;
+          if (spec && spec.length > 0) {
+            if (this.spec_tableData && this.spec_tableData.length > 0) {
+              this.spec_tableData.forEach((c) => {
+                c.isMust = false;
+              });
+              spec.forEach((a, ai) => {
+                let findex = this.spec_tableData.findIndex((b) => b.specid === a.id);
+                if (findex !== -1) {
+                  this.spec_tableData[findex].isMust = true;
+                } else {
+                  this.spec_tableData.push({
+                    id: "",
+                    index: "1",
+                    specid: a.id,
+                    spec_name: a.spec_name,
+                    isMust: true,
+                    spec_value_name: "",
+                    spec_value_id: "",
+                  });
+                }
+              });
+            } else {
+              spec.forEach((a, ai) => {
+                let model = {
+                  id: "",
+                  index: "1",
+                  specid: a.id,
+                  spec_name: a.spec_name,
+                  isMust: true,
+                  spec_value_name: "",
+                  spec_value_id: "",
+                };
+                this.spec_tableData.push(model);
+              });
+            }
+          }
+          this.spec_tableData.map((e, ei) => {
+            e.index = ei + "";
+            return e;
+          });
+          this.spec_tableData.forEach((si, sii) => {
+            this.$set(this.spec_tableData, sii, si);
+          });
+        } else if (code >= 100 && code <= 104) {
+          await this.logout();
+        } else {
+          this.$message.warning(message);
+        }
+      } else {
+        this.spec_tableData.forEach((si, sii) => {
+          si.isMust = false;
+          this.$set(this.spec_tableData, sii, si);
+        });
+      }
+    },
     //规格编辑修改结果
     refreshEdit(e) {
       let item = JSON.parse(JSON.stringify(e));
       const { index, id, specid, spec_name, spec_value_id, spec_value_name } = item;
+      console.log(item);
       if (index + "" === "-1") {
         this.spec_tableData.push(item);
       } else {
         this.spec_tableData.forEach((i, findex) => {
-          if (i.spec_id === spec_id) {
+          if (i.specid === specid) {
             this.spec_tableData[findex].id = id;
             this.spec_tableData[findex].specid = specid;
             this.spec_tableData[findex].spec_name = spec_name;
@@ -588,7 +656,7 @@ export default {
     async resetForm() {
       this.spec_tableData = [];
       // 重置
-      await this.$nextTick(() => {
+      await this.$nextTick(async () => {
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
@@ -693,6 +761,7 @@ export default {
               }
             });
           }
+          // await this.set_must_spec();
         }
       });
     },
@@ -704,6 +773,8 @@ export default {
       this.ruleForm.cat_arr_id = item;
       this.$refs.ruleForm.validateField("cat_id");
       this.is_noble = pid === "6";
+      await this.set_must_spec();
+      //修改
     },
 
     //单位选择

+ 4 - 5
src/views/sellOut/zixunOrder/components/baseFormAddEdit.vue

@@ -29,7 +29,7 @@
             <el-form-item label="规格类型" prop="specid">
               <search-spec
                 :value="ruleForm.specid"
-                :disabled="false"
+                :disabled="sitem.isMust"
                 :size="'mini'"
                 :isDetail="false"
                 :placeholder="'规格类型'"
@@ -37,14 +37,12 @@
               />
             </el-form-item>
             <el-form-item label="规格值" prop="spec_value_id">
-              <div
-                v-if="specVlist.length > 0"
-              >
+              <div v-if="specVlist.length > 0">
                 <el-select
                   v-model="ruleForm.spec_value_id"
                   placeholder="请选择规格值"
                   @change="spec_value_id_change"
-                  style="width:100%"
+                  style="width: 100%"
                   filterable
                 >
                   <el-option
@@ -157,6 +155,7 @@ export default {
           if (this.index + "" !== "-1") {
             this.specVlist = [];
             const { specid, spec_name, spec_value_id, spec_value_name } = this.sitem;
+            console.log(this.sitem);
             this.ruleForm = {
               index: this.index,
               specid: specid || "",

+ 70 - 1
src/views/sellOut/zixunOrder/components/editForm.vue

@@ -430,7 +430,12 @@
                       @click="openEdit(scope.$index, scope.row)"
                     ></i>
                   </el-tooltip>
-                  <el-tooltip effect="dark" content="删除" placement="top">
+                  <el-tooltip
+                    effect="dark"
+                    v-if="!scope.row.isMust"
+                    content="删除"
+                    placement="top"
+                  >
                     <i
                       class="el-icon-delete tb-icon"
                       @click="openDelete(scope.$index)"
@@ -961,6 +966,7 @@ export default {
           }
 
           this.od_form = JSON.parse(JSON.stringify(this.ruleForm));
+          await this.set_must_spec();
         }
       });
     },
@@ -972,6 +978,69 @@ export default {
     openDelete(index) {
       this.spec_tableData.splice(index, 1);
     },
+    async set_must_spec() {
+      const { cat_id } = this.ruleForm;
+      let id = cat_id.length == 1 ? cat_id[0] : "";
+      if (id) {
+        const { code, message, data } = await asyncRequest.catinfo({ id: id });
+        if (code === 0) {
+          const { spec } = data;
+          if (spec && spec.length > 0) {
+            if (this.spec_tableData && this.spec_tableData.length > 0) {
+              this.spec_tableData.forEach((c) => {
+                c.isMust = false;
+              });
+              spec.forEach((a, ai) => {
+                let findex = this.spec_tableData.findIndex((b) => b.specid === a.id);
+                if (findex !== -1) {
+                  this.spec_tableData[findex].isMust = true;
+                } else {
+                  this.spec_tableData.push({
+                    id: "",
+                    index: "1",
+                    specid: a.id,
+                    spec_name: a.spec_name,
+                    isMust: true,
+                    spec_value_name: "",
+                    spec_value_id: "",
+                  });
+                }
+              });
+            } else {
+              spec.forEach((a, ai) => {
+                let model = {
+                  id: "",
+                  index: "1",
+                  specid: a.id,
+                  spec_name: a.spec_name,
+                  isMust: true,
+                  spec_value_name: "",
+                  spec_value_id: "",
+                };
+                this.spec_tableData.push(model);
+              });
+            }
+          }
+          this.spec_tableData.map((e, ei) => {
+            e.index = ei + "";
+            return e;
+          });
+
+          this.spec_tableData.forEach((si, sii) => {
+            this.$set(this.spec_tableData, sii, si);
+          });
+        } else if (code >= 100 && code <= 104) {
+          await this.logout();
+        } else {
+          this.$message.warning(message);
+        }
+      } else {
+        this.spec_tableData.forEach((si, sii) => {
+          si.isMust = false;
+          this.$set(this.spec_tableData, sii, si);
+        });
+      }
+    },
     //规格编辑修改结果
     refreshEdit(e) {
       let item = JSON.parse(JSON.stringify(e));