diff --git a/package.json b/package.json index 2e2eb6e88..6fe857591 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "cropperjs": "^1.6.1", "crypto-js": "^4.1.1", "dayjs": "^1.11.10", + "decimal.js": "^10.4.3", "diagram-js": "^12.3.0", "echarts": "^5.4.3", "echarts-wordcloud": "^2.1.0", diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue index ef3d5c664..3b990c2b6 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue @@ -59,7 +59,7 @@ // 主数据税额 taxAmount:mainTaxAmount, // 主数据价税合计金额:mainAdTaxAmount =未税金额+税额 - adTaxAmount:(beforeTaxAmount+parseFloat(taxAmount)).toFixed(2) + adTaxAmount:beforeTaxAmount+parseFloat(taxAmount) }) } } @@ -88,6 +88,7 @@ import { CustomerSaleInvoiceMain,CustomerSaleInvoiceMainRules,CustomerSaleInvoiceDetailRules,CustomerSaleInvoiceDetail} from './customerSaleInvoiceRequestMain.data' import * as CustomerSaleInvoiceMainApi from '@/api/wms/customerSaleInvoiceMain' import * as CustomerStatementDetailApi from '@/api/wms/customerStatementDetail' +import Decimal from "decimal.js" // 传递给父类 const emit = defineEmits([ 'buttonBaseClick','getList' @@ -281,7 +282,7 @@ const initTableDataPrice = ()=>{ tableData.value.forEach(item=>{ item['sumPrice'] = (item['price'] + item['allocationPrice']).toFixed(5) // 未税金额 默认等于数量*合计单价,可修改,必填,最多可输入2位小数 - item['beforeTaxAmount'] = Number(item['sumPrice'])*item['qty'] + item['beforeTaxAmount'] = Number(new Decimal(Number(item['sumPrice'])).mul(new Decimal(item['qty'])).toNumber().toFixed(2)) // 税额:taxAmount 未税价格*税率/100,四舍五入保留2位小数 item['taxAmount'] = (item['beforeTaxAmount'] * formRef.value.formRef.formModel['taxRate'])/100 //含税金额