|
|
@ -53,19 +53,18 @@ |
|
|
|
:tableAllSchemas="SupplierinvoiceRequestDetail.allSchemas" |
|
|
|
:tableFormRules="SupplierinvoiceRequestDetailRules" |
|
|
|
:tableData="tableData" |
|
|
|
:sumFormDataByForm ="(formRef,formModel,tableData,formType)=>{ |
|
|
|
:sumFormDataByForm ="(formRef,formModel,tableData,formType,originFormModel,updateOriginFormModel)=>{ |
|
|
|
const {taxRate=0,amount=0,taxAmount=0,beforeTaxAmount=0,totalTaxAmount=0,discountAmount1=0,beforeTaxDiffAmount=0,taxAmountDiff=0} = formModel |
|
|
|
// 2、系统税额:每条数据的合同价格X可开票数量,计算结果取两位小数之后*税率的计算结果,再保留2位。所有子表数据再求和 |
|
|
|
let taxAmount_ = 0.00 |
|
|
|
if(formType=='update'){ // 编辑 |
|
|
|
taxAmount_ = taxAmount |
|
|
|
}else if(formType=='create'){ // 新增 |
|
|
|
taxAmount_ = tableData.reduce((prev, item) => prev + Number(Number(taxRate*0.01*Number(Number(item['singlePrice']*item['invoicableQuantity']).toFixed(2))).toFixed(2)),0) |
|
|
|
if(taxRate!=originFormModel.taxRate){ |
|
|
|
taxAmount_ = tableData.reduce((prev, item) => prev + Number(Number(taxRate*0.01*Number(Number(item['singlePrice']*item['invoicableQuantity']).toFixed(2))).toFixed(2)),0) |
|
|
|
updateOriginFormModel(formModel) |
|
|
|
} |
|
|
|
} |
|
|
|
console.log('sumFormDataByForm',tableData) |
|
|
|
console.log('taxAmount_',taxAmount_) |
|
|
|
|
|
|
|
if(tableData) |
|
|
|
formRef.value.setValues({ |
|
|
|
taxAmount:taxAmount_, |
|
|
|
afterTaxAmount:amount+taxAmount, // 3、系统价税合计:系统未税金额+系统税额 |
|
|
|