Bladeren bron

feat:添加字段

snow 1 jaar geleden
bovenliggende
commit
df76aa9785

+ 13 - 0
src/apis/service/serviceParam/supplierCat/index.js

@@ -0,0 +1,13 @@
+import http from "@/apis/axios";
+
+const api = "admin/";
+export default {
+  // 分类查询
+  cat_list:(data, params) => http(api + "catwlist", data, "post", params),
+  // 列表
+  list:(data, params) => http(api + "supplierCatList", data, "post", params),
+  // 添加供应商支持分类
+  add:(data, params) => http(api + "supplierCatAdd", data, "post", params),
+  // 供应商支持分类状态
+  status:(data, params) => http(api + "supplierCatStatus", data, "post", params)
+};

+ 0 - 1
src/components/globalComponents/search-supplier/main.vue

@@ -67,7 +67,6 @@ export default {
   watch: {
     names: {
       handler: function(val, old) {
-        // console.log(val, old, this.isDetail, "1");
         this.searchName = val;
         if (this.isDetail && this.searchName) {
           console.log(this.searchName);

+ 8 - 12
src/utils/validate.js

@@ -36,7 +36,6 @@ export function isqzf(s) {
   } else {
     type = false;
   }
-  console.log("console区-座-分 " + type);
   return type;
 }
 // //区-座
@@ -48,7 +47,6 @@ export function isqz(s) {
   } else {
     type = false;
   }
-  console.log("console区-座 " + type);
   return type;
 }
 //座-分
@@ -60,7 +58,6 @@ export function iszf(s) {
   } else {
     type = false;
   }
-  console.log("console座-分" + type);
   return type;
 }
 
@@ -73,7 +70,6 @@ export function isz(s) {
   } else {
     type = false;
   }
-  console.log("console座" + type);
   return type;
 }
 function setqj(s) {
@@ -403,7 +399,7 @@ export function add_sum(arg1, arg2) {
 //乘法精算
 export function accMul(arg1, arg2) {
   const s = accMulIn(arg1, arg2);
-  console.log(`${arg1}*${arg2}=${s}`);
+  // console.log(`${arg1}*${arg2}=${s}`);
   return s;
 }
 //除法精度问题
@@ -422,7 +418,7 @@ export function accDiv(arg1, arg2) {
   c1 = Number(arg1.toString().replace(".", ""));
   c2 = Number(arg2.toString().replace(".", ""));
   const s = (c1 / c2) * Math.pow(10, t2 - t1);
-  console.log(`${arg1}/${arg2}=${s}`);
+  // console.log(`${arg1}/${arg2}=${s}`);
   return s;
 }
 //减法精度问题
@@ -441,7 +437,7 @@ export function accSub(arg1, arg2) {
   m = Math.pow(10, Math.max(r1, r2)); //last modify by deeka //动态控制精度长度
   n = r1 >= r2 ? r1 : r2;
   const s = ((arg1 * m - arg2 * m) / m).toFixed(n);
-  console.log(`${arg1}-${arg2}=${s}`);
+  // console.log(`${arg1}-${arg2}=${s}`);
   return s;
 }
 export function isSpecialSymbol(s) {
@@ -535,8 +531,8 @@ export function hasSpace(s) {
   //   \xhh 十六进制  十六进制所代表的任意字符 会把部分字母过滤掉
   //
   const str2 = s.replace(/[\b\f\n\r\t\v\\\'\"\?\0]/g, "");
-  console.log(s);
-  console.log(str2);
+  // console.log(s);
+  // console.log(str2);
   return !(str2 === s);
 }
 function com1(str, arr) {
@@ -544,11 +540,11 @@ function com1(str, arr) {
   return s;
 }
 function com2(str, arr) {
-  console.log(str);
-  console.log(arr);
+  // console.log(str);
+  // console.log(arr);
   let s = "";
   for (let i = 0; i < str.length; i++) {
-    console.log((arr.find((si) => si.key === str[i]) || {}).value || str[i]);
+    // console.log((arr.find((si) => si.key === str[i]) || {}).value || str[i]);
     s += (arr.find((si) => si.key === str[i]) || {}).value || str[i];
   }
   return s;

+ 23 - 0
src/views/goodStore/goodsCost/columns.js

@@ -561,6 +561,29 @@ const rules = {
       validator: validate_desc,
       trigger: 'blur'
     }
+  ],
+  supplier_origin_price: [
+    {
+      required: true,
+      message: "请输入供货商采购成本价",
+      trigger: "change"
+    }
+  ],
+  cgd_apply_id:[
+    {
+      type:'array',
+      required: true,
+      message: "请选择竞单人",
+      trigger: "change"
+    }
+  ],
+  cgd_supplier_code: [
+    {
+      type: "array",
+      required: true,
+      message: "请选择采购供应商",
+      trigger: "change",
+    }
   ]
 }
 

+ 95 - 1
src/views/goodStore/goodsCost/components/baseFormNormal.vue

@@ -230,6 +230,54 @@
                 />
               </el-form-item>
             </el-col>
+
+            <template v-if="hasAccount">
+               <el-col :span="8">
+                 <el-form-item label="供应商采购成本" label-width="130px" prop="supplier_origin_price">
+                   <digital-input
+                     :values="ruleForm.supplier_origin_price"
+                     :placeholder="'供应商采购成本'"
+                     :min="0"
+                     :disabled="type === 'view' || is_noble"
+                     :max="100000000000"
+                     :position="'right'"
+                     :precision="2"
+                     :size="'mini'"
+                     :controls="false"
+                     :append="'元'"
+                     @reschange="number_change_origin($event)"
+                   />
+               </el-form-item>
+              </el-col>
+
+              <el-col :span="8">
+                <el-form-item label="采购供应商" label-width="120px" prop="cgd_supplier_code">
+                  <search-supplier
+                    :value="ruleForm.cgd_supplier_code"
+                    :placeholder="'采购供应商'"
+                    :size="'mini'"
+                    :names="cgdSupplierName"
+                    :disabled="type === 'view'"
+                    :isDetail="type !== 'add'"
+                    @searchChange="supplierCgdChange"
+                  />
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="8">
+                <el-form-item label="竞单人" prop="cgd_apply_id">
+                   <search-account
+                    :value="ruleForm.cgd_apply_id"
+                    :disabled="type === 'view'"
+                    :isDetail="type !== 'add'"
+                    :names="ruleForm.cgd_apply_name"
+                    :size="searchSize"
+                    :placeholder="'竞单人'"
+                    @searchChange="handleResignName"
+                  />
+                </el-form-item>
+              </el-col>
+            </template>
           </el-row>
 
           <el-row :span="24" v-show="is_noble">
@@ -1288,6 +1336,7 @@ export default {
   },
   data() {
     return {
+      hasAccount: false,
       isStockOptions,
       areaInfo: {
         delivery_place: {
@@ -1323,6 +1372,7 @@ export default {
       activeName: "1",
       loading: true,
       supplierName: "",
+      cgdSupplierName: "",
       options1: options1,
       options2: options2,
       options3: options3,
@@ -1348,6 +1398,26 @@ export default {
     this.initForm();
   },
   methods: {
+    async handleResignName(evt) {
+      const { id,label} = evt;
+      this.ruleForm.cgd_apply_id = id ? [id] : [];
+      this.ruleForm.cgd_apply_name = label || "";
+      this.$refs.ruleForm.validateField("cgd_apply_id")
+    },
+    number_change_origin(e){
+      this.ruleForm['supplier_origin_price'] = e + "" || "0";
+      this.$refs.ruleForm && this.$refs.ruleForm.validateField('supplier_origin_price');
+    },
+    supplierCgdChange(e){
+      const { id, code, label } = e;
+      if (id) {
+        this.ruleForm.cgd_supplier_code = [code];
+      } else {
+        this.ruleForm.cgd_supplier_code = [];
+      }
+
+      this.$refs.ruleForm.validateField("cgd_supplier_code");
+    },
     num_change(evt, index) {
       this.$set(this.childTableData, index, {
         ...this.childTableData[index],
@@ -1657,6 +1727,11 @@ export default {
               }
             }
 
+            model.supplier_origin_price = this.hasAccount ? model.supplier_origin_price : "";
+            model.cgd_apply_name = this.hasAccount ? model.cgd_apply_name : "";
+            model.cgd_apply_id = this.hasAccount ? model.cgd_apply_id[0] : "";
+            model.cgd_supplier_code = this.hasAccount ? model.cgd_supplier_code[0] : "";
+
             if (this.type === "add") {
               delete model["spuCode"];
               res = await asyncRequest.add(model);
@@ -1980,9 +2055,14 @@ export default {
       this.brand_name = "";
       this.unit_name = "";
       this.supplierName = "";
+      this.cgdSupplierName = ""
 
       this.ruleForm = {
         id: "",
+        supplier_origin_price: "0.00",
+        cgd_apply_id: [],
+        cgd_apply_name: "",
+        cgd_supplier_code: [],
         spuCode: "",
         cat_id: [],
         brandid: [],
@@ -2049,6 +2129,10 @@ export default {
           this.old_ladder_tableData = [];
           const {
             id,
+            supplier_origin_price,
+            cgd_apply_id,
+            cgd_apply_name,
+            cgd_supplier_code,
             companyName,
             spuCode, //string	商品spuCode
             // good_code, //string	无
@@ -2112,6 +2196,7 @@ export default {
             is_support_stock,
             is_combind,
             combind_list,
+            cgd_supplier_name
           } = this.sitem;
           console.log(good_img);
           if (this.type !== "add") {
@@ -2192,11 +2277,19 @@ export default {
           this.status = status;
           this.brand_name = brand_name;
           this.unit_name = unit;
+          
           this.supplierName = supplierName || "";
+          this.cgdSupplierName = cgd_supplier_name || "";
+
+
           console.log(good_img);
           console.log(good_info_img);
           this.ruleForm = {
             id: id || "",
+            supplier_origin_price: supplier_origin_price || "0.00",
+            cgd_apply_id: cgd_apply_id ? [cgd_apply_id] : [],
+            cgd_apply_name: cgd_apply_name ? cgd_apply_name : "",
+            cgd_supplier_code:cgd_supplier_code ? [cgd_supplier_code] : [],
             spuCode: spuCode || "",
             cat_id: cat_id && cat_id.length > 0 ? [cat_id[cat_id.length - 1]] : [],
             brandid: brand_id ? [brand_id] : [],
@@ -2440,7 +2533,8 @@ export default {
     },
     //供应商选择
     supplierNosearchChange(e) {
-      const { id, code, label } = e;
+      const { id, code, label,isPower } = e;
+      this.hasAccount = isPower;
       this.ruleForm.supplierNo = code ? [code] : [];
       this.$refs.ruleForm && this.$refs.ruleForm.validateField("supplierNo");
     },

+ 23 - 0
src/views/purchaseIn/workbench/columns.js

@@ -426,6 +426,29 @@ const rules = {
       trigger: "change",
     },
   ],
+  supplier_origin_price: [
+    {
+      required: true,
+      message: "请输入供货商采购成本价",
+      trigger: "change"
+    }
+  ],
+  cgd_apply_id:[
+    {
+      type:'array',
+      required: true,
+      message: "请选择竞单人",
+      trigger: "change"
+    }
+  ],
+  cgd_supplier_code: [
+    {
+      type: "array",
+      required: true,
+      message: "请选择采购供应商",
+      trigger: "change",
+    }
+  ]
 };
 export {
   options1,

+ 107 - 42
src/views/purchaseIn/workbench/components/baseForm.vue

@@ -34,9 +34,10 @@
             :value="ruleForm.supplierNo"
             :placeholder="'供应商'"
             :size="'mini'"
-            :names="supplierNo_name"
+            :names="cgd_supplier_name"
             :disabled="type === 'view'"
-            :isDetail="type !== 'add'"
+            :isDetail="true"
+            :isp="true"
             @searchChange="supplierNosearchChange"
           />
         </el-form-item>
@@ -449,6 +450,54 @@
         </el-form-item>
       </el-col>
 
+      <template v-if="hasAccount">
+        <el-col :span="8">
+          <el-form-item label="供应商采购成本" label-width="130px" prop="supplier_origin_price">
+            <digital-input
+              :values="ruleForm.supplier_origin_price"
+              :placeholder="'供应商采购成本'"
+              :min="0"
+              :disabled="type === 'view' || is_noble"
+              :max="100000000000"
+              :position="'right'"
+              :precision="2"
+              :size="'mini'"
+              :controls="false"
+              :append="'元'"
+              @reschange="number_change_origin($event)"
+            />
+        </el-form-item>
+       </el-col>
+
+        <el-col :span="8">
+          <el-form-item label="采购供应商" label-width="120px" prop="cgd_supplier_code">
+            <search-supplier
+              :value="ruleForm.cgd_supplier_code"
+              :placeholder="'采购供应商'"
+              :size="'mini'"
+              :names="cgd_supplierNo_name"
+              :disabled="type === 'view'"
+              :isDetail="true"
+              @searchChange="supplierCgdChange"
+            />
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="8">
+          <el-form-item label="竞单人" prop="cgd_apply_id">
+             <search-account
+              :value="ruleForm.cgd_apply_id"
+              :disabled="type === 'view'"
+              :isDetail="type !== 'add'"
+              :names="ruleForm.cgd_apply_name"
+              :size="searchSize"
+              :placeholder="'竞单人'"
+              @searchChange="handleResignName"
+            />
+          </el-form-item>
+        </el-col>
+      </template>
+
       <el-col :span="24" v-show="pid + '' === '6'">
         <el-col :span="6">
           <el-form-item label="金属重量" prop="noble_weight">
@@ -571,31 +620,6 @@
           </el-input>
         </el-form-item>
       </el-col>
-      <!-- <el-col :span="24">
-        <el-form-item
-          label="商品图片(<1mb)"
-          prop="good_img"
-          class="activity-upload"
-        >
-          <div class="btnupload" style="position: relative">
-            <img
-              v-if="ruleForm.good_img"
-              :src="ruleForm.good_img"
-              class="avatar"
-            />
-            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
-            <file-upload
-              class="Upload"
-              :accept="'.jpg,.png,.jpeg'"
-              :multiple="true"
-              :disabled="type === 'view'"
-              :uploadcondition="beforeAvatarUpload"
-              @UploadErrorEvent="UploadErrorEventgood_img"
-              @UploadSuccessEvent="UploadSuccessEventgood_img"
-            ></file-upload>
-          </div>
-        </el-form-item>
-      </el-col> -->
 
       <el-col :span="24">
         <el-form-item
@@ -697,6 +721,8 @@ export default {
 
   data() {
     return {
+      cgd_supplier_name:"",
+      hasAccount: false,
       areaInfo:{
         delivery_place:{
           code:[],
@@ -753,6 +779,12 @@ export default {
     this.initForm();
   },
   methods: {
+    async handleResignName(evt) {
+      const { id,label} = evt;
+      this.ruleForm.cgd_apply_id = id ? [id] : [];
+      this.ruleForm.cgd_apply_name = label || "";
+      this.$refs.ruleForm.validateField("cgd_apply_id")
+    },
     async areaChange(e,key) {
       const { code, area_code, label } = e
       this.ruleForm[key] = code ? code.split(',') : []
@@ -821,12 +853,15 @@ export default {
           delivery_fee
         ).toFixed(2);
       }
-      console.log(new Date().valueOf() + this.newPrice);
     },
 
+    number_change_origin(e){
+      this.ruleForm['supplier_origin_price'] = e + "" || "0";
+      this.$refs.ruleForm && this.$refs.ruleForm.validateField('supplier_origin_price');
+    },
     number_change(e, key) {
       this.ruleForm[key] = e + "" || "0";
-      this.$refs.ruleForm.validateField(key);
+      this.$refs.ruleForm.validateField && this.$refs.ruleForm.validateField(key);
       this.computedCost();
     },
     async initData() {
@@ -836,6 +871,11 @@ export default {
       });
       if (code === 0) {
         const {
+          cgd_supplier_name,
+          supplier_origin_price,
+          cgd_apply_id,
+          cgd_apply_name,
+          cgd_supplier_code,
           bidNo,
           good_name, //string	名称
           cat_id, //array 分类
@@ -880,6 +920,8 @@ export default {
           specinfo,
         } = JSON.parse(JSON.stringify(data));
 
+        this.hasAccount = supplier_origin_price && supplier_origin_price.length > 0;
+
         
         if(this.type !== 'add'){
           this.areaInfo.origin_place.code =    origin_place ? [origin_place.split(',')[2]] : []
@@ -901,12 +943,21 @@ export default {
           });
         }
         this.supplierNo_name = supplierName || "";
+        this.cgd_supplier_name = cgd_supplier_name || ""
+
+
+        // console.log(this.supplierNo_name)
+        // console.log(this.cgd_supplier_name)
         this.is_noble = is_gold_price === "1" && this.pid === "6";
         // this.is_noble = this.askItem.is_metal;
         this.brand_name = brand_name || "";
         this.unit_name = unit || "";
         const catId = String(cat_id ?? "");
         this.ruleForm = {
+          supplier_origin_price: supplier_origin_price || '0.00',
+          cgd_apply_id: cgd_apply_id ? [cgd_apply_id] : [],
+          cgd_apply_name: cgd_apply_name || "",
+          cgd_supplier_code: cgd_supplier_code ? [cgd_supplier_code] : [],
           infoNo: String(this.id ?? ""),
           bidNo: String(bidNo ?? ""),
           cat_id: catId ? [catId] : [],
@@ -968,14 +1019,7 @@ export default {
         return;
       }
 
-      // for (let key in this.ruleForm) {
-      //   console.log(this.rulesThis[key]);
-      //   console.log(
-      //     key + "---" + this.rulesThis[key][0].required + "-----" + this.ruleForm[key]
-      //   );
-      // }
       await this.$refs.ruleForm.validate(async (valid) => {
-        console.log(valid);
         if (valid) {
           if (!this.loading) {
             this.loading = true;
@@ -985,6 +1029,11 @@ export default {
               return;
             }
             let model = JSON.parse(JSON.stringify(this.ruleForm));
+            
+            model.supplier_origin_price = this.hasAccount ? model.supplier_origin_price : "";
+            model.cgd_apply_id = this.hasAccount ? model.cgd_apply_id[0] : "";
+            model.cgd_apply_name = this.hasAccount ? model.cgd_apply_name : "";
+            model.cgd_supplier_code = this.hasAccount ? model.cgd_supplier_code[0] : "";
             model.cat_id = model.cat_id[model.cat_id.length - 1];
             model.brandid = model.brandid.toString();
             model.supplierNo = model.supplierNo.toString();
@@ -1060,6 +1109,10 @@ export default {
           let good_img = this.askItem.good_img ? this.askItem.good_img.split(",") : [];
           //this.type === "add" ? this.askItem.unit_name : "";
           this.ruleForm = {
+            supplier_origin_price: "0.00",
+            cgd_apply_id: [],
+            cgd_apply_name: "",
+            cgd_supplier_code: [],
             infoNo: this.id || "",
             cat_id: this.type === "add" ? [this.askItem.cat_id] : [],
             supplierNo: [],
@@ -1068,11 +1121,7 @@ export default {
             delivery_day: "0", //物流时间
             work_day: "0", //生产工期
             brandid: [],
-            // this.type === "add" && this.askItem.brand_id
-            //   ? [this.askItem.brand_id]
-            //   : [],
             unit_id: [],
-            //this.type === "add" ? [this.askItem.unit] : [],
             weight: this.type === "add" ? this.askItem.total_weight : "0.000",
             tax: "",
             supply_area: "",
@@ -1246,15 +1295,27 @@ export default {
       }
       this.$refs.ruleForm.validateField("brandid");
     },
+    supplierCgdChange(e){
+      const { id, code, label } = e;
+      if (id) {
+        this.ruleForm.cgd_supplier_code = [code];
+      } else {
+        this.ruleForm.cgd_supplier_code = [];
+      }
+
+      this.$refs.ruleForm.validateField("cgd_supplier_code");
+    },
     //供应商选择
     supplierNosearchChange(e) {
-      console.log(e);
-      const { id, code, label } = e;
+      const { id, code, label ,isPower } = e;
+
       if (id) {
         this.ruleForm.supplierNo = [code];
       } else {
         this.ruleForm.supplierNo = [];
       }
+
+      this.hasAccount = isPower;
       this.$refs.ruleForm.validateField("supplierNo");
     },
     //税点选择
@@ -1391,6 +1452,10 @@ export default {
       this.brand_name = "";
       this.unit_name = "";
       this.ruleForm = {
+        supplier_origin_price: "0.00",
+        cgd_apply_id: [],
+        cgd_apply_name: "",
+        cgd_supplier_code: [],
         infoNo: "",
         cat_id: [],
         supplierNo: [],

+ 26 - 5
src/views/serviceParam/supplierBrand/addEdit.vue

@@ -26,7 +26,19 @@
             label-width="90px"
             class="demo-ruleForm"
           >
-            <el-form-item label="支持品牌" prop="brand_id">
+          <el-form-item label="供应商" prop="gyscode">
+            <search-supplier
+            :disabled="type === 'view' || type=== 'edit'"
+              :value="ruleForm.gyscode"
+              :names="supplierName"
+              :is-detail="true"
+               @searchChange="handleSupplierChange"
+               placeholder="供应商"
+               size="mini"
+             />
+          </el-form-item>
+
+          <el-form-item label="支持品牌" prop="brand_id">
               <search-brand
                 :value="ruleForm.brand_id"
                 :size="'mini'"
@@ -69,7 +81,7 @@
                     value-format="yyyy-MM-dd"
                     :picker-options="pickerOptions2"
                     style="width: 100%"
-                    @change="timeChange"
+                    @change="itemChange"
                   />
                 </el-form-item>
 
@@ -147,6 +159,7 @@ export default {
   data() {
     return {
       loading: false,
+      supplierName:[],
       title: '添加支持品牌',
       showModelThis: this.showModel,
       brand_name: '',
@@ -177,6 +190,7 @@ export default {
       rules: {
         gyscode: [
           {
+            type:'array',
             required: true,
             message: '供应商不能为空',
             trigger: 'change'
@@ -220,6 +234,11 @@ export default {
     }
   },
   methods: {
+    handleSupplierChange(evt){
+      const { code } = evt;
+      this.ruleForm.gyscode = code ? [code] : [];
+      this.$refs.ruleForm.validateField('gyscode');
+    },
     async initForm() {
       this.loading = true
       this.brand_name = ''
@@ -280,7 +299,7 @@ export default {
       this.ruleForm = {
         id: '',
         remark: '',
-        gyscode: this.sitem,
+        gyscode: [],
         brand_id: [],
         long: '1',
         starttime: '',
@@ -298,6 +317,7 @@ export default {
       if (code === 0) {
         const {
           id,
+          gysname,
           brand_book,
           brand_id,
           brand_name,
@@ -310,7 +330,7 @@ export default {
         this.brand_name = brand_name
         this.ruleForm = {
           id: id || '',
-          gyscode: gyscode,
+          gyscode: gyscode ? [gyscode] : [],
           brand_id: brand_id ? [brand_id] : [],
           long: long || '',
           starttime: starttime || '',
@@ -319,7 +339,7 @@ export default {
           remark: remark || ''
         }
 
-        console.log(starttime,endtime)
+        this.supplierName =  gysname
       } else if (code >= 100 && code <= 104) {
         await this.logout()
       } else {
@@ -332,6 +352,7 @@ export default {
           if (this.loading) return
           this.loading = true
           const model = JSON.parse(JSON.stringify(this.ruleForm))
+          model.gyscode = Array.isArray(model.gyscode) ? model.gyscode[0] : model.gyscode;
           model.brand_id = model.brand_id.toString()
           model.brand_book = model.brand_book.join(',')
           model.status = '1'

+ 6 - 1
src/views/serviceParam/supplierBrand/columns.js

@@ -5,6 +5,11 @@ export default [
     label: "供应商编号",
     minWidth: "140px",
   },
+  {
+    prop: "gysname",
+    label: "供应商名称",
+    minWidth: "140px",
+  },
   {
     prop: "brand_name",
     label: "品牌",
@@ -54,4 +59,4 @@ export default [
     _slot_: "operation",
   },
 
-]
+]

+ 34 - 23
src/views/serviceParam/supplierBrand/index.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="supplierBrand">
     <div class="supplierBrand_show_box" v-if="powers.some((i) => i == '001')">
-      <div class="role-list fl">
-        <supplierlist @change="supplierChange" />
-      </div>
-      <div class="rule-view fr">
+      <!-- <div class="role-list fl"> -->
+        <!-- <supplierlist @change="supplierChange" /> -->
+      <!-- </div> -->
+      <div class="rule-view">
         <ex-table
           v-loading="loading"
           :table="table"
@@ -29,8 +29,17 @@
             <div style="width: 100%">
               <el-row style="padding: 0 0 0 0px">
                 <el-col :span="24">
-                  <div class="fl" style="height: 28px; line-height: 28px">
-                    <span>供应商支持品牌:</span>
+                  <div class="fl" style="height: 28px; line-height: 28px;width:300px">
+                    <search-supplier
+                      :size="'mini'"
+                      :value="parmValue.gyscode"
+                      :disabled="false"
+                      :placeholder="'供应商名称'"
+                      :is-detail="true"
+                      :no-disabled="true"
+                      @searchChange="supplierChange"
+                    />
+                    <!-- :names="parmValue.supplierName" -->
                   </div>
                   <el-button
                     type="primary"
@@ -242,20 +251,18 @@ export default {
     };
   },
 
+  mounted(){
+    this.searchList();
+  },
   methods: {
-    async supplierChange(e) {
-      this.parmValue.page = 1;
-      this.parmValue.gyscode = e;
-      await this.searchList();
+    supplierChange(e){
+      const { code } = e;
+      this.parmValue.gyscode = code ? [code] : [];
+      this.searchList();
     },
-
     restSearch() {
       // 表格 - 分页
-      this.pageInfo = {
-        size: 15,
-        curr: 1,
-        total: 0,
-      };
+      this.pageInfo = { size: 15, curr: 1, total: 0 };
       this.parmValue.page = 1;
       this.parmValue.size = 15;
       this.parmValue.keyword = "";
@@ -263,10 +270,10 @@ export default {
       this.searchList();
     },
     openModal(id, isDetail) {
-      if (this.parmValue.gyscode === "") {
-        this.$message.warning("请选择供应商!");
-        return;
-      }
+      // if (this.parmValue.gyscode === "") {
+      //   this.$message.warning("请选择供应商!");
+      //   return;
+      // }
       this.modelId = id;
       this.isDetail = isDetail;
       this.sitem = this.parmValue.gyscode;
@@ -357,7 +364,10 @@ export default {
         return;
       }
       this.loading = true;
-      const { code, data, message } = await asyncRequest.list(this.parmValue);
+      const { code, data, message } = await asyncRequest.list({
+        ...this.parmValue,
+        gyscode:Array.isArray(this.parmValue.gyscode) ? this.parmValue.gyscode[0] : this.parmValue.gyscode,
+      });
       let scode = parseInt(code + "");
       if (scode === 0) {
         const { list, count } = data;
@@ -441,8 +451,9 @@ export default {
     }
     //右侧
     .rule-view {
-      height: calc(100% - 50px);
-      width: calc(100% - 320px);
+      width:100%;
+      // height: calc(100% - 50px);
+      // width: calc(100% - 320px);
       overflow-y: auto;
       padding: 10px 16px;
       @include scrollBar();

+ 120 - 0
src/views/serviceParam/supplierCat/CatModal.vue

@@ -0,0 +1,120 @@
+<template>
+  <el-dialog class="cat-modal"  top="6vh" width="800px" title="分类列表" :visible="_visible" @close="handleClose" append-to-body center>
+
+    <el-row class="cat-modal__header" gutter="10">
+      <el-col :span="8">
+        <el-input v-model="params.cat_name" size="mini" placeholder="分类名称" @change="pageInfo.page=1;onSearch()" />
+      </el-col>
+    </el-row>
+
+    <el-table size="mini" border v-loading="loading" :data="tableData" @selection-change="handleSelectionChange">
+      <el-table-column type="selection"  />
+      <el-table-column label="序号" type="index"  />
+      <el-table-column label="分类名称" prop="search"  />
+    </el-table>
+
+    <div class="cat-modal__bottom">
+      <el-pagination
+        size="mini"
+        @current-change="handleCurrentChange"
+        :current-page="pageInfo.page"
+        :page-size="pageInfo.size"
+        layout="total, prev, pager, next"
+        :total="pageInfo.total"
+        background
+      />
+      <el-button size="mini" type="primary" @click="submit">保存</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import asyncRequest from '@/apis/service/serviceParam/supplierCat'
+export default {
+  name: "CatModal",
+  props:['visible'],
+  computed:{
+    _visible:{
+      get(){
+        return this.visible;
+      },
+      set(newVal){
+        this.$emit('update:visible', newVal);
+      }
+    }
+  },
+  watch:{
+    visible:{
+      handler(newVisible){
+        if(!newVisible) return;
+        this.onSearch();
+      },
+      immediate: true
+    }
+  },
+  data(){
+    return {
+      params:{
+        cat_name: ""
+      },
+      selected:[],
+      tableData:[],
+      loading: false,
+      pageInfo:{
+        size: 10,
+        page: 1,
+        total:0
+      },
+    }
+  },
+  methods:{
+    submit(){
+      if(this.selected.length === 0) {
+        this.$message,warning("请选择分类");
+        return
+      }
+
+      this.$emit("selection-change",this.selected)
+      this._visible = false;
+    },
+    handleSelectionChange(data){
+      this.selected = data.map(({ id, search }) => ({ id, search }))
+    },
+    handleCurrentChange(page){
+      this.pageInfo.page = page;
+      this.onSearch();
+    },
+    handleClose(){
+      this._visible = false;
+    },
+    async onSearch(){
+      this.loading = true;
+      const { size,page } = this.pageInfo;
+      const result = await asyncRequest.cat_list({
+        size, page,
+        ...this.params
+      });
+
+      this.loading = false;
+      this.tableData = result.data.list;;
+      this.pageInfo.total = result.data.count;
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.cat-modal{
+
+  &__header {
+    display: flex;
+    margin-bottom: 10px;
+  }
+
+  &__bottom {
+    display: flex;
+    justify-content: space-between;
+    margin-top:10px;
+  }
+}
+</style>

+ 267 - 0
src/views/serviceParam/supplierCat/addEdit.vue

@@ -0,0 +1,267 @@
+<template>
+  <el-dialog
+    v-loading="loading"
+    :title="title"
+    :center="true"
+    align="left"
+    top="5vh"
+    width="600px"
+    append-to-body
+    :close-on-click-modal="false"
+    :visible.sync="showModelThis"
+    element-loading-text="拼命加载中"
+    element-loading-spinner="el-icon-loading"
+    element-loading-background="rgba(0, 0, 0, 0.8)"
+    @close="showModelThis = false"
+  >
+    <el-card style="margin: -20px 0 0 0">
+      <el-row :gutter="10">
+        <el-col :span="24">
+          <el-form
+            ref="ruleForm"
+            :model="ruleForm"
+            status-icon
+            :rules="rulesThis"
+            :size="'mini'"
+            label-width="90px"
+            class="demo-ruleForm"
+          >
+
+          <el-form-item label="供应商" prop="supplierNo">
+            <search-supplier
+              :value="ruleForm.supplierNo"
+               @searchChange="handleSupplierChange"
+               placeholder="供应商"
+             />
+          </el-form-item>
+
+          <el-form-item label="商品分类" prop="cat_id">
+            <el-table size="mini" border :data="catCollection" max-height="400px">
+              <el-table-column label="序号" type="index" width="60px" />
+              <el-table-column label="分类名称" prop="search" width="260" show-overflow-tooltip />
+              <el-table-column>
+                <template #header>
+                  操作
+                  <el-button size="mini" type="text" @click="visible = true">+</el-button>
+                </template>
+
+                <template slot-scope="scope">
+                  <el-button type="text" size="mini" @click="handleDeleteItem(scope.$index)">删除</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-form-item>
+
+
+            <el-col :span="24" style="text-align: right;">
+              <el-button
+                v-if="type !== 'view'"
+                :size="'small'"
+                type="primary"
+                @click="submitForm"
+              >保 存</el-button>
+              <el-button :size="'small'" @click="showModelThis = false">
+                {{
+                  type === "view" ? "关闭" : "取 消"
+                }}
+              </el-button>
+            </el-col>
+          </el-form>
+        </el-col>
+      </el-row>
+    </el-card>
+
+    <CatModal :visible.sync="visible" @selection-change="handleSelectionChange" />
+  </el-dialog>
+</template>
+<script>
+import asyncRequest from '@/apis/service/serviceParam/supplierCat'
+import resToken from '@/mixins/resToken'
+import CatModal from "./CatModal.vue"
+import dayjs from 'dayjs'
+export default {
+  name: 'Brand',
+  components: { CatModal },
+  mixins: [resToken],
+  props: ['showModel', 'id', 'type', 'sitem'],
+  data() {
+    return {
+      visible: false,
+      loading: false,
+      title: '添加支持分类',
+      showModelThis: this.showModel,
+      brand_name: '',
+      ruleForm: {
+        supplierNo:[],
+        cat_id:[]
+      },
+      catCollection: [],
+      rulesThis: this.rules,
+      rules: {
+        supplierNo:[{
+          type:'array',
+          required:true,
+          message:'请选择供应商'
+        }],
+        cat_id: [{
+          type:'array',
+          required:true,
+          message:'请添加供应商支持分类'
+        }]
+      }
+    }
+  },
+  watch: {
+    showModel: function(val) {
+      this.showModelThis = val
+      if (val) {
+        this.initForm()
+      }
+    },
+    showModelThis(val) {
+      if (!val) {
+        this.$emit('cancel')
+      }
+    }
+  },
+  methods: {
+    handleSupplierChange(evt){
+      const { code } = evt;
+      this.ruleForm.supplierNo = code ? [code] : [];
+      this.$refs.ruleForm.validateField('supplierNo');
+    },
+    handleSelectionChange(list){
+      const uniqueCatCollection = list.filter(({id}) => this.ruleForm.cat_id.indexOf(id) === -1);
+      this.ruleForm.cat_id = [...this.ruleForm.cat_id,...uniqueCatCollection.map(item => item.id)]
+      this.catCollection = [...this.catCollection,...uniqueCatCollection];
+      this.$refs.ruleForm.validateField('cat_id');
+    },
+    handleDeleteItem(index){
+      this.catCollection.splice(index,1);
+      this.ruleForm.cat_id.splice(index,1);
+      this.$refs.ruleForm.validateField('cat_id');
+    },
+    async initForm() {
+      this.loading = true
+      this.brand_name = ''
+      this.resetFormData()
+      if (this.type === 'add') {
+        this.rulesThis = this.rules
+        this.title = '添加支持分类'
+        await this.resetForm()
+      } else if (this.type === 'edit') {
+        this.rulesThis = this.rules
+        this.title = '修改支持分类'
+        await this.resetForm()
+        await this.initData()
+      } else {
+        this.rulesThis = {}
+        this.title = '查看支持分类'
+        await this.resetForm()
+        await this.initData()
+      }
+      this.loading = false
+    },
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields()
+          this.$refs.ruleForm.clearValidate()
+          this.resetFormData()
+        }
+      })
+    },
+    resetFormData() {
+      this.ruleForm = {
+        cat_id:[],
+        supplierNo:[]
+      }
+    },
+    async initData() {
+      this.loading = true
+      const { code, message, data } = await asyncRequest.detail({
+        id: this.id
+      })
+
+      this.loading = false
+      if (code === 0) {
+        const {
+          id,
+          brand_book,
+          brand_id,
+          brand_name,
+          long,
+          starttime,
+          endtime,
+          gyscode,
+          remark
+        } = data
+        this.brand_name = brand_name
+        this.ruleForm = {
+          id: id || '',
+          gyscode: gyscode,
+          brand_id: brand_id ? [brand_id] : [],
+          long: long || '',
+          starttime: starttime || '',
+          endtime: endtime || '',
+          brand_book: brand_book ? brand_book.split(',') : [],
+          remark: remark || ''
+        }
+
+        console.log(starttime,endtime)
+      } else if (code >= 100 && code <= 104) {
+        await this.logout()
+      } else {
+        this.$message.warning(message)
+      }
+    },
+    async submitForm() {
+      await this.$refs.ruleForm.validate(async valid => {
+        if (valid) {
+          if (this.loading) return
+          this.loading = true
+
+          const res = await asyncRequest.add({
+            supplierNo:Array.isArray(this.ruleForm.supplierNo) ? this.ruleForm.supplierNo[0] : this.ruleForm.supplierNo,
+            cat_id:this.ruleForm.cat_id
+          })
+
+          this.loading = false
+          const { code, message } = res
+          if (code === 0) {
+            this.showModelThis = false
+            // 刷新
+            this.$emit('refresh')
+          } else if (code >= 100 && code <= 104) {
+            await this.logout()
+          } else {
+            this.$message.warning(message)
+          }
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.btnupload {
+  margin-left: 5px !important;
+  margin-bottom: 5px !important;
+
+  .el-icon-close {
+    position: absolute;
+    top: 5px;
+    right: 5px;
+    cursor: pointer;
+
+    &:hover {
+      color: #409eff;
+    }
+  }
+}
+</style>

+ 43 - 0
src/views/serviceParam/supplierCat/columns.js

@@ -0,0 +1,43 @@
+export default [
+  // { type: "selection", fixed: "left", _noset_: true },
+  {
+    prop: "supplierNo",
+    label: "供应商编号",
+    minWidth: "140px",
+  },
+  {
+    prop: "supplierName",
+    label: "供应商名称",
+    minWidth: "140px",
+  },
+  {
+    prop: "cat",
+    label: "分类名称",
+    minWidth: "120px",
+  },
+  {
+    prop: "status",
+    label: "状态",
+    minWidth: "60px",
+    _slot_: "status",
+  },
+  {
+    prop: "creater",
+    label: "创建人",
+    minWidth: "60px",
+  },
+  {
+    prop: "addtime",
+    label: "添加时间",
+    minWidth: "145px",
+  },
+  {
+    prop: "",
+    label: "操作",
+    fixed: "right",
+    width: "60",
+    _noset_: true,
+    _slot_: "operation",
+  },
+
+]

+ 511 - 0
src/views/serviceParam/supplierCat/index.vue

@@ -0,0 +1,511 @@
+<template>
+  <div class="supplierBrand">
+    <div class="supplierBrand_show_box" v-if="powers.some((i) => i == '001')">
+      <div class="rule-view">
+        <ex-table
+          v-loading="loading"
+          :table="table"
+          :data="tableData"
+          :columns="columns"
+          :page="pageInfo"
+          :size="size"
+          @page-curr-change="handlePageChange"
+          @page-size-change="handleSizeChange"
+          @screen-reset="
+            pageInfo.curr = 1;
+            parmValue.page = 1;
+            searchList();
+          "
+          @screen-submit="
+            pageInfo.curr = 1;
+            parmValue.page = 1;
+            searchList();
+          "
+        >
+          <template #table-header="{}">
+            <div style="width: 100%">
+              <el-row style="padding: 0 0 0 0px">
+                <el-col :span="24">
+                  <div class="fl" style="height: 28px; line-height: 28px;display:flex">
+                    <search-supplier
+                      style="margin-right:10px;width:260px"
+                      :size="'mini'"
+                      :value="parmValue.supplierNo"
+                      :disabled="false"
+                      :placeholder="'供应商名称'"
+                      :is-detail="true"
+                      :no-disabled="true"
+                      @searchChange="supplierChange"
+                    />
+
+                    <el-select v-model="parmValue.status" style="margin-right: 10px;width:90px" size="mini" clearable placeholder="状态" 
+                       @change="pageInfo.curr = 1;parmValue.page = 1;searchList();"
+                    >
+                      <el-option label="启用" value="1" />
+                      <el-option label="禁用" value="0" />
+                    </el-select>
+
+                    <el-input v-model="parmValue.creater" style="margin-right: 10px;width:120px" size="mini" placeholder="创建人" clearable
+                       @change="pageInfo.curr = 1;parmValue.page = 1;searchList();"
+                    />
+
+                    <period-date-picker
+                      :start="parmValue.start"
+                      :end="parmValue.end"
+                      :type="1"
+                      :width="'135px'"
+                      :size="searchSize"
+                      @timeReturned="timeReturned($event)"
+                    />
+                  </div>
+
+                  <el-button
+                    type="primary"
+                    class="fr"
+                    style="margin: 0 0 0 10px"
+                    :size="searchSize"
+                    @click="searchList"
+                  >
+                    刷新
+                  </el-button>
+
+                  <el-button
+                    type="warning"
+                    style="margin: 0 0 0 10px"
+                    :size="searchSize"
+                    class="fr"
+                    @click="restSearch"
+                  >
+                    重置
+                  </el-button>
+                  <el-button
+                    v-if="powers.some((i) => i == '003')"
+                    type="success"
+                    class="fr"
+                    style="margin: 0 0 0 10px"
+                    :size="searchSize"
+                    @click="openModal(-1, 'add')"
+                  >
+                    添加
+                  </el-button></el-col
+                >
+              </el-row>
+            </div>
+          </template>
+          <template #status="{ scope }">
+            <el-tag
+              :size="tablebtnSize"
+              :type="scope.row.status == '0' ? 'warning' : ''"
+              v-text="
+                (options2.find((item) => item.id == scope.row.status) || {}).name || '--'
+              "
+            ></el-tag>
+          </template>
+          
+          <template #operation="{ scope }">
+            <!-- <el-tooltip
+              effect="dark"
+              content="详情"
+              v-if="powers.some((i) => i == '007')"
+              placement="top"
+            >
+              <i
+                class="el-icon-view tb-icon"
+                @click="openModal(scope.row.id, 'view')"
+              ></i>
+            </el-tooltip>
+            <el-tooltip
+              effect="dark"
+              content="修改"
+              v-if="powers.some((i) => i == '005') && scope.row.status + '' === '0'"
+              placement="top"
+            >
+              <i
+                class="el-icon-edit tb-icon"
+                @click="openModal(scope.row.id, 'edit')"
+              ></i> </el-tooltip > -->
+              <el-tooltip
+              v-if="powers.some((i) => i == '004') && scope.row.status + '' === '1'"
+              effect="dark"
+              content="禁用"
+              placement="top"
+            >
+              <i
+                class="el-icon-video-pause tb-icon"
+                @click="changeStatus(scope.row.id, scope.row.status)"
+              ></i>
+            </el-tooltip>
+            <el-tooltip
+              v-if="powers.some((i) => i == '004') && scope.row.status + '' === '0'"
+              effect="dark"
+              content="启用"
+              placement="top"
+            >
+              <i
+                class="el-icon-video-play tb-icon"
+                @click="changeStatus(scope.row.id, scope.row.status)"
+              ></i> </el-tooltip
+            >
+            <!-- <el-tooltip
+              effect="dark"
+              content="删除"
+              placement="top"
+              v-if="powers.some((i) => i == '006') && scope.row.status + '' === '0'"
+            >
+              <i class="el-icon-delete tb-icon" @click="deleteItem(scope.row.id)"></i>
+            </el-tooltip> -->
+          </template>
+        </ex-table>
+        <add-edit
+          :id="modelId"
+          :type="isDetail"
+          :showModel="showModel"
+          :sitem="sitem"
+          @cancel="showModel = false"
+          @refresh="(showModel = false), searchList()"
+        />
+      </div>
+    </div>
+
+    <no-auth v-else></no-auth>
+  </div>
+</template>
+<script>
+import asyncRequest from "@/apis/service/serviceParam/supplierCat";
+import { statusList } from "@/assets/js/statusList";
+import mixinPage from "@/mixins/elPaginationHandle";
+import { mapGetters } from "vuex";
+import supplierlist from "./supplierlist";
+import addEdit from "./addEdit";
+import resToken from "@/mixins/resToken";
+import columns from "./columns";
+export default {
+  name: "supplierBrand",
+  mixins: [mixinPage, resToken],
+  components: {
+    supplierlist,
+    addEdit,
+  },
+  computed: {
+    //组件SIZE设置
+    ...mapGetters(["tablebtnSize", "searchSize", "size"]),
+    powers() {
+      const tran =
+        this.$store.getters.btnList.find((item) => item.menu_route == "supplierBrand") ||
+        {};
+      const { action } = tran ?? {};
+      return action ?? [];
+    },
+  },
+  data() {
+    return {
+      statusList: statusList,
+      options1: [
+        { id: "0", name: "长期" },
+        { id: "1", name: "非长期" },
+      ],
+      options2: [
+        { id: "0", name: "禁用" },
+        { id: "1", name: "启用" },
+      ],
+      showModel: false,
+      modelSitem: null,
+      modelId: "",
+      modelType: "",
+      selectLoading: false,
+      loading: true,
+      showModelThis: false,
+      parmValue: {
+        supplierNo: [],
+        start:"",
+        end:"",
+        status: "",
+        creater: "", // 供应商code
+        page: 1, // 页码
+        size: 15, // 每页显示条数
+      },
+      tableData: [],
+      passwordModel: false,
+      passwordModelId: 0,
+      isPasswordDetail: false,
+      // 表格 - 数据
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        // _defaultHeader_: ["setcol"],
+      },
+      // 表格 - 分页
+      pageInfo: {
+        size: 15,
+        curr: 1,
+        total: 0,
+      },
+      // 表格 - 列参数
+      columns,
+    };
+  },
+
+  mounted(){
+    this.searchList();
+  },
+  methods: {
+    supplierChange(e){
+      const { code } = e;
+      this.parmValue.supplierNo = code ? [code] : [];
+      this.searchList();
+    },
+    restSearch() {
+      // 表格 - 分页
+      this.pageInfo = { size: 15, curr: 1, total: 0 };
+      this.parmValue.page = 1;
+      this.parmValue.size = 15;
+      this.parmValue.supplierNo = [];
+      this.parmValue.start = "";
+      this.parmValue.end = "";
+      this.parmValue.status = "";
+      this.parmValue.creater = "";
+      this.searchList();
+    },
+    openModal(id, isDetail) {
+      this.modelId = id;
+      this.isDetail = isDetail;
+      this.showModel = true;
+    },
+
+    gotoEdit(row, type) {
+      const { status } = row;
+      if (type === "005" && status + '' === "1") {
+        this.$message.warning("禁用后,才可以修改!");
+        return;
+      }
+      this.routeGoto("supplierBrandDetail", {
+        id: row.code,
+        type: "edit",
+      });
+    },
+    /**
+     * 启用/禁用
+     * @param {String} id id
+     * @param {String} status 0-禁用 1-启用
+     */
+    async changeStatus(id, status) {
+      await this.$confirm(`确定要改为${status + '' === "1" ? "禁用" : "启用"}?`, {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          this.loading = true;
+          const model = {
+            id: id, status: status + '' === "1" ? "0" : "1",
+          };
+          const res = await asyncRequest.status(model);
+          if (res && res.code === 0) {
+            this.loading = false;
+            this.$notify.success({
+              title: "状态修改成功!",
+              message: "",
+            });
+            await this.searchList();
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.loading = false;
+            this.$message.warning(res.message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+    async deleteItem(id) {
+      await this.$confirm("确定要删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async () => {
+          const model = {
+            id: id,
+          };
+          const res = await asyncRequest.delete(model);
+          if (res && res.code === 0) {
+            this.$notify.success({
+              title: "删除成功",
+              message: "",
+            });
+            this.searchList();
+          } else if (res && res.code >= 100 && res.code <= 104) {
+            await this.logout();
+          } else {
+            this.$message.warning(res.message);
+          }
+        })
+        .catch(() => {
+          console.log("取消");
+        });
+    },
+    async timeReturned(e) {
+      if (e.startTime !== "") {
+        this.parmValue.start = e.startTime;
+      } else {
+        this.parmValue.start = "";
+      }
+
+      if (e.endTime !== "") {
+        this.parmValue.end = e.endTime;
+      } else {
+        this.parmValue.end = "";
+      }
+
+      await this.searchList();
+    },
+    // 刷新表格
+    async searchList() {
+      if (
+        (this.parmValue.start !== "" && this.parmValue.end === "") ||
+        (this.parmValue.start === "" && this.parmValue.end !== "")
+      ) {
+        this.$message.warning("时间区间不完整!");
+        return;
+      }
+
+      this.loading = true;
+      const { code, data, message } = await asyncRequest.list({
+        ...this.parmValue,
+        supplierNo:Array.isArray(this.parmValue.supplierNo) ? this.parmValue.supplierNo[0] : ""
+      });
+      
+       let scode = parseInt(code + "");
+      if (scode === 0) {
+        const { list, count } = data;
+        this.tableData = list;
+        this.pageInfo.total = Number(count + "");
+      } else if (scode >= 100 && scode <= 104) {
+        await this.logout();
+      } else {
+        this.tableData = [];
+        this.pageInfo.total = 0;
+      }
+      this.loading = false;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+@import "~@/styles/mixin.scss";
+.supplierBrand {
+  position: relative;
+  width: 100%;
+  height: calc(100vh - 50px);
+  overflow: hidden;
+
+  .supplierBrand_show_box {
+    // position: relative;
+    // height: calc(100% - 50px);
+    // min-height: calc(100% - 50px);
+
+    display: relative;
+    width: 100%;
+    height: 100%;
+    // height: calc(100vh - 50px);
+    // overflow: hidden;
+    // text-align: left;
+    //左侧
+    .role-list {
+      height: 100%;
+      overflow-y: auto;
+      width: 320px;
+      // padding: 8px 16px;
+      min-height: 100%;
+      flex-shrink: 0;
+      border-right: 2px solid #dfe6ec;
+      @include scrollBar();
+      &::after {
+        content: "";
+        position: absolute;
+        top: 0;
+        right: 0;
+        height: 100%;
+        width: 2px;
+        background-color: #e4e7ed;
+        z-index: 1;
+      }
+      .role-list__title {
+        color: #b4b6c0;
+        line-height: 32px;
+      }
+      .role-list__item {
+        position: relative;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+        overflow: hidden;
+        height: 32px;
+        line-height: 32px;
+        padding-left: 8px;
+        color: rgb(48, 49, 51);
+        cursor: pointer;
+        i {
+          position: absolute;
+          right: 0;
+          line-height: 32px;
+        }
+      }
+      .role-list__item.active {
+        color: #6954f0;
+        background: #f7f7f7;
+      }
+    }
+    //右侧
+    .rule-view {
+      width:100%;
+      // height: calc(100% - 50px);
+      // width: calc(100% - 320px);
+      overflow-y: auto;
+      padding: 10px 16px;
+      @include scrollBar();
+      .rule-list {
+        border-right: 1px solid #dfe6ec;
+        .title {
+          padding: 18px 18px 12px 18px;
+          border-bottom: 1px dashed #dfe6ec;
+          font-size: 15px;
+          color: #000;
+        }
+        .main {
+          padding: 18px 18px 12px 18px;
+          border-bottom: 1px solid #dfe6ec;
+        }
+        .main-title {
+          width: 80px;
+        }
+        .main-item {
+          width: calc(100% - 80px);
+        }
+      }
+    }
+    .rule-bottom {
+      padding: 10px 18px 8px 0;
+      background: #fff;
+      width: calc(100% - 200px);
+      position: absolute;
+      text-align: right;
+      bottom: 0;
+      right: 0;
+      &::before {
+        content: "";
+        position: absolute;
+        top: 0;
+        right: 0;
+        height: 2px;
+        width: 100%;
+        background-color: #e4e7ed;
+        z-index: 1;
+      }
+    }
+  }
+}
+</style>

+ 230 - 0
src/views/serviceParam/supplierCat/supplierlist.vue

@@ -0,0 +1,230 @@
+<template>
+  <div v-loading="loading" class="supplier-list">
+    <div class="role-list__title">
+      <p class="title">
+        <span class="font">供应商列表</span>
+
+        <el-button
+          type="warning"
+          class="fr"
+          size="mini"
+          @click="restSearch"
+        >重置</el-button>
+      </p>
+      <p class="search">
+        <el-input
+          v-model="parmValue.name"
+          placeholder="供应商名称"
+          class="input-with-select"
+          size="small"
+          @blur="
+            parmValue.page = 1;
+            pageInfo.curr = 1;
+            searchList();
+          "
+        >
+          <el-button
+            slot="append"
+            icon="el-icon-search"
+            @click="
+              parmValue.page = 1;
+              pageInfo.curr = 1;
+              searchList();
+            "
+          />
+        </el-input>
+      </p>
+    </div>
+    <div class="data-show">
+      <p
+        v-if="tableData.length == 0"
+        style="line-height: 60px; text-align: center; color: #909399"
+      >
+        暂无数据
+      </p>
+      <ul v-else class="main">
+        <li
+          v-for="(item, index) in tableData"
+          :key="'supplier' + index"
+          class="role-list__item"
+          :class="{ active: item.code == activeCode }"
+          @click="switchRoleHandle(item.code)"
+        >
+          {{ item.name }}
+        </li>
+      </ul>
+    </div>
+
+    <div class="Pagination tc" style="bottom:-100px">
+      <el-pagination
+        :current-page="pageInfo.curr"
+        :size="'small'"
+        layout="total,  jumper"
+        :total="pageInfo.total"
+        @current-change="currentChange"
+      />
+    </div>
+  </div>
+</template>
+<script>
+import asyncRequest from '@/apis/service/serviceParam/supplierAccount'
+import mixinPage from '@/mixins/elPaginationHandle'
+import { mapGetters } from 'vuex'
+
+import resToken from '@/mixins/resToken'
+export default {
+  name: 'SupplierAccount',
+  mixins: [mixinPage, resToken],
+
+  computed: {
+    // 组件SIZE设置
+    ...mapGetters(['tablebtnSize', 'searchSize', 'size'])
+  },
+  data() {
+    return {
+      loading: false,
+      activeCode: '',
+      parmValue: {
+        page: 1, // 页码
+        size: 20, // 每页显示条数
+        start: '',
+        end: '',
+        status: '',
+        creater: '',
+        company_name: '',
+        name: '',
+        ocr_status: ''
+      },
+
+      // 表格 - 数据
+      tableData: [],
+      // 表格 - 参数
+      table: {
+        stripe: true,
+        border: true,
+        _defaultHeader_: ['setcol']
+      },
+      // 表格 - 分页
+      pageInfo: {
+        size: 20,
+        curr: 1,
+        total: 0
+      }
+    }
+  },
+  mounted() {
+    this.searchList()
+  },
+  methods: {
+    restSearch() {
+      // 表格 - 分页
+      this.pageInfo = {
+        size: 20,
+        curr: 1,
+        total: 0
+      }
+      this.parmValue = {
+        page: 1, // 页码
+        size: 20, // 每页显示条数
+        start: '',
+        end: '',
+        status: '',
+        company_name: '', // 创建人部门
+        creater: '',
+        name: '',
+        person: '',
+        ocr_status: ''
+      }
+      this.searchList()
+    },
+    switchRoleHandle(code) {
+      this.activeCode = code
+      this.$emit('change', code)
+    },
+    async currentChange(e) {
+      this.parmValue.page = e
+      this.pageInfo.curr = e
+      await this.searchList()
+    },
+    // 刷新表格
+    async searchList() {
+      if (this.loading) return
+      this.activeCode = ''
+      this.loading = true
+      const { code, data } = await asyncRequest.slist(this.parmValue)
+      const scode = parseInt(code)
+      if (scode === 0) {
+        const { list, count } = data
+        this.tableData = list
+        this.pageInfo.total = Number(count + '')
+        if (list.length !== 0) {
+          this.switchRoleHandle(list[0].code)
+        } else {
+          this.switchRoleHandle('')
+        }
+      } else if (scode >= 100 && scode <= 104) {
+        await this.logout()
+      } else {
+        this.tableData = []
+        this.pageInfo.total = 0
+      }
+      this.loading = false
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.supplier-list {
+  position: relative;
+  width: 100%;
+  height: 100%;
+  .role-list__title {
+    width: 100%;
+    top: 0;
+    left: 0;
+    padding: 12px 16px;
+    background: #f7f7f7;
+    position: absolute;
+    z-index: 2;
+    margin: 0 0 10px 0;
+    p.title {
+      height: 35px;
+      line-height: 29px;
+      padding-left: 5px;
+      span.font {
+        font-size: 16px;
+        font-weight: bolder;
+      }
+    }
+  }
+  .data-show {
+    padding: 100px 16px 70px 16px;
+    .main {
+      li {
+        height: 33px;
+        line-height: 33px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        &:hover {
+          cursor: pointer;
+        }
+        &.active {
+          color: #6954f0;
+          // background: #f7f7f7;
+        }
+      }
+    }
+  }
+
+  .Pagination {
+    background: #f7f7f7;
+    position: absolute;
+    z-index: 2;
+    bottom: 0;
+    left: 0;
+    padding: 12px 0 18px 0;
+    width: 100%;
+  }
+}
+</style>

+ 0 - 0
src/views/serviceParam/supplierCat/供应商支持分类


+ 23 - 0
src/views/supplierPurchaseIn/supplierWorkbench/columns.js

@@ -426,6 +426,29 @@ const rules = {
       trigger: "change",
     },
   ],
+  supplier_origin_price: [
+    {
+      required: true,
+      message: "请输入供货商采购成本价",
+      trigger: "change"
+    }
+  ],
+  cgd_apply_id:[
+    {
+      type:'array',
+      required: true,
+      message: "请选择竞单人",
+      trigger: "change"
+    }
+  ],
+  cgd_supplier_code: [
+    {
+      type: "array",
+      required: true,
+      message: "请选择采购供应商",
+      trigger: "change",
+    }
+  ]
 };
 export {
   options1,

+ 90 - 3
src/views/supplierPurchaseIn/supplierWorkbench/components/baseForm.vue

@@ -448,6 +448,54 @@
         </el-form-item>
       </el-col>
 
+      <template v-if="hasAccount">
+        <el-col :span="8">
+          <el-form-item label="供应商采购成本" label-width="130px" prop="supplier_origin_price">
+            <digital-input
+              :values="ruleForm.supplier_origin_price"
+              :placeholder="'供应商采购成本'"
+              :min="0"
+              :disabled="type === 'view' || is_noble"
+              :max="100000000000"
+              :position="'right'"
+              :precision="2"
+              :size="'mini'"
+              :controls="false"
+              :append="'元'"
+              @reschange="number_change_origin($event)"
+            />
+        </el-form-item>
+       </el-col>
+
+        <el-col :span="8">
+          <el-form-item label="采购供应商" label-width="120px" prop="cgd_supplier_code">
+            <search-supplier
+              :value="ruleForm.cgd_supplier_code"
+              :placeholder="'采购供应商'"
+              :size="'mini'"
+              :names="cgd_supplierNo_name"
+              :disabled="type === 'view'"
+              :isDetail="true"
+              @searchChange="supplierCgdChange"
+            />
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="8">
+          <el-form-item label="竞单人" prop="cgd_apply_id">
+             <search-account
+              :value="ruleForm.cgd_apply_id"
+              :disabled="type === 'view'"
+              :isDetail="type !== 'add'"
+              :names="ruleForm.cgd_apply_name"
+              :size="searchSize"
+              :placeholder="'竞单人'"
+              @searchChange="handleResignName"
+            />
+          </el-form-item>
+        </el-col>
+      </template>
+
       <el-col :span="24" v-show="pid + '' === '6'">
         <el-col :span="6">
           <el-form-item label="金属重量" prop="noble_weight">
@@ -697,6 +745,7 @@ export default {
 
   data() {
     return {
+      hasAccount: false,
       areaInfo:{
         delivery_place:{
           code:[],
@@ -754,6 +803,26 @@ export default {
     this.initForm();
   },
   methods: {
+    number_change_origin(e){
+      this.ruleForm['supplier_origin_price'] = e + "" || "0";
+      this.$refs.ruleForm && this.$refs.ruleForm.validateField('supplier_origin_price');
+    },
+    async handleResignName(evt) {
+      const { id,label} = evt;
+      this.ruleForm.cgd_apply_id = id ? [id] : [];
+      this.ruleForm.cgd_apply_name = label || "";
+      this.$refs.ruleForm.validateField("cgd_apply_id")
+    },
+    supplierCgdChange(e){
+      const { id, code, label } = e;
+      if (id) {
+        this.ruleForm.cgd_supplier_code = [code];
+      } else {
+        this.ruleForm.cgd_supplier_code = [];
+      }
+
+      this.$refs.ruleForm.validateField("cgd_supplier_code");
+    },
     async areaChange(e, key) {
       const { code, area_code, label } = e
       this.ruleForm[key] = code ? code.split(',') : []
@@ -839,7 +908,6 @@ export default {
           delivery_fee
         ).toFixed(2);
       }
-      console.log(new Date().valueOf() + this.newPrice);
     },
 
     number_change(e, key) {
@@ -855,6 +923,11 @@ export default {
       if (code === 0) {
         const {
           bidNo,
+          cgd_supplier_name,
+          supplier_origin_price,
+          cgd_apply_id,
+          cgd_apply_name,
+          cgd_supplier_code,
           good_name, //string	名称
           cat_id, //array 分类
           cat_info,
@@ -898,6 +971,8 @@ export default {
           specinfo,
         } = JSON.parse(JSON.stringify(data));
 
+        this.hasAccount = supplier_origin_price && supplier_origin_price.length > 0;
+
         if(this.type !== 'add'){
           this.areaInfo.origin_place.code =    origin_place ? [origin_place.split(',')[2]] : []
           this.areaInfo.origin_place.label =   origin_place_cn ? [origin_place_cn] : []
@@ -924,6 +999,10 @@ export default {
         this.brand_name = brand_name || "";
         this.unit_name = unit || "";
         this.ruleForm = {
+          supplier_origin_price: supplier_origin_price || '0.00',
+          cgd_apply_id: cgd_apply_id ? [cgd_apply_id] : [],
+          cgd_apply_name: cgd_apply_name || "",
+          cgd_supplier_code: cgd_supplier_code ? [cgd_supplier_code] : [],
           infoNo: this.id || "",
           bidNo: bidNo || "",
           infoNo: this.id || "",
@@ -1003,6 +1082,11 @@ export default {
               return;
             }
             let model = JSON.parse(JSON.stringify(this.ruleForm));
+            model.supplier_origin_price = this.hasAccount ? model.supplier_origin_price : "";
+            model.cgd_apply_id = this.hasAccount ? model.cgd_apply_id[0] : "";
+            model.cgd_apply_name = this.hasAccount ? model.cgd_apply_name : "";
+            model.cgd_supplier_code = this.hasAccount ? model.cgd_supplier_code[0] : "";
+
             model.cat_id = model.cat_id[model.cat_id.length - 1];
             model.brandid = model.brandid.toString();
             model.supplierNo = model.supplierNo.toString();
@@ -1266,8 +1350,11 @@ export default {
     },
     //供应商选择
     supplierNosearchChange(e) {
-      console.log(e);
-      const { id, code, label } = e;
+      const { id, code, label,isPower } = e;
+
+      console.log(isPower,'--')
+      this.hasAccount = isPower;
+
       if (id) {
         this.ruleForm.supplierNo = [code];
       } else {