戴艳蓉 3 éve
szülő
commit
4fda07b063
1 módosított fájl, 73 hozzáadás és 102 törlés
  1. 73 102
      src/views/goodStore/goodsCost/index.vue

+ 73 - 102
src/views/goodStore/goodsCost/index.vue

@@ -37,15 +37,15 @@
             <el-col :span="4" style="width: 135px">
               <search-brand
                 :value="brandid"
-                :disabled="type === 'view' || type === 'editCoin'"
+                :disabled="false"
                 :size="'mini'"
-                :isDetail="type !== 'add'"
-                :names="brand_name"
+                :isDetail="false"
+                :names="''"
                 :placeholder="'商品品牌'"
                 @searchChange="brandidsearchChange"
               />
             </el-col>
-            <el-col :span="6" style="width: 373px; padding: 0 0 0 10px">
+            <el-col :span="6" style="width: 310px; padding: 0 0 0 10px">
               <good-class
                 :value="parmValue.cat_id"
                 @handleChange="goods_class_change"
@@ -65,17 +65,38 @@
                 刷新
               </el-button>
             </el-col>
+            <el-col
+              :span="3"
+              class="fr"
+              style="width: 66px; padding: 0 0 0 10px"
+            >
+              <el-button type="warning" :size="searchSize" @click="restSearch">
+                重置
+              </el-button>
+            </el-col>
           </el-row>
           <el-row>
-            <el-col :span="4" style="width: 373px">
-              <search-supplier
-                :value="supplierNo"
-                :placeholder="'供应商'"
-                :disabled="false"
+            <el-col :span="4" style="width: 226px">
+              <el-select
+                v-model="parmValue.status"
+                filterable
+                clearable
                 :size="searchSize"
-                :isDetail="false"
-                @searchChange="supplierNosearchChange"
-              />
+                placeholder="状态"
+                style="width: 100%"
+                @change="
+                  pageInfo.curr = 1;
+                  parmValue.page = 1;
+                  searchList();
+                "
+              >
+                <el-option
+                  v-for="item in statusList"
+                  :key="'status' + item.code"
+                  :label="item.name"
+                  :value="item.code"
+                />
+              </el-select>
             </el-col>
             <el-col :span="4" style="width: 145px; padding: 0 0 0 10px">
               <el-select
@@ -99,31 +120,10 @@
                 />
               </el-select>
             </el-col>
-            <el-col :span="4" style="width: 373px; padding: 0 0 0 10px">
-              <search-work-company
-                :value="parmValue.company_id"
-                :placeholder="'业务公司'"
-                :disabled="false"
-                :size="searchSize"
-                :isDetail="false"
-                @searchChange="company_idsearchChange"
-              />
-            </el-col>
-            <el-col
-              :span="3"
-              class="fr"
-              style="width: 66px; padding: 0 0 0 10px"
-            >
-              <el-button type="warning" :size="searchSize" @click="restSearch">
-                重置
-              </el-button>
-            </el-col>
-          </el-row>
-          <el-row style="padding: 10px 0 0 0">
-            <el-col :span="4" style="width: 518px">
+            <el-col :span="4" style="width: 450px; padding: 0 0 0 10px">
               <el-input
                 :size="searchSize"
-                v-model="parmValue.name"
+                v-model="sinput"
                 :maxlength="40"
                 @blur="
                   pageInfo.curr = 1;
@@ -138,31 +138,12 @@
                   placeholder="关键字类型"
                 >
                   <el-option label="商品编号" value="1" />
-                  <el-option label="商品名称" value="2" /> </el-select
+                  <el-option label="商品名称" value="2" />
+                  <el-option label="业务企业编号" value="3" />
+                  <el-option label="供应商编号" value="4" /> </el-select
               ></el-input>
             </el-col>
-            <el-col :span="4" style="width: 210px; padding: 0 0 0 10px">
-              <el-select
-                v-model="parmValue.status"
-                filterable
-                clearable
-                :size="searchSize"
-                placeholder="状态"
-                style="width: 100%"
-                @change="
-                  pageInfo.curr = 1;
-                  parmValue.page = 1;
-                  searchList();
-                "
-              >
-                <el-option
-                  v-for="item in statusList"
-                  :key="'status' + item.code"
-                  :label="item.name"
-                  :value="item.code"
-                />
-              </el-select>
-            </el-col>
+
             <el-col
               :span="3"
               class="fr"
