Bläddra i källkod

修改已匹配逻辑 --- cjh

17767204043 3 år sedan
förälder
incheckning
ec99eb5890
1 ändrade filer med 47 tillägg och 21 borttagningar
  1. 47 21
      src/views/Agreement/match/matching.vue

+ 47 - 21
src/views/Agreement/match/matching.vue

@@ -302,7 +302,6 @@
                     </Col>
                   </Row>
                   <div v-if="matched_info.isCurrenct">
-                    <keep-alive>
                       <Table
                         ref="selection"
                         @on-selection-change="checkedDeepen"
@@ -331,7 +330,6 @@
                           </div>
                         </template>
                       </Table>
-                    </keep-alive>
                   </div>
                 </div>
               </div>
@@ -371,13 +369,12 @@
                   style="display: flex; justify-content: space-between"
                   span="6"
                 >
-                  <span v-if="matched_info.matching_status == 2">
+                  <span>
                     <Button
-                      @click="handleGoProduction(2, matched_info)"
+                      @click="handleMatchedSet(matched_info,1)"
                       type="primary"
                       size="small"
-                      :disabled="matched_info.product_state != 0"
-                      >下生产通知</Button
+                      >撤销匹配</Button
                     >
                   </span>
 
@@ -814,13 +811,14 @@ export default {
         this.matched_detail[row._index].total_price = Number(
           this.matched_detail[row._index].total_price
         ).toFixed(2);
-        if (row.total_price > 0) {
-          this.matched_detail.forEach((e) => {
-            if (e.id == row.id) {
-              e.total_price = row.total_price;
-            }
-          });
+          if (row.total_price > 0) {
+            this.matched_detail.forEach((e) => {
+              if (e.id == row.id) {
+               e.total_price = row.total_price;
+             }
+            });
         }
+        
         return;
       }
     },
@@ -929,17 +927,28 @@ export default {
 
       return sums;
     },
-    handleMatchedSet(row, index, type) {
+    handleMatchedSet(row, type) {
       console.log(this.matchedSelectedList);
-      if (this.matchedSelectedList.length == 0) {
+      if (this.matchedSelectedList.length == 0 && type !=1) {
         return this.$Message.warning("请选择");
       }
-      this.axios
-        .post("/api/contract_match_revoke", {
-          id: [],
+      let params= {}
+      if(type == 1){
+         params = {
+            id: [],
+          order_no: row.order_no,
+          time: [row.crt_time],
+         }
+      }else{
+        params = {
+            id: [],
           order_no: this.matchedSelectedList,
           time: this.matchedTimeList,
-        })
+         }
+      }
+      console.log(params);
+      this.axios
+        .post("/api/contract_match_revoke", params)
         .then((res) => {
           if (res.code == 200) {
             this.matchedSelectedList = "";
@@ -1046,8 +1055,21 @@ export default {
       );
     },
     handleTabsClick(name) {
-      name == 2 && this.handleMatchedListInit();
-      name == 1 && this.contractList();
+      if(name ==2 ){
+        this.isMatchedSelectAll = false
+        this.handleMatchedListInit()
+      }else{
+        this.checkedDeepenList=[]
+        this.matched_detail = []
+        // this.getMatchedDetailList("",1)
+        this.detail();
+        this.deepenList();
+        this.contractList();
+        this.ifMatching = true;
+
+      }
+      // name == 2 && this.handleMatchedListInit();
+      // name == 1 && this.contractList();
     },
     deepenList() {
       //深化信息接口
@@ -1280,7 +1302,8 @@ export default {
               this.$set(item, "total_price", 0);
             });
             this.matched_detail = res.data.data;
-            if(type != 1){
+            // type != 1
+            if(this.checkedDeepenList.length>0 || type!=1){
                this.matched_detail.forEach((e) => {
                   this.checkedDeepenList.forEach((l) => {
                     if (e.id == l.id) {
@@ -1431,6 +1454,9 @@ export default {
             this.contractList();
             this.deepenList();
             this.handleShowCurrencyMatched1(false);
+            this.ifMatching = true;
+            this.checkedContractList = [];
+            this.checkedDeepenList=[];
           }
         });
     },