17767204043 3 سال پیش
والد
کامیت
0b8f2c0dd5
2فایلهای تغییر یافته به همراه53 افزوده شده و 5 حذف شده
  1. 25 3
      src/views/PurchasingManage/InstockOrder/edit.vue
  2. 28 2
      src/views/PurchasingManage/PurchasingOrder/edit.vue

+ 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) {

+ 28 - 2
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
@@ -1103,6 +1103,7 @@ export default {
       order_no:'',
       suppliersList:[],
       ext_tax_rate:0,
+      matchingList:[]
     }
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
@@ -1134,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 () {
@@ -1170,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;