mushencc 3 yıl önce
ebeveyn
işleme
88e4d5947e

+ 25 - 3
src/views/PurchasingManage/InstockOrder/edit.vue

@@ -1704,6 +1704,7 @@ export default {
       warehouse: "",
       tableData: [{ title: "选择物料", _disabled: true }],
       ext_tax_rate: 0,
+      matchingList:[]
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
@@ -1781,6 +1782,11 @@ export default {
     if (this.$route.query.order_in_no != "") {
       this.initData(this.$route.query.order_in_no);
     }
+    this.axios({ method: "get", url: "/api/purchase_orders_list" })
+      .then((res) => {
+        this.matchingList = res.data.list;
+      })
+      .catch((err) => {});
   },
   methods: {
     shareFreightOk() {
@@ -1928,14 +1934,30 @@ export default {
     },
     changeSelect(e, index, row, type) {
       if (type == 1) {
+        this.tableData[index].is_upd = true;
+        row.is_upd = true;
+        this.tableData.splice(index, 1, row);
         row.project_code = e;
+        this.matchingList.forEach((e) => {
+          if (this.tableData[index].project_code == e.project_number) {
+            this.tableData[index].project_title = e.project_name;
+          }
+        });
       }
       if (type == 2) {
+        this.tableData[index].is_upd = true;
+        row.is_upd = true;
+        this.tableData.splice(index, 1, row);
         row.project_title = e;
+        this.matchingList.forEach((e) => {
+          if (this.tableData[index].project_title == e.project_name) {
+            this.tableData[index].project_code = e.project_number;
+          }
+        });
       }
-      this.tableData[index].is_upd = true;
-      row.is_upd = true;
-      this.tableData.splice(index, 1, row);
+      // this.tableData[index].is_upd = true;
+      // row.is_upd = true;
+      // this.tableData.splice(index, 1, row);
     },
     btnChangeTaxRate() {
       if (this.selectedTableData.length == 0) {

+ 34 - 7
src/views/PurchasingManage/PurchasingOrder/edit.vue

@@ -249,7 +249,7 @@
               clearable
               transfer
               v-show="!isCheck&&row.project_number!=='查看'"
-              @on-change='selectChange(row,index)'
+              @on-change='selectChangeCoding(row,index)'
               filterable
               label-in-value
             >
@@ -272,7 +272,7 @@
               size="small"
               clearable
               transfer
-              @on-change='selectChange(row,index)'
+              @on-change='selectChangeName(row,index)'
               v-show="!isCheck&&row.project_number!=='查看'"
               filterable
               label-in-value
@@ -679,6 +679,7 @@ export default {
               },
               on: {
                 'on-change': (e) => {
+                  debugger
                   currentRow.no_tax_price = e.target.value
                   currentRow.no_tax_amount = (1 * currentRow.no_tax_price * currentRow.num).toFixed(2)
                   currentRow.price = (1 * currentRow.no_tax_price * (1 + 1 * currentRow.tax_rate / 100)).toFixed(2)
@@ -891,11 +892,11 @@ export default {
                 }
                 },
                 'on-focus':()=>{
-                    if(this.$route.query.type==6||this.$route.query.type==3||this.$route.query.type==1){
-                        currentRow.tax_amount = (currentRow.tax_amount*1).toFixed(2);
-                        this.tableData.splice(index,1,currentRow)
+      //               if(this.$route.query.type==6||this.$route.query.type==3||this.$route.query.type==1){
+      //                   currentRow.tax_amount = (currentRow.tax_amount*1).toFixed(2);
+      //                   this.tableData.splice(index,1,currentRow)
                     
-                  }else{
+                  // }else{
                     //  currentRow.tax_amount = ''
                   // currentRow.fax = (1 * currentRow.tax_amount / currentRow.no_tax_price).toFixed(2)
                 //  currentRow.no_tax_amount = (1*(currentRow.total_price-currentRow.tax_amount)).toFixed(2)
@@ -904,7 +905,7 @@ export default {
         currentRow.change = true;
       }
                   this.tableData.splice(index, 1, currentRow);}
-                }
+                
               }
             },this.tableData[index].tax_amount)
           }
@@ -1102,6 +1103,7 @@ export default {
       order_no:'',
       suppliersList:[],
       ext_tax_rate:0,
+      matchingList:[]
     }
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
@@ -1133,6 +1135,11 @@ export default {
     this.initModal()
     this.initProjectModal()
     this.initSupplierModal(this.modalSupplierData)
+        this.axios({ method: "get", url: "/api/purchase_orders_list" })
+    .then((res) => {
+      this.matchingList = res.data.list
+    })
+    .catch((err) => {});
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted () {
@@ -1169,6 +1176,26 @@ export default {
     }
   },
   methods: {
+      selectChangeCoding(row,index){
+    if(!row.copy&&!row.edit){
+      this.tableData[index].change = true;
+    }
+    this.matchingList.forEach(e=>{
+      if( this.tableData[index].project_code == e.project_number){
+        this.tableData[index].project_title = e.project_name
+      }
+    })
+  },
+  selectChangeName(row,index){
+    if(!row.copy&&!row.edit){
+      this.tableData[index].change = true;
+    }
+    this.matchingList.forEach(e=>{
+      if( this.tableData[index].project_title == e.project_name){
+        this.tableData[index].project_code = e.project_number
+      }
+    })
+  },
     selectMaterial(row){
          this.clickMaterial = JSON.parse(JSON.stringify(row));
          this.showModal = true;

+ 28 - 5
src/views/PurchasingManage/RequisitionOrder/edit.vue

@@ -194,7 +194,7 @@
               clearable
               transfer
               v-show="!isCheck"
-              @on-change='selectChange(row,index)'
+              @on-change='selectChangeCoding(row,index)'
               filterable
               label-in-value
             >
@@ -217,7 +217,7 @@
               size="small"
               clearable
               transfer
-              @on-change='selectChange(row,index)'
+              @on-change='selectChangeName(row,index)'
               v-show="!isCheck"
               filterable
               label-in-value
@@ -760,6 +760,7 @@ export default {
       warehouse: '',
       isCheck: false,
       warningList: [],
+      matchingList:[]
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
@@ -809,7 +810,11 @@ export default {
     });
     this.initModal();
     // this.initProjectModal();
-    
+    this.axios({ method: "get", url: "/api/purchase_orders_list" })
+    .then((res) => {
+      this.matchingList = res.data.list
+    })
+    .catch((err) => {});
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
@@ -901,10 +906,29 @@ export default {
     selectRow(e){
        this.selectChoose = e;
     },
+  selectChangeCoding(row,index){
+    if(!row.copy&&!row.edit){
+      this.tableData[index].change = true;
+    }
+    this.matchingList.forEach(e=>{
+      if( this.tableData[index].project_code == e.project_number){
+        this.tableData[index].project_title = e.project_name
+      }
+    })
+  },
+  selectChangeName(row,index){
+    if(!row.copy&&!row.edit){
+      this.tableData[index].change = true;
+    }
+    this.matchingList.forEach(e=>{
+      if( this.tableData[index].project_title == e.project_name){
+        this.tableData[index].project_code = e.project_number
+      }
+    })
+  },
    selectChange(row,index){
       if(!row.copy&&!row.edit){
         this.tableData[index].change = true;
-        console.log(this.tableData)
       }
    },
     total_sure(){
@@ -951,7 +975,6 @@ this.selectChoose.map(m=>{
               v.ad = true}})
             //  this.tableData[index].time = this.total_time;
            })
-           console.log(this.tableData);
            this.$forceUpdate();
           break;
         case 4: