From 077a76278d469fd1bd8982a7307f230153381583 Mon Sep 17 00:00:00 2001 From: zhang_li Date: Thu, 24 Apr 2025 10:38:13 +0800 Subject: [PATCH] =?UTF-8?q?YT-2478MS=E3=80=8A=E9=94=80=E5=94=AE=E5=BC=80?= =?UTF-8?q?=E7=A5=A8=E7=94=B3=E8=AF=B7=E3=80=8B=E3=80=8A=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=BC=80=E7=A5=A8=E8=AE=B0=E5=BD=95=E3=80=8B=E4=B8=BB=E8=A1=A8?= =?UTF-8?q?=E4=B8=AD=E5=A2=9E=E5=8A=A0=E5=B9=B6=E6=98=BE=E7=A4=BA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=9A=20=E2=80=9C=E6=A8=A1=E5=85=B7=E6=9C=AA?= =?UTF-8?q?=E7=A8=8E=E9=87=91=E9=A2=9D=E2=80=9D=E3=80=81=E2=80=9C=E6=A8=A1?= =?UTF-8?q?=E5=85=B7=E7=A8=8E=E9=A2=9D=E2=80=9D=E3=80=81=E2=80=9C=E6=A8=A1?= =?UTF-8?q?=E5=85=B7=E5=90=AB=E7=A8=8E=E9=87=91=E9=A2=9D=E2=80=9D=E3=80=81?= =?UTF-8?q?=E2=80=9C=E6=9D=90=E6=96=99=E6=9C=AA=E7=A8=8E=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E2=80=9D=E3=80=81=E2=80=9C=E6=9D=90=E6=96=99=E7=A8=8E=E9=A2=9D?= =?UTF-8?q?=E2=80=9D=E3=80=81=E2=80=9C=E6=9D=90=E6=96=99=E5=90=AB=E7=A8=8E?= =?UTF-8?q?=E9=87=91=E9=A2=9D=E2=80=9D=20=EF=BC=8C=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E7=BC=96=E8=BE=91=EF=BC=8C=E4=BF=9D=E7=95=992=E4=BD=8D?= =?UTF-8?q?=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customerSaleInvoiceRecordMain.data.ts | 133 ++++++++++++++++++ .../CustomerSaleInvoiceBasicForm.vue | 35 ++++- .../customerSaleInvoiceRequestMain.data.ts | 49 ------- 3 files changed, 162 insertions(+), 55 deletions(-) diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts b/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts index 6f3a6a436..4b8a03ae6 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts @@ -5,6 +5,7 @@ import { } from '../moldAllocation/customerStatement/customerStatementMain.data' import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain' import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain' +import { accountantFormart } from '@/utils/formatter' const { t } = useI18n() // 国际化 @@ -166,6 +167,138 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ width:150 } }, + { + label: '模具未税金额', + field: 'moldUntaxedAmount', + formatter: accountantFormart, + table: { + width: 160 + }, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, + { + label: '模具税额', + field: 'moldTaxAmount', + formatter: accountantFormart, + table: { + width: 160 + }, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, + { + label: '模具含税金额', + field: 'moldTaxTotal', + formatter: accountantFormart, + table: { + width: 160 + }, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, + { + label: '材料未税金额', + field: 'materialsUntaxedAmount', + formatter: accountantFormart, + table: { + width: 160 + }, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, + { + label: '材料税额', + field: 'materialsTaxAmount', + formatter: accountantFormart, + table: { + width: 160 + }, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, + { + label: '材料含税金额', + field: 'materialsTaxTotal', + formatter: accountantFormart, + table: { + width: 160 + }, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, { + label: '模具未税尾差', + field: 'allocationDifferenceBeforeTax', + formatter: accountantFormart, + table: { + width: 160 + }, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, { label: '金税票号', field: 'goldenTaxInvoiceNumber', diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue index ef3473e49..364f37b6e 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue @@ -40,7 +40,9 @@ discountAmount1 = 0, beforeTaxDiffAmount = 0, taxAmountDiff = 0, - rebateTax=0, + rebateTax = 0, + moldUntaxedAmount=0, + materialsUntaxedAmount=0 } = formModel // 2、系统税额:每条数据的合同价格X可开票数量,计算结果取两位小数之后*税率的计算结果,再保留2位。所有子表数据再求和 if (formType == 'update') { @@ -56,11 +58,29 @@ } // 2.主数据税额 mainTaxAmount = 未税金额*税率/100 保留两位小数 let mainTaxAmount = Number(beforeTaxAmount*taxRate*0.01).toFixed(2) + // 4、主数据模具税额 moldTaxAmount = 累加后的模具未税金额*利率/100保留两位小数 + 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) + formRef.value.setValues({ // 主数据税额 taxAmount:mainTaxAmount, // 主数据价税合计金额:mainAdTaxAmount =未税金额+税额 - adTaxAmount:beforeTaxAmount+parseFloat(taxAmount) + adTaxAmount: (beforeTaxAmount + parseFloat(taxAmount)).toFixed(2), + // 主数据模具税额 + moldTaxAmount:moldTaxAmount, + // 主数据-模具含税金额 = 模具未税金额+模具税额 + moldTaxTotal: (Number(moldUntaxedAmount) + Number(moldTaxAmount)).toFixed(2), + // 主数据-材料金额 + materialsTaxAmount: materialsTaxAmount, + // 主数据-材料含税金额= 材料未税金额+材料税额 + materialsTaxTotal: (Number(materialsUntaxedAmount) + Number(materialsTaxAmount)).toFixed(2), + + // 主数据模具未税尾差 allocationDifferenceBeforeTax : 模具未税金额 减去 系统明细中品番数量*模具单价 保留两位小数后汇总金额 + allocationDifferenceBeforeTax: (Number(moldUntaxedAmount) - Number(allAmount)).toFixed(2), }) } } @@ -72,14 +92,17 @@ let mainBeforeTaxAmount = tableData.reduce((prev, item) =>prev + Number(item['beforeTaxAmount'].toFixed(2)),0).toFixed(2) // 2、主数据税额 mainTaxAmount = 未税金额*税率/100 保留两位小数 let mainTaxAmount = Number(mainBeforeTaxAmount * taxRate * 0.01).toFixed(2) - // 3、主数据模具未税金额 moldUntaxedAmount : 所有明细行模具分摊单价*数量保留两位小数之后累加 - let moldUntaxedAmount = tableData.reduce((prev, item) =>prev + Number((Number(item['allocationPrice'])*Number(item['qty'])).toFixed(2)),0).toFixed(2) + // 3、主数据模具未税金额 moldUntaxedAmount : 取明细行第一条数据moldUntaxedAmount + let moldUntaxedAmount = tableData[0].moldUntaxedAmount // 4、主数据模具税额 moldTaxAmount = 累加后的模具未税金额*利率/100保留两位小数 let moldTaxAmount = Number(Number(moldUntaxedAmount) * Number(taxRate) * 0.01).toFixed(2) // 5、主数据材料未税金额 materialsUntaxedAmount : 所有明细行销售单价*数量保留两位小数之后累加 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) + const sumObject = { // 主数据未税金额 beforeTaxAmount:mainBeforeTaxAmount, @@ -99,8 +122,8 @@ materialsTaxAmount: materialsTaxAmount, // 主数据-材料含税金额= 材料未税金额+材料税额 materialsTaxTotal: (Number(materialsUntaxedAmount) + Number(materialsTaxAmount)).toFixed(2), - // 主数据模具未税尾差 allocationDifferenceBeforeTax : 所有明细行未税金额保留两位小数的总和 (mainBeforeTaxAmount) 减去 系统明细中品番数量*模具单价 保留两位小数(moldUntaxedAmount)后汇总金额 - allocationDifferenceBeforeTax: (Number(mainBeforeTaxAmount) - Number(moldUntaxedAmount)).toFixed(2), + // 主数据模具未税尾差 allocationDifferenceBeforeTax : 模具未税金额 减去 系统明细中品番数量*模具单价 保留两位小数后汇总金额 + allocationDifferenceBeforeTax: (Number(moldUntaxedAmount) - Number(allAmount)).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 41e0336cc..859670da0 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts @@ -220,18 +220,11 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ table: { width: 160 }, - sortTableDefault: 8, form: { - component: 'InputNumber', componentProps: { - precision: 2, disabled: true, } }, - tableForm: { - type: 'InputNumber', - precision: 2, - } }, { label: '模具税额', @@ -240,18 +233,11 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ table: { width: 160 }, - sortTableDefault: 8, form: { - component: 'InputNumber', componentProps: { - precision: 2, disabled: true, } }, - tableForm: { - type: 'InputNumber', - precision: 2, - } }, { label: '模具含税金额', @@ -260,18 +246,11 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ table: { width: 160 }, - sortTableDefault: 8, form: { - component: 'InputNumber', componentProps: { - precision: 2, disabled: true, } }, - tableForm: { - type: 'InputNumber', - precision: 2, - } }, { label: '材料未税金额', @@ -280,18 +259,11 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ table: { width: 160 }, - sortTableDefault: 9, form: { - component: 'InputNumber', componentProps: { - precision: 2, disabled: true, } }, - tableForm: { - type: 'InputNumber', - precision: 2, - } }, { label: '材料税额', @@ -300,18 +272,11 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ table: { width: 160 }, - sortTableDefault: 10, form: { - component: 'InputNumber', componentProps: { - precision: 2, disabled: true, } }, - tableForm: { - type: 'InputNumber', - precision: 2, - } }, { label: '材料含税金额', @@ -320,18 +285,11 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ table: { width: 160 }, - sortTableDefault: 10, form: { - component: 'InputNumber', componentProps: { - precision: 2, disabled: true, } }, - tableForm: { - type: 'InputNumber', - precision: 2, - } }, { label: '模具未税尾差', field: 'allocationDifferenceBeforeTax', @@ -339,18 +297,11 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive([ table: { width: 160 }, - sortTableDefault: 10, form: { - component: 'InputNumber', componentProps: { - precision: 2, disabled: true, } }, - tableForm: { - type: 'InputNumber', - precision: 2, - } }, { label: '金税票号',