Browse Source

采购订单-子表增加折扣折前单价字段

jingbb 1 month ago
parent
commit
73152b4722

+ 16 - 0
src/views/purchase/purchaseOrder/PurchaseOrderForm.data.ts

@@ -304,6 +304,22 @@ export const purchaseOrderProductColumns: JVxeColumn[] = [
       width:"200px",
       defaultValue:'',
     },
+    {
+      title: '折扣(discount)',
+      key: 'discount',
+      type: JVxeTypes.normal,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
+    {
+      title: '折前单价(taxPriceOriginal)',
+      key: 'taxPriceOriginal',
+      type: JVxeTypes.normal,
+      width:"200px",
+      placeholder: '请输入${title}',
+      defaultValue:'',
+    },
     {
       title: '单价(price)',
       key: 'taxPrice',

+ 3 - 1
src/views/purchase/purchaseOrder/components/PurchaseOrderFormForm.vue

@@ -659,7 +659,7 @@
           item.sourceType = 'Sale' + item.childId;
           item.sourceCode = item.billCode;
           item.taxPrice = item.taxPriceGys;
-          item.taxAmount = item.taxPrice * item.quantity;
+          item.taxAmount = (item.taxPrice * item.quantity).toFixed(2);
           // item.productClass =data[0].productClass
         });
         var xTable = purOrderFormShipFormProductTableRef.value!.getXTable();
@@ -790,6 +790,8 @@
           if (prop.row.taxPrice) {
             var num = prop.row.quantity * Number(prop.row.taxPrice);
             prop.row.taxAmount = isNaN(num) ? '' : num.toFixed(2);
+            var nowTaxPriceOriginal = prop.row.taxPrice /(1-Number(prop.row.discount)/100);
+            prop.row.taxPriceOriginal = isNaN(nowTaxPriceOriginal) ? '' : nowTaxPriceOriginal.toFixed(2);
             purOrderFormShipFormProductTable.dataSource[prop.rowIndex].taxAmount = Number(prop.row.taxAmount);
           }
         }