From 35bca0a78746b8b97497f89c9e1e52e643dc4d5e Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期日, 13 九月 2026 11:40:35 +0800
Subject: [PATCH] fix: 统一销售和采购相关页面金额、单价、数量、总价保留6位小数
---
src/views/procurementManagement/procurementReport/index.vue | 24 ++-
src/views/salesManagement/receiptPaymentLedger/index.vue | 37 +---
src/views/salesManagement/returnOrder/components/detailDia.vue | 2
src/views/salesManagement/salesLedger/index.vue | 86 +++++++----
src/views/salesManagement/salesQuotation/index.vue | 8
src/views/procurementManagement/paymentLedger/index.vue | 45 ++----
src/views/productionManagement/workOrderManagement/index.vue | 11 +
src/views/procurementManagement/procurementLedger/index.vue | 78 ++++++++---
src/views/salesManagement/returnOrder/components/formDia.vue | 11
src/views/procurementManagement/purchaseReturnOrder/New.vue | 33 ++--
src/views/procurementManagement/purchaseReturnOrder/index.vue | 5
src/views/procurementManagement/purchaseReturnOrder/ProductList.vue | 2
src/utils/summarizeTable.js | 20 ++
13 files changed, 214 insertions(+), 148 deletions(-)
diff --git a/src/utils/summarizeTable.js b/src/utils/summarizeTable.js
index 1ad480d..b25cc74 100644
--- a/src/utils/summarizeTable.js
+++ b/src/utils/summarizeTable.js
@@ -40,14 +40,22 @@
});
return sums;
};
-// 涓嶅惈绋庢�讳环璁$畻
-const calculateTaxExclusiveTotalPrice = (taxInclusiveTotalPrice, taxRate) => {
+// 涓嶅惈绋庢�讳环璁$畻锛宒ecimals 涓轰繚鐣欏皬鏁颁綅鏁帮紙閿�鍞�/閲囪喘鐩稿叧椤甸潰浼� 6锛�
+const calculateTaxExclusiveTotalPrice = (
+ taxInclusiveTotalPrice,
+ taxRate,
+ decimals = 2
+) => {
const taxRateDecimal = taxRate / 100;
- return (taxInclusiveTotalPrice / (1 + taxRateDecimal)).toFixed(2);
+ return (taxInclusiveTotalPrice / (1 + taxRateDecimal)).toFixed(decimals);
};
-// 鍚◣鎬讳环璁$畻
-const calculateTaxIncludeTotalPrice = (taxInclusiveUnitPrice, quantity) => {
- return (taxInclusiveUnitPrice * quantity).toFixed(2);
+// 鍚◣鎬讳环璁$畻锛宒ecimals 涓轰繚鐣欏皬鏁颁綅鏁帮紙閿�鍞�/閲囪喘鐩稿叧椤甸潰浼� 6锛�
+const calculateTaxIncludeTotalPrice = (
+ taxInclusiveUnitPrice,
+ quantity,
+ decimals = 2
+) => {
+ return (taxInclusiveUnitPrice * quantity).toFixed(decimals);
};
// 瀵煎嚭鍑芥暟渚涘叾浠栨枃浠朵娇鐢�
export {
diff --git a/src/views/procurementManagement/paymentLedger/index.vue b/src/views/procurementManagement/paymentLedger/index.vue
index e79a344..19768a8 100644
--- a/src/views/procurementManagement/paymentLedger/index.vue
+++ b/src/views/procurementManagement/paymentLedger/index.vue
@@ -79,7 +79,7 @@
@pagination="sonPaginationSearch">
<template #payableAmountSlot="{ row }">
<el-text type="danger">
- {{ parseFloat(row.payableAmount).toFixed(2) }}
+ {{ parseFloat(row.payableAmount).toFixed(6) }}
</el-text>
</template>
<template #paymentActionSlot="{ row }">
@@ -99,8 +99,8 @@
<el-date-picker style="width:100%" v-model="paymentForm.paymentDate" value-format="YYYY-MM-DD" type="date" placeholder="璇烽�夋嫨浠樻鏃ユ湡" clearable />
</el-form-item>
<el-form-item label="浠樻閲戦锛�" prop="paymentAmount">
- <el-input-number style="width:100%" v-model="paymentForm.paymentAmount" :precision="2" :min="0" :max="Math.max(0,(Number(currentPaymentRow.payableAmount)||0)-(Number(currentPaymentRow.paymentAmount)||0))" placeholder="璇疯緭鍏ヤ粯娆鹃噾棰�" controls-position="right" />
- <div style="color:#e6a23c;font-size:12px;margin-top:4px">褰撳墠鍙粯娆句綑棰濓細{{ Math.max(0,(Number(currentPaymentRow.payableAmount)||0)-(Number(currentPaymentRow.paymentAmount)||0)).toFixed(2) }} 鍏�</div>
+ <el-input-number style="width:100%" v-model="paymentForm.paymentAmount" :min="0" :precision="6" :max="Math.max(0,(Number(currentPaymentRow.payableAmount)||0)-(Number(currentPaymentRow.paymentAmount)||0))" placeholder="璇疯緭鍏ヤ粯娆鹃噾棰�" controls-position="right" />
+ <div style="color:#e6a23c;font-size:12px;margin-top:4px">褰撳墠鍙粯娆句綑棰濓細{{ Math.max(0,(Number(currentPaymentRow.payableAmount)||0)-(Number(currentPaymentRow.paymentAmount)||0)).toFixed(6) }} 鍏�</div>
</el-form-item>
<el-form-item label="浠樻鏂瑰紡锛�" prop="paymentMethod">
<el-select v-model="paymentForm.paymentMethod" placeholder="璇烽�夋嫨浠樻鏂瑰紡" style="width:100%" clearable>
@@ -169,7 +169,7 @@
prop: "contractAmount",
width: 200,
formatData: params => {
- return params ? parseFloat(params).toFixed(2) : 0;
+ return params ? parseFloat(params).toFixed(6) : 0;
},
},
{
@@ -177,7 +177,7 @@
prop: "paymentAmount",
width: 200,
formatData: params => {
- return params ? parseFloat(params).toFixed(2) : 0;
+ return params ? parseFloat(params).toFixed(6) : 0;
},
},
{
@@ -206,28 +206,11 @@
const currentPaymentRow = ref({});
const paymentFormRef = ref(null);
const paymentForm = reactive({ paymentDate:"", paymentAmount:undefined, paymentMethod:"", remark:"" });
- const validatePaymentAmount = (_,v,cb) => {
- if(!v) return cb(new Error("璇疯緭鍏ヤ粯娆鹃噾棰�"));
- const max = Math.max(0,(Number(currentPaymentRow.value.payableAmount)||0)-(Number(currentPaymentRow.value.paymentAmount)||0));
- if(v > max) return cb(new Error(`浠樻閲戦涓嶈兘瓒呰繃鍙粯娆句綑棰� ${max.toFixed(2)} 鍏僠));
- cb();
- };
- const paymentRules = {
- paymentDate:[{required:true,message:"璇烽�夋嫨浠樻鏃ユ湡",trigger:"change"}],
- paymentAmount:[{required:true,validator:validatePaymentAmount,trigger:"blur"}],
- paymentMethod:[{required:true,message:"璇烽�夋嫨浠樻鏂瑰紡",trigger:"change"}],
- };
- const openPaymentDialog = row => { currentPaymentRow.value=row; paymentForm.paymentDate=""; paymentForm.paymentAmount=undefined; paymentForm.paymentMethod=""; paymentForm.remark=""; paymentDialogVisible.value=true; };
+ const validatePaymentAmount = (_,v,cb) => { if(!v) return cb(new Error("璇疯緭鍏ヤ粯娆鹃噾棰�")); const m=Math.max(0,(Number(currentPaymentRow.value.payableAmount)||0)-(Number(currentPaymentRow.value.paymentAmount)||0)); if(v>m) return cb(new Error(`浠樻閲戦涓嶈兘瓒呰繃鍙粯娆句綑棰� ${m.toFixed(6)} 鍏僠)); cb(); };
+ const paymentRules = { paymentDate:[{required:true,message:"璇烽�夋嫨浠樻鏃ユ湡",trigger:"change"}], paymentAmount:[{required:true,validator:validatePaymentAmount,trigger:"blur"}], paymentMethod:[{required:true,message:"璇烽�夋嫨浠樻鏂瑰紡",trigger:"change"}] };
+ const openPaymentDialog = r => { currentPaymentRow.value=r; paymentForm.paymentDate=""; paymentForm.paymentAmount=undefined; paymentForm.paymentMethod=""; paymentForm.remark=""; paymentDialogVisible.value=true; };
const closePaymentDialog = () => { paymentFormRef.value?.resetFields(); paymentDialogVisible.value=false; };
- const submitPaymentForm = () => {
- paymentFormRef.value?.validate(valid => {
- if(valid){
- savePayment({ supplierId:currentSupplierId.value, purchaseContractNumber:currentPaymentRow.value.purchaseContractNumber, paymentDate:paymentForm.paymentDate, paymentAmount:paymentForm.paymentAmount, paymentMethod:paymentForm.paymentMethod, remark:paymentForm.remark }).then(res => {
- proxy.$modal.msgSuccess("鏂板浠樻鎴愬姛"); closePaymentDialog(); getPaymenRecordtList(currentSupplierId.value); getList();
- });
- }
- });
- };
+ const submitPaymentForm = () => { paymentFormRef.value?.validate(v=>{ if(v){ savePayment({ supplierId:currentSupplierId.value, purchaseContractNumber:currentPaymentRow.value.purchaseContractNumber, paymentDate:paymentForm.paymentDate, paymentAmount:paymentForm.paymentAmount, paymentMethod:paymentForm.paymentMethod, remark:paymentForm.remark }).then(res=>{ proxy.$modal.msgSuccess("鏂板浠樻鎴愬姛"); closePaymentDialog(); getPaymenRecordtList(currentSupplierId.value); getList(); }); } }); };
// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = param => {
@@ -235,6 +218,9 @@
param,
["contractAmounts", "paymentAmount", "payableAmount"],
{
+ contractAmounts: { decimalPlaces: 6 },
+ paymentAmount: { decimalPlaces: 6 },
+ payableAmount: { decimalPlaces: 6 },
ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
}
@@ -246,6 +232,9 @@
param,
["contractAmount", "invoiceAmount", "paymentAmount"],
{
+ contractAmount: { decimalPlaces: 6 },
+ invoiceAmount: { decimalPlaces: 6 },
+ paymentAmount: { decimalPlaces: 6 },
ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
}
@@ -254,7 +243,7 @@
summarizeTable[summarizeTable.length - 1] =
originalTableDataSon.value[
originalTableDataSon.value.length - 1
- ].payableAmount.toFixed(2);
+ ].payableAmount.toFixed(6);
} else {
summarizeTable[summarizeTable.length - 1] = 0.0;
}
@@ -330,7 +319,7 @@
};
const formattedNumber = (row, column, cellValue) => {
if (column.property !== "supplierName") {
- return parseFloat(cellValue).toFixed(2);
+ return parseFloat(cellValue).toFixed(6);
} else {
return cellValue;
}
diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index 616884c..ca92040 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -195,6 +195,11 @@
width="200"
show-overflow-tooltip
:formatter="formattedNumber" />
+ <el-table-column label="瀹為檯鍚堝悓閲戦(鍏�)"
+ prop="netContractAmount"
+ width="200"
+ show-overflow-tooltip
+ :formatter="formattedNumber" />
<el-table-column label="褰曞叆浜�"
prop="recorderName"
width="120"
@@ -594,7 +599,7 @@
<el-form-item label="鍚◣鍗曚环(鍏�)锛�"
prop="taxInclusiveUnitPrice">
<el-input-number v-model="productForm.taxInclusiveUnitPrice"
- :precision="2"
+ :precision="6"
:step="0.1"
:min="0"
clearable
@@ -607,7 +612,7 @@
prop="quantity">
<el-input-number :step="0.1"
clearable
- :precision="2"
+ :precision="6"
:min="0"
style="width: 100%"
v-model="productForm.quantity"
@@ -621,7 +626,7 @@
<el-form-item label="鍚◣鎬讳环(鍏�)锛�"
prop="taxInclusiveTotalPrice">
<el-input-number v-model="productForm.taxInclusiveTotalPrice"
- :precision="2"
+ :precision="6"
:step="0.1"
:min="0"
clearable
@@ -633,7 +638,7 @@
<el-form-item label="涓嶅惈绋庢�讳环(鍏�)锛�"
prop="taxExclusiveTotalPrice">
<el-input-number v-model="productForm.taxExclusiveTotalPrice"
- :precision="2"
+ :precision="6"
:step="0.1"
:min="0"
clearable
@@ -660,7 +665,7 @@
<el-form-item label="搴撳瓨棰勮鏁伴噺锛�"
prop="warnNum">
<el-input-number v-model="productForm.warnNum"
- :precision="2"
+ :precision="6"
:step="0.1"
:min="0"
clearable
@@ -939,7 +944,16 @@
},
});
const { form, rules } = toRefs(data);
- const { form: searchForm } = useFormData(data.searchForm);
+ const { form: searchForm } = useFormData({
+ ...data.searchForm,
+ // 璁剧疆褰曞叆鏃ユ湡鑼冨洿涓哄綋澶�
+ entryDate: [
+ dayjs().startOf("day").format("YYYY-MM-DD"),
+ dayjs().endOf("day").format("YYYY-MM-DD"),
+ ],
+ entryDateStart: dayjs().startOf("day").format("YYYY-MM-DD"),
+ entryDateEnd: dayjs().endOf("day").format("YYYY-MM-DD"),
+ });
// 浜у搧琛ㄥ崟寮规鏁版嵁
const productFormVisible = ref(false);
@@ -1071,7 +1085,7 @@
};
const formattedNumber = (row, column, cellValue) => {
- return parseFloat(cellValue).toFixed(2);
+ return parseFloat(cellValue).toFixed(6);
};
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
@@ -1191,6 +1205,11 @@
"futureTicketsAmount",
],
{
+ taxInclusiveUnitPrice: { decimalPlaces: 6 },
+ taxInclusiveTotalPrice: { decimalPlaces: 6 },
+ taxExclusiveTotalPrice: { decimalPlaces: 6 },
+ ticketsAmount: { decimalPlaces: 6 },
+ futureTicketsAmount: { decimalPlaces: 6 },
ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
}
@@ -1256,15 +1275,30 @@
};
// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = param => {
- return proxy.summarizeTable(param, ["contractAmount"]);
+ return proxy.summarizeTable(
+ param,
+ ["contractAmount", "netContractAmount"],
+ {
+ contractAmount: { decimalPlaces: 6 },
+ netContractAmount: { decimalPlaces: 6 },
+ }
+ );
};
// 瀛愯〃鍚堣鏂规硶
const summarizeProTable = param => {
- return proxy.summarizeTable(param, [
- "taxInclusiveUnitPrice",
- "taxInclusiveTotalPrice",
- "taxExclusiveTotalPrice",
- ]);
+ return proxy.summarizeTable(
+ param,
+ [
+ "taxInclusiveUnitPrice",
+ "taxInclusiveTotalPrice",
+ "taxExclusiveTotalPrice",
+ ],
+ {
+ taxInclusiveUnitPrice: { decimalPlaces: 6 },
+ taxInclusiveTotalPrice: { decimalPlaces: 6 },
+ taxExclusiveTotalPrice: { decimalPlaces: 6 },
+ }
+ );
};
// 鎵撳紑寮规
const openForm = async (type, row) => {
@@ -1772,14 +1806,16 @@
productForm.value.taxInclusiveTotalPrice =
proxy.calculateTaxIncludeTotalPrice(
productForm.value.taxInclusiveUnitPrice,
- productForm.value.quantity
+ productForm.value.quantity,
+ 6
);
if (productForm.value.taxRate) {
// 涓嶅惈绋庢�讳环璁$畻
productForm.value.taxExclusiveTotalPrice =
proxy.calculateTaxExclusiveTotalPrice(
productForm.value.taxInclusiveTotalPrice,
- productForm.value.taxRate
+ productForm.value.taxRate,
+ 6
);
}
};
@@ -1810,7 +1846,7 @@
productForm.value.taxInclusiveUnitPrice = (
Number(productForm.value.taxInclusiveTotalPrice) /
Number(productForm.value.quantity)
- ).toFixed(2);
+ ).toFixed(6);
// 纭繚缁撴灉涓嶄负璐熸暟
if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
productForm.value.taxInclusiveUnitPrice = "0";
@@ -1821,7 +1857,7 @@
productForm.value.quantity = (
Number(productForm.value.taxInclusiveTotalPrice) /
Number(productForm.value.taxInclusiveUnitPrice)
- ).toFixed(2);
+ ).toFixed(6);
// 纭繚缁撴灉涓嶄负璐熸暟
if (Number(productForm.value.quantity) < 0) {
productForm.value.quantity = "0";
@@ -1831,7 +1867,7 @@
productForm.value.taxExclusiveTotalPrice = (
Number(productForm.value.taxInclusiveTotalPrice) /
(1 + taxRate / 100)
- ).toFixed(2);
+ ).toFixed(6);
// 纭繚缁撴灉涓嶄负璐熸暟
if (Number(productForm.value.taxExclusiveTotalPrice) < 0) {
productForm.value.taxExclusiveTotalPrice = "0";
@@ -1841,7 +1877,7 @@
productForm.value.taxInclusiveTotalPrice = (
Number(productForm.value.taxExclusiveTotalPrice) *
(1 + taxRate / 100)
- ).toFixed(2);
+ ).toFixed(6);
// 纭繚缁撴灉涓嶄负璐熸暟
if (Number(productForm.value.taxInclusiveTotalPrice) < 0) {
productForm.value.taxInclusiveTotalPrice = "0";
@@ -1851,7 +1887,7 @@
productForm.value.taxInclusiveUnitPrice = (
Number(productForm.value.taxInclusiveTotalPrice) /
Number(productForm.value.quantity)
- ).toFixed(2);
+ ).toFixed(6);
// 纭繚缁撴灉涓嶄负璐熸暟
if (Number(productForm.value.taxInclusiveUnitPrice) < 0) {
productForm.value.taxInclusiveUnitPrice = "0";
@@ -1862,7 +1898,7 @@
productForm.value.quantity = (
Number(productForm.value.taxInclusiveTotalPrice) /
Number(productForm.value.taxInclusiveUnitPrice)
- ).toFixed(2);
+ ).toFixed(6);
// 纭繚缁撴灉涓嶄负璐熸暟
if (Number(productForm.value.quantity) < 0) {
productForm.value.quantity = "0";
diff --git a/src/views/procurementManagement/procurementReport/index.vue b/src/views/procurementManagement/procurementReport/index.vue
index 26e682d..c109af3 100644
--- a/src/views/procurementManagement/procurementReport/index.vue
+++ b/src/views/procurementManagement/procurementReport/index.vue
@@ -48,7 +48,7 @@
<div class="summary-stats">
<div class="stat-item">
<span class="stat-label">閲囪喘鎬婚锛�</span>
- <span class="stat-value">楼{{ businessSummaryStats.totalAmount.toLocaleString() }}</span>
+ <span class="stat-value">楼{{ formatStatAmount(businessSummaryStats.totalAmount) }}</span>
</div>
<div class="stat-item">
<span class="stat-label">鍟嗗搧绉嶇被锛�</span>
@@ -56,7 +56,7 @@
</div>
<div class="stat-item">
<span class="stat-label">閫�娆炬�婚锛�</span>
- <span class="stat-value">{{ businessSummaryStats.returnAmount }}</span>
+ <span class="stat-value">楼{{ formatStatAmount(businessSummaryStats.returnAmount) }}</span>
</div>
</div>
</div>
@@ -101,8 +101,17 @@
// 缁熻鏁版嵁
const businessSummaryStats = ref({
totalAmount: 0,
+ returnAmount: 0,
productTypes: 0
})
+
+// 姹囨�婚噾棰濆睍绀猴紝淇濈暀6浣嶅皬鏁�
+const formatStatAmount = (val) => {
+ return Number(val || 0).toLocaleString('zh-CN', {
+ minimumFractionDigits: 6,
+ maximumFractionDigits: 6
+ })
+}
// 琛ㄦ牸鍒楅厤缃紙鏍规嵁鍚庣瀛楁瀹氫箟锛�
const tableColumns = ref([
@@ -119,7 +128,7 @@
prop: 'purchaseNum',
width: 120,
formatData: (val) => {
- return val ? parseFloat(val).toLocaleString() : '0'
+ return val ? parseFloat(val).toLocaleString('zh-CN', { minimumFractionDigits: 6, maximumFractionDigits: 6 }) : '0'
}
},
{
@@ -127,7 +136,7 @@
prop: 'returnQuantity',
width: 120,
formatData: (val) => {
- return val ? parseFloat(val).toLocaleString() : '0'
+ return val ? parseFloat(val).toLocaleString('zh-CN', { minimumFractionDigits: 6, maximumFractionDigits: 6 }) : '0'
}
},
{
@@ -135,14 +144,14 @@
prop: 'returnAmount',
width: 120,
formatData: (val) => {
- return val ? `楼${parseFloat(val).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : '楼0.00'
+ return val ? `楼${parseFloat(val).toLocaleString('zh-CN', { minimumFractionDigits: 6, maximumFractionDigits: 6 })}` : '楼0.000000'
}
},
{
label: '閫�娆惧偍閲�',
prop: 'purchaseAmount',
formatData: (val) => {
- return val ? `楼${parseFloat(val).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : '楼0.00'
+ return val ? `楼${parseFloat(val).toLocaleString('zh-CN', { minimumFractionDigits: 6, maximumFractionDigits: 6 })}` : '楼0.000000'
}
},
{
@@ -155,7 +164,7 @@
prop: 'averagePrice',
width: 120,
formatData: (val) => {
- return val ? `楼${parseFloat(val).toFixed(2)}` : '楼0.00'
+ return val ? `楼${parseFloat(val).toFixed(6)}` : '楼0.000000'
}
},
{
@@ -266,6 +275,7 @@
} else {
businessSummaryStats.value = {
totalAmount: 0,
+ returnAmount: 0,
productTypes: 0
}
}
diff --git a/src/views/procurementManagement/purchaseReturnOrder/New.vue b/src/views/procurementManagement/purchaseReturnOrder/New.vue
index 9474b11..6f67ca9 100644
--- a/src/views/procurementManagement/purchaseReturnOrder/New.vue
+++ b/src/views/procurementManagement/purchaseReturnOrder/New.vue
@@ -275,6 +275,7 @@
<el-input-number v-model="scope.row.returnQuantity"
controls-position="right"
:step="1"
+ :precision="6"
:min="0"
:max="getReturnQtyMax(scope.row)"
:disabled="getReturnQtyMax(scope.row) <= 0"
@@ -340,7 +341,7 @@
<el-input-number v-model="formState.totalDiscountAmount"
controls-position="right"
:step="0.01"
- :precision="2"
+ :precision="6"
style="width: 100%;"
@change="handleChangeTotalDiscountAmount"
placeholder="璇疯緭鍏ユ暣鍗曟姌鎵i"/>
@@ -353,7 +354,7 @@
<el-input v-model="formState.totalDiscountRate"
controls-position="right"
:step="0.01"
- :precision="2"
+ :precision="6"
style="width: 100%;"
@change="totalDiscount"
placeholder="璇疯緭鍏ユ暣鍗曟姌鎵g巼">
@@ -377,7 +378,7 @@
<el-input-number v-model="formState.totalAmount"
controls-position="right"
:step="0.01"
- :precision="2"
+ :precision="6"
style="width: 100%;"
placeholder="璇疯緭鍏ユ垚浜ら噾棰�"/>
</el-form-item>
@@ -511,7 +512,7 @@
});
const formattedNumber = (row, column, cellValue) => {
- return parseFloat(cellValue).toFixed(2);
+ return parseFloat(cellValue).toFixed(6);
};
const formatAmount = (value) => {
@@ -522,7 +523,7 @@
if (Number.isNaN(num)) {
return '--'
}
- return num.toFixed(2)
+ return num.toFixed(6)
}
const toNumber = (val) => {
@@ -535,14 +536,15 @@
const total = Number(row?.stockInNum ?? row?.totalQuantity ?? row?.quantity ?? 0)
const un = Number(row?.unQuantity ?? 0)
if (!Number.isFinite(total) || !Number.isFinite(un)) return 0
- return Math.max(total - un, 0)
+ // 淇濈暀6浣嶅皬鏁帮紝閬垮厤娴偣鍑忔硶浜х敓绮惧害璇樊
+ return Math.max(parseFloat((total - un).toFixed(6)), 0)
}
const getReturnTotal = (row) => {
const qty = toNumber(row?.returnQuantity)
const unitPrice = toNumber(row?.taxInclusiveUnitPrice)
const total = qty * unitPrice
- return Number(total.toFixed(2))
+ return Number(total.toFixed(6))
}
const syncReturnTotal = (row) => {
@@ -568,7 +570,7 @@
}
const baseAmount = getBaseAmount()
// 鎶樻墸棰� = 浜у搧閫�璐ф�讳环鍚堣 * 鎶樻墸鐜�
- formState.value.totalDiscountAmount = Number((baseAmount * (discountRate / 100)).toFixed(2))
+ formState.value.totalDiscountAmount = Number((baseAmount * (discountRate / 100)).toFixed(6))
syncTotalAmount()
}
@@ -596,9 +598,12 @@
"taxExclusiveTotalPrice",
],
{
- stockInNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
- returnQuantity: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
- unQuantity: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ stockInNum: { decimalPlaces: 6 },
+ returnQuantity: { decimalPlaces: 6 },
+ unQuantity: { decimalPlaces: 6 },
+ taxInclusiveUnitPrice: { decimalPlaces: 6 },
+ taxInclusiveTotalPrice: { decimalPlaces: 6 },
+ taxExclusiveTotalPrice: { decimalPlaces: 6 },
}
);
};
@@ -620,11 +625,11 @@
if (normalizedAmount > baseAmount) {
proxy.$modal.msgError("鏁村崟鎶樻墸棰濅笉鑳藉ぇ浜庝骇鍝侀��璐ф�讳环鍚堣")
- formState.value.totalDiscountAmount = Number(baseAmount.toFixed(2))
+ formState.value.totalDiscountAmount = Number(baseAmount.toFixed(6))
}
const discountRate = (toNumber(formState.value.totalDiscountAmount) / baseAmount) * 100
- formState.value.totalDiscountRate = Number(discountRate.toFixed(2))
+ formState.value.totalDiscountRate = Number(discountRate.toFixed(6))
syncTotalAmount()
}
@@ -639,7 +644,7 @@
const baseAmount = getBaseAmount()
const discount = toNumber(formState.value.totalDiscountAmount)
// 鎴愪氦閲戦 = 浜у搧閫�璐ф�讳环鍚堣 - 鎶樻墸棰�
- formState.value.totalAmount = Number((baseAmount - discount).toFixed(2))
+ formState.value.totalAmount = Number((baseAmount - discount).toFixed(6))
}
// 鑾峰彇渚涘簲鍟嗛�夐」
diff --git a/src/views/procurementManagement/purchaseReturnOrder/ProductList.vue b/src/views/procurementManagement/purchaseReturnOrder/ProductList.vue
index 27fae4a..66ab843 100644
--- a/src/views/procurementManagement/purchaseReturnOrder/ProductList.vue
+++ b/src/views/procurementManagement/purchaseReturnOrder/ProductList.vue
@@ -116,7 +116,7 @@
const selectedRows = ref([])
const tableLoading = ref(false)
const formattedNumber = (row, column, cellValue) => {
- return parseFloat(cellValue).toFixed(2);
+ return parseFloat(cellValue).toFixed(6);
};
/** 宸查��璐ф暟閲� = 鍏ュ簱琛屾�绘暟閲� 鈭� 褰撳墠鍙��璐ф暟閲忥紙鍓╀綑锛� */
diff --git a/src/views/procurementManagement/purchaseReturnOrder/index.vue b/src/views/procurementManagement/purchaseReturnOrder/index.vue
index f8866e1..c6fb4ac 100644
--- a/src/views/procurementManagement/purchaseReturnOrder/index.vue
+++ b/src/views/procurementManagement/purchaseReturnOrder/index.vue
@@ -458,7 +458,7 @@
if (Number.isNaN(num)) {
return value;
}
- return num.toFixed(2);
+ return num.toFixed(6);
};
/** 宸查��璐ф暟閲� = 鍏ュ簱琛屾�绘暟閲� 鈭� 褰撳墠鍙��璐ф暟閲忥紙鍓╀綑锛� */
@@ -466,7 +466,8 @@
const total = Number(row?.stockInNum ?? row?.totalQuantity ?? row?.quantity ?? 0);
const un = Number(row?.unQuantity ?? 0);
if (!Number.isFinite(total) || !Number.isFinite(un)) return 0;
- return Math.max(total - un, 0);
+ // 淇濈暀6浣嶅皬鏁帮紝閬垮厤娴偣鍑忔硶浜х敓绮惧害璇樊
+ return Math.max(parseFloat((total - un).toFixed(6)), 0);
};
onMounted(() => {
diff --git a/src/views/productionManagement/workOrderManagement/index.vue b/src/views/productionManagement/workOrderManagement/index.vue
index b721de6..704bcbf 100644
--- a/src/views/productionManagement/workOrderManagement/index.vue
+++ b/src/views/productionManagement/workOrderManagement/index.vue
@@ -544,6 +544,12 @@
},
});
const { searchForm } = toRefs(data);
+ // 鏁伴噺杩愮畻淇濈暀6浣嶅皬鏁帮紝閬垮厤娴偣鍑忔硶鍑虹幇 7.199999999999999 杩欑被绮惧害璇樊
+ const toQuantity = val => {
+ const n = Number(val);
+ if (!Number.isFinite(n)) return 0;
+ return parseFloat(n.toFixed(6));
+ };
const toProgressPercentage = val => {
const n = Number(val);
if (!Number.isFinite(n)) return 0;
@@ -675,7 +681,10 @@
currentReportRowData.value = row;
const planQuantity = Number(row.planQuantity || 0);
const completeQuantity = Number(row.completeQuantity || 0);
- const remainingQuantity = Math.max(0, planQuantity - completeQuantity);
+ const remainingQuantity = Math.max(
+ 0,
+ toQuantity(planQuantity - completeQuantity)
+ );
reportForm.planQuantity = remainingQuantity;
reportForm.quantity =
row.quantity !== undefined && row.quantity !== null ? row.quantity : null;
diff --git a/src/views/salesManagement/receiptPaymentLedger/index.vue b/src/views/salesManagement/receiptPaymentLedger/index.vue
index 96c7856..1278d72 100644
--- a/src/views/salesManagement/receiptPaymentLedger/index.vue
+++ b/src/views/salesManagement/receiptPaymentLedger/index.vue
@@ -126,12 +126,12 @@
<el-dialog v-model="receiptDialogVisible" title="鏂板鍥炴" width="35%" @close="closeReceiptDialog">
<el-form :model="receiptForm" label-width="100px" :rules="receiptRules" ref="receiptFormRef">
- <el-form-item label="閿�鍞悎鍚屽彿锛�"> {{ currentRow.salesContractNo || '--' }} </el-form-item>
+ <el-form-item label="閿�鍞悎鍚屽彿锛�">{{ currentRow.salesContractNo || '--' }}</el-form-item>
<el-form-item label="鍥炴鏃ユ湡锛�" prop="paymentDate">
<el-date-picker style="width:100%" v-model="receiptForm.paymentDate" value-format="YYYY-MM-DD" type="date" placeholder="璇烽�夋嫨鍥炴鏃ユ湡" clearable />
</el-form-item>
<el-form-item label="鍥炴閲戦锛�" prop="paymentAmount">
- <el-input-number style="width:100%" v-model="receiptForm.paymentAmount" :precision="2" :min="0" :max="Math.max(0,(Number(currentRow.receiptableAmount)||0)-(Number(currentRow.receiptPaymentAmount)||0))" placeholder="璇疯緭鍏ュ洖娆鹃噾棰�" controls-position="right" />
+ <el-input-number style="width:100%" v-model="receiptForm.paymentAmount" :min="0" :precision="6" :max="Math.max(0,(Number(currentRow.receiptableAmount)||0)-(Number(currentRow.receiptPaymentAmount)||0))" placeholder="璇疯緭鍏ュ洖娆鹃噾棰�" controls-position="right" />
<div style="color:#e6a23c;font-size:12px;margin-top:4px">褰撳墠鍙洖娆句綑棰濓細{{ formattedNumber(null,null,Math.max(0,(Number(currentRow.receiptableAmount)||0)-(Number(currentRow.receiptPaymentAmount)||0))) }} 鍏�</div>
</el-form-item>
<el-form-item label="鍥炴鏂瑰紡锛�" prop="paymentMethod">
@@ -184,28 +184,11 @@
const currentRow = ref({});
const receiptFormRef = ref(null);
const receiptForm = reactive({ paymentDate:"", paymentAmount:undefined, paymentMethod:"", remark:"" });
- const validatePaymentAmount = (_,v,cb) => {
- if(!v) return cb(new Error("璇疯緭鍏ュ洖娆鹃噾棰�"));
- const max = Math.max(0,(Number(currentRow.value.receiptableAmount)||0)-(Number(currentRow.value.receiptPaymentAmount)||0));
- if(v > max) return cb(new Error(`鍥炴閲戦涓嶈兘瓒呰繃鍙洖娆句綑棰� ${max.toFixed(2)} 鍏僠));
- cb();
- };
- const receiptRules = {
- paymentDate:[{required:true,message:"璇烽�夋嫨鍥炴鏃ユ湡",trigger:"change"}],
- paymentAmount:[{required:true,validator:validatePaymentAmount,trigger:"blur"}],
- paymentMethod:[{required:true,message:"璇烽�夋嫨鍥炴鏂瑰紡",trigger:"change"}],
- };
- const openReceiptDialog = row => { currentRow.value=row; receiptForm.paymentDate=""; receiptForm.paymentAmount=undefined; receiptForm.paymentMethod=""; receiptForm.remark=""; receiptDialogVisible.value=true; };
+ const validatePaymentAmount = (_,v,cb) => { if(!v) return cb(new Error("璇疯緭鍏ュ洖娆鹃噾棰�")); const m=Math.max(0,(Number(currentRow.value.receiptableAmount)||0)-(Number(currentRow.value.receiptPaymentAmount)||0)); if(v>m) return cb(new Error(`鍥炴閲戦涓嶈兘瓒呰繃鍙洖娆句綑棰� ${m.toFixed(6)} 鍏僠)); cb(); };
+ const receiptRules = { paymentDate:[{required:true,message:"璇烽�夋嫨鍥炴鏃ユ湡",trigger:"change"}], paymentAmount:[{required:true,validator:validatePaymentAmount,trigger:"blur"}], paymentMethod:[{required:true,message:"璇烽�夋嫨鍥炴鏂瑰紡",trigger:"change"}] };
+ const openReceiptDialog = r => { currentRow.value=r; receiptForm.paymentDate=""; receiptForm.paymentAmount=undefined; receiptForm.paymentMethod=""; receiptForm.remark=""; receiptDialogVisible.value=true; };
const closeReceiptDialog = () => { receiptFormRef.value?.resetFields(); receiptDialogVisible.value=false; };
- const submitReceiptForm = () => {
- receiptFormRef.value?.validate(valid => {
- if(valid){
- saveReceiptPayment({ customerId:customerId.value, salesContractNo:currentRow.value.salesContractNo, paymentDate:receiptForm.paymentDate, paymentAmount:receiptForm.paymentAmount, paymentMethod:receiptForm.paymentMethod, remark:receiptForm.remark }).then(res => {
- proxy.$modal.msgSuccess("鏂板鍥炴鎴愬姛"); closeReceiptDialog(); receiptPaymentList(customerId.value); getList();
- });
- }
- });
- };
+ const submitReceiptForm = () => { receiptFormRef.value?.validate(v=>{ if(v){ saveReceiptPayment({ customerId:customerId.value, salesContractNo:currentRow.value.salesContractNo, paymentDate:receiptForm.paymentDate, paymentAmount:receiptForm.paymentAmount, paymentMethod:receiptForm.paymentMethod, remark:receiptForm.remark }).then(res=>{ proxy.$modal.msgSuccess("鏂板鍥炴鎴愬姛"); closeReceiptDialog(); receiptPaymentList(customerId.value); getList(); }); } }); };
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
@@ -231,7 +214,7 @@
});
};
const formattedNumber = (row, column, cellValue) => {
- return cellValue ? parseFloat(cellValue).toFixed(2) : "0.00";
+ return cellValue ? parseFloat(cellValue).toFixed(6) : "0.000000";
};
// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = param => {
@@ -239,6 +222,9 @@
param,
["invoiceTotal", "receiptPaymentAmount", "unReceiptPaymentAmount"],
{
+ invoiceTotal: { decimalPlaces: 6 },
+ receiptPaymentAmount: { decimalPlaces: 6 },
+ unReceiptPaymentAmount: { decimalPlaces: 6 },
ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
}
@@ -250,6 +236,9 @@
param,
["contractAmount", "receiptPaymentAmount", "receiptableAmount"],
{
+ contractAmount: { decimalPlaces: 6 },
+ receiptPaymentAmount: { decimalPlaces: 6 },
+ receiptableAmount: { decimalPlaces: 6 },
ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
}
diff --git a/src/views/salesManagement/returnOrder/components/detailDia.vue b/src/views/salesManagement/returnOrder/components/detailDia.vue
index ecc663f..2b723e2 100644
--- a/src/views/salesManagement/returnOrder/components/detailDia.vue
+++ b/src/views/salesManagement/returnOrder/components/detailDia.vue
@@ -239,7 +239,7 @@
raw?.canReturnQuantity,
returnQuantity: Number.isFinite(num) ? num : 0,
price: Number(raw?.taxInclusiveUnitPrice ?? raw?.price ?? 0),
- amount: Number(raw?.amount ?? 0).toFixed(2),
+ amount: Number(raw?.amount ?? 0).toFixed(6),
isQuality: raw?.isQuality ?? 2,
remark: raw?.remark ?? "",
};
diff --git a/src/views/salesManagement/returnOrder/components/formDia.vue b/src/views/salesManagement/returnOrder/components/formDia.vue
index 81d9487..3999eea 100644
--- a/src/views/salesManagement/returnOrder/components/formDia.vue
+++ b/src/views/salesManagement/returnOrder/components/formDia.vue
@@ -216,7 +216,8 @@
const total = Number(row?.stockOutNum ?? row?.totalQuantity ?? row?.totalReturnNum ?? 0);
const un = Number(row?.unQuantity ?? 0);
if (!Number.isFinite(total) || !Number.isFinite(un)) return 0;
- return Math.max(total - un, 0);
+ // 淇濈暀6浣嶅皬鏁帮紝閬垮厤娴偣鍑忔硶浜х敓绮惧害璇樊
+ return Math.max(parseFloat((total - un).toFixed(6)), 0);
};
const tableColumn = ref([
@@ -437,7 +438,7 @@
num,
returnQuantity: Number.isFinite(num) ? num : 0,
price: Number(raw?.taxInclusiveUnitPrice ?? raw?.price ?? 0),
- amount: Number(raw?.amount ?? 0).toFixed(2),
+ amount: Number(raw?.amount ?? 0).toFixed(6),
isQuality: raw?.isQuality ?? 2,
remark: raw?.remark ?? "",
};
@@ -666,14 +667,14 @@
const calculateRowAmount = (row) => {
const stockOutNum = Number(row.returnQuantity || 0);
const price = Number(row.price || 0);
- row.amount = (stockOutNum * price).toFixed(2);
+ row.amount = (stockOutNum * price).toFixed(6);
};
const calculateTotalRefund = () => {
const total = tableData.value.reduce((sum, row) => {
return sum + Number(row.amount || 0);
}, 0);
- form.value.refundAmount = total.toFixed(2);
+ form.value.refundAmount = total.toFixed(6);
};
const availableProducts = ref([]);
@@ -715,7 +716,7 @@
returnQuantity: 0,
num: 0,
price: Number(product.taxInclusiveUnitPrice ?? 0),
- amount: "0.00",
+ amount: "0.000000",
isQuality: 2,
remark: "",
productCategory: product.productCategory ?? product.productName ?? "",
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index d2e82b5..c001152 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -664,7 +664,7 @@
align="right"
>
<template #default="scope">
- {{ Number(scope.row.totalAmount ?? 0).toFixed(2) }}
+ {{ Number(scope.row.totalAmount ?? 0).toFixed(6) }}
</template>
</el-table-column>
<el-table-column fixed="right" label="鎿嶄綔" width="120" align="center">
@@ -776,7 +776,7 @@
:min="0"
v-model="productForm.taxInclusiveUnitPrice"
style="width: 100%"
- :precision="2"
+ :precision="6"
placeholder="璇疯緭鍏�"
clearable
@change="calculateFromUnitPrice"
@@ -791,7 +791,7 @@
v-model="productForm.quantity"
placeholder="璇疯緭鍏�"
clearable
- :precision="2"
+ :precision="6"
@change="calculateFromQuantity"
style="width: 100%"
/>
@@ -1144,7 +1144,7 @@
v-model="scope.row.deliveryQuantity"
:min="0"
:max="getDeliveryBatchDeliveryMax(scope.row)"
- :precision="2"
+ :precision="6"
:step="0.01"
controls-position="right"
@change="handleDeliveryBatchQuantityChange(scope.row)"
@@ -1542,9 +1542,9 @@
};
const formattedNumber = (row, column, cellValue) => {
if (cellValue === undefined || cellValue === null || cellValue === "") {
- return "0.00";
+ return "0.000000";
}
- return parseFloat(cellValue).toFixed(2);
+ return parseFloat(cellValue).toFixed(6);
};
const findLedgerRecordByRow = (row) => {
if (!row) return null;
@@ -1708,11 +1708,15 @@
};
// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = (param) => {
- return proxy.summarizeTable(param, [
- "contractAmount",
- "taxInclusiveTotalPrice",
- "taxExclusiveTotalPrice",
- ]);
+ return proxy.summarizeTable(
+ param,
+ ["contractAmount", "taxInclusiveTotalPrice", "taxExclusiveTotalPrice"],
+ {
+ contractAmount: { decimalPlaces: 6 },
+ taxInclusiveTotalPrice: { decimalPlaces: 6 },
+ taxExclusiveTotalPrice: { decimalPlaces: 6 },
+ }
+ );
};
// 瀛愯〃鍚堣鏂规硶
const summarizeChildrenTable = (param, parentRow) => {
@@ -1734,11 +1738,19 @@
return "";
});
}
- return proxy.summarizeTable(param, [
- "taxInclusiveUnitPrice",
- "taxInclusiveTotalPrice",
- "taxExclusiveTotalPrice",
- ]);
+ return proxy.summarizeTable(
+ param,
+ [
+ "taxInclusiveUnitPrice",
+ "taxInclusiveTotalPrice",
+ "taxExclusiveTotalPrice",
+ ],
+ {
+ taxInclusiveUnitPrice: { decimalPlaces: 6 },
+ taxInclusiveTotalPrice: { decimalPlaces: 6 },
+ taxExclusiveTotalPrice: { decimalPlaces: 6 },
+ }
+ );
};
// 鎵撳紑寮规
const openForm = async (type, row) => {
@@ -1868,10 +1880,11 @@
const quantity = Number(p.quantity ?? 0) || 0;
const unitPrice = Number(p.unitPrice ?? 0) || 0;
const taxRate = "13"; // 榛樿 13%锛屼究浜庣洿鎺ユ彁浜わ紙濡傞渶鍙湪浜у搧涓嚜琛屼慨鏀癸級
- const taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(2);
+ const taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(6);
const taxExclusiveTotalPrice = proxy.calculateTaxExclusiveTotalPrice(
taxInclusiveTotalPrice,
- taxRate
+ taxRate,
+ 6
);
return {
// 鍙拌处瀛楁
@@ -1880,7 +1893,7 @@
unit: p.unit || "",
quantity: quantity,
taxRate: taxRate,
- taxInclusiveUnitPrice: unitPrice.toFixed(2),
+ taxInclusiveUnitPrice: unitPrice.toFixed(6),
taxInclusiveTotalPrice: taxInclusiveTotalPrice,
taxExclusiveTotalPrice: taxExclusiveTotalPrice,
invoiceType: "澧炴櫘绁�",
@@ -2549,7 +2562,7 @@
const total = products.reduce((sum, product) => {
return sum + (parseFloat(product.quantity) || 0);
}, 0);
- return total.toFixed(2);
+ return total.toFixed(6);
};
// 璁$畻浜у搧鎬婚噾棰�
@@ -2558,7 +2571,7 @@
const total = products.reduce((sum, product) => {
return sum + (parseFloat(product.taxInclusiveTotalPrice) || 0);
}, 0);
- return total.toFixed(2);
+ return total.toFixed(6);
};
// 鐢ㄤ簬鎵撳嵃鐨勮绠楀嚱鏁�
@@ -2567,7 +2580,7 @@
const total = products.reduce((sum, product) => {
return sum + (parseFloat(product.quantity) || 0);
}, 0);
- return total.toFixed(2);
+ return total.toFixed(6);
};
const getTotalAmountForPrint = (products) => {
@@ -2575,7 +2588,7 @@
const total = products.reduce((sum, product) => {
return sum + (parseFloat(product.taxInclusiveTotalPrice) || 0);
}, 0);
- return total.toFixed(2);
+ return total.toFixed(6);
};
const mathNum = () => {
@@ -2590,14 +2603,16 @@
productForm.value.taxInclusiveTotalPrice =
proxy.calculateTaxIncludeTotalPrice(
productForm.value.taxInclusiveUnitPrice,
- productForm.value.quantity
+ productForm.value.quantity,
+ 6
);
if (productForm.value.taxRate) {
// 涓嶅惈绋庢�讳环璁$畻
productForm.value.taxExclusiveTotalPrice =
proxy.calculateTaxExclusiveTotalPrice(
productForm.value.taxInclusiveTotalPrice,
- productForm.value.taxRate
+ productForm.value.taxRate,
+ 6
);
}
};
@@ -2616,14 +2631,15 @@
isCalculating.value = true;
// 璁$畻鍚◣鍗曚环 = 鍚◣鎬讳环 / 鏁伴噺
- productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(2);
+ productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(6);
// 濡傛灉鏈夌◣鐜囷紝璁$畻涓嶅惈绋庢�讳环
if (productForm.value.taxRate) {
productForm.value.taxExclusiveTotalPrice =
proxy.calculateTaxExclusiveTotalPrice(
totalPrice,
- productForm.value.taxRate
+ productForm.value.taxRate,
+ 6
);
}
@@ -2653,12 +2669,12 @@
// 鍏堣绠楀惈绋庢�讳环 = 涓嶅惈绋庢�讳环 / (1 - 绋庣巼/100)
const taxRateDecimal = taxRate / 100;
const inclusiveTotalPrice = exclusiveTotalPrice / (1 - taxRateDecimal);
- productForm.value.taxInclusiveTotalPrice = inclusiveTotalPrice.toFixed(2);
+ productForm.value.taxInclusiveTotalPrice = inclusiveTotalPrice.toFixed(6);
// 璁$畻鍚◣鍗曚环 = 鍚◣鎬讳环 / 鏁伴噺
productForm.value.taxInclusiveUnitPrice = (
inclusiveTotalPrice / quantity
- ).toFixed(2);
+ ).toFixed(6);
isCalculating.value = false;
};
@@ -2681,14 +2697,15 @@
isCalculating.value = true;
// 璁$畻鍚◣鎬讳环
- productForm.value.taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(2);
+ productForm.value.taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(6);
// 濡傛灉鏈夌◣鐜囷紝璁$畻涓嶅惈绋庢�讳环
if (productForm.value.taxRate) {
productForm.value.taxExclusiveTotalPrice =
proxy.calculateTaxExclusiveTotalPrice(
productForm.value.taxInclusiveTotalPrice,
- productForm.value.taxRate
+ productForm.value.taxRate,
+ 6
);
}
@@ -2713,14 +2730,15 @@
isCalculating.value = true;
// 璁$畻鍚◣鎬讳环
- productForm.value.taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(2);
+ productForm.value.taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(6);
// 濡傛灉鏈夌◣鐜囷紝璁$畻涓嶅惈绋庢�讳环
if (productForm.value.taxRate) {
productForm.value.taxExclusiveTotalPrice =
proxy.calculateTaxExclusiveTotalPrice(
productForm.value.taxInclusiveTotalPrice,
- productForm.value.taxRate
+ productForm.value.taxRate,
+ 6
);
}
@@ -2748,7 +2766,7 @@
// 璁$畻涓嶅惈绋庢�讳环
productForm.value.taxExclusiveTotalPrice =
- proxy.calculateTaxExclusiveTotalPrice(inclusiveTotalPrice, taxRate);
+ proxy.calculateTaxExclusiveTotalPrice(inclusiveTotalPrice, taxRate, 6);
isCalculating.value = false;
};
diff --git a/src/views/salesManagement/salesQuotation/index.vue b/src/views/salesManagement/salesQuotation/index.vue
index fce764f..df1111d 100644
--- a/src/views/salesManagement/salesQuotation/index.vue
+++ b/src/views/salesManagement/salesQuotation/index.vue
@@ -65,7 +65,7 @@
</el-table-column>
<el-table-column prop="totalAmount" label="鎶ヤ环閲戦" width="120">
<template #default="scope">
- 楼{{ scope.row.totalAmount.toFixed(2) }}
+ 楼{{ scope.row.totalAmount.toFixed(6) }}
</template>
</el-table-column>
<el-table-column label="鎿嶄綔" width="200" fixed="right" align="center">
@@ -215,7 +215,7 @@
<el-table-column prop="unitPrice" label="鍗曚环">
<template #default="scope">
<el-form-item :prop="`products.${scope.$index}.unitPrice`" class="product-table-form-item">
- <el-input-number v-model="scope.row.unitPrice" :min="0" :precision="2" style="width: 100%" />
+ <el-input-number v-model="scope.row.unitPrice" :min="0" :precision="6" style="width: 100%" />
</el-form-item>
</template>
</el-table-column>
@@ -267,7 +267,7 @@
<!-- <el-tag :type="getStatusType(currentQuotation.status)">{{ currentQuotation.status }}</el-tag>-->
<!-- </el-descriptions-item>-->
<el-descriptions-item label="鎶ヤ环鎬婚" :span="2">
- <span style="font-size: 18px; color: #e6a23c; font-weight: bold;">楼{{ currentQuotation.totalAmount?.toFixed(2) }}</span>
+ <span style="font-size: 18px; color: #e6a23c; font-weight: bold;">楼{{ currentQuotation.totalAmount?.toFixed(6) }}</span>
</el-descriptions-item>
</el-descriptions>
@@ -279,7 +279,7 @@
<el-table-column prop="unit" label="鍗曚綅" />
<el-table-column prop="unitPrice" label="鍗曚环">
<template #default="scope">
- 楼{{ scope.row.unitPrice.toFixed(2) }}
+ 楼{{ scope.row.unitPrice.toFixed(6) }}
</template>
</el-table-column>
</el-table>
--
Gitblit v1.9.3