From cb7c43d443dd2c9898e3bfc74a37fe1e1b4b512e Mon Sep 17 00:00:00 2001 From: yufei_wang <2267742828@qq.com> Date: Wed, 6 Nov 2024 15:32:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=80=E5=94=AE=E5=BC=80=E7=A5=A8=E7=94=B3?= =?UTF-8?q?=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customerSaleInvoiceMain/index.vue | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceMain/index.vue b/src/views/wms/deliversettlementManage/customerSaleInvoiceMain/index.vue index 83859f047..f6fc5f425 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceMain/index.vue +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceMain/index.vue @@ -58,6 +58,7 @@ @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" @inputNumberChange="inputNumberChange" + @onChange="onChange" :sumFormDataByTableCustom=" (formRef, formModel, tableData) => { tableData.forEach(item=>{ @@ -168,6 +169,14 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => tableData.value = res.list && res.list.length > 0 ?res.list : [] tableData.value.forEach(item=>{ item['sumPrice'] = item['price'] + item['allocationPrice'] + // 未税金额 默认等于数量*合计单价,可修改,必填,最多可输入2位小数 + item['beforeTaxAmount'] = item['sumPrice']*item['qty'] + item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //含税金额 + + // 税额:taxAmount 未税价格*税率/100,四舍五入保留2位小数 + item['taxAmount'] = (item['beforeTaxAmount'] * formRef.formModel['taxRate'])/100 //含税金额 + + }) }) @@ -420,9 +429,30 @@ const tableSelectionDelete = (selection) => { tableData.value = tableData.value.filter(item => !selection.includes(item)) } +const onChange = (field, cur, formRef)=>{ + + console.log('onChange',field, cur, formRef) + + if(field == 'taxRate'){ + // 税额:taxAmount 未税价格*税率/100,四舍五入保留2位小数 + tableData.value.forEach(item=>{ + item['taxAmount'] = (item['beforeTaxAmount'] * cur)/100 //含税金额 + }) + } +} + const inputNumberChange = (field, index, row, val) => { console.log('inputNumberChange',field, index, row, val) + // 合计单价 = 销售单价 + 模具分摊单价 row['sumPrice'] = row['price'] + row['allocationPrice'] + + // 含税金额 = 未税价格+税额,四舍五入保留2位小数 + row['afterTaxAmount'] = row['beforeTaxAmount'] + row['taxAmount'] + + // 模具分摊单价 默认从模具分摊对账单带出,未税金额修改后重新计算,等于未税金额/数量-销售单价 + row['allocationPrice'] = row['beforeTaxAmount']/row['qty'] - row['price'] + + } //为true表示子表数据中存在数量为0的数据 const flag = ref(false)