瀏覽代碼

新增采购计划-项目名称和编码添加联动
修改供应链金额输入清空问题
---cjh

17767204043 3 年之前
父節點
當前提交
a30c285fdc
共有 2 個文件被更改,包括 113 次插入89 次删除
  1. 85 84
      src/views/PurchasingManage/PurchasingOrder/edit.vue
  2. 28 5
      src/views/PurchasingManage/RequisitionOrder/edit.vue

+ 85 - 84
src/views/PurchasingManage/PurchasingOrder/edit.vue

@@ -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)
@@ -690,21 +691,21 @@ export default {
                   // currentRow.total_price = (1 * currentRow.no_tax_amount + 1 * currentRow.tax_amount).toFixed(2)
                   this.tableData.splice(index, 1, currentRow);
                 },
-                'on-focus':()=>{
-                   if(this.$route.query.type==6||this.$route.query.type==3){
-                    return
-                  }
-  currentRow.no_tax_price = '';
-                  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)
-                  currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
-                  currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
-                   if(!currentRow.copy&&!currentRow.edit){
-        currentRow.change = true;
-      }
-                  // currentRow.total_price = (1 * currentRow.no_tax_amount + 1 * currentRow.tax_amount).toFixed(2)
-                  this.tableData.splice(index, 1, currentRow);
-                }
+  //               'on-focus':()=>{
+  //                  if(this.$route.query.type==6||this.$route.query.type==3){
+  //                   return
+  //                 }
+  // currentRow.no_tax_price = '';
+  //                 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)
+  //                 currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
+  //                 currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
+  //                  if(!currentRow.copy&&!currentRow.edit){
+  //       currentRow.change = true;
+  //     }
+  //                 // currentRow.total_price = (1 * currentRow.no_tax_amount + 1 * currentRow.tax_amount).toFixed(2)
+  //                 this.tableData.splice(index, 1, currentRow);
+  //               }
               }
             })
           }
@@ -735,19 +736,19 @@ export default {
       }
                   this.tableData.splice(index, 1, currentRow);
                 },
-                'on-focus':()=>{
-                   if(this.$route.query.type==6||this.$route.query.type==3){
-                    return
-                  }
-                  currentRow.tax_rate = '';
-                  currentRow.price = (1 * currentRow.no_tax_price * (1 + 1 * currentRow.tax_rate / 100)).toFixed(2)
-                  currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
-                  currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
-                   if(!currentRow.copy&&!currentRow.edit){
-        currentRow.change = true;
-      }
-                  this.tableData.splice(index, 1, currentRow);
-                }
+      //           'on-focus':()=>{
+      //              if(this.$route.query.type==6||this.$route.query.type==3){
+      //               return
+      //             }
+      //             currentRow.tax_rate = '';
+      //             currentRow.price = (1 * currentRow.no_tax_price * (1 + 1 * currentRow.tax_rate / 100)).toFixed(2)
+      //             currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
+      //             currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
+      //              if(!currentRow.copy&&!currentRow.edit){
+      //   currentRow.change = true;
+      // }
+      //             this.tableData.splice(index, 1, currentRow);
+      //           }
               }
             }, [h('span', { slot: 'append' }, '%')])
           }
@@ -779,20 +780,20 @@ export default {
       }
                   this.tableData.splice(index, 1, currentRow);
                 },
-                'on-focus':()=>{
-                   if(this.$route.query.type==6||this.$route.query.type==3){
-                    return
-                  }
-                  currentRow.price = ''
-                  currentRow.no_tax_price = (1 * currentRow.price / (1 + 1 * currentRow.tax_rate / 100)).toFixed(2)
-                  currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
-                  currentRow.no_tax_amount = (1 * currentRow.no_tax_price * currentRow.num).toFixed(2)
-                  currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
-                   if(!currentRow.copy&&!currentRow.edit){
-        currentRow.change = true;
-      }
-                  this.tableData.splice(index, 1, currentRow);
-                }
+      //           'on-focus':()=>{
+      //              if(this.$route.query.type==6||this.$route.query.type==3){
+      //               return
+      //             }
+      //             currentRow.price = ''
+      //             currentRow.no_tax_price = (1 * currentRow.price / (1 + 1 * currentRow.tax_rate / 100)).toFixed(2)
+      //             currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
+      //             currentRow.no_tax_amount = (1 * currentRow.no_tax_price * currentRow.num).toFixed(2)
+      //             currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
+      //              if(!currentRow.copy&&!currentRow.edit){
+      //   currentRow.change = true;
+      // }
+      //             this.tableData.splice(index, 1, currentRow);
+      //           }
               }
             })
           }
@@ -823,20 +824,20 @@ export default {
       }
                   this.tableData.splice(index, 1, currentRow);
                 },
