Преглед изворни кода

修改匹配列表bug---cjh

17767204043 пре 3 година
родитељ
комит
96c43bac94
2 измењених фајлова са 21 додато и 11 уклоњено
  1. 5 2
      src/views/Agreement/match/list.vue
  2. 16 9
      src/views/Agreement/match/matching.vue

+ 5 - 2
src/views/Agreement/match/list.vue

@@ -30,7 +30,7 @@
         </span>
       </Col>
       <Col span="2" offset="2">
-        <Button @click="initData" type="primary" style="margin-right: 10px" size='small'
+        <Button @click="initData(1)" type="primary" style="margin-right: 10px" size='small'
           >搜索</Button
         >
       </Col>
@@ -121,7 +121,10 @@ export default {
     this.initData();
   },
   methods: {
-    initData() {
+    initData(page) {
+      if(page){
+        this.page_index = 1
+      }
       this.axios({
         method: "post",
         url: "/api/contract_match_list",

+ 16 - 9
src/views/Agreement/match/matching.vue

@@ -293,7 +293,7 @@
                     </Col>
                     <Col span="2">
                       <Button
-                        @click="getMatchedDetailList(matched_info)"
+                        @click="getMatchedDetailList(matched_info,1)"
                         size="small"
                         type="primary"
                       >
@@ -999,6 +999,7 @@ export default {
         })
         .then((res) => {
           if (res.code == 200) {
+            console.log(res.data);
             this.contractData = res.data.data;
             this.contractTotal = res.data.total;
             this.searchRegionList = res.data.region_list;
@@ -1258,7 +1259,7 @@ export default {
     checkedDeepen(se) {
       this.checkedDeepenList = se;
     },
-    getMatchedDetailList(row) {
+    getMatchedDetailList(row,type) {
       this.matched_detail.forEach((e) => {
         if (e.total_price > 0) {
           this.checkedDeepenList.push(e);
@@ -1279,14 +1280,17 @@ export default {
               this.$set(item, "total_price", 0);
             });
             this.matched_detail = res.data.data;
-            this.matched_detail.forEach((e) => {
-              this.checkedDeepenList.forEach((l) => {
-                if (e.id == l.id) {
-                  e._checked = true;
-                  e.total_price = l.total_price;
-                }
+            if(type != 1){
+               this.matched_detail.forEach((e) => {
+                  this.checkedDeepenList.forEach((l) => {
+                    if (e.id == l.id) {
+                      e._checked = true;
+                      e.total_price = l.total_price;
+                  }
+                });
               });
-            });
+            }
+           
             this.regionMatchedList = res.data.region_list; //区域
             this.urlMatchedList = res.data.url_number_list; //图号
             this.productList = res.data.product_title_list;
@@ -1372,6 +1376,9 @@ export default {
       if (this.checkedDeepenList.length < 1) {
         return this.$Message.warning("请选择深化信息中的内容");
       }
+      if(this.checkedDeepenList.length > 1 && this.checkedContractList.length > 1 ){
+        return this.$Message.warning("多个产品不能对应多个图号");
+      }
       let priceValue = 0;
       this.checkedContractList.forEach((e) => {
         priceValue += e.total_price; //这是合同选择的价格的和