浏览代码

feat:供应商商品成本

snow 1 年之前
父节点
当前提交
0dbf0e902d

+ 3 - 2
src/apis/service/dataCorrection/order/index.js

@@ -3,9 +3,10 @@ const api = "admin/";
 
 export default {
   list: (data, params) => http(api + "cgdlist", data, "post", params),
+  create: (data, params) => http(api + "dachangeadd", data, "post", params),
   // 获取全部账户列表
   accountall: (data, params) => http(api + 'userCompanyBasicList', data, 'post', params),
-  //获取采购单修改供应商的记录
-  cgdgetchangesupplierlist: (data, params) => http(api + "cgdgetchangesupplierlist", data, "post", params),
+
+  cgdgetchangesupplierlist: (data, params) => http(api + "dachangelist", data, "post", params),
   detail: (data, params) => http(api + "cgdinfo", data, "post", params)
 }

+ 22 - 39
src/views/dataCorrection/cgMessage/addEdit.vue

@@ -68,12 +68,7 @@
                     <i class="el-icon-arrow-down el-icon--right" :size="searchSize"></i>
                   </el-button>
                   <el-dropdown-menu slot="dropdown">
-                    <el-dropdown-item
-                      v-for="item in options"
-                      :key="item"
-                      :command="item"
-                      >{{ item }}</el-dropdown-item
-                    >
+                    <el-dropdown-item v-for="item in options" :key="item" :command="item">{{ item }}</el-dropdown-item>
                   </el-dropdown-menu>
                 </el-dropdown>
               </el-col>
@@ -93,9 +88,7 @@
                   type="primary"
                   style="float: right; margin-left: 5px"
                   @click="searchList"
-                >
-                  刷新
-                </el-button>
+                >刷新</el-button>
               </el-col>
             </el-row>
             <el-row style="padding: 10px 0 0 0">
@@ -125,9 +118,6 @@
                     "
                   >
                     <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-option label="商品名称" value="5"></el-option>
                     <el-option label="供应商负责人" value="6"></el-option>
@@ -137,14 +127,7 @@
                 </el-input>
               </el-col>
               <el-col :span="4" style="width: 66px; float: right">
-                <el-button
-                  type="warning"
-                  class="fr"
-                  :size="searchSize"
-                  @click="restSearch"
-                >
-                  重置
-                </el-button>
+                <el-button type="warning" class="fr" :size="searchSize" @click="restSearch">重置</el-button>
               </el-col>
               <!-- 暂时注释,下版需要导出 -->
               <el-col :span="4" style="width: 66px; float: right">
@@ -154,18 +137,17 @@
                   @click="submit(selection)"
                   :size="searchSize"
                   class="fr"
-                >
-                  提交
-                </el-button>
+                >提交</el-button>
               </el-col>
             </el-row>
           </div>
         </template>
         <template #good_name="{ scope }">
           <span>{{ scope.row.good_name }}</span>
-          <span v-for="(si, i) in scope.row.speclist" :key="si.spec_id + i">
-            {{ i === 0 ? "__" : "--" }}{{ si.spec_name }}[{{ si.spec_value }}]
-          </span>
+          <span
+            v-for="(si, i) in scope.row.speclist"
+            :key="si.spec_id + i"
+          >{{ i === 0 ? "__" : "--" }}{{ si.spec_name }}[{{ si.spec_value }}]</span>
         </template>
         <template #status="{ scope }">
           <el-tag
@@ -176,6 +158,7 @@
             "
           ></el-tag>
         </template>
+
         <template #order_type="{ scope }">
           <el-tag
             :size="tablebtnSize"
@@ -204,10 +187,10 @@ export default {
   mixins: [mixinPage, resToken],
   props: ["showModel"],
   computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    ...mapGetters(["tablebtnSize", "searchSize", "size"])
   },
   watch: {
-    showModel: function (val) {
+    showModel: function(val) {
       this.showModelThis = val;
       if (val) {
         this.restSearch();
@@ -217,7 +200,7 @@ export default {
       if (!val) {
         this.$emit("cancel");
       }
-    },
+    }
   },
   data() {
     return {
@@ -226,7 +209,7 @@ export default {
       input: "",
       timeOBJ: {
         start: "", //起始时间
-        end: "", // 结束时间
+        end: "" // 结束时间
       },
       options: ["创建时间", "最晚入库时间"],
       sselect: "创建时间",
@@ -253,7 +236,7 @@ export default {
         page: 1, // 页码
         size: 15, // 每页显示条数
         supplierNo: "",
-        wsm_supplierNo: "",
+        wsm_supplierNo: ""
       },
       tableData: [],
       // 表格 - 数据
@@ -262,16 +245,16 @@ export default {
       table: {
         stripe: true,
         border: true,
-        _defaultHeader_: ["setcol"],
+        _defaultHeader_: ["setcol"]
       },
       // 表格 - 分页
       pageInfo: {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       },
       // 表格 - 列参数
-      columns: columns,
+      columns: columns
     };
   },
 
@@ -300,7 +283,7 @@ export default {
       this.input = "";
       this.timeOBJ = {
         start: "", //起始时间
-        end: "", // 结束时间
+        end: "" // 结束时间
       };
       this.parmValue = {
         bk_code: "", // 备库编码
@@ -317,13 +300,13 @@ export default {
         last_start: "", //最后入库时间开始
         last_end: "", //最后入库时间结束
         page: 1, // 页码
-        size: 15, // 每页显示条数
+        size: 15 // 每页显示条数
       };
       // 表格 - 分页
       this.pageInfo = {
         size: 15,
         curr: 1,
-        total: 0,
+        total: 0
       };
       this.searchList();
     },
@@ -389,8 +372,8 @@ export default {
         this.timeOBJ.end = "";
       }
       await this.handleClick(this.sselect);
-    },
-  },
+    }
+  }
 };
 </script>
 

+ 20 - 56
src/views/dataCorrection/vendorCorrection/columns.js

@@ -1,66 +1,32 @@
 const columns = [
   {
-    prop: "cgdNo",
+    prop: "code",
     label: "采购单编号",
     minWidth: "155"
   },
   {
-    prop: "cgder_old",
-    label: "供应商负责人(修改前)",
-    minWidth: "105"
+    prop:'oaCode',
+    label:'OA编号',
+    minWidth:'155'
   },
   {
-    prop: "cgder",
-    label: "供应商负责人(修改后)",
-    minWidth: "105"
+    prop:'status',
+    label:'状态',
+    _slot_:"status",
+    width:'90px'
   },
   {
     prop: "supplierNo_old",
-    label: "供应商编码(修改前)",
-    minWidth: "155"
+    label: "供应商公司(修改前)",
+    minWidth: "185",
+    _slot_:"supplierBefore"
   },
   {
     prop: "supplierNo",
-    label: "供应商编码(修改后)",
-    minWidth: "155"
-  },
-  {
-    prop: "supplier_name_old",
-    label: "供应商名称(修改前)",
-    minWidth: "155"
-  },
-  {
-    prop: "supplier_name",
-    label: "供应商名称(修改后)",
-    minWidth: "155"
-  },
-
-  {
-    prop: "wsm_code_old",
-    label: "仓库编码(修改前)",
-    minWidth: "155"
-  },
-  {
-    prop: "wsm_code",
-    label: "仓库编码(修改后)",
-    minWidth: "155"
+    label: "供应商公司(修改后)",
+    minWidth: "185",
+    _slot_:'supplierAfter'
   },
-  {
-    prop: "wsm_name_old",
-    label: "仓库名称(修改前)",
-    minWidth: "155"
-  },
-  {
-    prop: "wsm_name",
-    label: "仓库名称(修改后)",
-    minWidth: "155"
-  },
-
-  // {
-  //   prop: "addtime",
-  //   label: "添加时间",
-  //   minWidth: "155"
-  // },
   {
     prop: "updatetime",
     label: "修改时间",
@@ -68,17 +34,15 @@ const columns = [
   },
 
   {
-    prop: "company_name",
-    label: "创建人部门",
+    prop: "apply_name",
     minWidth: "150px",
+    label: "申请人",
   },
   {
-    prop: "creater",
-    label: "创建人",
-    minWidth: "65"
-  },
-
-
+    prop: "createtime",
+    minWidth: "150px",
+    label: "申请时间",
+  }
 ]
 export {
   columns

+ 24 - 24
src/views/dataCorrection/vendorCorrection/components/addEdit.vue

@@ -37,29 +37,6 @@
         <template #table-header="{ selection }">
           <div style="width: 100%">
             <el-row style="padding: 0 0 0 80px">
-              <el-col :span="4" style="width: 130px; padding: 0 0 10px 0">
-                <el-dropdown @command="handleClick($event)" :size="searchSize">
-                  <el-button :size="searchSize" style="width: 120px">
-                    {{ sselect }}
-                    <i class="el-icon-arrow-down el-icon--right" :size="searchSize"></i>
-                  </el-button>
-                  <el-dropdown-menu slot="dropdown">
-                    <el-dropdown-item v-for="item in options" :key="item" :command="item">{{ item }}</el-dropdown-item>
-                  </el-dropdown-menu>
-                </el-dropdown>
-              </el-col>
-
-              <el-col :span="4" style="width: 303px; padding: 0 0 10px 0">
-                <period-date-picker
-                  :type="1"
-                  :width="'135px'"
-                  :size="searchSize"
-                  :start="timeOBJ.start"
-                  :end="timeOBJ.end"
-                  @timeReturned="handleTime"
-                />
-              </el-col>
-
               <el-col :span="4" style="width: 150px">
                 <el-select
                   :size="searchSize"
@@ -84,7 +61,7 @@
                 </el-select>
               </el-col>
 
-              <el-col :span="4" style="width: 151px; padding: 0 0 0 10px">
+              <el-col :span="4" style="width: 151px; padding: 0 0 0px 10px">
                 <el-select
                   :size="searchSize"
                   v-model="parmValue.order_type"
@@ -108,6 +85,29 @@
                 </el-select>
               </el-col>
 
+              <el-col :span="4" style="width: 130px; padding: 0 10px">
+                <el-dropdown @command="handleClick($event)" :size="searchSize">
+                  <el-button :size="searchSize" style="width: 120px">
+                    {{ sselect }}
+                    <i class="el-icon-arrow-down el-icon--right" :size="searchSize"></i>
+                  </el-button>
+                  <el-dropdown-menu slot="dropdown">
+                    <el-dropdown-item v-for="item in options" :key="item" :command="item">{{ item }}</el-dropdown-item>
+                  </el-dropdown-menu>
+                </el-dropdown>
+              </el-col>
+
+              <el-col :span="4" style="width: 300px; padding: 0 0 10px 10px">
+                <period-date-picker
+                  :type="1"
+                  :width="'135px'"
+                  :size="searchSize"
+                  :start="timeOBJ.start"
+                  :end="timeOBJ.end"
+                  @timeReturned="handleTime"
+                />
+              </el-col>
+
               <el-col :span="3" style="width: 66px; float: right">
                 <el-button
                   :size="searchSize"

+ 155 - 139
src/views/dataCorrection/vendorCorrection/components/correctionForm.vue

@@ -9,130 +9,147 @@
     ref="ruleForm"
   >
     <el-row>
-      <el-collapse-item v-if="mode === 'update'" title="业务详情" name="0">TODO../...</el-collapse-item>
+      <el-collapse-item v-if="mode === 'update'" title="业务详情" name="0">TODO......</el-collapse-item>
 
       <el-row :span="24">
         <component
           name="1"
           :is="mapComponent[mode].item"
-          v-bind="createLabelProp('采购订单')"
+          v-bind="createLabelField('采购订单')"
           prop="cgdNo"
         >
-          <el-input placeholder="选择订单" @focus="centerDialogVisible = true" v-if="!sitem" />
-          <div style="display:flex" v-else>
-            <div>
-              <show-data-table
-                :newTime="newTime"
-                :sitem="sitem"
-                :columns="ShowDataTableColumns"
-                border
-              >
-                <template slot="supplier_name">
-                  <span>{{ sitem.supplier_name }}</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="company">
-                  <span>{{ sitem.company }}</span>
-                  <el-popover placement="top" width="300" trigger="hover">
-                    <ul>
-                      <li>
-                        <span>购买方公司编号:</span>
-                        <span>{{ sitem.companyNo }}</span>
-                      </li>
-                    </ul>
-                    <i class="el-icon-warning-outline fr" slot="reference"></i>
-                  </el-popover>
-                </template>
+          <el-select
+            style="width:100%"
+            placeholder="选择订单"
+            filterable
+            remote
+            @focus="centerDialogVisible = true"
+            v-if="!sitem"
+          />
 
-                <template slot="status">
-                  <el-tag
-                    :size="'mini'"
-                    :type="sitem.status == '0' ? 'warning' : ''"
-                    v-text="
-                    (statusOptions.find((i) => i.value == sitem.status) || {}).label || '--'
-                  "
-                  ></el-tag>
-                </template>
-                <template slot="order_type">
-                  <el-tag
-                    :size="'mini'"
-                    v-text="
-                    (cg_order_type_options.find((i) => i.id == sitem.order_type) || {})
-                      .label || '--'
-                  "
-                  ></el-tag>
-                  <el-popover
-                    placement="top"
-                    width="300"
-                    v-if="sitem.order_type + '' === '1'"
-                    trigger="hover"
-                  >
-                    <ul>
-                      <li>
-                        <span>备库单编号:</span>
-                        <span>{{ sitem.bkcode }}</span>
-                      </li>
-                    </ul>
-                    <i class="el-icon-warning-outline fr" slot="reference"></i>
-                  </el-popover>
-                </template>
+          <el-collapse-transition>
+            <div style="display:flex" v-if="sitem">
+              <div>
+                <show-data-table
+                  :newTime="newTime"
+                  :sitem="sitem"
+                  :columns="ShowDataTableColumns"
+                  border
+                >
+                  <template slot="supplier_name">
+                    <span>{{ sitem.supplier_name }}</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="company">
+                    <span>{{ sitem.company }}</span>
+                    <el-popover placement="top" width="300" trigger="hover">
+                      <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="wsm">
-                  <span>{{ sitem.wsm_supplier }}/{{ sitem.wsm_name }}</span>
-                  <el-popover placement="top" width="300" trigger="hover">
-                    <ul>
-                      <li>
-                        <span>仓库公司编号:</span>
-                        <span>{{ sitem.wsm_supplierNo }}</span>
-                      </li>
-                      <li>
-                        <span>仓库名称编号:</span>
-                        <span>{{ sitem.wsm_code }}</span>
-                      </li>
-                    </ul>
-                    <i class="el-icon-warning-outline fr" slot="reference"></i>
-                  </el-popover>
-                </template>
-              </show-data-table>
-            </div>
+                  <template slot="status">
+                    <el-tag
+                      :size="'mini'"
+                      :type="sitem.status == '0' ? 'warning' : ''"
+                      v-text="
+                        (statusOptions.find((i) => i.value == sitem.status) || {}).label || '--'
+                      "
+                    />
+                  </template>
+                  <template slot="order_type">
+                    <el-tag
+                      :size="'mini'"
+                      v-text="
+                      (cg_order_type_options.find((i) => i.id == sitem.order_type) || {})
+                       .label || '--'
+                      "
+                    />
+                    <el-popover
+                      placement="top"
+                      width="300"
+                      v-if="sitem.order_type + '' === '1'"
+                      trigger="hover"
+                    >
+                      <ul>
+                        <li>
+                          <span>备库单编号:</span>
+                          <span>{{ sitem.bkcode }}</span>
+                        </li>
+                      </ul>
+                      <i class="el-icon-warning-outline fr" slot="reference"></i>
+                    </el-popover>
+                  </template>
 
-            <el-tooltip content="重新选择订单" placement="top" v-if="mode !== 'update'">
-              <i
-                class="el-icon-circle-close"
-                size="mini"
-                type="text"
-                style="font-size:18px;cursor:pointer;margin-left:10px"
-                @click="resetOrder"
-              />
-            </el-tooltip>
-          </div>
-        </component>
+                  <template slot="wsm">
+                    <span>{{ sitem.wsm_supplier }}/{{ sitem.wsm_name }}</span>
+                    <el-popover placement="top" width="300" trigger="hover">
+                      <ul>
+                        <li>
+                          <span>仓库公司编号:</span>
+                          <span>{{ sitem.wsm_supplierNo }}</span>
+                        </li>
+                        <li>
+                          <span>仓库名称编号:</span>
+                          <span>{{ sitem.wsm_code }}</span>
+                        </li>
+                      </ul>
+                      <i class="el-icon-warning-outline fr" slot="reference"></i>
+                    </el-popover>
+                  </template>
+                </show-data-table>
+              </div>
 
-        <component
-          name="2"
-          :is="mapComponent[mode].item"
-          v-bind="createLabelProp('商品信息')"
-          v-if="sitem"
-          :style="`margin-top:10px;margin-right:${mode === 'create' ? '30px' : '0px'}`"
-        >
-          <show-goods-data-table
-            :newTime="newTime"
-            v-if="newTime !== ''"
-            :type="sitem.order_type"
-            :skucode="sitem.skuCode"
-            :spucode="sitem.spuCode"
-            :iscgd="true"
-            border
-          />
+              <el-tooltip content="重新选择订单" placement="top" v-if="mode !== 'update'">
+                <i
+                  class="el-icon-circle-close"
+                  size="mini"
+                  type="text"
+                  style="font-size:18px;cursor:pointer;margin-left:10px"
+                  @click="resetOrder"
+                />
+              </el-tooltip>
+            </div>
+          </el-collapse-transition>
         </component>
+
+        <el-collapse-transition>
+          <component
+            name="2"
+            v-if="sitem"
+            :is="mapComponent[mode].item"
+            v-bind="createLabelField('商品信息')"
+            :style="
+              `
+               margin-top:10px;
+               margin-right:${mode === 'create' ? '30px' : '0px'}
+               `
+            "
+          >
+            <show-goods-data-table
+              :newTime="newTime"
+              v-if="newTime !== ''"
+              :type="sitem.order_type"
+              :skucode="sitem.skuCode"
+              :spucode="sitem.spuCode"
+              :iscgd="true"
+              border
+            />
+          </component>
+        </el-collapse-transition>
       </el-row>
 
       <el-row>
@@ -163,6 +180,7 @@
               v-model="ruleForm.uid"
               :disabled="mode === 'update'"
               multiple
+              remote
               filterable
               :multiple-limit="1"
               clearable
@@ -217,8 +235,8 @@
     </el-row>
 
     <add-edit
-      :showModel="centerDialogVisible"
       @refresh="refresh"
+      :showModel="centerDialogVisible"
       @cancel="centerDialogVisible = false"
     />
   </component>
@@ -233,25 +251,25 @@ import WaitApproval from "./waitApproval.vue";
 
 const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]*$/;
 
