소스 검색

Merge branch 'feature/Feature-basic_data' of https://gogs.zfire.top/zfire-front/supply-front into feature/Feature-basic_data

chen 3 년 전
부모
커밋
dd7f31f0ac

+ 28 - 34
src/views/sales_policy/components/AddCondition.vue

@@ -451,6 +451,7 @@ export default {
       saleTypeCode: "",
       arrIndex: 0,
       popArr: {},
+      fang: false,
     };
   },
   created() {
@@ -566,46 +567,39 @@ export default {
           }
         }
       }
-      console.log(index, this.arrIndex);
     },
     getMaterialLists(index) {
-
       this.arrIndex = index;
-      getMaterialList({
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        saleTypeCode: this.saleTypeCode,
-        policyId: this.comCode,
-      }).then((res) => {
-        let arr = []
-        let datas = []
-
-                       for (let i = 0; i < res.data.records.length; i++) {
-                          for (let j = 0; j < this.conditionBox.length; j++) {
-
-                                datas = [...datas,...this.conditionBox[j]]
-                                if (datas.length) {
-                                   for (let k = 0; k < datas.length; k++) {
-                                    if (datas[k].id !== res.data.records[i].id) {
-                                        arr.push(res.data.records[i])
-                                    }
-
-                                }
-                                }else{
-                                  arr = res.data.records
-                                }
-
-
-                          }
-
-
-                       }
+      if (!this.fang) {
+        getMaterialList({
+          pageNum: this.currentPage,
+          pageSize: this.pageSize,
+          saleTypeCode: this.saleTypeCode,
+          policyId: this.comCode,
+        }).then((res) => {
+          this.conditList = res.data.records;
+          this.listTotal = res.data.total;
+          this.fang = true;
+        });
+      } else {
+        console.log('fang');
 
+        let datas = [];
 
+      for (let j = 0; j < this.conditionBox.length; j++) {
+            datas = [...datas, ...this.conditionBox[j]];
+        }
+        for (let i = 0; i < this.conditList.length; i++) {
+           if (datas.length) {
+              for (let k = 0; k < datas.length; k++) {
+                if (datas[k].id == this.conditList[i].id) {
+                  this.conditList.splice(i,1)
+                }
+              }
+          }
+        }
 
-        this.conditList = arr;
-        this.listTotal = res.data.total;
-      });
+      }
     },
     handleSelectionAllChange(e) {
       this.leftData = e;

+ 4 - 0
src/views/supply/apply/components/apply_form.vue

@@ -289,6 +289,7 @@ export default {
           item.orderId = item.id;
         })
         this.goodsList = data.orders;
+        this.screenForm.type = data.mainId;
       })
     },
 
@@ -457,6 +458,9 @@ export default {
     clickSubmitForm(status) {
       this.$refs.mainForm.validate((valid) => {
         if (valid) {
+          if(this.goodsList.length < 1) {
+            return this.$errorMsg('请添加引用');
+          }
           for(let i=0; i<this.goodsList.length; i++) {
             if(!this.goodsList[i].invoiceNum) {
               this.$errorMsg('请输入申请数量');

+ 3 - 0
src/views/supply/apply/components/engin_form.vue

@@ -624,6 +624,9 @@ export default {
     clickSubmitForm(status) {
       this.$refs.mainForm.validate((valid) => {
         if (valid) {
+          if(this.goodsList.length < 1) {
+            return this.$errorMsg('请添加引用');
+          }
           for(let i=0; i<this.goodsList.length; i++) {
             if(!this.goodsList[i].invoiceNum) {
               this.$errorMsg('请输入申请数量');

+ 35 - 4
src/views/supply/policy/components/retail_form.vue

@@ -749,7 +749,6 @@ export default {
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
-
       cusIndex: 0,
       radio: "",
       pop: "",
@@ -879,13 +878,15 @@ export default {
     this.getDictList();
     this.getWalletList();
     this.getWarehouseList();
-    this.getPolicyList();
+
     this.getTypeList();
     if (this.listItem) {
       this.getDetail();
     }
   },
+  beforeUpdate() {
 
+  },
   methods: {
     // 返回列表
     goBack() {
@@ -973,6 +974,7 @@ export default {
     },
     handleShow() {
       this.isShowDialog = true;
+      this.getPolicyList()
     },
     // 获取钱包列表
     getWalletList() {
@@ -1160,12 +1162,15 @@ export default {
       this.getConditionList(params[3], this.step);
     },
     getConditionList(policyConditionId, popType) {
+      let arr = []
       getConditionList({
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         policyConditionId,
         popType,
       }).then((res) => {
+        console.log(this.cusIndex);
+         const datas = res.data.records
         for (let i = 0; i < res.data.records.length; i++) {
           res.data.records[i].qty = 1;
         }
@@ -1175,8 +1180,34 @@ export default {
         if (this.cusIndex == 0) {
           this.popDataArr = [];
         }
-        this.popDataArr.push(res.data.records);
-        // console.log(this.popDataArr, "[]", this.radioObj);
+
+        if (this.cusIndex == 1) {
+          for (let l = 0; l < this.dataList.length; l++) {
+
+              for (let k = 0; k < datas.length; k++) {
+                            console.log(this.dataList[l].id == datas[k].id,'hahah',datas,this.dataList);
+                      if (this.dataList[l].id == datas[k].id) {
+                          datas.splice(k,1)
+                      }
+              }
+          }
+           this.popDataArr.push(datas);
+        }else{
+
+          for (let j = 0; j <  this.popDataArr[this.cusIndex-1].length; j++) {
+             for (let k = 0; k < datas.length; k++) {
+
+                      if (this.dataList[l].id == datas[k].id) {
+                            datas.splice(k,1)
+                      }
+              }
+
+          }
+          this.popDataArr.push(datas);
+        }
+
+        // this.popDataArr.push(res.data.records);
+
       });
     },
     hanlePopData() {

+ 2 - 2
src/views/supply/retail/components/retail_form.vue

@@ -26,7 +26,7 @@
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="产品大类" prop="type">
-            <el-select v-model="mainForm.type" placeholder="选择产品大类" style="width: 100%">
+            <el-select v-model="mainForm.type" placeholder="选择产品大类" style="width: 100%" :disabled="goodsList.length > 0">
               <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
             </el-select>
           </el-form-item>
@@ -167,7 +167,7 @@
         <el-row :gutter="20">
           <el-col :xs="12" :sm="6" :lg="6">
             <el-form-item prop="type">
-              <el-select v-model="mainForm.type" placeholder="选择品类" style="width: 100%" clearable>
+              <el-select v-model="mainForm.type" placeholder="选择品类" style="width: 100%" clearable :disabled="goodsList.length > 0 || rightGoodsList.length > 0">
                 <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
               </el-select>
             </el-form-item>