diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue index 0f96a15ff..ef9bb83b7 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue @@ -42,7 +42,9 @@ taxAmountDiff = 0, rebateTax = 0, moldUntaxedAmount=0, - materialsUntaxedAmount=0 + materialsUntaxedAmount=0, + alreadyMoldUntaxedAmount=0 + } = formModel // 2、系统税额:每条数据的合同价格X可开票数量,计算结果取两位小数之后*税率的计算结果,再保留2位。所有子表数据再求和 if (formType == 'update') { @@ -62,9 +64,8 @@ let moldTaxAmount = Number(Number(moldUntaxedAmount) * Number(taxRate) * 0.01).toFixed(2) // 6、主数据材料税额 materialsTaxAmount = 材料未税金额*税率/100 保留两位小数 let materialsTaxAmount = Number(Number(materialsUntaxedAmount) * Number(taxRate) * 0.01).toFixed(2) - // 所有明细行模具分摊单价*数量保留两位小数之后累加 - let allAmount = tableData.reduce((prev, item) =>prev + Number((Number(item['allocationPrice'])*Number(item['qty'])).toFixed(2)),0).toFixed(2) - + // 8、主数据模具税额 alreadyMoldTaxAmount = (已分摊品番数量*分摊单价)保留两位小数*税率)保留两位小数后汇总求和 + let alreadyMoldTaxAmount = tableData.reduce((prev, item) => prev + Number((Number(item['allocationPrice']) * Number(item['qty']) * Number(taxRate) * 0.01).toFixed(2)), 0).toFixed(2) formRef.value.setValues({ // 主数据税额 taxAmount:mainTaxAmount, @@ -78,9 +79,8 @@ materialsTaxAmount: materialsTaxAmount, // 主数据-材料含税金额= 材料未税金额+材料税额 materialsTaxTotal: (Number(materialsUntaxedAmount) + Number(materialsTaxAmount)).toFixed(2), - - // 主数据模具未税尾差 allocationDifferenceBeforeTax : 模具未税金额 减去 系统明细中品番数量*模具单价 保留两位小数后汇总金额 - // allocationDifferenceBeforeTax: (Number(moldUntaxedAmount) - Number(allAmount)).toFixed(2), + // 主数据已分摊模具税额 + alreadyMoldTaxAmount: alreadyMoldTaxAmount, }) } } @@ -100,9 +100,11 @@ let materialsUntaxedAmount = tableData.reduce((prev, item) =>prev + Number((Number(item['price'])*Number(item['qty'])).toFixed(2)),0).toFixed(2) // 6、主数据材料税额 materialsTaxAmount = 材料未税金额*税率/100 保留两位小数 let materialsTaxAmount = Number(Number(materialsUntaxedAmount) * Number(taxRate) * 0.01).toFixed(2) - // 所有明细行模具分摊单价*数量保留两位小数之后累加 - let allAmount = tableData.reduce((prev, item) =>prev + Number((Number(item['allocationPrice'])*Number(item['qty'])).toFixed(2)),0).toFixed(2) - + //  7、已分摊模具未税金额=(已分摊品番数量*分摊单价)保留两位小数 后汇总弄求和 + let alreadyMoldUntaxedAmount = tableData.reduce((prev, item) =>prev + Number((Number(item['allocationPrice'])*Number(item['qty'])).toFixed(2)),0).toFixed(2) + // 8、主数据模具税额 alreadyMoldTaxAmount = (已分摊品番数量*分摊单价)保留两位小数*税率)保留两位小数后汇总求和 + let alreadyMoldTaxAmount = tableData.reduce((prev, item) => prev + Number((Number((Number(item['allocationPrice']) * Number(item['qty'])).toFixed(2)) * Number(taxRate) * 0.01).toFixed(2)), 0).toFixed(2) + const sumObject = { // 主数据未税金额 beforeTaxAmount:mainBeforeTaxAmount, @@ -122,8 +124,13 @@ materialsTaxAmount: materialsTaxAmount, // 主数据-材料含税金额= 材料未税金额+材料税额 materialsTaxTotal: (Number(materialsUntaxedAmount) + Number(materialsTaxAmount)).toFixed(2), - // 主数据模具未税尾差 allocationDifferenceBeforeTax : 模具未税金额 减去 系统明细中品番数量*模具单价 保留两位小数后汇总金额 - allocationDifferenceBeforeTax: (Number(moldUntaxedAmount) - Number(allAmount)).toFixed(2), + + // 主数据已分摊模具未税金额 + alreadyMoldUntaxedAmount: alreadyMoldUntaxedAmount, + // 主数据已分摊模具税额 + alreadyMoldTaxAmount: alreadyMoldTaxAmount, + // 主数据模具未税差异=已分摊模具未税金额-模具分摊未税金额 + moldTaxAmountDiff: (Number(alreadyMoldUntaxedAmount) - Number(moldUntaxedAmount)).toFixed(2), } formRef.value.setValues(sumObject) } diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts index 859670da0..cfa61efed 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts @@ -290,9 +290,49 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ disabled: true, } }, - }, { - label: '模具未税尾差', - field: 'allocationDifferenceBeforeTax', + }, + // { + // label: '模具未税尾差', + // field: 'allocationDifferenceBeforeTax', + // formatter: accountantFormart, + // table: { + // width: 160 + // }, + // form: { + // componentProps: { + // disabled: true, + // } + // }, + // }, + { + label: '已分摊模具未税金额', + field: 'alreadyMoldUntaxedAmount', + formatter: accountantFormart, + table: { + width: 160 + }, + form: { + componentProps: { + disabled: true, + } + }, + }, + { + label: '已分摊模具税额', + field: 'alreadyMoldTaxAmount', + formatter: accountantFormart, + table: { + width: 160 + }, + form: { + componentProps: { + disabled: true, + } + }, + }, + { + label: '模具未税差异', + field: 'moldTaxAmountDiff', formatter: accountantFormart, table: { width: 160 diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue index c327618fc..3f2c1072f 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue @@ -61,6 +61,7 @@ @buttonBaseClick="detailButtonBaseClick" @searchTableSuccessDetail="searchTableSuccessDetail" + @handleMainFefresh='handleMainFefresh' >