Browse Source

采购订单单价、金额计算

yh 1 week ago
parent
commit
52c0c97b01

+ 14 - 0
src/views/purchase/purchaseOrder/components/PurchaseOrderFormForm.vue

@@ -826,6 +826,20 @@
             purOrderFormShipFormProductTable.dataSource[prop.rowIndex].taxAmount = Number(prop.row.taxAmount);
           }
         }
+        if (prop.col.key == 'taxPriceOriginal') {
+          if (prop.row.taxPriceOriginal) {
+            let price = 0;
+            if (prop.row.discount) {
+              price = Number(prop.row.taxPriceOriginal) * (1 - Number(prop.row.discount) / 100);
+            } else {
+              price = Number(prop.row.taxPriceOriginal);
+            }
+            prop.row.taxPrice = isNaN(price) ? '' : Number(price.toFixed(2));
+            let num = prop.row.quantity * Number(prop.row.taxPrice);
+            prop.row.taxAmount = isNaN(num) ? '' : num.toFixed(2);
+            purOrderFormShipFormProductTable.dataSource[prop.rowIndex].taxAmount = Number(prop.row.taxAmount);
+          }
+        }
       }
       /**
        * 值改变事件触发-树控件回调