17767204043 3 anni fa
parent
commit
8dea4e5224
1 ha cambiato i file con 72 aggiunte e 70 eliminazioni
  1. 72 70
      src/views/Agreement/match/matching.vue

+ 72 - 70
src/views/Agreement/match/matching.vue

@@ -293,7 +293,7 @@
                     </Col>
                     <Col span="2">
                       <Button
-                        @click="getMatchedDetailList(matched_info,1)"
+                        @click="getMatchedDetailList(matched_info, 1)"
                         size="small"
                         type="primary"
                       >
@@ -302,34 +302,34 @@
                     </Col>
                   </Row>
                   <div v-if="matched_info.isCurrenct">
-                      <Table
-                        ref="selection"
-                        @on-selection-change="checkedDeepen"
-                        :columns="matchedSheetTableColumns"
-                        border
-                        :max-height="500"
-                        on-selection-change
-                        :data="matched_detail"
-                        style="width: 100%"
-                        show-summary
-                        :summary-method="deepenSummary"
+                    <Table
+                      ref="selection"
+                      @on-selection-change="checkedDeepen"
+                      :columns="matchedSheetTableColumns"
+                      border
+                      :max-height="500"
+                      on-selection-change
+                      :data="matched_detail"
+                      style="width: 100%"
+                      show-summary
+                      :summary-method="deepenSummary"
+                    >
+                      <template
+                        slot-scope="{ row }"
+                        slot="total_price"
+                        ref="row"
                       >
-                        <template
-                          slot-scope="{ row }"
-                          slot="total_price"
-                          ref="row"
-                        >
-                          <div class="service table_slot">
-                            <Input
-                              v-model="row.total_price"
-                              type="number"
-                              @on-blur="checkPrice(row)"
-                              style="width: 80%"
-                              clearable
-                            />
-                          </div>
-                        </template>
-                      </Table>
+                        <div class="service table_slot">
+                          <Input
+                            v-model="row.total_price"
+                            type="number"
+                            @on-blur="checkPrice(row)"
+                            style="width: 80%"
+                            clearable
+                          />
+                        </div>
+                      </template>
+                    </Table>
                   </div>
                 </div>
               </div>
@@ -371,7 +371,7 @@
                 >
                   <span>
                     <Button
-                      @click="handleMatchedSet(matched_info,1)"
+                      @click="handleMatchedSet(matched_info, 1)"
                       type="primary"
                       size="small"
                       >撤销匹配</Button
@@ -811,14 +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,34 +929,32 @@ export default {
     },
     handleMatchedSet(row, type) {
       console.log(this.matchedSelectedList);
-      if (this.matchedSelectedList.length == 0 && type !=1) {
+      if (this.matchedSelectedList.length == 0 && type != 1) {
         return this.$Message.warning("请选择");
       }
-      let params= {}
-      if(type == 1){
-         params = {
-            id: [],
+      let params = {};
+      if (type == 1) {
+        params = {
+          id: [],
           order_no: row.order_no,
           time: [row.crt_time],
-         }
-      }else{
+        };
+      } else {
         params = {
-            id: [],
+          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 = "";
-            this.matchedTimeList = [];
-            this.handleMatchedListInit();
-            this.isMatchedSelectAll = false;
-          }
-        });
+      this.axios.post("/api/contract_match_revoke", params).then((res) => {
+        if (res.code == 200) {
+          this.matchedSelectedList = "";
+          this.matchedTimeList = [];
+          this.handleMatchedListInit();
+          this.isMatchedSelectAll = false;
+        }
+      });
     },
     cancelMatch(row) {
       //撤销匹配
@@ -1055,18 +1053,17 @@ export default {
       );
     },
     handleTabsClick(name) {
-      if(name ==2 ){
-        this.isMatchedSelectAll = false
-        this.handleMatchedListInit()
-      }else{
-        this.checkedDeepenList=[]
-        this.matched_detail = []
+      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();
@@ -1281,7 +1278,7 @@ export default {
     checkedDeepen(se) {
       this.checkedDeepenList = se;
     },
-    getMatchedDetailList(row,type) {
+    getMatchedDetailList(row, type) {
       this.matched_detail.forEach((e) => {
         if (e.total_price > 0) {
           this.checkedDeepenList.push(e);
@@ -1303,17 +1300,19 @@ export default {
             });
             this.matched_detail = res.data.data;
             // type != 1
-            if(this.checkedDeepenList.length>0 || type!=1){
-               this.matched_detail.forEach((e) => {
+            if (this.checkedDeepenList.length > 0) {
+              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;
@@ -1399,7 +1398,10 @@ export default {
       if (this.checkedDeepenList.length < 1) {
         return this.$Message.warning("请选择深化信息中的内容");
       }
-      if(this.checkedDeepenList.length > 1 && this.checkedContractList.length > 1 ){
+      if (
+        this.checkedDeepenList.length > 1 &&
+        this.checkedContractList.length > 1
+      ) {
         return this.$Message.warning("多个产品不能对应多个图号");
       }
       let priceValue = 0;
@@ -1456,7 +1458,7 @@ export default {
             this.handleShowCurrencyMatched1(false);
             this.ifMatching = true;
             this.checkedContractList = [];
-            this.checkedDeepenList=[];
+            this.checkedDeepenList = [];
           }
         });
     },