@@ -180,7 +161,6 @@
                 添加
               </el-button>
             </el-col>
-          
           </el-row>
         </div></template
       >
@@ -193,7 +173,7 @@
           v-viewer
         >
           <img
-            :src="scope.row.good_thumb_img" 
+            :src="scope.row.good_thumb_img"
             style="display: inline-block; width: 100%; height: 100%"
             alt=""
           />
@@ -202,7 +182,7 @@
       <template #status="{ scope }">
         <el-tag
           :size="tablebtnSize"
-          :type="scope.row.status == '0' ? '' : 'warning'"
+          :type="scope.row.status == '1' ? '' : 'warning'"
           v-text="
             (statusList.find((item) => item.code == scope.row.status) || {})
               .name || '--'
@@ -338,9 +318,17 @@ export default {
         start: "",
         end: "",
         status: "",
-        creater: "",
+        good_name: "",
+        spucode: "",
+        cat_id: "",
+        brandid: "",
+        good_type: "",
+        companyNo: "",
+        supplierNo: "",
+        // creater: "",
       },
-
+      sinput: "",
+      select: "",
       // 表格 - 数据
       tableData: [],
       // 表格 - 参数
@@ -385,37 +373,16 @@ export default {
         start: "",
         end: "",
         status: "",
-        creater: "",
+        good_name: "",
+        spucode: "",
+        cat_id: "",
+        brandid: "",
+        good_type: "",
+        companyNo: "",
+        supplierNo: "",
       };
       this.searchList();
     },
-    
-    //供应商选择
-    async supplierNosearchChange(e) {
-      console.log(e);
-      const { id, code, label } = e;
-      if (id) {
-        this.supplierNo = [code];
-      } else {
-        this.supplierNo = [code];
-      }
-      this.parmValue.supplierNo = this.supplierNo.toString();
-      this.pageInfo.curr = 1;
-      this.parmValue.page = 1;
-      await this.searchList();
-    },
-    //业务企业选择
-    async company_idsearchChange(e) {
-      const { id, code, label } = e;
-      if (id) {
-        this.parmValue.company_id = code;
-      } else {
-        this.parmValue.company_id = "";
-      }
-      this.pageInfo.curr = 1;
-      this.parmValue.page = 1;
-      await this.searchList();
-    },
     //商品品牌选择
     async brandidsearchChange(e) {
       const { id, code, label } = e;
@@ -424,7 +391,7 @@ export default {
       } else {
         this.brandid = [];
       }
-      this.ruleForm.brandid = this.this.brandid.toString();
+      this.parmValue.brandid = this.brandid.toString();
       this.pageInfo.curr = 1;
       this.parmValue.page = 1;
       await this.searchList();
@@ -508,16 +475,20 @@ export default {
     // 刷新表格
     async searchList() {
       this.loading = true;
+      this.parmValue.spucode = this.select === "1" ? this.sinput : "";
+      this.parmValue.good_name = this.select === "2" ? this.sinput : "";
+      this.parmValue.companyNo = this.select === "3" ? this.sinput : "";
+      this.parmValue.supplierNo = this.select === "4" ? this.sinput : "";
       const res = await asyncRequest.list(this.parmValue);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
-        this.tableData.forEach((a)=>{
-          a.cat_name=""
-          let list=a.cat_info||[]
-          list.forEach((b,i)=>{
-            a.cat_name+=i==0?b.name:'/'+b.name
-          })
-        })
+        this.tableData.forEach((a) => {
+          a.cat_name = "";
+          let list = a.cat_info || [];
+          list.forEach((b, i) => {
+            a.cat_name += i == 0 ? b.name : "/" + b.name;
+          });
+        });
         this.pageInfo.total = Number(res.data.count);
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();
@@ -529,9 +500,9 @@ export default {
     },
     //商品分类选择
     async goods_class_change(e) {
-      const { value } = e;
-      this.cat_id = value || [];
-      this.pageInfo.cat_id = this.cat_id.toString();
+      this.cat_id = e || [];
+      this.parmValue.cat_id =
+        this.cat_id.length > 0 ? this.cat_id[this.cat_id.length - 1] : "";
       this.pageInfo.curr = 1;
       this.parmValue.page = 1;
       await this.searchList();