From e705ef7b15c04307d6f37b388564dedfaeef4a55 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期二, 21 四月 2026 15:27:09 +0800
Subject: [PATCH] 阳光彩印web 生产报工的机台展示
---
src/views/salesManagement/salesLedger/index.vue | 57 ++++++++++++++++++++++++++++++++-------------------------
1 files changed, 32 insertions(+), 25 deletions(-)
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index d203f32..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: "",
@@ -767,14 +768,14 @@
taxInclusiveUnitPrice: [
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
],
- taxRate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ // taxRate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
taxInclusiveTotalPrice: [
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
],
taxExclusiveTotalPrice: [
{ required: true, message: "璇疯緭鍏�", trigger: "blur" },
],
- invoiceType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ // invoiceType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
},
});
const { productForm, productRules } = toRefs(productFormData);
@@ -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 = "13"; // 榛樿 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 {
@@ -1936,10 +1941,10 @@
// 鏍规嵁涓嶅惈绋庢�讳环璁$畻鍚◣鍗曚环鍜屾暟閲�
const calculateFromExclusiveTotalPrice = () => {
- if (!productForm.value.taxRate) {
- proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
- return;
- }
+ // if (!productForm.value.taxRate) {
+ // proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
+ // return;
+ // }
if (isCalculating.value) return;
const exclusiveTotalPrice = parseFloat(productForm.value.taxExclusiveTotalPrice);
@@ -1965,10 +1970,10 @@
// 鏍规嵁鏁伴噺鍙樺寲璁$畻鎬讳环
const calculateFromQuantity = () => {
- if (!productForm.value.taxRate) {
- proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
- return;
- }
+ // if (!productForm.value.taxRate) {
+ // proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
+ // return;
+ // }
if (isCalculating.value) return;
const quantity = parseFloat(productForm.value.quantity);
@@ -1991,17 +1996,19 @@
productForm.value.taxRate,
3
);
- }
+ }else{
+ productForm.value.taxExclusiveTotalPrice = (unitPrice * quantity).toFixed(3);
+ }
isCalculating.value = false;
};
// 鏍规嵁鍚◣鍗曚环鍙樺寲璁$畻鎬讳环
const calculateFromUnitPrice = () => {
- if (!productForm.value.taxRate) {
- proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
- return;
- }
+ // if (!productForm.value.taxRate) {
+ // proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
+ // return;
+ // }
if (isCalculating.value) return;
const quantity = parseFloat(productForm.value.quantity);
@@ -2031,10 +2038,10 @@
// 鏍规嵁绋庣巼鍙樺寲璁$畻涓嶅惈绋庢�讳环
const calculateFromTaxRate = () => {
- if (!productForm.value.taxRate) {
- proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
- return;
- }
+ // if (!productForm.value.taxRate) {
+ // proxy.$modal.msgWarning("璇峰厛閫夋嫨绋庣巼");
+ // return;
+ // }
if (isCalculating.value) return;
const inclusiveTotalPrice = parseFloat(productForm.value.taxInclusiveTotalPrice);
--
Gitblit v1.9.3