-const VALID_OA_CODE = function(rule, value, callback) {
+const VALID_OA_CODE = function(_1, _2, callback) {
   const { oaCode } = this.ruleForm;
-
   if (!oaCode) {
     callback(new Error("OA编号不能为空!"));
   } else {
     if (reg.test(oaCode)) {
       callback();
     } else {
-      callback(new Error("OA编号必须包含数字和字母且不能包含特殊字符!"));
+      callback(new Error("OA编号必须包含数字和字母!"));
     }
   }
 };
 
 const VALID_SUPPLIER = function(_1, _2, callback) {
+  const { isArray } = Array;
   const { supplierNo } = this.ruleForm;
   if (
-    (Array.isArray(supplierNo) && !supplierNo[0]) ||
-    (!Array.isArray(supplierNo) && !supplierNo)
+    (isArray(supplierNo) && !supplierNo[0]) ||
+    (!isArray(supplierNo) && !supplierNo)
   ) {
     callback(new Error("请选择供应商!"));
   } else {
@@ -263,11 +281,6 @@ const VALID_SUPPLIER = function(_1, _2, callback) {
   }
 };
 
-// if (payload.supplierNo === this.sitem.supplierNo) {
-//   this.$message.warning("修改的供应商不能与采购单原供应商一致!");
-//   return;
-// }
-
 export default {
   components: { addEdit, WaitApproval },
   computed: {
@@ -279,8 +292,8 @@ export default {
     }
   },
   data() {
-    const BINDED_VALID_OA_CODE = VALID_OA_CODE.bind(this);
-    const BINDED_VALID_SUPPLIER = VALID_SUPPLIER.bind(this);
+    const binded_valid_oa_code = VALID_OA_CODE.bind(this);
+    const binded_valid_supplier = VALID_SUPPLIER.bind(this);
 
     return {
       activeNames: ["1", "2", "3", "4"],
@@ -314,28 +327,26 @@ export default {
       select: "1",
       input: "",
       ruleForm: {
+        supplierName: "",
         supplierNo: "",
-        uid: "",
-        cgdNo: "",
+        remark: "",
         oaCode: "",
-        supplierName: "",
-        remark: ""
+        cgdNo: "",
+        uid: ""
       },
       rules: {
         supplierNo: [
           {
             required: true,
-            // type: "array",
             trigger: "change",
-            validator: BINDED_VALID_SUPPLIER
-            // message: "请选择供应商"
+            validator: binded_valid_supplier
           }
         ],
         oaCode: [
           {
             required: true,
             trigger: "change",
-            validator: BINDED_VALID_OA_CODE
+            validator: binded_valid_oa_code
           }
         ],
         uid: [
@@ -364,7 +375,6 @@ export default {
   },
   mounted() {
     this.getAllActive();
-
     if (this.mode === "update") {
       this.initData();
     }
@@ -375,7 +385,7 @@ export default {
       //请求详情...
       this.refresh(this.id);
     },
-    createLabelProp(value) {
+    createLabelField(value) {
       return {
         [this.mapComponent[this.mode].labelProp]: value
       };
@@ -383,14 +393,20 @@ export default {
     async submit() {
       try {
         await this.$refs.ruleForm.validate();
-        const { supplierName: _, ...rest } = this.ruleForm;
+        const { supplierName, ...rest } = this.ruleForm;
 
         const payload = {
-          cgdNo: rest.cgdNo,
+          type: "1",
+          code: rest.cgdNo,
           oaCode: rest.oaCode,
-          supplierNo: rest.supplierNo[0],
-          remark: rest.remark
+          remark: rest.remark,
+          change: {
+            supplierNo: rest.supplierNo[0],
+            supplierName
+          }
         };
+
+        // const {} = await asyncRequest.
       } catch (e) {
         console.log(e);
       }

+ 5 - 2
src/views/dataCorrection/vendorCorrection/detail.vue

@@ -8,8 +8,12 @@
 
 <script>
 import CorrectionForm from "./components/correctionForm.vue";
+
 export default {
   name: "",
+  components: {
+    CorrectionForm
+  },
   computed: {
     mode() {
       return this.$route.query.mode || "create";
@@ -21,7 +25,6 @@ export default {
       };
       return mapTitle[this.mode];
     }
-  },
-  components: { CorrectionForm }
+  }
 };
 </script>

+ 65 - 47
src/views/dataCorrection/vendorCorrection/index.vue

@@ -22,9 +22,9 @@
         "
       >
         <template #table-header="{}">
-          <div style="width: 100%; height: 70px">
+          <div style="width: 100%;">
             <el-row style="padding-left: 80px">
-              <el-col :span="7" style="width: 293px">
+              <!-- <el-col :span="7" style="width: 293px">
                 <period-date-picker
                   :type="1"
                   :width="'135px'"
@@ -33,10 +33,10 @@
                   :end="parmValue.end"
                   @timeReturned="handleTime"
                 />
-              </el-col>
-              <el-col :span="5" style="width: 230px; float: left; margin-left: 10px">
+              </el-col>-->
+              <el-col :span="5" style="width: 230px; float: left;">
                 <el-input
-                  v-model="parmValue.cgdNo"
+                  v-model="parmValue.code"
                   :size="'mini'"
                   style="width: 100%"
                   placeholder="采购单编号"
@@ -48,6 +48,27 @@
                 />
               </el-col>
 
+              <el-col :span="5" style="width: 155px; float: left; margin-left: 10px">
+                <el-select
+                  size="mini"
+                  v-model="parmValue.status"
+                  placeholder="状态"
+                  clearable
+                  @change="
+                    pageInfo.curr = 1;
+                    parmValue.page = 1;
+                    searchList();
+                  "
+                >
+                  <el-option
+                    v-for="opt in statusOptions"
+                    :key="opt.value"
+                    :label="opt.label"
+                    :value="opt.value"
+                  />
+                </el-select>
+              </el-col>
+
               <el-col :span="3" style="width: 66px; float: right">
                 <el-button
                   type="primary"
@@ -71,36 +92,6 @@
                   })"
                 >添加</el-button>
               </el-col>
-            </el-row>
-
-            <el-row style="padding-top: 10px">
-              <el-col :span="5" style="width: 155px; float: left; margin-left: 0px">
-                <el-input
-                  v-model="parmValue.creater"
-                  :size="'mini'"
-                  style="width: 100%"
-                  placeholder="创建人"
-                  @blur="
-                    pageInfo.curr = 1;
-                    parmValue.page = 1;
-                    searchList();
-                  "
-                ></el-input>
-              </el-col>
-
-              <el-col :span="5" style="width: 155px; float: left; margin-left: 10px">
-                <el-input
-                  v-model="parmValue.company_name"
-                  :size="'mini'"
-                  style="width: 100%"
-                  placeholder="创建人部门"
-                  @blur="
-                    pageInfo.curr = 1;
-                    parmValue.page = 1;
-                    searchList();
-                  "
-                ></el-input>
-              </el-col>
 
               <el-col :span="3" style="width: 66px; float: right">
                 <el-button
@@ -113,6 +104,31 @@
             </el-row>
           </div>
         </template>
+
+        <template #status="{scope}">
+          <el-tag
+            :size="'mini'"
+            :type="scope.row.status == '1' ? 'warning' : ''"
+            v-text="
+            (statusOptions.find((i)=> i.value == scope.row.status) || {})
+              .label || '--'
+          "
+          ></el-tag>
+        </template>
+
+        <template #supplierBefore="{scope}">
+          <el-tooltip :content="'供应商公司编码 : ' + scope.row.before.supplierNo" placement="top">
+            <i class="el-icon-warning-outline" style="margin-right:2px;cursor:pointer" />
+          </el-tooltip>
+          {{scope.row.before.supplier_name}}
+        </template>
+
+        <template #supplierAfter="{scope}">
+          <el-tooltip :content="'供应商公司编码 : ' + scope.row.after.supplierNo" placement="top">
+            <i class="el-icon-warning-outline" style="margin-right:2px;cursor:pointer" />
+          </el-tooltip>
+          {{scope.row.after.supplier_name}}
+        </template>
       </ex-table>
     </div>
 
@@ -125,9 +141,9 @@
 <script>
 import asyncRequest from "@/apis/service/dataCorrection/order";
 import mixinPage from "@/mixins/elPaginationHandle";
-import { mapGetters } from "vuex";
 import resToken from "@/mixins/resToken";
 import { columns } from "./columns";
+import { mapGetters } from "vuex";
 
 export default {
   mixins: [mixinPage, resToken],
@@ -143,12 +159,14 @@ export default {
   data() {
     return {
       loading: false,
+      statusOptions: [
+        { value: "1", label: "待审核" },
+        { value: "2", label: "审核通过" },
+        { value: "3", label: "审核驳回" }
+      ],
       parmValue: {
-        cgdNo: "",
-        creater: "",
-        start: "",
-        end: "",
-        company_name: "", //创建人部门
+        code: "",
+        status: "",
         page: 1, // 页码
         size: 15 // 每页显示条数
       },
@@ -176,7 +194,10 @@ export default {
   methods: {
     async searchList() {
       this.loading = true;
-      const res = await asyncRequest.cgdgetchangesupplierlist(this.parmValue);
+      const res = await asyncRequest.cgdgetchangesupplierlist({
+        ...this.parmValue,
+        type: "1"
+      });
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
         this.pageInfo.total = Number(res.data.count);
@@ -197,11 +218,8 @@ export default {
         total: 0
       };
       this.parmValue = {
-        cgdNo: "",
-        company_name: "", //创建人部门
-        creater: "",
-        start: "",
-        end: "",
+        code: "",
+        status: "",
         page: 1, // 页码
         size: 15 // 每页显示条数
       };

+ 5 - 7
src/views/dataReport/table3.vue

@@ -40,9 +40,9 @@
               <search-work-company
                 :value="parmValue.companyNo"
                 :placeholder="'业务公司名称'"
+                :no-disabled="true"
                 :disabled="false"
                 :size="'mini'"
-                :no-disabled="true"
                 @searchChange="company_idsearchChange"
               />
             </div>
@@ -94,20 +94,18 @@
   </div>
 </template>
 <script>
-import mixinPage from "@/mixins/elPaginationHandle";
-import resToken from "@/mixins/resToken";
-import urlConfig from "@/apis/url-config";
 import asyncRequest from "@/apis/service/reportQuery/newReport";
 import periodDatePickerActive from "./period-date-picker/main.vue";
+import mixinPage from "@/mixins/elPaginationHandle";
+import urlConfig from "@/apis/url-config";
+import resToken from "@/mixins/resToken";
 import { table3 } from "./columns";
 import { mapGetters } from "vuex";
 import dayjs from "dayjs";
 
 export default {
   name: "SaleReport",
-  components: {
-    periodDatePickerActive
-  },
+  components: { periodDatePickerActive },
   mixins: [mixinPage, resToken],
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),

+ 6 - 35
src/views/dataReport/table7.vue

@@ -56,32 +56,6 @@
               <el-button type="warning" class="fr" :size="searchSize" @click="restSearch">重置</el-button>
             </el-col>
           </el-row>
-          <el-row style="padding: 10px 0 0 0">
-            <!-- <el-col :span="6" style="width: 150px">
-              <el-select
-                v-model="parmValue.status"
-                :size="searchSize"
-                filterable
-                clearable
-                placeholder="退货单状态"
-                style="width: 100%"
-                @change="
-                  pageInfo.curr = 1;
-                  parmValue.page = 1;
-                  searchList();
-                "
-              >
-                <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-option label="采购已驳回" value="7" />
-                <el-option label="申请已取消" value="8" />
-              </el-select>
-            </el-col>-->
-          </el-row>
         </div>
       </template>
     </ex-table>
@@ -208,15 +182,12 @@ export default {
     // 选中触发函数
     selection_change(e) {
       const { list } = e;
+      const { parse, stringify } = JSON;
       // 选中的数组集合
-      this.changeList = list.length > 0 ? JSON.parse(JSON.stringify(list)) : [];
+      this.changeList = list.length > 0 ? parse(stringify(list)) : [];
     },
     // 导出文件
     async download() {
-      // if(this.changeList.length<=0){
-      //   this.$message.warning("请选择有效数据")
-      //   return;
-      // }
       const start_date = new Date(this.parmValue.start_date).valueOf();
       const end_date = new Date(this.parmValue.end_date).valueOf();
       const flag = end_date - start_date > 30 * 24 * 60 * 60 * 1000;
@@ -229,8 +200,10 @@ export default {
         this.$message.warning("请选择导出文件的时间区间");
         return;
       }
-      const model = JSON.parse(JSON.stringify(this.parmValue));
-      // model.is_export = 1;
+
+      const { parse, stringify } = JSON;
+      const model = parse(stringify(this.parmValue));
+
       if (!this.loading) {
         this.loading = true;
         const httpType = `aplication/zip`;
@@ -240,8 +213,6 @@ export default {
           responseType: "blob",
           data: model,
           headers: {
-            // 'Content-Type': 'multipart/form-data',
-            // Accept: "application/vnd.ms-excel"
             Accept: httpType
           }
         })

+ 73 - 58
src/views/goodStore/supplierGoodsCost/components/baseForm.vue

@@ -58,6 +58,7 @@
               <el-form-item prop="is_combind" label="组合类型" label-width="110px">
                 <el-select
                   style="width:100%"
+                  :disabled="type !== 'add'"
                   v-model="ruleForm.is_combind"
                   placeholder="是否组合商品"
                   @change="groupGoodChange"
@@ -103,7 +104,7 @@
                 <company-sort
                   :value="ruleForm.cat_id"
                   :placeholder="'商品分类'"
-                  :disabled="!ruleForm.company_id || type !== 'add'"
+                  :disabled="type !== 'add' || !ruleForm.company_id"
                   :size="'mini'"
                   :names="cat_id_name"
                   :isDetail="type !== 'add'"
@@ -442,7 +443,7 @@
       </el-col>
     </el-row>
 
-    <el-row class="ddiv" v-if="ruleForm.is_combind === '1'">
+    <el-row class="ddiv" v-if="ruleForm. is_combind === '1'">
       <el-col
         :span="1"
         tag="div"
@@ -461,7 +462,6 @@
         <el-table :data="childTableData" size="mini" border max-height="350px">
           <el-table-column label="子商品成本编号" prop="childCode" min-width="160px" />
           <el-table-column label="子商品名称" prop="child_name" min-width="180px" show-overflow-tooltip />
-
           <el-table-column label="组合比例" prop="child_num" width="140px">
             <template slot-scope="scope">
               <span v-if="scope.$index !== editIndex">
@@ -489,7 +489,13 @@
             <template #header>
               <div>
                 <span>操作</span>
-                <el-tooltip class="item" effect="dark" content="添加" placement="top">
+                <el-tooltip
+                  class="item"
+                  effect="dark"
+                  content="添加"
+                  placement="top"
+                  v-if="type === 'add' || type === 'edit'"
+                >
                   <i
                     class="el-icon-circle-plus-outline fr"
                     style="font-size:18px;cursor: pointer"
@@ -509,27 +515,29 @@
                 <i class="el-icon-view tb-icon" @click="onChildProdChange(scope.$index, 'view')"></i>
               </el-tooltip>
 
-              <el-tooltip
-                effect="dark"
-                content="修改"
-                placement="top"
-                v-if="editIndex !== scope.$index"
-              >
-                <i class="el-icon-edit tb-icon" @click="onChildProdChange(scope.$index,'edit')"></i>
-              </el-tooltip>
+              <template v-if="type === 'add' || type === 'edit'">
+                <el-tooltip
+                  effect="dark"
+                  content="修改"
+                  placement="top"
+                  v-if="editIndex !== scope.$index"
+                >
+                  <i class="el-icon-edit tb-icon" @click="onChildProdChange(scope.$index,'edit')"></i>
+                </el-tooltip>
 
-              <el-tooltip effect="dark" content="保存" placement="top" v-else>
-                <i class="el-icon-circle-check tb-icon" @click="onSaveLine(scope.$index)"></i>
-              </el-tooltip>
+                <el-tooltip effect="dark" content="保存" placement="top" v-else>
+                  <i class="el-icon-circle-check tb-icon" @click="onSaveLine(scope.$index)"></i>
+                </el-tooltip>
 
-              <el-tooltip
-                effect="dark"
-                content="删除"
-                placement="top"
-                v-if="editIndex !== scope.$index"
-              >
-                <i class="el-icon-delete tb-icon" @click="onDeleteItem(scope.$index)"></i>
-              </el-tooltip>
+                <el-tooltip
+                  effect="dark"
+                  content="删除"
+                  placement="top"
+                  v-if="editIndex !== scope.$index"
+                >
+                  <i class="el-icon-delete tb-icon" @click="onDeleteItem(scope.$index)"></i>
+                </el-tooltip>
+              </template>
             </template>
           </el-table-column>
         </el-table>
@@ -568,7 +576,12 @@
                 <i class="el-icon-edit tb-icon" @click="openEdit(scope.$index, scope.row)"></i>
               </el-tooltip>
 
-              <el-tooltip v-if="!scope.row.isMust" effect="dark" content="删除" placement="top">
+              <el-tooltip
+                v-if="!scope.row.isMust && spec_tableData.length !== 1"
+                effect="dark"
+                content="删除"
+                placement="top"
+              >
                 <i class="el-icon-delete tb-icon" @click="openDelete(scope.$index)"></i>
               </el-tooltip>
             </template>
@@ -1263,9 +1276,6 @@ export default {
 
       this.editIndex = -1;
     },
-    onCompanyChange() {
-      this.supplierNosearchChange({ code: this.currentCompany });
-    },
     onChildProdChange(index = null, type = "view") {
       this.modalType = type;
 
@@ -1299,18 +1309,23 @@ export default {
 
       this[type === "view" ? "mVisible" : "visible"] = true;
     },
-    handleProductSelected(evt) {
-      const { childCode, child_name } = evt;
-      const item = { childCode, child_name, child_num: 1 };
-      const childCodes = this.childTableData.map(({childCode}) => childCode)
-      if(!childCodes.includes(childCode)){
-        this.childTableData.push(item);
-      }
+    handleProductSelected(selecteds = []) {
+      const childCodes = this.childTableData.map(({ childCode }) => childCode);
+      selecteds.forEach(item => {
+        const { childCode, child_name } = item;
+        const _t = { childCode, child_name, child_num: 1 };
+        if (!childCodes.includes(childCode)) {
+          this.childTableData.push(_t);
+        }
+      });
     },
     onCompanyChange() {
-      if (this.type === "add") {
-        this.ruleForm.company_id = this.currentCompany;
-      }
+      this.supplierNosearchChange({ code: this.currentCompany });
+    },
+    company_idsearchChange(e) {
+      const { code } = e;
+      this.ruleForm.company_id = code || "";
+      this.$refs.ruleForm && this.$refs.ruleForm.validateField("company_id");
     },
     async initForm() {
       this.loading = true;
@@ -1324,11 +1339,6 @@ export default {
 
       this.loading = false;
     },
-    company_idsearchChange(e) {
-      const { code } = e;
-      this.ruleForm.company_id = code || "";
-      this.$refs.ruleForm && this.$refs.ruleForm.validateField("company_id");
-    },
     async number_change(e, key) {
       this.ruleForm[key] = e + "" || "0";
       this.$refs.ruleForm.validateField(key);
@@ -1392,6 +1402,14 @@ export default {
         this.$message.warning("当前有正在编辑的子商品,请先保存");
         return;
       }
+
+      const { is_combind, is_gold_price } = this.ruleForm;
+
+      if (is_combind === "1" && is_gold_price === "1" && this.is_noble) {
+        this.$message.warning("组合商品不能启用实时金价");
+        return;
+      }
+
       this.sch_is_noble();
       this.good_type_change();
       this.ruleForm.good_remark = replaceTextWrapAndSpace(
@@ -1422,6 +1440,7 @@ export default {
               loading = false;
               return;
             }
+
             if (this.is_support_stock + "" === "0" && is_stock === "0") {
               this.$message.warning(
                 "该商品为供应商退货业务创建的,不允许改为非库存品!"
@@ -1429,6 +1448,7 @@ export default {
               loading = false;
               return;
             }
+
             if (is_stock === "0") {
               const { scode, sdata, smsg } = await this.getSupplerPower();
               if (scode === 0) {
@@ -1442,6 +1462,7 @@ export default {
                 }
               }
             }
+
             if (this.spec_tableData.length === 0) {
               this.$message.warning("请录入商品规格信息!");
               this.loading = false;
@@ -1472,18 +1493,14 @@ export default {
                 let n = parseInt(si.min_num);
                 min = n < min ? n : min;
               });
-              // console.log(smoq, min, smoq < min);
+
               if (smoq < min) {
                 this.$message.warning("备库起订量不能低于成本最低起订量!");
                 this.loading = false;
                 return;
               }
             }
-            // if (is_step === "0" && this.ladder_tableData.length > 1) {
-            //   this.$message.warning("不启用阶梯成本,只能录入一条阶梯成本信息!");
-            //   this.loading = false;
-            //   return;
-            // }
+
             if (this.is_noble) {
               if (noble_weight * 1000 > weight * 1000) {
                 this.$message.warning("贵金属总重量不能大于商品总重量!");
@@ -1491,6 +1508,7 @@ export default {
                 return;
               }
             }
+
             if (is_gold_price === "1" && this.is_noble) {
               let is_p = true;
               this.ladder_tableData.forEach(v => {
@@ -1498,13 +1516,6 @@ export default {
                   is_p = false;
                 }
               });
-              // if (!is_p) {
-              //  this.$message.warning(
-              //    "启用实时金价的贵金属商品不能填写成本单价!"
-              //  );
-              //  this.loading = false;
-              //  return;
-              //}
             }
 
             let model = JSON.parse(JSON.stringify(this.ruleForm));
@@ -1532,6 +1543,11 @@ export default {
                 return;
               }
 
+              if (this.childTableData.length === 1) {
+                this.message.warning("子商品数量必须大于1!");
+                return;
+              }
+
               if (this.type === "add") {
                 model.combind_list = this.childTableData.map(item => ({
                   ...item,
@@ -1573,7 +1589,6 @@ export default {
               }
             }
 
-            console.log(model);
             if (this.type === "add") {
               delete model["spuCode"];
               res = await asyncRequest.add(model);
@@ -2119,7 +2134,6 @@ export default {
           this.status = status;
           this.brand_name = brand_name;
           this.unit_name = unit;
-          // this.supplierName = supplierName || "";
 
           if (this.type === "add") {
             this.supplierName = this.getCompanyWithCode(
@@ -2140,7 +2154,7 @@ export default {
             good_type: good_type || "0",
             is_stock: is_stock || "0",
             supplierNo: supplierNo ? [supplierNo] : [],
-            company_id: "",
+            company_id: companyNo,
             is_auth: is_auth || "",
             tax: tax ? tax + "%" : "",
             good_name: good_name || "",
@@ -2202,6 +2216,7 @@ export default {
           this.ruleForm.supplierNo = [this.currentCompany];
           this.$refs.ruleForm.validateField("supplierNo");
         }
+
         await this.set_must_spec();
       });
     },

+ 134 - 129
src/views/goodStore/supplierGoodsCost/components/productListModal.vue

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

+ 146 - 121
src/views/goodStore/supplierGoodsCost/detail.vue

@@ -15,7 +15,11 @@
         <el-tab-pane label="商品成本详情" name="1" v-if="queryType !== 'add'">
           <el-collapse v-model="activeNames" style="margin: -18px 0 0 0">
             <tempalte
-              v-if="queryType === 'editCoin' || queryType === 'editBase' || queryType === 'edit'"
+              v-if="
+                queryType === 'editCoin' ||
+                queryType === 'editBase' ||
+                queryType === 'edit'
+              "
             >
               <el-collapse-item title="商品成本详情" name="0">
                 <base-form
@@ -32,16 +36,24 @@
             <template v-else>
               <el-collapse-item title="基础信息" name="1">
                 <show-data-table :columns="basicColumns" :sitem="sitem" border>
-                  <template slot="noble">
-                    <span v-if="sitem.noble_metal">
-                      {{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
-                      sitem.noble_name
-                      }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
-                      sitem.is_gold_price + '' === "0" ? "不" : ""
-                      }}启用实时金价-{{ sitem.is_diff + '' === "1" ? "有" : "无" }}工差-{{
-                      sitem.config
-                      }}-{{ sitem.other_config }}
-                    </span>
+                  <template slot="good_img">
+                    <template v-if="sitem && sitem.good_img">
+                      <div style="max-height: 24px; overflow: hidden">
+                        <el-image
+                          style="height: 24px; width: 24px; margin-right: 5px"
+                          v-for="(img, index) in sitem.good_img.split(',')"
+                          :src="img"
+                          :preview-src-list="sitem.good_img.split(',')"
+                          :key="index"
+                        />
+                      </div>
+                    </template>
+                  </template>
+
+                  <template slot="is_combind">
+                    {{
+                    String(sitem.is_combind) === '1' ? '组合商品' : '非组合商品'
+                    }}
                   </template>
 
                   <template slot="packing_spec">
@@ -53,44 +65,25 @@
                   <template slot="is_auth">
                     <el-tag
                       size="mini"
-                    >{{ ( options3.find(({id}) => id === sitem.is_auth) || {}).name || '--' }}</el-tag>
+                    >{{ (options3.find(({id}) => id === sitem.is_auth) || {}).name || '--' }}</el-tag>
                   </template>
 
-                  <template
-                    slot="cat_info"
-                  >{{sitem.cat_info ? sitem.cat_info.map(({name}) => name).join('_') : '--' }}</template>
-                  <template slot="weight">{{sitem.weight}}g</template>
-                  <template slot="tax">{{sitem.tax}}%</template>
-                  <template slot="is_stock">{{String(sitem.is_stock) === '0' ? '非库存品' : '库存品'}}</template>
-
-                  <template slot="is_combind">
-                    {{
-                    String(sitem.is_combind) === '1' ? '组合商品' : '非组合商品'
-                    }}
-                  </template>
-
-                  <template
-                    slot="is_exclusive"
-                  >{{String(sitem.is_exclusive) === '0' ? '非泰康' : '泰康'}}</template>
-
-                  <template slot="good_img">
-                    <template v-if="sitem.good_img">
+                  <template slot="good_info_img">
+                    <div style="max-height: 24px; overflow: hidden">
                       <el-image
-                        style="height: 20px;width: 20px;margin-right: 10px"
-                        v-for="(img,index) in sitem.good_img.split(',')"
-                        :src="img"
-                        :preview-src-list="sitem.good_img.split(',')"
-                        :key="index"
+                        style="height: 24px; width: 24px"
+                        :src="sitem.good_info_img"
+                        :preview-src-list="[sitem.good_info_img]"
                       />
-                    </template>
+                    </div>
                   </template>
 
-                  <template slot="good_info_img">
-                    <el-image
-                      style="height: 20px;width: 20px"
-                      :src="sitem.good_info_img"
-                      :preview-src-list="[sitem.good_info_img]"
-                    />
+                  <template slot="cat_info">
+                    {{
+                    sitem.cat_info
+                    ? sitem.cat_info.map(({ name }) => name).join("_")
+                    : "--"
+                    }}
                   </template>
 
                   <template slot="good_name">
@@ -110,7 +103,7 @@
                     </span>
                     <el-popover placement="top" width="300" trigger="hover">
                       <ul>
-                        <li v-if=" newTime !== '' && isDisplayPrivateField('1')">
+                        <li v-if="newTime !== '' && isDisplayPrivateField('1')">
                           <span>商品成本编号:</span>
                           <span>{{ sitem.spuCode }}</span>
                         </li>
@@ -119,68 +112,79 @@
                     </el-popover>
                   </template>
 
-                  <template slot="noble_weight">{{sitem.noble_weight}}g</template>
-                  <template slot="is_gold_price">{{String(sitem.is_gold_price) === '1' ? '是' : '否'}}</template>
-                  <template slot="is_diff">{{String(sitem.is_diff) === '1' ? '有公差' : '无工差'}}</template>
-
-                  <template slot="delivery_day">{{sitem.delivery_day}}天</template>
-                  <template slot="lead_time">{{sitem.lead_time}}天</template>
-                  <template slot="sample_day">{{sitem.sample_day}}天</template>
-                  <template slot="delivery_place">{{delivery_place}}</template>
-                  <template slot="origin_place">{{origin_place}}</template>
-                  <template slot="packing_weight">{{sitem.packing_weight}}g</template>
-                </show-data-table>
-              </el-collapse-item>
-
-              <!-- <el-collapse-item title="规格信息" name="2">
-              <el-table :data="sitem.speclist" :size="'mini'" border style="width: 100%">
-                <el-table-column prop="spec_name" label="规格类型" />
-                <el-table-column prop="spec_value" label="规格值" />
-              </el-table>
-              </el-collapse-item>-->
-
-              <!-- <el-collapse-item title="包装信息" name="3">
-              <show-data-table :columns="packingColumns" :sitem="sitem">
-                <template slot="packing_weight">
-                  {{sitem.packing_weight}}g
-                </template>
-              </show-data-table>
-            </el-collapse-item>
+                  <template slot="noble">
+                    <span v-if="sitem.noble_metal">
+                      {{ sitem.noble_weight ? sitem.noble_weight : "0" }}g-{{
+                      sitem.noble_name
+                      }}-{{ sitem.gold_price ? sitem.gold_price : "0" }}元/g-{{
+                      sitem.is_gold_price + "" === "0" ? "不" : ""
+                      }}启用实时金价-{{ sitem.is_diff + "" === "1" ? "有" : "无" }}工差-{{
+                      sitem.config
+                      }}-{{ sitem.other_config }}
+                    </span>
+                  </template>
 
-            <el-collapse-item title="发货信息" name="4">
-              <show-data-table :columns="sendColumns" :sitem="sitem">
-                <template slot="delivery_day">{{sitem.delivery_day}}天</template>
-                <template slot="lead_time">{{sitem.lead_time}}天</template>
-                <template slot="sample_day">{{sitem.sample_day}}天</template>
-                <template slot="delivery_place">{{delivery_place}}</template>
-                <template slot="origin_place">{{origin_place}}</template>
-              </show-data-table>
-              </el-collapse-item>-->
+                  <template slot="weight">{{ sitem.weight }}g</template>
+                  <template slot="tax">{{ sitem.tax }}%</template>
+                  <template slot="is_stock">{{ String(sitem.is_stock) === "0" ? "非库存品" : "库存品" }}</template>
+                  <template
+                    slot="is_exclusive"
+                  >{{ String(sitem.is_exclusive) === "0" ? "非泰康" : "泰康" }}</template>
+                  <template slot="noble_weight">{{ sitem.noble_weight }}g</template>
+                  <template slot="is_gold_price">
+                    {{
+                    String(sitem.is_gold_price) === "1" ? "是" : "否"
+                    }}
+                  </template>
+                  <template slot="is_diff">
+                    {{
+                    String(sitem.is_diff) === "1" ? "有公差" : "无工差"
+                    }}
+                  </template>
 
-              <!-- <el-collapse-item title="图片信息" name="5">
-              <show-data-table :columns="imageColumns" :sitem="sitem">
-                <template slot="good_thumb_img">
-                  <el-image style="height: 40px;width: 40px" :src="sitem.good_thumb_img" :preview-src-list="[sitem.good_thumb_img]" />
-                </template>
+                  <template slot="packing_weight">{{ sitem.packing_weight }}g</template>
 
-                <template slot="good_img">
-                  <template v-if="sitem.good_img">
-                    <el-image style="height: 40px;width: 40px;margin-right: 10px" v-for="(img,index) in sitem.good_img.split(',')" :src="img" :preview-src-list="sitem.good_img.split(',')" :key="index" />
-                  </template>
-                </template>
+                  <template slot="delivery_day">{{ sitem.delivery_day }}天</template>
+                  <template slot="lead_time">{{ sitem.lead_time }}天</template>
+                  <template slot="sample_day">{{ sitem.sample_day }}天</template>
+                  <template slot="delivery_place">{{ delivery_place }}</template>
+                  <template slot="origin_place">{{ origin_place }}</template>
+                </show-data-table>
+              </el-collapse-item>
 
-                <template slot="good_info_img">
-                    <el-image style="height: 40px;width: 40px" :src="sitem.good_info_img" :preview-src-list="[sitem.good_info_img]" />
-                </template>
-              </show-data-table>
-              </el-collapse-item>-->
+              <el-collapse-item
+                title="子商品信息"
+                v-if="sitem.combind_list && sitem.combind_list.length > 0"
+                name="4"
+              >
+                <el-table :data="sitem.combind_list" size="mini" border max-height="350px">
+                  <el-table-column label="子商品成本编号" prop="childCode" min-width="160px" />
+                  <el-table-column
+                    label="子商品名称"
+                    prop="child_name"
+                    min-width="180px"
+                    show-overflow-tooltip
+                  />
+                  <el-table-column label="组合比例" prop="child_num" width="100px" />
+                  <el-table-column label="操作" width="60px">
+                    <template slot-scope="scope">
+                      <el-tooltip effect="dark" content="查看" placement="top">
+                        <i
+                          class="el-icon-view tb-icon"
+                          @click="onChildProdChange(scope.$index, 'view')"
+                        ></i>
+                      </el-tooltip>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </el-collapse-item>
 
-              <el-collapse-item title="固定与阶梯成本" name="6" v-if="displayCostField">
+              <el-collapse-item title="固定与阶梯成本" name="2" v-if="isDisplayPrivateField('1')">
                 <show-data-table :columns="ladderColumns" :sitem="sitem">
-                  <template slot="demo_fee">{{sitem.demo_fee}}元</template>
-                  <template slot="open_fee">{{sitem.open_fee}}元</template>
-                  <template slot="sample_fee">{{sitem.sample_fee}}元</template>
-                  <template slot="market_price">{{sitem.market_price}}元</template>
+                  <template slot="demo_fee">{{ sitem.demo_fee }}元</template>
+                  <template slot="open_fee">{{ sitem.open_fee }}元</template>
+                  <template slot="sample_fee">{{ sitem.sample_fee }}元</template>
+                  <template slot="market_price">{{ sitem.market_price }}元</template>
                   <template slot="data_table">
                     <el-table size="mini" :data="sitem.nakelist">
                       <el-table-column prop="min_num" label="起订量(>=)" />
@@ -198,13 +202,14 @@
               </el-collapse-item>
 
               <el-collapse-item
+                name="3"
                 title="采购部门审批"
                 v-if="
-                ((status + '' === '0' && ppowers.some((i) => i == '0')) ||
-                  (status + '' === '2' && ppowers.some((i) => i == '2')) ||
-                  (status + '' === '3' && ppowers.some((i) => i == '3'))) &&
-                queryType === 'view'
-              "
+                  ((status + '' === '0' && ppowers.some((i) => i == '0')) ||
+                    (status + '' === '2' && ppowers.some((i) => i == '2')) ||
+                    (status + '' === '3' && ppowers.some((i) => i == '3'))) &&
+                  queryType === 'view'
+                "
               >
                 <exam-form
                   :statusList="statusList"
@@ -217,7 +222,12 @@
             </template>
           </el-collapse>
         </el-tab-pane>
-        <el-tab-pane label="审批记录" name="2" v-if="queryType !== 'add'">
+
+        <el-tab-pane label="最近修改记录" name="2" v-if="queryType !== 'add'">
+          <type-change-item v-if="newTime !== ''" :newTime="newTime" :type="'3'" :code="queryId" />
+        </el-tab-pane>
+
+        <el-tab-pane label="审批记录" name="3" v-if="queryType !== 'add'">
           <process-time-line
             v-if="newTime !== ''"
             :newTime="newTime"
@@ -226,7 +236,7 @@
           />
         </el-tab-pane>
 
-        <el-tab-pane label="流程图" name="3" v-if="queryType !== 'add'">
+        <el-tab-pane label="流程图" name="4" v-if="queryType !== 'add'">
           <flow-chart process_id="15" type="SPCB" :orderCode="queryId" />
         </el-tab-pane>
       </el-tabs>
@@ -234,6 +244,13 @@
     <div v-else>
       <no-auth></no-auth>
     </div>
+
+    <product-modal
+      :type="modalType"
+      :editIndex="editIndex"
+      :editItem="editItem"
+      :visible.sync="visible"
+    />
   </div>
 </template>
 <script>
@@ -249,18 +266,20 @@ import {
   sendColumns,
   imageColumns,
   ladderColumns,
-  options6,
-  options3
+  options3,
+  options6
 } from "./columns";
 import privateField from "@/mixins/privateField";
+import ProductModal from "./components/productModal.vue";
 
 export default {
-  name: "supplierGoodsCostDetail",
+  name: "goodsCostDetail",
   mixins: [resToken, privateField],
   components: {
     ShowDataTable,
     baseForm,
-    costForm
+    costForm,
+    ProductModal
   },
   computed: {
     ...mapGetters([
@@ -270,12 +289,6 @@ export default {
       "private_field",
       "originLevel"
     ]),
-    displayCostField() {
-      return (
-        ["1", "3"].includes(this.originLevel) ||
-        this.private_field.includes("1")
-      );
-    },
     powers() {
       const { btnList } = this.$store.getters;
       const tran =
@@ -298,9 +311,9 @@ export default {
       statusList: [],
       basicColumns,
       packingColumns,
-      sendColumns,
-      options6,
       options3,
+      options6,
+      sendColumns,
       imageColumns,
       ladderColumns,
       size: "small",
@@ -313,13 +326,26 @@ export default {
       status: "",
       sitem: null,
       delivery_place: "",
-      origin_place: ""
+      origin_place: "",
+      editItem: null,
+      editIndex: -1,
+      visible: false,
+      modalType: ""
     };
   },
   mounted() {
     this.initForm();
   },
   methods: {
+    onChildProdChange(index = null, type = "view") {
+      this.modalType = type;
+
+      this.editItem =
+        index === null ? null : { ...this.sitem.combind_list[index] };
+
+      this.editIndex = index === null ? -1 : index;
+      this.visible = true;
+    },
     async initForm() {
       const { id, type } = this.$route.query;
       this.queryId = id;
@@ -340,7 +366,6 @@ export default {
     // 点击业务审核的保存按钮
 
     async examForm(e) {
-      console.log(e);
       if (!this.loading) {
         let type = "";
         if (e.state + "" === "1") {

+ 71 - 186
src/views/goodStore/supplierGoodsCost/index.vue

@@ -25,7 +25,7 @@
       <template #table-header="{}">
         <div style="width: 100%">
           <el-row style="padding: 0 0 10px 80px">
-            <el-col :span="6" style="width: 303px">
+            <el-col :span="6" style="width: 301px">
               <period-date-picker
                 :type="1"
                 :width="'135px'"
@@ -35,18 +35,8 @@
                 @timeReturned="handleTime"
               />
             </el-col>
-            <el-col :span="4" style="width: 135px">
-              <search-brand
-                :value="brandid"
-                :disabled="false"
-                :size="'mini'"
-                :isDetail="true"
-                :names="parmValue.supplierName"
-                :placeholder="'商品品牌'"
-                @searchChange="brandidsearchChange"
-              />
-            </el-col>
-            <el-col :span="6" style="width: 310px; padding: 0 0 0 10px">
+
+            <el-col :span="6" style="width: 310px">
               <good-class
                 :value="parmValue.cat_id"
                 @handleChange="goods_class_change"
@@ -60,7 +50,6 @@
             <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
               <el-button type="primary" :size="searchSize" @click="searchList">刷新</el-button>
             </el-col>
-
             <el-col :span="3" class="fr" style="width: 66px; padding: 0 0 0 10px">
               <el-button type="warning" :size="searchSize" @click="restSearch">重置</el-button>
             </el-col>
@@ -111,61 +100,12 @@
               </el-select>
             </el-col>
 
-            <el-col :span="4" style="width: 135px;margin-left:10px">
-              <el-select
-                v-model="parmValue.is_stock"
-                size="mini"
-                style="width: 100%"
-                placeholder="商品类型"
-                clearable
-                @change="
-                  pageInfo.curr = 1;
-                  parmValue.page = 1;
-                  searchList();
-                "
-              >
-                <el-option
-                  v-for="opt in isStockOptions"
-                  :key="opt.value"
-                  :value="opt.value"
-                  :label="opt.label"
-                />
-              </el-select>
-            </el-col>
-
-            <!-- <el-col :span="4" style="width: 147px; padding: 0 0 0 10px">
-              <el-select
-                v-model="parmValue.has_account"
-                filterable
-                clearable
+            <el-col :span="4" style="width: 320px; padding: 0 0 0 10px">
+              <search-work-company
+                :value="parmValue.companyNo"
+                :placeholder="'业务公司'"
                 :size="searchSize"
-                placeholder="供应商账号"
-                style="width: 100%"
-                @change="
-                  pageInfo.curr = 1;
-                  parmValue.page = 1;
-                  searchList();
-                "
-              >
-                <el-option
-                  v-for="item in has_account_list"
-                  :key="'status' + item.code"
-                  :label="item.name"
-                  :value="item.code"
-                />
-              </el-select>
-            </el-col>-->
-            <el-col :span="3" style="margin: 0 10px">
-              <search-supplier
-                :size="'mini'"
-                style="width: 300px"
-                :value="supplierNo"
-                :disabled="false"
-                :placeholder="'供应商名称'"
-                :names="''"
-                :isDetail="false"
-                :noDisabled="true"
-                @searchChange="supplierChange"
+                @searchChange="companyNosearchChange"
               />
             </el-col>
 
@@ -173,7 +113,7 @@
               :span="3"
               class="fr"
               style="width: 66px; padding: 0 0 0 10px"
-              v-if="powers.some((i) => i == '003') && !isSupertube"
+              v-if="powers.some((i) => i == '003')"
             >
               <el-button
                 :size="searchSize"
@@ -182,21 +122,36 @@
                 @click="handleCreate"
               >添加</el-button>
             </el-col>
-            <el-col
+            <!-- <el-col
               :span="3"
               class="fr"
               style="width: 110px; padding: 0 0 0 10px"
-              v-if="powers.some((i) => i == '055') && !isSupertube"
+              v-if="powers.some((i) => i == '055')"
             >
-              <el-button :size="searchSize" type="warning" style="float: right" @click="add_online">
+              <el-button
+                :size="searchSize"
+                type="warning"
+                style="float: right"
+                @click="add_online"
+              >
                 <i class="el-icon-circle-plus-outline"></i>
                 <span>商品上线</span>
               </el-button>
-            </el-col>
+            </el-col>-->
           </el-row>
-
           <el-row style="margin-top: 10px">
-            <!-- <el-col :span="4" style="width: 225px">
+            <el-col :span="4" style="width: 225px">
+              <search-brand
+                :value="brandid"
+                :disabled="false"
+                :size="'mini'"
+                :isDetail="true"
+                :names="parmValue.supplierName"
+                :placeholder="'商品品牌'"
+                @searchChange="brandidsearchChange"
+              />
+            </el-col>
+            <el-col :span="4" style="width: 145px; padding: 0 0 0 10px">
               <el-select
                 v-model="parmValue.is_stock"
                 size="mini"
@@ -216,26 +171,8 @@
                   :label="opt.label"
                 />
               </el-select>
-            </el-col>-->
-            <el-col :span="3" style="margin-right:25px">
-              <el-select
-                clearable
-                v-model="parmValue.is_combind"
-                placeholder="组合类型"
-                style="width:225px"
-                size="mini"
-                @change="
-                  pageInfo.curr = 1;
-                  parmValue.page = 1;
-                  searchList();
-                "
-              >
-                <el-option label="组合商品" value="1" />
-                <el-option label="非组合商品" value="0" />
-              </el-select>
             </el-col>
-
-            <el-col :span="4" style="width: 360px">
+            <el-col :span="4" style="width: 420px; padding: 0 0 0 10px">
               <el-input
                 :size="searchSize"
                 v-model="sinput"
@@ -270,12 +207,6 @@
         </div>
       </template>
 
-      <template #spuCode="{ scope }">
-        <div style="display:flex;align-items:center">
-          <p>{{scope.row.spuCode}}</p>
-        </div>
-      </template>
-
       <template #good_thumb_img="{ scope }">
         <div
           v-if="scope.row.good_thumb_img"
@@ -301,37 +232,6 @@
           "
         ></el-tag>
       </template>
-
-      <template #is_combind="{ scope }">
-        <el-tag
-          size="mini"
-          :type="scope.row.is_combind === '1' ? '' : 'warning'"
-        >{{scope.row.is_combind === '1' ? '组合商品' : '非组合商品'}}</el-tag>
-      </template>
-
-      <template #has_account="{ scope }">
-        <el-tag
-          :size="tablebtnSize"
-          :type="
-            (
-              has_account_list.find((item) => item.code == scope.row.has_account + '') ||
-              {}
-            ).type || '--'
-          "
-          v-text="
-            (
-              has_account_list.find((item) => item.code == scope.row.has_account + '') ||
-              {}
-            ).name || '--'
-          "
-        ></el-tag>
-      </template>
-      <template #is_combind="{ scope }">
-        <el-tag
-          size="mini"
-          :type="scope.row.is_combind === '1' ? '' : 'warning'"
-        >{{scope.row.is_combind === '1' ? '组合商品' : '非组合商品'}}</el-tag>
-      </template>
       <template #isonline="{ scope }">
         <el-tag
           :size="tablebtnSize"
@@ -364,25 +264,23 @@
             @click="getRouter('supplierGoodsCostDetail', scope.row.spuCode)"
           ></i>
         </el-tooltip>
-        <el-tooltip
-          v-if="
-            powers.some((i) => i == '079') && scope.row.status !== '8' && !isSupertube
-          "
+        <!-- <el-tooltip
+          v-if="powers.some((i) => i == '079') && scope.row.status !== '8'"
           effect="dark"
           content="下线商品"
           placement="top"
         >
-          <i class="el-icon-download tb-icon" @click="showDonlineDlg(scope.row.spuCode)"></i>
-        </el-tooltip>
-
-        <!-- scope.row.has_account + '' == '0' && -->
+          <i
+            class="el-icon-download tb-icon"
+            @click="showDonlineDlg(scope.row.spuCode)"
+          ></i>
+        </el-tooltip>-->
+        <!-- (scope.row.is_stock + '' === '0') -->
         <el-tooltip
           v-if="
-            (((ppowers.some((i) => i == '7') && scope.row.status + '' === '7') ||
-              (ppowers.some((i) => i == '6') && scope.row.status + '' === '6') ||
-              (ppowers.some((i) => i == '8') && scope.row.status + '' === '8')) &&
-            (scope.row.is_stock + '' === '0' || scope.row.is_stock + '' === '1')) &&
-            !isSupertube && String(scope.row.has_account) === '0'
+            (ppowers.some((i) => i == '7') && scope.row.status + '' === '7') ||
+            (ppowers.some((i) => i == '6') && scope.row.status + '' === '6') ||
+            (ppowers.some((i) => i == '8') && scope.row.status + '' === '8')
           "
           effect="dark"
           content="修改"
@@ -400,10 +298,8 @@
         </el-tooltip>
         <el-tooltip
           v-if="
-            (ppowers.some((i) => i == '4') &&
-            (scope.row.status + '' === '4' || scope.row.status + '' === '1') &&
-            (scope.row.is_stock + '' === '0' || scope.row.is_stock + '' === '1')) &&
-            !isSupertube && String(scope.row.has_account) === '0'
+            ppowers.some((i) => i == '4') &&
+            (scope.row.status + '' === '4' || scope.row.status + '' === '1')
           "
           effect="dark"
           content="修改基础信息"
@@ -414,13 +310,11 @@
             @click="wantto(scope.row.is_online, scope.row.spuCode, scope.row.status, '2')"
           ></i>
         </el-tooltip>
-        <!-- scope.row.has_account + '' == '0' &&  -->
+
         <el-tooltip
           v-if="
-            (ppowers.some((i) => i == '5') &&
-            (scope.row.status + '' === '5' || scope.row.status + '' === '1') &&
-            (scope.row.is_stock + '' === '0' || scope.row.is_stock + '' === '1')) &&
-            !isSupertube && String(scope.row.has_account) === '0'
+            ppowers.some((i) => i == '5') &&
+            (scope.row.status + '' === '5' || scope.row.status + '' === '1')
           "
           effect="dark"
           content="修改成本信息"
@@ -435,7 +329,6 @@
           v-if="
             powers.some((i) => i == '010') &&
             !(scope.row.status + '' === '7' || scope.row.status + '' === '8') &&
-            !isSupertube &&
             String(scope.row.createrid) !== '0'
           "
           effect="dark"
@@ -444,15 +337,6 @@
         >
           <i class="el-icon-document-copy tb-icon" @click="good_copy(scope.row.spuCode)"></i>
         </el-tooltip>
-
-        <el-tooltip
-          v-if="powers.some((i) => i == '006') && !isSupertube"
-          effect="dark"
-          content="删除"
-          placement="top"
-        >
-          <i class="el-icon-delete tb-icon" @click="deleteItem(scope.row.spuCode)"></i>
-        </el-tooltip>
       </template>
     </ex-table>
     <no-auth v-else></no-auth>
@@ -504,14 +388,14 @@
 </template>
 <script>
 import asyncRequest from "@/apis/service/goodStore/goodsCost";
-import { listCol, options1, options4 } from "./columns";
-import { has_account_list, isStockOptions } from "@/assets/js/statusList";
 import mixinPage from "@/mixins/elPaginationHandle";
-import resToken from "@/mixins/resToken";
+import { listCol, options1, options4 } from "./columns";
+import { isStockOptions } from "@/assets/js/statusList";
 import companyHelper from "@/mixins/companyHelper";
 import addEdit from "./components/addEdit";
-
+import resToken from "@/mixins/resToken";
 import { mapGetters } from "vuex";
+
 export default {
   name: "goodsCost",
   mixins: [mixinPage, resToken, companyHelper],
@@ -520,7 +404,7 @@ export default {
   },
   computed: {
     //组件SIZE设置
-    ...mapGetters(["tablebtnSize", "searchSize", "size", "isSupertube"]),
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
       const tran =
         this.$store.getters.btnList.find(
@@ -535,7 +419,7 @@ export default {
         {};
       const { action } = tran ?? {};
       console.log(action);
-      return action || [];
+      return action ?? [];
     }
   },
   data() {
@@ -547,10 +431,9 @@ export default {
       }
     };
     return {
+      isStockOptions,
       dialogFormVisible: false,
-      has_account_list,
       donline_formStOps: [],
-      isStockOptions,
       donline_form: {
         offline_reason: "",
         offline_remark: "",
@@ -623,8 +506,6 @@ export default {
       parmValue: {
         page: 1, // 页码
         size: 15, // 每页显示条数
-        is_combind: "",
-        is_stock: "",
         start: "",
         end: "",
         status: "",
@@ -636,7 +517,8 @@ export default {
         companyNo: "",
         supplierNo: "",
         isonline: "",
-        company_name: "" //创建人部门
+        company_name: "", //创建人部门
+        is_stock: ""
         // creater: "",
       },
       sinput: "",
@@ -691,15 +573,14 @@ export default {
     this.searchList();
   },
   methods: {
+    companyNosearchChange({ code }) {
+      this.parmValue.companyNo = code;
+      this.searchList();
+    },
     handleCreate() {
-      // if (!this.currentIsBusinessCompany()) return;
+      // if(!this.currentIsBusinessCompany()) return
       this.routeGoto("supplierGoodsCostDetail", { id: "add", type: "add" });
     },
-    async supplierChange(e) {
-      const { code, label } = e;
-      this.supplierNo = code ? [code] : [];
-      this.searchList();
-    },
     // 获取异常原因下拉列表
     async getresultlist() {
       const res = await asyncRequest.resultlist({
@@ -726,8 +607,10 @@ export default {
 
         //有多选框的条件
         this.parmValue.select = this.select;
+        // this.parmValue.sselect = this.sselect ;
         this.parmValue.sinput = this.sinput;
         //
+        console.log(this.parmValue);
         let routerModel = {
           options: JSON.parse(JSON.stringify(this.parmValue)),
           router: this.$route.path
@@ -765,7 +648,7 @@ export default {
         isonline: "",
         companyNo: "",
         supplierNo: "",
-        is_combind: ""
+        is_stock: ""
       };
       this.searchList();
     },
@@ -936,15 +819,17 @@ export default {
       let item = JSON.parse(JSON.stringify(this.parmValue));
       item.spucode = this.select === "1" ? this.sinput : "";
       item.good_name = this.select === "2" ? this.sinput : "";
-      item.companyNo = this.select === "3" ? this.sinput : "";
-      item.supplierNo = this.select === "4" ? this.sinput : "";
+      // item.companyNo = this.select === "3" ? this.sinput : "";
       item.company_name = this.select === "5" ? this.sinput : ""; // 部门
       item.cat_id =
         item.cat_id.length > 0 ? item.cat_id[item.cat_id.length - 1] : "";
-      const res = await asyncRequest.list({
+      // item.companyNo = this.currentCompany
+      item.noRelation = true;
+
+      const res = await asyncRequest.copy_list({
         ...item,
-        supplierNo: this.currentCompany,
-        noRelation: true
+        noRelation: true,
+        supplierNo: this.currentCompany
       });
 
       if (res && res.code === 0 && res.data) {

+ 50 - 55
src/views/sellOut/combinedAdd/components/baseForm.vue

@@ -10,40 +10,49 @@
     <el-form-item v-loading="loading.product" label="组合商品" prop="spuCode">
       <el-input v-if="!productinfo" placeholder="选择组合商品" @focus="pVisible = true" />
 
-      <div v-else key="product" style="display:flex">
-        <show-goods-data-table
-          border
-           v-if="newTime !== ''"
-           type="1"
-           :iscgd="true"
-           :newTime="newTime"
-           :spucode="productinfo.spuCode"
-           :isStockInfo="true"
-         />
- 
-        <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-collapse-transition>
+        <div v-if="productinfo" key="product" style="display:flex">
+          <show-goods-data-table
+            border
+            type="1"
+            v-if="newTime !== ''"
+            :iscgd="true"
+            :newTime="newTime"
+            :spucode="productinfo.spuCode"
+            :isStockInfo="true"
           />
-        </el-tooltip>
-      </div>
+
+          <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-collapse-transition>
     </el-form-item>
 
     <el-form-item v-loading="loading.stock" label="所在仓库" prop="wsm_code">
-      <el-input v-if="!stockinfo" placeholder="选择所在仓库" @focus="sVisible = true" />
+      <el-input
+        v-if="!stockinfo"
+        :disabled="!productinfo"
+        placeholder="选择所在仓库"
+        @focus="sVisible = true"
+      />
 
-      <div v-else key="stock" style="display:flex">
-        <show-data-table border :columns="stockColumns" :sitem="stockinfo" />
-        <el-tooltip content="重新选择仓库" placement="top">
-          <i
-            class="el-icon-circle-close"
-            style="cursor:pointer;font-size:18px;margin-left:10px"
-            @click="resetStock"
-          />
-        </el-tooltip>
-      </div>
+      <el-collapse-transition>
+        <div v-if="stockinfo" key="stock" style="display:flex">
+          <show-data-table border :columns="stockColumns" :sitem="stockinfo" />
+          <el-tooltip content="重新选择仓库" placement="top">
+            <i
+              class="el-icon-circle-close"
+              style="cursor:pointer;font-size:18px;margin-left:10px"
+              @click="resetStock"
+            />
+          </el-tooltip>
+        </div>
+      </el-collapse-transition>
     </el-form-item>
 
     <el-row>
@@ -63,24 +72,6 @@
           />
         </el-form-item>
       </el-col>
-
-      <!-- <el-col :span="12">
-        <el-form-item label="可用库存数">
-          <digital-input
-            :values="ruleForm.usable_stock"
-            :placeholder="'可用库存数'"
-            :min="0"
-            :max="100000000000"
-            :position="'right'"
-            :precision="0"
-            :size="'mini'"
-            :controls="false"
-            :disabled="true"
-            :append="''"
-            @reschange="number_change($event, 'usable_stock')"
-          />
-        </el-form-item>
-      </el-col>-->
     </el-row>
 
     <el-form-item label="子商品库存情况" label-width="110px">
@@ -91,10 +82,6 @@
         <el-table-column label="本次添加库存数">
           <template slot-scope="{ row }">{{ calcStockNum(row) }}</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>
@@ -107,7 +94,11 @@
       </div>
     </el-form-item>
 
-    <stock-modal :visible.sync="sVisible" @selected="handleStockSelected" />
+    <stock-modal
+      :visible.sync="sVisible"
+      :supplierNo="productinfo ? productinfo.supplierNo :''"
+      @selected="handleStockSelected"
+    />
     <product-modal :visible.sync="pVisible" @selected="handleProductSelected" />
   </el-form>
 </template>
@@ -115,9 +106,9 @@
 <script>
 import StockModal from "./stockModal.vue";
 import ProductModal from "./productModal.vue";
+import privateField from "@/mixins/privateField";
 import asyncRequest from "@/apis/service/sellOut/combindAdd";
 import { stockColumns, productColumns } from "./columnsForm";
-import privateField from "@/mixins/privateField";
 import { add_sum, isnumber, accMul } from "@/utils/validate";
 
 const validateNum = (_, value, callback) => {
@@ -193,14 +184,16 @@ export default {
             parseInt(accMul(this.ruleForm.stock_num, child_num)) > usable_stock
           ) {
             this.$message.warning(
-              `子商品   ${child_name}   添加库存数不能超过可用库存数`
+              `子商品  ${child_name}  添加库存数不能超过可用库存数`
             );
             return;
           }
         }
 
         this.loading.full = true;
-        const { code, message } = await asyncRequest.add({ ...params, flag: "1"
+        const { code, message } = await asyncRequest.add({
+          ...params,
+          flag: "1"
         });
         this.loading.full = false;
 
@@ -226,6 +219,8 @@ export default {
     },
     resetProduct() {
       this.productinfo = null;
+      this.stockinfo = null;
+      this.ruleForm.wsm_code = "";
       this.ruleForm.spuCode = "";
     },
     calcStockNum(row) {

+ 7 - 5
src/views/sellOut/combinedAdd/components/stockModal.vue

@@ -1,7 +1,7 @@
 <template>
   <el-dialog
     class="stock-dialog"
-    top="8vh"
+    top="2vh"
     title="选择仓库"
     center
     :visible="_visible"
@@ -9,6 +9,7 @@
     width="1024px"
   >
     <ex-table
+      style="margin-top:-20px"
       v-loading="loading"
       :table="table"
       :data="tableData"
@@ -141,7 +142,7 @@ import asyncRequest from "@/apis/service/sellOut/combindAdd";
 import mixinPage from "@/mixins/elPaginationHandle";
 export default {
   name: "StockModal",
-  props: ["visible"],
+  props: ["visible", "supplierNo"],
   mixins: [mixinPage],
   computed: {
     _visible: {
@@ -190,7 +191,7 @@ export default {
         end: "", //新建结束时间
         mobile: "", //手机号
         contactor_name: "", //联系人
-        size: 10,
+        size: 15,
         page: 1
       },
       tablebtnSize: "mini",
@@ -202,7 +203,7 @@ export default {
         {
           type: "selection",
           width: "80px",
-          fixed: 'left'
+          fixed: "left"
         },
         {
           prop: "wsm_code",
@@ -302,7 +303,7 @@ export default {
         mobile: "", //手机号
         contactor_name: "", //联系人
         page: 1, // 页码
-        size: 10 // 每页显示条数
+        size: 15 // 每页显示条数
       };
       this.searchList();
     },
@@ -326,6 +327,7 @@ export default {
 
       const { code, data } = await asyncRequest.stock({
         ...this.parmValue,
+        // supplierNo: this.supplierNo,
         needRela: true
       });
 

+ 6 - 9
src/views/sellOut/combinedAdd/detail.vue

@@ -25,12 +25,8 @@
                   </template>
                 </show-data-table>
               </el-collapse-item>
-              <el-collapse-item
-                title="组合商品详情"
-                name="5"
-                v-if="sitem && sitem.spuCode
-              "
-              >
+
+              <el-collapse-item title="组合商品详情" name="5" v-if="sitem && sitem.spuCode">
                 <show-goods-data-table
                   v-if="newTime !== ''"
                   type="1"
@@ -87,16 +83,17 @@
   </div>
 </template>
 <script>
-import asyncRequest from "@/apis/service/sellOut/combinedAdd";
+import { showColumns, detailColumns, productColumns } from "./columns";
 import ProductDetail from "@/components/details/src/product.vue";
-import StockDetail from "@/components/details/src/stock.vue";
 import { xs_order_type_options } from "@/assets/js/statusList";
-import { showColumns, detailColumns, productColumns } from "./columns";
+import asyncRequest from "@/apis/service/sellOut/combinedAdd";
+import StockDetail from "@/components/details/src/stock.vue";
 import WaitApproval from "./components/waitApproval";
 import mixinPage from "@/mixins/elPaginationHandle";
 import BaseForm from "./components/baseForm";
 import resToken from "@/mixins/resToken";
 import { mapGetters } from "vuex";
+
 export default {
   name: "combinedAddDetail",
   mixins: [mixinPage, resToken],

+ 159 - 217
src/views/sellOut/salesOrder/components/addForm.vue

@@ -16,11 +16,11 @@
               <el-form-item label="销售方" prop="supplierNo">
                 <search-work-company
                   :type="'1'"
-                  :value="ruleForm.supplierNo"
                   :size="'mini'"
-                  :placeholder="'销售方公司'"
                   :disabled="true"
                   :isDetail="false"
+                  :placeholder="'销售方公司'"
+                  :value="ruleForm.supplierNo"
                   @searchChange="supplierChange"
                 />
               </el-form-item>
@@ -53,11 +53,7 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="平台订单号" prop="platform_order">
-                <el-input
-                  v-model="ruleForm.platform_order"
-                  placeholder="如:PO号"
-                  maxlength="100"
-                />
+                <el-input v-model="ruleForm.platform_order" placeholder="如:PO号" maxlength="100" />
               </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -70,18 +66,13 @@
                   value-format="yyyy-MM-dd"
                   :picker-options="pickerOptions"
                   placeholder="承诺回款时间"
-                >
-                </el-date-picker>
+                />
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
               <el-form-item label="其他单号" prop="workNo">
-                <el-input
-                  v-model="ruleForm.workNo"
-                  placeholder="如:业管单号"
-                  maxlength="100"
-                />
+                <el-input v-model="ruleForm.workNo" placeholder="如:业管单号" maxlength="100" />
               </el-form-item>
             </el-col>
             <el-col :span="12">
@@ -112,12 +103,12 @@
                       class="fl"
                       v-if="goods_sitem.good_thumb_img"
                       :src="goods_sitem.good_thumb_img"
-                      alt=""
+                      alt
                     />
                     <span>{{ goods_sitem.good_name }}</span>
                     <span v-for="(si, i) in goods_sitem.specinfo" :key="si.spec_id + i">
-                      <span>{{ i === 0 ? "--" : "__" }}</span
-                      ><span>{{ si.spec_name }}[{{ si.spec_value }}]</span>
+                      <span>{{ i === 0 ? "--" : "__" }}</span>
+                      <span>{{ si.spec_name }}[{{ si.spec_value }}]</span>
                     </span>
                   </template>
                   <template slot="good_info_img">
@@ -131,39 +122,42 @@
                     />
                   </template>
                   <template slot="cat">
-                    <span v-for="(si, sii) in goods_sitem.cat_info" :key="si.id"
-                      ><span v-if="sii !== 0">_</span><span>{{ si.name }}</span>
+                    <span v-for="(si, sii) in goods_sitem.cat_info" :key="si.id">
+                      <span v-if="sii !== 0">_</span>
+                      <span>{{ si.name }}</span>
                     </span>
                   </template>
                   <template slot="exclusive">
-                    <span v-for="(si, sii) in goods_sitem.exclusive" :key="si.id"
-                      ><span v-if="sii !== 0">/</span><span>{{ si.name }}</span>
+                    <span v-for="(si, sii) in goods_sitem.exclusive" :key="si.id">
+                      <span v-if="sii !== 0">/</span>
+                      <span>{{ si.name }}</span>
                     </span>
                   </template>
                   <template slot="is_stock">
-                    <el-tag :size="'mini'">{{
+                    <el-tag :size="'mini'">
+                      {{
                       goods_sitem.is_stock + "" === "1" ? "是" : "否"
-                    }}</el-tag>
+                      }}
+                    </el-tag>
                   </template>
                   <template slot="weight">
-                    <span
-                      >商品总重:{{ goods_sitem.new_weight }}/{{
-                        goods_sitem.weight_unit
-                      }}</span
-                    >
-                    <span v-if="goods_sitem.metal_id"
-                      >--{{
-                        goods_sitem.noble_weight ? goods_sitem.noble_weight : "0"
+                    <span>
+                      商品总重:{{ goods_sitem.new_weight }}/{{
+                      goods_sitem.weight_unit
+                      }}
+                    </span>
+                    <span v-if="goods_sitem.metal_id">
+                      --{{
+                      goods_sitem.noble_weight ? goods_sitem.noble_weight : "0"
                       }}g--{{ goods_sitem.metal_name }}---{{
-                        goods_sitem.gold_price ? goods_sitem.gold_price : "0"
+                      goods_sitem.gold_price ? goods_sitem.gold_price : "0"
                       }}元/g--{{
-                        goods_sitem.is_gold_price + "" === "0" ? "不" : ""
+                      goods_sitem.is_gold_price + "" === "0" ? "不" : ""
                       }}启用实时金价--{{
-                        goods_sitem.is_diff + "" === "1" ? "有" : "无"
+                      goods_sitem.is_diff + "" === "1" ? "有" : "无"
                       }}工差--{{ goods_sitem.config }}---{{
-                        goods_sitem.other_config
-                      }}</span
-                    >
+                      goods_sitem.other_config }}
+                    </span>
                   </template>
                 </show-data-table>
               </el-form-item>
@@ -185,12 +179,7 @@
 
                 <el-col :span="12">
                   <el-form-item label="凭证文件" prop="proof_id">
-                    <el-tooltip
-                      effect="dark"
-                      content="查找历史凭证"
-                      placement="top"
-                      class="fr"
-                    >
+                    <el-tooltip effect="dark" content="查找历史凭证" placement="top" class="fr">
                       <i class="el-icon-search tb-icon" @click="showVoucherFun"></i>
                     </el-tooltip>
 
@@ -222,8 +211,7 @@
 
                           <video width="250" controls class="fl">
                             <source :src="ruleForm.proof_url" type="video/mp4" />
-                            <source :src="ruleForm.proof_url" type="video/avi" />
-                            您的浏览器不支持Video标签。
+                            <source :src="ruleForm.proof_url" type="video/avi" />您的浏览器不支持Video标签。
                           </video>
                         </div>
                         <div v-else-if="ruleForm.proof_type === '2'" class="clearfix">
@@ -248,22 +236,19 @@
                       disabled
                       maxlength="200"
                       placeholder="剩余库存"
-                    /> </el-form-item
-                ></el-col>
+                    />
+                  </el-form-item>
+                </el-col>
                 <el-col :span="12">
-                  <el-form-item
-                    label="系统最低售价"
-                    prop="good_price"
-                    label-width="110px"
-                  >
+                  <el-form-item label="系统最低售价" prop="good_price" label-width="110px">
                     <el-input
                       v-model="ruleForm.good_price"
                       disabled
                       maxlength="20"
                       v-loading="priceLoding"
                     >
-                      <template slot="append">元</template></el-input
-                    >
+                      <template slot="append">元</template>
+                    </el-input>
                   </el-form-item>
                 </el-col>
                 <el-col :span="12">
@@ -321,25 +306,19 @@
                   value-format="yyyy-MM-dd"
                   :picker-options="pickerOptions"
                   placeholder="要求到货时间"
-                >
-                </el-date-picker>
+                ></el-date-picker>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
               <el-form-item label="下单方式" prop="sendtype">
-                <el-select
-                  v-model="ruleForm.sendtype"
-                  placeholder="下单方式"
-                  style="width: 100%"
-                >
+                <el-select v-model="ruleForm.sendtype" placeholder="下单方式" style="width: 100%">
                   <el-option
                     v-for="item in sendtype_options"
                     :key="item.value"
                     :label="item.label"
                     :value="item.value"
-                  >
-                  </el-option>
+                  ></el-option>
                 </el-select>
               </el-form-item>
             </el-col>
@@ -353,8 +332,7 @@
                   :rows="ruleForm.good_code ? 4 : 2"
                   placeholder="订单备注"
                   v-model="ruleForm.remark"
-                >
-                </el-input>
+                ></el-input>
               </el-form-item>
             </el-col>
 
@@ -412,12 +390,7 @@
               </template>
             </el-table-column>
 
-            <el-table-column
-              prop="contactor"
-              label="收件联系人"
-              min-width="110"
-              show-overflow-tooltip
-            >
+            <el-table-column prop="contactor" label="收件联系人" min-width="110" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-form-item
                   v-if="scope.row.edit"
@@ -437,12 +410,7 @@
               </template>
             </el-table-column>
 
-            <el-table-column
-              prop="mobile"
-              label="收货联系电话"
-              min-width="130"
-              show-overflow-tooltip
-            >
+            <el-table-column prop="mobile" label="收货联系电话" min-width="130" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-form-item
                   v-if="scope.row.edit"
@@ -462,12 +430,7 @@
               </template>
             </el-table-column>
 
-            <el-table-column
-              prop="addr_code"
-              label="收货省市区"
-              min-width="230"
-              show-overflow-tooltip
-            >
+            <el-table-column prop="addr_code" label="收货省市区" min-width="230" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-form-item
                   v-if="scope.row.edit"
@@ -476,26 +439,21 @@
                   :size="'mini'"
                   :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
                 >
-                  <search-area 
+                  <search-area
                     :value="scope.row.code"
-                    size="mini" 
+                    size="mini"
                     :disabled="!scope.row.edit"
                     :is-detail="scope.row.edit"
                     :names="scope.row.names"
-                    placeholder="收货省市区" 
-                    :level="3" 
+                    placeholder="收货省市区"
+                    :level="3"
                     @searchChange="areaChange($event,scope.$index)"
                   />
                 </el-form-item>
                 <span v-if="!scope.row.edit">{{ scope.row.addr_code_name }}</span>
               </template>
             </el-table-column>
-            <el-table-column
-              prop="addr"
-              label="详细地址"
-              min-width="170"
-              show-overflow-tooltip
-            >
+            <el-table-column prop="addr" label="详细地址" min-width="170" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-form-item
                   v-if="scope.row.edit"
@@ -551,36 +509,17 @@
                   placement="top"
                 >
                   <a class="downloadAddr" href="./static/收货地址模板.xlsx">
-                    <i
-                      class="el-icon-download tb-icon"
-                      style="color: #6954f0; margin: 0"
-                    ></i>
+                    <i class="el-icon-download tb-icon" style="color: #6954f0; margin: 0"></i>
                   </a>
                 </el-tooltip>
               </template>
               <template slot-scope="scope">
-                <el-tooltip
-                  effect="dark"
-                  content="编辑"
-                  v-if="!scope.row.edit"
-                  placement="top"
-                >
-                  <i
-                    class="el-icon-edit tb-icon"
-                    @click="openHouseModal(scope.$index)"
-                  ></i>
+                <el-tooltip effect="dark" content="编辑" v-if="!scope.row.edit" placement="top">
+                  <i class="el-icon-edit tb-icon" @click="openHouseModal(scope.$index)"></i>
                 </el-tooltip>
 
-                <el-tooltip
-                  effect="dark"
-                  content="保存"
-                  v-if="scope.row.edit"
-                  placement="top"
-                >
-                  <i
-                    class="el-icon-circle-check tb-icon"
-                    @click="checkRow(scope.$index)"
-                  ></i>
+                <el-tooltip effect="dark" content="保存" v-if="scope.row.edit" placement="top">
+                  <i class="el-icon-circle-check tb-icon" @click="checkRow(scope.$index)"></i>
                 </el-tooltip>
 
                 <el-tooltip effect="dark" content="删除" placement="top">
@@ -595,11 +534,7 @@
         </el-form>
       </el-col>
       <el-col :span="24">
-        <in-addr-model
-          :show-model="addrmodel"
-          @cancel="addrmodel = false"
-          @refresh="addrRefresh"
-        />
+        <in-addr-model :show-model="addrmodel" @cancel="addrmodel = false" @refresh="addrRefresh" />
 
         <show-voucher-model
           :showModel="showVoucher"
@@ -620,15 +555,15 @@
         <p>
           订单总金额:
           {{
-            priceAccMul(
-              ruleForm && ruleForm.good_num ? ruleForm.good_num : "0",
-              ruleForm && ruleForm.new_good_price
-                ? ruleForm && ruleForm.new_good_price
-                : "0"
-            )
+          priceAccMul(
+          ruleForm && ruleForm.good_num ? ruleForm.good_num : "0",
+          ruleForm && ruleForm.new_good_price
+          ? ruleForm && ruleForm.new_good_price
+          : "0"
+          )
           }}
         </p>
-        <el-button :size="'mini'" type="primary" @click="submitForm">保 存 </el-button>
+        <el-button :size="'mini'" type="primary" @click="submitForm">保 存</el-button>
       </el-col>
     </el-row>
   </div>
@@ -644,7 +579,7 @@ import {
   isEmoticon,
   isSpecialSymbol,
   hasSpace,
-  isAddr,
+  isAddr
 } from "@/utils/validate";
 import inAddrModel from "@/components/in-addr-model";
 import showVoucherModel from "@/components/show-voucher-model";
@@ -660,29 +595,29 @@ export default {
   mixins: [mixinPage, resToken, companyHelper],
   props: ["newTime", "id", "sitem", "type"],
   computed: {
-    ...mapGetters(["business_companyNo"]),
+    ...mapGetters(["business_companyNo"])
   },
   components: {
     inAddrModel,
     showVoucherModel,
-    searchGoodOnlineModal,
+    searchGoodOnlineModal
   },
   watch: {
-    newTime: function (val) {
+    newTime: function(val) {
       if (val) {
         this.initForm();
       }
-    },
+    }
   },
   computed: {
     powers() {
       const tran =
         this.$store.getters.btnList.find(
-          (item) => item.menu_route == "salesOrderDetail"
+          item => item.menu_route == "salesOrderDetail"
         ) || {};
       const { action } = tran ?? {};
       return action ?? [];
-    },
+    }
   },
 
   data() {
@@ -753,7 +688,7 @@ export default {
       pickerOptions: {
         disabledDate(time) {
           return time.getTime() < Date.now() - 1000 * 60 * 60 * 24;
-        },
+        }
       },
       goodtype_options: [
         {
@@ -762,33 +697,33 @@ export default {
           children: [
             {
               value: "1",
-              label: "常规商品",
+              label: "常规商品"
             },
             {
               value: "2",
-              label: "赠品",
+              label: "赠品"
             },
             {
               value: "3",
-              label: "样品",
-            },
-          ],
+              label: "样品"
+            }
+          ]
         },
         {
           value: "is_activity_1",
           label: "参与活动",
-          children: [],
-        },
+          children: []
+        }
       ],
       sendtype_options: [
         {
           value: "1",
-          label: "有地址下单",
+          label: "有地址下单"
         },
         {
           value: "2",
-          label: "无地址下单",
-        },
+          label: "无地址下单"
+        }
       ],
       ruleForm: {
         order_type: "1",
@@ -810,7 +745,7 @@ export default {
         workNo: "", //其他单号
         sendtype: "1", //发货方式
         remark: "", //备注
-        good_code: "", // 商品编号
+        good_code: "" // 商品编号
       },
       rulesThis: this.rules,
       rules: {
@@ -818,44 +753,44 @@ export default {
           {
             required: true,
             message: "请选择销售方公司",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         customer_code: [
           {
             type: "array",
             required: true,
             message: "请选择企业客户",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         platform_id: [
           {
             required: true,
             message: "请选择所属平台",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         arrtime: [
           {
             required: true,
             message: "要求到货时间",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         new_good_price: [
           {
             required: true,
             message: "销售单价不能为空!",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
         ],
         proof_id: [
           {
             required: false,
             message: "请选择凭证文件",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
 
         goodtype: [
@@ -863,40 +798,40 @@ export default {
             type: "array",
             required: true,
             message: "请选择活动类型",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         good_num: [
           {
             required: true,
             message: "请选择活动类型",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         sendtype: [
           {
             required: true,
             message: "请选择发货方式",
-            trigger: "change",
-          },
+            trigger: "change"
+          }
         ],
         good_code: [
           {
             required: true,
             message: "请选择销售商品",
-            trigger: "blur",
-          },
+            trigger: "blur"
+          }
         ],
         remark: [
           {
             required: true,
             message: "备注不能为空",
-            trigger: "blur",
-          },
-        ],
+            trigger: "blur"
+          }
+        ]
       },
       addrForm: {
-        order_addr: [], //收货地址
+        order_addr: [] //收货地址
       },
       delAddrList: [],
       delStockList: [],
@@ -904,30 +839,30 @@ export default {
         receipt_quantity: {
           required: true,
           validator: validateWeight,
-          trigger: "blur",
+          trigger: "blur"
         },
 
         contactor: {
           required: true,
           trigger: "blur",
-          validator: validatecontactor,
+          validator: validatecontactor
         },
         mobile: {
           required: true,
           validator: validatemobile,
-          trigger: "blur",
+          trigger: "blur"
         },
 
         order_addr: {
           type: "array",
           required: false,
-          trigger: "change",
+          trigger: "change"
         },
         addr: {
           required: true,
           validator: validateAddr,
-          trigger: "blur",
-        },
+          trigger: "blur"
+        }
       },
 
       loading: false,
@@ -936,9 +871,9 @@ export default {
       goods_sitem: {},
       order_good_num: {
         ogood_type: "",
-        ogood_num: "0",
+        ogood_num: "0"
       },
-      priceLoding: false,
+      priceLoding: false
     };
   },
   mounted() {
@@ -985,7 +920,7 @@ export default {
             workNo: "", //其他单号
             sendtype: "1", //发货方式
             remark: "", //备注
-            good_code: "", // 商品编号
+            good_code: "" // 商品编号
           };
         }
 
@@ -994,12 +929,12 @@ export default {
           this.$refs.addrForm.clearValidate();
           const { addrs } = this.sitem;
           this.addrForm = {
-            order_addr: [],
+            order_addr: []
           };
           this.delAddrList = [];
 
           if (addrs && addrs.length > 0) {
-            addrs.forEach((v) => {
+            addrs.forEach(v => {
               const { area_code, city_code, provice_code } = v.addr_code;
               let model = {
                 edit: false,
@@ -1012,7 +947,7 @@ export default {
                     : [],
                 addr: v.addr || "",
                 id: v.id,
-                is_del: 0,
+                is_del: 0
               };
               this.delAddrList.push(model);
               this.addrForm.order_addr.push(model);
@@ -1038,10 +973,10 @@ export default {
     addrRefresh(e) {
       const list = JSON.parse(JSON.stringify(e.list));
       list.forEach(item => {
-        item.code = item.areaCode ? [item.areaCode] :[]
-        item.names = item.label ? [item.label] : []
-      })
-      console.log(list)
+        item.code = item.areaCode ? [item.areaCode] : [];
+        item.names = item.label ? [item.label] : [];
+      });
+      console.log(list);
       this.addrForm.order_addr.push(...list);
     },
     async resultList(e) {
@@ -1068,21 +1003,22 @@ export default {
       let model = {
         skuCode: good_code,
         companyNo: supplierNo,
-        platform_id,
+        platform_id
       };
       const { code, data, message } = await asyncRequest.goods_active(model);
       if (code === 0) {
         const { act, good } = data;
         let actlist = act.length > 0 ? JSON.parse(JSON.stringify(act)) : [];
-        actlist.forEach((a) => {
+        actlist.forEach(a => {
           a.value = a.activity_code;
           a.label = a.activity_name;
         });
         this.goodtype_options[1].children = [];
         this.goodtype_options[1].children.push(...actlist);
-        let goodItem = good.length > 0 ? JSON.parse(JSON.stringify(good[0])) : {};
+        let goodItem =
+          good.length > 0 ? JSON.parse(JSON.stringify(good[0])) : {};
         if (goodItem.good_name) {
-          this.goodtype_options[0].children.map((b) => {
+          this.goodtype_options[0].children.map(b => {
             b.activity_stock = goodItem ? goodItem.stock_num + "" : "0";
             return b;
           });
@@ -1096,12 +1032,14 @@ export default {
     },
     async get_goods_detail(skuCode) {
       let { code, data, message } = await asyncRequest.goods_detail({
-        skuCode: skuCode,
+        skuCode: skuCode
       });
       if (code === 0) {
         this.goods_sitem = data;
         // console.log("1111111111111111", this.goods_sitem);
-        this.goods_sitem.good_info_img = this.goods_sitem.good_info_img.split(",");
+        this.goods_sitem.good_info_img = this.goods_sitem.good_info_img.split(
+          ","
+        );
         const { weight } = this.goods_sitem;
         let kgnum = parseInt((weight * 1) / 1000);
         let gnum = (weight * 1) % 1000;
@@ -1181,16 +1119,16 @@ export default {
       if (oldGood_type === ogood_type && good_num === ogood_num) {
         this.order_good_num = {
           ogood_type: goodtype.length === 2 ? goodtype[1] : "",
-          ogood_num: this.ruleForm.good_num,
+          ogood_num: this.ruleForm.good_num
         };
         return;
       }
 
       //activity_stock
       if (goodtype.length === 2) {
-        this.goodtype_options.forEach((a) => {
+        this.goodtype_options.forEach(a => {
           if (a.children && a.children.length) {
-            a.children.forEach((b) => {
+            a.children.forEach(b => {
               if (b.value === goodtype[1]) {
                 console.log(b.activity_stock);
                 this.ruleForm.activity_stock = b.activity_stock || "0";
@@ -1208,7 +1146,7 @@ export default {
 
       this.order_good_num = {
         ogood_type: goodtype.length === 2 ? goodtype[1] : "",
-        ogood_num: this.ruleForm.good_num,
+        ogood_num: this.ruleForm.good_num
       };
     },
     change_good_code() {
@@ -1223,7 +1161,7 @@ export default {
       }
       this.addshowModel = {
         company_id: supplierNo,
-        platform_code: platform_id,
+        platform_code: platform_id
       };
       this.showModel = true;
     },
@@ -1254,7 +1192,7 @@ export default {
       this.goods_sitem = {};
     },
     openHouseModal(index) {
-      let findex = this.addrForm.order_addr.findIndex((v) => v.edit === true);
+      let findex = this.addrForm.order_addr.findIndex(v => v.edit === true);
       if (findex !== -1) {
         this.$message.warning("当前已有地址在编辑,请保存后再试!");
         return;
@@ -1266,7 +1204,7 @@ export default {
             contactor: "",
             mobile: "",
             addr_code: [],
-            addr: "",
+            addr: ""
           });
         } else {
           this.addrForm.order_addr[index].edit = true;
@@ -1277,26 +1215,27 @@ export default {
     select_area_change(e, index) {
       this.addrForm.order_addr[index].addr_code = e;
     },
-    areaChange(e,index){
-      const { code,area_code,label } = e
+    areaChange(e, index) {
+      const { code, area_code, label } = e;
       this.addrForm.order_addr[index].names = label ? [label] : [];
       this.addrForm.order_addr[index].code = area_code ? [area_code] : [];
-      this.addrForm.order_addr[index].addr_code = code ? code.split(',') : [];
+      this.addrForm.order_addr[index].addr_code = code ? code.split(",") : [];
     },
     //省市区保存某一行
     async checkRow(rowIndex) {
-      await this.$refs.addrForm.validate(async (valid) => {
+      await this.$refs.addrForm.validate(async valid => {
         if (valid) {
           const { addr_code } = this.addrForm.order_addr[rowIndex];
           if (addr_code && addr_code.length === 3) {
             let arrCode = addr_code[addr_code.length - 1];
             // console.log(model);
             let { code, data, message } = await asyncRequest.addrall({
-              code: arrCode,
+              code: arrCode
             });
             if (code === 0) {
               const { province, city, area } = data;
-              let province_name = province && province.name ? province.name : "";
+              let province_name =
+                province && province.name ? province.name : "";
               let city_name = city && city.name ? city.name : "";
               let area_name = area && area.name ? area.name : "";
               this.addrForm.order_addr[rowIndex].addr_code_name =
@@ -1323,7 +1262,7 @@ export default {
       rows.splice(index, 1);
     },
     async submitForm() {
-      await this.$refs.ruleForm.validate(async (valid) => {
+      await this.$refs.ruleForm.validate(async valid => {
         if (valid) {
           if (this.loading) {
             return;
@@ -1360,7 +1299,7 @@ export default {
             let addrT = 0,
               isAEdit = false;
 
-            order_addr.forEach((v2) => {
+            order_addr.forEach(v2 => {
               if (v2.edit) {
                 isAEdit = true;
               }
@@ -1370,7 +1309,7 @@ export default {
                 mobile: v2.mobile,
                 addr: v2.addr,
                 receipt_quantity: v2.receipt_quantity,
-                addr_code: v2.addr_code,
+                addr_code: v2.addr_code
               };
               model.addrlist.push(model2);
             });
@@ -1395,7 +1334,7 @@ export default {
           model.goodtype = key_0 === "is_activity_1" ? "1" : key_1;
           model.act_code = key_0 === "is_activity_1" ? key_1 : "";
 
-          Object.keys(model).forEach((key) => {
+          Object.keys(model).forEach(key => {
             if (typeof model[key] === "string") {
               model[key] = replaceTextWrapAndSpace(model[key]);
             }
@@ -1406,7 +1345,7 @@ export default {
           if (res && res.code === 0) {
             this.$notify.success({
               title: "订单创建成功!",
-              message: "",
+              message: ""
             });
 
             this.$emit("refresh");
@@ -1426,7 +1365,7 @@ export default {
       this.priceLoding = true;
       let resModel = {
         isok: true,
-        price: "0",
+        price: "0"
       };
       const { good_num, good_code, goodtype } = this.ruleForm;
       let key_1 = goodtype[1];
@@ -1435,7 +1374,7 @@ export default {
         skuCode: good_code,
         sale_num: good_num,
         is_activity: key_0 === "is_activity_0" ? "0" : "1",
-        act_code: key_0 === "is_activity_1" ? key_1 : "",
+        act_code: key_0 === "is_activity_1" ? key_1 : ""
       };
       console.log(model);
       let { code, message, data } = await asyncRequest.salegetprice(model);
@@ -1446,7 +1385,10 @@ export default {
 
         let oldGood_type = goodtype.length === 2 ? goodtype[1] : "";
 
-        if (key_0 === "is_activity_0" && (oldGood_type == 2 || oldGood_type == 3)) {
+        if (
+          key_0 === "is_activity_0" &&
+          (oldGood_type == 2 || oldGood_type == 3)
+        ) {
           resModel.price = 0 + "";
         }
       } else if (code >= 100 && code <= 104) {
@@ -1457,8 +1399,8 @@ export default {
       }
       this.priceLoding = false;
       return resModel;
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>

+ 107 - 143
src/views/sellOut/salesOrder/components/out-order-add-model.vue

@@ -38,67 +38,31 @@
               </el-col>
               <el-col :span="12">
                 <el-form-item label="发货数量" prop="send_num">
-                  <el-input
-                    v-model="ruleForm.send_num"
-                    placeholder="收货数量"
-                    maxlength="10"
-                  />
+                  <el-input v-model="ruleForm.send_num" placeholder="收货数量" maxlength="10" />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="联系人" prop="contactor">
-                  <el-input
-                    v-model="ruleForm.contactor"
-                    maxlength="250"
-                    placeholder="联系人"
-                  />
+                  <el-input v-model="ruleForm.contactor" maxlength="250" placeholder="联系人" />
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="联系电话" prop="mobile">
-                  <el-input
-                    v-model="ruleForm.mobile"
-                    maxlength="11"
-                    placeholder="联系电话"
-                  />
-                </el-form-item>
-              </el-col>
-              <el-col :span="24">
-                <el-form-item
-                  :label="''"
-                  prop="addr_code"
-                  :label-width="'99px'"
-                >
-                  <search-area
-                    :value="code"
-                    :is-detail="true"
-                    size="mini"
-                    :names="label"
-                    placeholder=""
-                    :level="3"
-                    @searchChange="areaChange($event)"
-                  />
+                  <el-input v-model="ruleForm.mobile" maxlength="11" placeholder="联系电话" />
                 </el-form-item>
               </el-col>
               <el-col :span="24">
                 <el-form-item label="详细地址" prop="addr">
-                  <el-input
-                    v-model="ruleForm.addr"
-                    maxlength="250"
-                    placeholder="详细地址"
-                  />
+                  <el-input v-model="ruleForm.addr" maxlength="250" placeholder="详细地址" />
                 </el-form-item>
               </el-col>
               <el-col :span="24" style="text-align: right">
-                <el-button
-                  type="primary"
-                  :size="'mini'"
-                  @click="submitForm"
-                >保 存
-                </el-button>
-                <el-button :size="'mini'" @click="showModelThis = false">{{
+                <el-button type="primary" :size="'mini'" @click="submitForm">保 存</el-button>
+                <el-button :size="'mini'" @click="showModelThis = false">
+                  {{
                   isDetail ? "关 闭" : "取 消"
-                }}</el-button>
+                  }}
+                </el-button>
               </el-col>
             </el-row>
           </el-form>
@@ -108,8 +72,8 @@
   </el-dialog>
 </template>
 <script>
-import asyncRequest from '@/apis/service/sellOut/salesOrder/detail'
-import resToken from '@/mixins/resToken'
+import asyncRequest from "@/apis/service/sellOut/salesOrder/detail";
+import resToken from "@/mixins/resToken";
 import {
   isnumber,
   isMobile,
@@ -118,72 +82,72 @@ import {
   isSpecialSymbol,
   hasSpace,
   isAddr
-} from '@/utils/validate'
+} from "@/utils/validate";
 export default {
-  name: 'Account',
+  name: "Account",
   mixins: [resToken],
-  props: ['showModel', 'id', 'sitem'],
+  props: ["showModel", "id", "sitem"],
   data() {
     const validateWeight = (rule, value, callback) => {
-      if (value === '') {
-        callback(new Error('不能为空!'))
+      if (value === "") {
+        callback(new Error("不能为空!"));
       } else {
         if (!isnumber(value)) {
-          callback(new Error('仅支持整数!'))
+          callback(new Error("仅支持整数!"));
         } else {
-          callback()
+          callback();
         }
       }
-    }
-    const validatemobile = (rule, value, callback) => {
-      if (value === '') {
-        callback(new Error('手机号不能为空!'))
+    };
+    const validatemobile = (_, value, callback) => {
+      if (value === "") {
+        callback(new Error("手机号不能为空!"));
       } else {
         if (!isMobile(value)) {
-          callback(new Error('手机号格式不正确!'))
+          callback(new Error("手机号格式不正确!"));
         } else {
-          callback()
+          callback();
         }
       }
-    }
-    const validatecontactor = (rule, value, callback) => {
-      if (value === '') {
-        callback(new Error('联系人不能为空!'))
+    };
+    const validatecontactor = (_, value, callback) => {
+      if (value === "") {
+        callback(new Error("联系人不能为空!"));
       } else {
         if (value.length < 2 || value.length > 10) {
-          callback(new Error('联系人规则为2~10位汉字!'))
+          callback(new Error("联系人规则为2~10位汉字!"));
         } else {
           if (!isChinese(value)) {
-            callback(new Error('联系人规则为2~10位汉字!'))
+            callback(new Error("联系人规则为2~10位汉字!"));
           } else if (isEmoticon(value)) {
-            callback(new Error('联系人规则为2~10位汉字!'))
+            callback(new Error("联系人规则为2~10位汉字!"));
           } else {
-            callback()
+            callback();
           }
         }
       }
-    }
-    const validateAddr = (rule, value, callback) => {
-      if (value === '') {
-        callback(new Error('详细地址不能为空!'))
+    };
+    const validateAddr = (_, value, callback) => {
+      if (value === "") {
+        callback(new Error("详细地址不能为空!"));
       } else {
         if (hasSpace(value)) {
-          callback(new Error('不能出现/回车/换行符!'))
+          callback(new Error("不能出现/回车/换行符!"));
         } else if (isSpecialSymbol(value)) {
-          callback(new Error('不能使用英文特殊字符!'))
+          callback(new Error("不能使用英文特殊字符!"));
         } else if (isAddr(value)) {
-          callback()
+          callback();
         } else {
-          callback(new Error('详细地址填写不规范!'))
+          callback(new Error("详细地址填写不规范!"));
         }
       }
-    }
+    };
     return {
       code: [],
       label: [],
       roleList: [],
       loading: false,
-      title: '新建发货单',
+      title: "新建发货单",
       showModelThis: this.showModel,
       rulesThis: {},
       rules: {
@@ -191,14 +155,14 @@ export default {
           {
             required: true,
             validator: validateWeight,
-            trigger: 'blur'
+            trigger: "blur"
           }
         ],
 
         contactor: [
           {
             required: true,
-            trigger: 'blur',
+            trigger: "blur",
             validator: validatecontactor
           }
         ],
@@ -206,137 +170,137 @@ export default {
           {
             required: true,
             validator: validatemobile,
-            trigger: 'blur'
+            trigger: "blur"
           }
         ],
 
         addr_code: [
           {
-            type: 'array',
+            type: "array",
             required: true,
-            message: '不能为空',
-            trigger: 'change'
+            message: "不能为空",
+            trigger: "change"
           }
         ],
         addr: [
           {
             required: true,
             validator: validateAddr,
-            trigger: 'blur'
+            trigger: "blur"
           }
         ]
       },
       ruleForm: {
-        orderCode: '',
-        wsend_num: '',
-        send_num: '',
-        contactor: '',
-        mobile: '',
+        orderCode: "",
+        wsend_num: "",
+        send_num: "",
+        contactor: "",
+        mobile: "",
         addr_code: [],
-        addr: '',
-        id: ''
+        addr: "",
+        id: ""
       }
-    }
+    };
   },
   watch: {
     showModel: function(val) {
-      this.showModelThis = val
+      this.showModelThis = val;
       if (val) {
-        this.initForm()
+        this.initForm();
       }
     },
     showModelThis(val) {
       if (!val) {
-        this.$emit('cancel')
+        this.$emit("cancel");
       }
     }
   },
   methods: {
     async areaChange(e) {
-      const { code, area_code, label } = e
-      this.ruleForm.addr_code = code ? code.split(',') : []
-      this.code = area_code ? [area_code] : []
-      this.label = label ? [label] : []
-      this.$refs.ruleForm.validateField('addr_code')
+      const { code, area_code, label } = e;
+      this.ruleForm.addr_code = code ? code.split(",") : [];
+      this.code = area_code ? [area_code] : [];
+      this.label = label ? [label] : [];
+      this.$refs.ruleForm.validateField("addr_code");
     },
 
     closeModel() {
-      console.log('closeModel!!')
-      this.showModelThis = false
-      this.$emit('closeModel')
+      console.log("closeModel!!");
+      this.showModelThis = false;
+      this.$emit("closeModel");
     },
 
     async initForm() {
-      this.loading = true
-      this.rulesThis = this.rules
-      await this.resetForm()
-      this.loading = false
+      this.loading = true;
+      this.rulesThis = this.rules;
+      await this.resetForm();
+      this.loading = false;
     },
 
     // 初始化表单
     async resetForm() {
       await this.$nextTick(() => {
         if (this.$refs.ruleForm) {
-          this.$refs.ruleForm.resetFields()
-          this.$refs.ruleForm.clearValidate()
-          const { orderCode, good_num, addr_sum } = this.sitem
-          const sum = parseInt(good_num + '') - parseInt(addr_sum + '')
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          const { orderCode, good_num, addr_sum } = this.sitem;
+          const sum = parseInt(good_num + "") - parseInt(addr_sum + "");
           this.ruleForm = {
-            orderCode: orderCode || '',
-            wsend_num: sum || '0',
-            send_num: sum || '0',
-            contactor: '',
-            mobile: '',
-            addr: '',
+            orderCode: orderCode || "",
+            wsend_num: sum || "0",
+            send_num: sum || "0",
+            contactor: "",
+            mobile: "",
+            addr: "",
             addr_code: []
-          }
+          };
         }
-      })
+      });
     },
     // 省市区选择
     async select_area_change(e) {
-      this.ruleForm.addr_code = e
-      this.$refs.ruleForm.validateField('addr_code')
+      this.ruleForm.addr_code = e;
+      this.$refs.ruleForm.validateField("addr_code");
     },
     // 保存更改
     async submitForm() {
-      await this.$refs.ruleForm.validate(async(valid) => {
+      await this.$refs.ruleForm.validate(async valid => {
         if (valid) {
           if (this.loading) {
-            return
+            return;
           }
-          this.loading = true
-          const model = JSON.parse(JSON.stringify(this.ruleForm))
-          model.addr_code = model.addr_code.toString()
-          const res = await asyncRequest.saleout(model)
-          this.loading = false
+          this.loading = true;
+          const model = JSON.parse(JSON.stringify(this.ruleForm));
+          model.addr_code = model.addr_code.toString();
+          const res = await asyncRequest.saleout(model);
+          this.loading = false;
           if (res && res.code === 0) {
             this.$notify.success({
-              title: '添加成功',
-              message: ''
-            })
-            this.showModelThis = false
-            this.$emit('refresh')
+              title: "添加成功",
+              message: ""
+            });
+            this.showModelThis = false;
+            this.$emit("refresh");
           } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout()
+            await this.logout();
           } else {
-            this.$message.warning(res.message)
+            this.$message.warning(res.message);
           }
         } else {
-          console.log('error submit!!')
-          return false
+          console.log("error submit!!");
+          return false;
         }
-      })
+      });
     },
     handleCompany(e) {
-      console.log(e)
+      console.log(e);
       if (e && e.code) {
-        this.ruleForm.post_name = [e.shortName]
+        this.ruleForm.post_name = [e.shortName];
       }
-      this.$refs.ruleForm.validateField('post_name')
+      this.$refs.ruleForm.validateField("post_name");
     }
   }
-}
+};
 </script>
 
 <style lang="scss" scoped>