From 41a639a4a4b6fbf35db7903b5ee3c068c8644430 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期二, 21 四月 2026 10:45:56 +0800
Subject: [PATCH] feat: 统一数值精度为三位小数并添加保养项目字段

---
 src/views/salesManagement/salesLedger/index.vue |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index d3daec6..5537bb9 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -375,9 +375,10 @@
 					<el-col :span="12">
 						<el-form-item label="绋庣巼(%)锛�" prop="taxRate">
 							<el-select v-model="productForm.taxRate" placeholder="璇烽�夋嫨" clearable @change="calculateFromTaxRate">
-								<el-option label="1" value="1" />
-								<el-option label="6" value="6" />
-								<el-option label="13" value="13" />
+								<el-option label="0" :value="0" />
+								<el-option label="1" :value="1" />
+								<el-option label="6" :value="6" />
+								<el-option label="13" :value="13" />
 							</el-select>
 						</el-form-item>
 					</el-col>
@@ -751,7 +752,7 @@
 		unit: "",
 		quantity: "",
 		taxInclusiveUnitPrice: "",
-		taxRate: "",
+		taxRate: 0,
 		taxInclusiveTotalPrice: "",
 		taxExclusiveTotalPrice: "",
 		invoiceType: "",
@@ -1200,7 +1201,7 @@
 	productData.value = products.map((p) => {
 		const quantity = Number(p.quantity ?? 0) || 0;
 		const unitPrice = Number(p.unitPrice ?? 0) || 0;
-		const taxRate = "0"; // 榛樿 13%锛屼究浜庣洿鎺ユ彁浜わ紙濡傞渶鍙湪浜у搧涓嚜琛屼慨鏀癸級
+		const taxRate = Number(p.taxRate ?? 0) || 0; // 榛樿 13%锛屼究浜庣洿鎺ユ彁浜わ紙濡傞渶鍙湪浜у搧涓嚜琛屼慨鏀癸級
 		const taxInclusiveTotalPrice = (unitPrice * quantity).toFixed(3);
 		const taxExclusiveTotalPrice = proxy.calculateTaxExclusiveTotalPrice(taxInclusiveTotalPrice, taxRate, 3);
 		return {
@@ -1300,7 +1301,10 @@
 	}
 	
 	productOperationType.value = type;
-	productForm.value = {};
+	productForm.value = {
+		taxRate: 0,
+		invoiceType: "澧炴櫘绁�"
+	};
 	proxy.resetForm("productFormRef");
 	if (type === "edit") {
 		productForm.value = { ...row };
@@ -1335,6 +1339,7 @@
 const submitProduct = () => {
 	proxy.$refs["productFormRef"].validate((valid) => {
 		if (valid) {
+			productForm.value.taxRate = productForm.value.taxRate?productForm.value.taxRate:0;
 			if (operationType.value === "edit") {
 				submitProductEdit();
 			} else {

--
Gitblit v1.9.3