From 9b25e5c7a4e2e300b213ad4d5fb4d4b72cdced39 Mon Sep 17 00:00:00 2001
From: zhang_nuo <zhang_12370@163.com>
Date: 星期日, 13 九月 2026 11:40:54 +0800
Subject: [PATCH] fix(monitor/operlog): 修复操作日志表格操作日期显示错误
---
src/views/salesManagement/salesLedger/index.vue | 130 ++++++++++++++++++++++++++++---------------
1 files changed, 85 insertions(+), 45 deletions(-)
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 4c13d3d..c001152 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -117,6 +117,11 @@
</el-tag>
</template>
</el-table-column>
+ <el-table-column label="瀹℃壒涓暟閲�" width="120" align="center">
+ <template #default="scope">
+ <span>{{ scope.row.pendingApprovalQuantity || 0 }}</span>
+ </template>
+ </el-table-column>
<el-table-column
label="蹇�掑叕鍙�"
prop="expressCompany"
@@ -148,6 +153,7 @@
</template>
</el-table-column>
<el-table-column label="鏁伴噺" prop="quantity" />
+ <el-table-column label="閫�璐ф暟閲�" prop="returnQuantity" />
<el-table-column label="寰呭彂璐ф暟閲�" prop="noQuantity" />
<el-table-column label="绋庣巼(%)" prop="taxRate" />
<el-table-column
@@ -214,6 +220,13 @@
<el-table-column
label="鍚堝悓閲戦(鍏�)"
prop="contractAmount"
+ width="220"
+ show-overflow-tooltip
+ :formatter="formattedNumber"
+ />
+ <el-table-column
+ label="瀹為檯鍚堝悓閲戦(鍏�)"
+ prop="netContractAmount"
width="220"
show-overflow-tooltip
:formatter="formattedNumber"
@@ -651,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">
@@ -763,7 +776,7 @@
:min="0"
v-model="productForm.taxInclusiveUnitPrice"
style="width: 100%"
- :precision="2"
+ :precision="6"
placeholder="璇疯緭鍏�"
clearable
@change="calculateFromUnitPrice"
@@ -778,7 +791,7 @@
v-model="productForm.quantity"
placeholder="璇疯緭鍏�"
clearable
- :precision="2"
+ :precision="6"
@change="calculateFromQuantity"
style="width: 100%"
/>
@@ -1131,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)"
@@ -1529,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;
@@ -1695,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) => {
@@ -1721,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) => {
@@ -1749,7 +1774,7 @@
// 绛捐鏃ユ湡榛樿涓哄綋澶�
form.value.executionDate = getCurrentDate();
// 鍒涘缓鏃堕棿榛樿涓哄綋澶�
- form.value.createTime = getCurrentDate();
+ form.value.createTime = dayjs().format("YYYY-MM-DD HH:mm:ss");
// 榛樿鑷姩鐢熸垚閿�鍞悎鍚屽彿
form.value.autoGenerateContractNo = true;
} else {
@@ -1855,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 {
// 鍙拌处瀛楁
@@ -1867,7 +1893,7 @@
unit: p.unit || "",
quantity: quantity,
taxRate: taxRate,
- taxInclusiveUnitPrice: unitPrice.toFixed(2),
+ taxInclusiveUnitPrice: unitPrice.toFixed(6),
taxInclusiveTotalPrice: taxInclusiveTotalPrice,
taxExclusiveTotalPrice: taxExclusiveTotalPrice,
invoiceType: "澧炴櫘绁�",
@@ -2004,6 +2030,12 @@
);
if (shippedProducts.length > 0) {
proxy.$modal.msgWarning("宸插彂璐ф垨瀹℃牳閫氳繃鐨勪骇鍝佷笉鑳藉垹闄�");
+ return;
+ }
+
+ // 妫�鏌ユ槸鍚﹀彧鍓╀竴鏉℃暟鎹紝閿�鍞彴璐﹁嚦灏戜繚鐣欎竴鏉′骇鍝�
+ if (productData.value.length <= 1) {
+ proxy.$modal.msgWarning("閿�鍞彴璐﹁嚦灏戦渶瑕佷繚鐣欎竴鏉′骇鍝佹暟鎹�");
return;
}
@@ -2155,7 +2187,7 @@
};
// 鎵撳嵃鍔熻兘
-const handlePrint = async () => {
+ const handlePrint = async () => {
if (selectedRows.value.length === 0) {
proxy.$modal.msgWarning("璇烽�夋嫨瑕佹墦鍗扮殑鏁版嵁");
return;
@@ -2512,11 +2544,7 @@
// 鏍煎紡鍖栨棩鏈�
const formatDate = (dateString) => {
if (!dateString) return getCurrentDate();
- const date = new Date(dateString);
- const year = date.getFullYear();
- const month = String(date.getMonth() + 1).padStart(2, "0");
- const day = String(date.getDate()).padStart(2, "0");
- return `${year}/${month}/${day}`;
+ return dayjs(dateString).format("YYYY/MM/DD HH:mm:ss");
};
// 鏍煎紡鍖栨棩鏈熸椂闂�
const formatDateTime = (date) => {
@@ -2534,7 +2562,7 @@
const total = products.reduce((sum, product) => {
return sum + (parseFloat(product.quantity) || 0);
}, 0);
- return total.toFixed(2);
+ return total.toFixed(6);
};
// 璁$畻浜у搧鎬婚噾棰�
@@ -2543,7 +2571,7 @@
const total = products.reduce((sum, product) => {
return sum + (parseFloat(product.taxInclusiveTotalPrice) || 0);
}, 0);
- return total.toFixed(2);
+ return total.toFixed(6);
};
// 鐢ㄤ簬鎵撳嵃鐨勮绠楀嚱鏁�
@@ -2552,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) => {
@@ -2560,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 = () => {
@@ -2575,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
);
}
};
@@ -2601,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
);
}
@@ -2638,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;
};
@@ -2666,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
);
}
@@ -2698,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
);
}
@@ -2733,7 +2766,7 @@
// 璁$畻涓嶅惈绋庢�讳环
productForm.value.taxExclusiveTotalPrice =
- proxy.calculateTaxExclusiveTotalPrice(inclusiveTotalPrice, taxRate);
+ proxy.calculateTaxExclusiveTotalPrice(inclusiveTotalPrice, taxRate, 6);
isCalculating.value = false;
};
@@ -2803,7 +2836,7 @@
/**
* 鍒ゆ柇鏄惁鍙互鍙戣揣
- * 鍙湁鍦ㄤ骇鍝佺姸鎬佹槸鍏呰冻锛屽彂璐х姸鎬佹槸寰呭彂璐у拰瀹℃牳鎷掔粷鐨勬椂鍊欐墠鍙互鍙戣揣
+ * 鍙湁鍦ㄤ骇鍝佺姸鎬佹槸鍏呰冻锛屽彂璐х姸鎬佹槸寰呭彂璐с�佸鎵逛腑銆佸鏍告嫆缁濄�侀儴鍒嗗彂璐х殑鏃跺�欐墠鍙互鍙戣揣
* @param row 琛屾暟鎹�
*/
const canShip = (row) => {
@@ -2815,15 +2848,16 @@
// 鑾峰彇鍙戣揣鐘舵��
const shippingStatus = row.shippingStatus;
- // 濡傛灉宸插彂璐э紙鏈夊彂璐ф棩鏈熸垨杞︾墝鍙凤級锛屼笉鑳藉啀娆″彂璐�
+ // 濡傛灉宸插彂璐э紝涓嶈兘鍐嶆鍙戣揣
if (shippingStatus === "宸插彂璐�") {
return false;
}
- // 鍙戣揣鐘舵�佸繀椤绘槸"寰呭彂璐�"鎴�"瀹℃牳鎷掔粷"
+ // 鍙戣揣鐘舵�佸繀椤绘槸"寰呭彂璐�"銆�"瀹℃壒涓�"銆�"瀹℃牳鎷掔粷"鎴�"閮ㄥ垎鍙戣揣"
const statusStr = shippingStatus ? String(shippingStatus).trim() : "";
return (
statusStr === "寰呭彂璐�" ||
+ statusStr === "瀹℃壒涓�" ||
statusStr === "瀹℃牳鎷掔粷" ||
statusStr === "閮ㄥ垎鍙戣揣"
);
@@ -2844,11 +2878,17 @@
// 妫�鏌ユ槸鍚﹀彲浠ュ彂璐�
if (!canShip(row)) {
proxy.$modal.msgWarning(
- "鍙湁鍦ㄤ骇鍝佺姸鎬佹槸鍏呰冻锛屽彂璐х姸鎬佹槸寰呭彂璐ф垨瀹℃牳鎷掔粷鐨勬椂鍊欐墠鍙互鍙戣揣"
+ "鍙湁鍦ㄤ骇鍝佺姸鎬佹槸鍏呰冻锛屽彂璐х姸鎬佹槸寰呭彂璐с�佸鎵逛腑銆佸鏍告嫆缁濇垨閮ㄥ垎鍙戣揣鐨勬椂鍊欐墠鍙互鍙戣揣"
);
return;
}
+ // 瀹℃壒涓椂鎻愮ず鐢ㄦ埛宸叉湁寰呭鎵圭殑鍙戣揣璁板綍
+ const statusStr = row.shippingStatus ? String(row.shippingStatus).trim() : "";
+ if (statusStr === "瀹℃壒涓�") {
+ proxy.$modal.msgWarning("璇ヤ骇鍝佸瓨鍦ㄥ緟瀹℃壒鐨勫彂璐ц褰曪紝璇锋敞鎰忛伩鍏嶉噸澶嶆彁浜�");
+ }
+
currentDeliveryRow.value = row;
const batchNoList = await getDeliveryBatchNoList(
row.productModelId || row.modelId
--
Gitblit v1.9.3