-                'on-focus':()=>{
-                   if(this.$route.query.type==6||this.$route.query.type==3){
-                    return
-                  }
-                  currentRow.no_tax_amount = '';
-                     currentRow.no_tax_price = (1 * currentRow.no_tax_amount / 1*currentRow.num).toFixed(2)
-                  currentRow.price = (1 * currentRow.no_tax_price * (1 + 1 * currentRow.tax_rate / 100)).toFixed(2)
-                  currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
-                  currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
-                   if(!currentRow.copy&&!currentRow.edit){
-        currentRow.change = true;
-      }
-                   this.tableData.splice(index, 1, currentRow);
-                }
+      //           'on-focus':()=>{
+      //              if(this.$route.query.type==6||this.$route.query.type==3){
+      //               return
+      //             }
+      //             currentRow.no_tax_amount = '';
+      //                currentRow.no_tax_price = (1 * currentRow.no_tax_amount / 1*currentRow.num).toFixed(2)
+      //             currentRow.price = (1 * currentRow.no_tax_price * (1 + 1 * currentRow.tax_rate / 100)).toFixed(2)
+      //             currentRow.total_price = (1 * currentRow.price * currentRow.num).toFixed(2)
+      //             currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
+      //              if(!currentRow.copy&&!currentRow.edit){
+      //   currentRow.change = true;
+      // }
+      //              this.tableData.splice(index, 1, currentRow);
+      //           }
               }
             })
           }
@@ -890,21 +891,21 @@ export default {
                     this.tableData[index].no_tax_amount = ((this.tableData[index].total_price*1)-(row.tax_amount*1)).toFixed(2);
                 }
                 },
-                '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)
+      //           '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)
                     
-                  }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)
-                 currentRow.no_tax_price = currentRow.num?(1*(currentRow.no_tax_amount/currentRow.num)).toFixed(2):0
-                  if(!currentRow.copy&&!currentRow.edit){
-        currentRow.change = true;
-      }
-                  this.tableData.splice(index, 1, currentRow);}
-                }
+      //             }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)
+      //            currentRow.no_tax_price = currentRow.num?(1*(currentRow.no_tax_amount/currentRow.num)).toFixed(2):0
+      //             if(!currentRow.copy&&!currentRow.edit){
+      //   currentRow.change = true;
+      // }
+      //             this.tableData.splice(index, 1, currentRow);}
+      //           }
               }
             },this.tableData[index].tax_amount)
           }
@@ -935,20 +936,20 @@ export default {
       }
                   this.tableData.splice(index, 1, currentRow);
                 },
-                'on-focus':()=>{
-                   if(this.$route.query.type==6||this.$route.query.type==3){
-                    return
-                  }
-                    currentRow.total_price =''
-                    currentRow.price =currentRow.num?(1 * currentRow.total_price / currentRow.num).toFixed(2):0;
-                  currentRow.no_tax_price = (1 * currentRow.price / (1 + 1 * currentRow.tax_rate / 100)).toFixed(2)
-                  currentRow.no_tax_amount = currentRow.num?(1 * currentRow.no_tax_price * currentRow.num).toFixed(2):0;
-                  currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
-                   if(!currentRow.copy&&!currentRow.edit){
-        currentRow.change = true;
-      }
-                  this.tableData.splice(index, 1, currentRow);
-                }
+      //           'on-focus':()=>{
+      //              if(this.$route.query.type==6||this.$route.query.type==3){
+      //               return
+      //             }
+      //               currentRow.total_price =''
+      //               currentRow.price =currentRow.num?(1 * currentRow.total_price / currentRow.num).toFixed(2):0;
+      //             currentRow.no_tax_price = (1 * currentRow.price / (1 + 1 * currentRow.tax_rate / 100)).toFixed(2)
+      //             currentRow.no_tax_amount = currentRow.num?(1 * currentRow.no_tax_price * currentRow.num).toFixed(2):0;
+      //             currentRow.tax_amount = (1 * currentRow.total_price - 1 * currentRow.no_tax_amount).toFixed(2)
+      //              if(!currentRow.copy&&!currentRow.edit){
+      //   currentRow.change = true;
+      // }
+      //             this.tableData.splice(index, 1, currentRow);
+      //           }
               }
             })
           }

+ 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
@@ -759,6 +759,7 @@ export default {
       warehouse: '',
       isCheck: false,
       warningList: [],
+      matchingList:[]
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
@@ -808,7 +809,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() {
@@ -900,10 +905,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(){
@@ -950,7 +974,6 @@ this.selectChoose.map(m=>{
               v.ad = true}})
             //  this.tableData[index].time = this.total_time;
            })
-           console.log(this.tableData);
            this.$forceUpdate();
           break;
         case 4: