Browse Source

发货通知单-增加单价字段并可修改

jingbb 3 months ago
parent
commit
832536f9ab

+ 11 - 3
src/views/saleCode/deliveryNotice/components/deliveryNoticeForm.vue

@@ -507,7 +507,8 @@
           item.money=item.discountedAmount
           item.taxPrice = item.discountedPrice
         })
-        var arrProduct = data.concat(deliveryDetailFormProductTable.dataSource)
+        var xTable = deliveryDetailFormProductTableRef.value!.getXTable();//关键代码 如果不更新 重新加载表格即可
+        var arrProduct = xTable.data.concat(data)
         deliveryDetailFormProductTable.dataSource=arrProduct  
         notAllowEdit.value=true
         formData.sourceCode =data[0].billCode
@@ -544,7 +545,13 @@
         if(prop.col.key=='quantity'){
           if(prop.row.quantity){
             var num= prop.row.quantity*Number(prop.row.taxPrice)
-            prop.row.money = num.toFixed(2)
+            prop.row.money =isNaN(num)?'': num.toFixed(2)
+          }
+        }
+        if(prop.col.key=='taxPrice'){
+          if(prop.row.taxPrice){
+            var num= prop.row.quantity*Number(prop.row.taxPrice)
+            prop.row.money =isNaN(num)?'': num.toFixed(2)
           }
         }
       }
@@ -557,7 +564,8 @@
           item.productCode = item.code
           item.productId = item.id
         })
-        var arrProduct = deliveryDetailFormProductTable.dataSource.concat(data)
+        var xTable = deliveryDetailFormProductTableRef.value!.getXTable();//关键代码 如果不更新 重新加载表格即可
+        var arrProduct = xTable.data.concat(data)
         deliveryDetailFormProductTable.dataSource=arrProduct  
       }
       return {

+ 8 - 0
src/views/saleCode/deliveryNotice/delivertNoticeForm.data.ts

@@ -270,6 +270,14 @@ export const deliveryNoticeProductColumns: JVxeColumn[] = [
       width:"200px",
       defaultValue:'',
     },
+    {
+      title: '单价(Price)',
+      key: 'taxPrice',
+      type: JVxeTypes.inputNumber,
+      placeholder: '请输入${title}',
+      width:"200px",
+      defaultValue:'',
+    },
     {
       title: '金额(money)',
       key: 'money',