From 53e7b5182e230c225282f6753ba692ddf9a5e1aa Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期一, 11 五月 2026 13:32:05 +0800
Subject: [PATCH] 销售台账,产品信息字段顺序变更,复制新建功能点逻辑调整
---
src/views/salesManagement/salesLedger/index.vue | 320 +++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 251 insertions(+), 69 deletions(-)
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 5f36cee..94e992d 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -66,8 +66,10 @@
:value="2" />
<el-option label="瀹℃壒澶辫触"
:value="3" />
- <el-option label="宸插彂璐�"
+ <el-option label="瀹℃壒閫氳繃"
:value="4" />
+ <el-option label="宸插彂璐�"
+ :value="5" />
</el-select>
</el-form-item>
<el-form-item label="鍏ュ簱鐘舵�侊細">
@@ -109,6 +111,20 @@
<el-button type="primary"
plain
@click="handleImport">瀵煎叆</el-button>
+ <el-dropdown @command="handleHistoryImportCommand">
+ <el-button type="primary"
+ plain>
+ 鍘嗗彶杩佺Щ<el-icon class="el-icon--right">
+ <ArrowDown />
+ </el-icon>
+ </el-button>
+ <template #dropdown>
+ <el-dropdown-menu>
+ <el-dropdown-item command="notShipped">鏈嚭搴�</el-dropdown-item>
+ <el-dropdown-item command="shipped">宸插嚭搴�</el-dropdown-item>
+ </el-dropdown-menu>
+ </template>
+ </el-dropdown>
<el-button @click="handleOut">瀵煎嚭</el-button>
<el-button type="danger"
plain
@@ -144,7 +160,7 @@
style="width: 100%"
:summary-method="summarizeMainTable"
@expand-change="expandChange"
- height="calc(100vh - 18.5em)">
+ height="calc(100vh - 22em)">
<el-table-column align="center"
type="selection"
width="55"
@@ -224,6 +240,8 @@
<template #default="scope">
<el-tag v-if="scope.row.approveStatus === 1 && (!scope.row.shippingDate || !scope.row.shippingCarNumber)"
type="success">鍏呰冻</el-tag>
+ <el-tag v-else-if="scope.row.approveStatus === 1 && scope.row.shippingDate && scope.row.shippingCarNumber"
+ type="success">宸插嚭搴�</el-tag>
<el-tag v-else-if="scope.row.approveStatus === 0 && (scope.row.shippingDate || scope.row.shippingCarNumber)"
type="success">宸插嚭搴�</el-tag>
<el-tag v-else
@@ -369,6 +387,8 @@
type="success">閮ㄥ垎鍏ュ簱</el-tag>
<el-tag v-else-if="Number(scope.row.stockStatus) === 2"
type="success">宸插叆搴�</el-tag>
+ <el-tag v-else-if="Number(scope.row.stockStatus) === 3"
+ type="warning">瀹℃壒涓�</el-tag>
<el-tag v-else
type="info">-</el-tag>
</template>
@@ -644,6 +664,36 @@
<span v-else>{{ scope.row.thickness ?? "" }}</span>
</template>
</el-table-column>
+ <el-table-column label="妤煎眰缂栧彿"
+ prop="floorCode"
+ min-width="250"
+ show-overflow-tooltip>
+ <template #default="scope">
+ <el-input v-if="scope.row.__editing"
+ v-model="scope.row.floorCode"
+ placeholder="璇疯緭鍏�"
+ clearable
+ style="width: 100%" />
+ <span v-else>{{ scope.row.floorCode ?? "" }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鍚◣鍗曚环(鍏�)"
+ prop="taxInclusiveUnitPrice"
+ min-width="160">
+ <template #default="scope">
+ <el-input-number v-if="scope.row.__editing"
+ :step="0.01"
+ :min="0"
+ :precision="2"
+ style="width: 100%"
+ v-model="scope.row.taxInclusiveUnitPrice"
+ placeholder="璇疯緭鍏�"
+ clearable
+ @change="() => handleInlineUnitPriceChange(scope.row)"
+ @input="() => handleInlineUnitPriceChange(scope.row)" />
+ <span v-else>{{ formattedNumber(null, null, scope.row.taxInclusiveUnitPrice) }}</span>
+ </template>
+ </el-table-column>
<el-table-column label="瀹�(mm)"
prop="width"
min-width="160">
@@ -680,23 +730,6 @@
<span v-else>{{ scope.row.height ?? "" }}</span>
</template>
</el-table-column>
- <el-table-column label="缁撶畻鍗曠墖闈㈢Н(銕�)"
- prop="settlePieceArea"
- min-width="200">
- <template #default="scope">
- <el-input-number v-if="scope.row.__editing"
- controls-position="right"
- v-model="scope.row.settlePieceArea"
- :min="0"
- :step="1"
- :precision="4"
- style="width: 100%"
- placeholder="璇疯緭鍏�"
- clearable
- @change="() => handleInlineSettleAreaChange(scope.row)" />
- <span v-else>{{ scope.row.settlePieceArea ? Number(scope.row.settlePieceArea).toFixed(4) : "" }}</span>
- </template>
- </el-table-column>
<el-table-column label="鏁伴噺"
prop="quantity"
min-width="150">
@@ -715,6 +748,23 @@
<span v-else>{{ scope.row.quantity ?? "" }}</span>
</template>
</el-table-column>
+ <el-table-column label="缁撶畻鍗曠墖闈㈢Н(銕�)"
+ prop="settlePieceArea"
+ min-width="200">
+ <template #default="scope">
+ <el-input-number v-if="scope.row.__editing"
+ controls-position="right"
+ v-model="scope.row.settlePieceArea"
+ :min="0"
+ :step="1"
+ :precision="4"
+ style="width: 100%"
+ placeholder="璇疯緭鍏�"
+ clearable
+ @change="() => handleInlineSettleAreaChange(scope.row)" />
+ <span v-else>{{ scope.row.settlePieceArea ? Number(scope.row.settlePieceArea).toFixed(4) : "" }}</span>
+ </template>
+ </el-table-column>
<el-table-column label="闈㈢Н(m虏)"
prop="actualTotalArea"
min-width="200">
@@ -728,23 +778,6 @@
style="width: 100%"
placeholder="鑷姩璁$畻" />
<span v-else>{{ scope.row.actualTotalArea ? Number(scope.row.actualTotalArea).toFixed(4) : "" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="鍚◣鍗曚环(鍏�)"
- prop="taxInclusiveUnitPrice"
- min-width="160">
- <template #default="scope">
- <el-input-number v-if="scope.row.__editing"
- :step="0.01"
- :min="0"
- :precision="2"
- style="width: 100%"
- v-model="scope.row.taxInclusiveUnitPrice"
- placeholder="璇疯緭鍏�"
- clearable
- @change="() => handleInlineUnitPriceChange(scope.row)"
- @input="() => handleInlineUnitPriceChange(scope.row)" />
- <span v-else>{{ formattedNumber(null, null, scope.row.taxInclusiveUnitPrice) }}</span>
</template>
</el-table-column>
<el-table-column label="绋庣巼(%)"
@@ -779,6 +812,19 @@
prop="taxExclusiveTotalPrice"
:formatter="formattedNumber"
min-width="120" />
+ <el-table-column label="鍔犲伐瑕佹眰"
+ prop="processRequirement"
+ min-width="160"
+ show-overflow-tooltip>
+ <template #default="scope">
+ <el-input v-if="scope.row.__editing"
+ v-model="scope.row.processRequirement"
+ placeholder="璇疯緭鍏�"
+ clearable
+ style="width: 100%" />
+ <span v-else>{{ scope.row.processRequirement ?? "" }}</span>
+ </template>
+ </el-table-column>
<el-table-column label="鍙戠エ绫诲瀷"
prop="invoiceType"
min-width="120">
@@ -796,19 +842,6 @@
<span v-else>{{ scope.row.invoiceType ?? "" }}</span>
</template>
</el-table-column>
- <el-table-column label="鍔犲伐瑕佹眰"
- prop="processRequirement"
- min-width="160"
- show-overflow-tooltip>
- <template #default="scope">
- <el-input v-if="scope.row.__editing"
- v-model="scope.row.processRequirement"
- placeholder="璇疯緭鍏�"
- clearable
- style="width: 100%" />
- <span v-else>{{ scope.row.processRequirement ?? "" }}</span>
- </template>
- </el-table-column>
<el-table-column label="澶囨敞"
prop="remark"
min-width="140"
@@ -820,19 +853,6 @@
clearable
style="width: 100%" />
<span v-else>{{ scope.row.remark ?? "" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="妤煎眰缂栧彿"
- prop="floorCode"
- min-width="250"
- show-overflow-tooltip>
- <template #default="scope">
- <el-input v-if="scope.row.__editing"
- v-model="scope.row.floorCode"
- placeholder="璇疯緭鍏�"
- clearable
- style="width: 100%" />
- <span v-else>{{ scope.row.floorCode ?? "" }}</span>
</template>
</el-table-column>
<el-table-column label="閲嶇"
@@ -1675,6 +1695,46 @@
title="閫夋嫨鍏ュ簱浜у搧"
width="60%"
:close-on-click-modal="false">
+ <div style="margin-bottom: 12px;">
+ <el-form>
+ <el-form-item required>
+ <template #label>
+ <div style="display: flex; align-items: center; justify-content: space-between; width: 100%;">
+ <span>瀹℃壒浜洪�夋嫨锛�</span>
+ <el-button type="primary"
+ size="small"
+ @click="addStockApproverNode"
+ icon="Plus">鏂板鑺傜偣</el-button>
+ </div>
+ </template>
+ <div class="approver-nodes-container">
+ <div v-for="(node, index) in stockApproverNodes"
+ :key="node.id"
+ class="approver-node-item">
+ <div class="approver-node-header">
+ <span class="approver-node-label">瀹℃壒鑺傜偣 {{ index + 1 }}</span>
+ <el-button v-if="stockApproverNodes.length > 1"
+ type="danger"
+ size="small"
+ text
+ @click="removeStockApproverNode(index)"
+ icon="Delete">鍒犻櫎</el-button>
+ </div>
+ <el-select v-model="node.userId"
+ placeholder="璇烽�夋嫨瀹℃壒浜�"
+ filterable
+ clearable
+ style="width: 100%;">
+ <el-option v-for="item in stockApproverOptions"
+ :key="item.userId"
+ :label="item.userName"
+ :value="item.userId" />
+ </el-select>
+ </div>
+ </div>
+ </el-form-item>
+ </el-form>
+ </div>
<el-table :data="stockProductList"
border
stripe
@@ -1815,6 +1875,15 @@
const selectedStockProductIds = ref([]);
const stockLoading = ref(false);
const currentStockLedgerId = ref(null);
+ const stockApproverOptions = ref([]);
+ const stockApproverNodes = ref([{ id: 1, userId: null }]);
+ let nextStockApproverId = 2;
+ const addStockApproverNode = () => {
+ stockApproverNodes.value.push({ id: nextStockApproverId++, userId: null });
+ };
+ const removeStockApproverNode = index => {
+ stockApproverNodes.value.splice(index, 1);
+ };
const ledgerQrDialogVisible = ref(false);
const ledgerQrCompositeUrl = ref("");
@@ -2149,10 +2218,17 @@
row.thickness !== null && row.thickness !== undefined && row.thickness !== ""
? Number(row.thickness)
: null;
+ copied.floorCode = row?.floorCode ?? row?.floor_code ?? "";
- // 澶嶅埗鏂板缓浠呭甫鍑轰骇鍝佸ぇ绫讳笌瑙勬牸鍨嬪彿锛屽叾浠栨暟瀛楀瓧娈靛叏閮ㄧ暀绌猴紝閬垮厤鍑虹幇 0.00
+ const srcUnit = row?.taxInclusiveUnitPrice;
+ const unitNum =
+ srcUnit !== null && srcUnit !== undefined && srcUnit !== ""
+ ? Number(srcUnit)
+ : NaN;
+ copied.taxInclusiveUnitPrice = Number.isFinite(unitNum) ? unitNum : null;
+
+ // 澶嶅埗鏂板缓甯﹀嚭锛氫骇鍝佸ぇ绫汇�佽鏍煎瀷鍙枫�佸帤搴︺�佹ゼ灞傜紪鍙枫�佸崟浠凤紱鍏朵綑鏁伴噺/闈㈢Н/鎬讳环绛夌暀绌猴紝閬垮厤鍑虹幇 0.00
copied.quantity = null;
- copied.taxInclusiveUnitPrice = null;
copied.taxInclusiveTotalPrice = null;
copied.taxExclusiveTotalPrice = null;
copied.width = null;
@@ -2841,7 +2917,19 @@
proxy.$modal.msgError("瀵煎叆澶辫触锛岃閲嶈瘯");
},
});
-
+ const HISTORY_IMPORT_URL_MAP = {
+ notShipped: "/sales/ledger/salesHistory/notShippingImport",
+ shipped: "/sales/ledger/salesHistory/shippingImport",
+ };
+ const HISTORY_IMPORT_TEMPLATE_URL_MAP = {
+ notShipped: "/sales/ledger/salesHistory/notShippingImportTemplate",
+ shipped: "/sales/ledger/salesHistory/shippingImportTemplate",
+ };
+ const HISTORY_IMPORT_TEMPLATE_FILE_NAME_MAP = {
+ notShipped: "閿�鍞彂璐у巻鍙叉暟鎹鍏ユā鏉�-鏈彂璐�.xlsx",
+ shipped: "閿�鍞彂璐у巻鍙叉暟鎹鍏ユā鏉�-宸插彂璐�.xlsx",
+ };
+ const currentImportCommand = ref("default");
const changeDaterange = value => {
if (value) {
searchForm.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
@@ -2957,22 +3045,36 @@
currentStockLedgerId.value = id;
selectedStockProductIds.value = [];
stockProductList.value = [];
+ stockApproverNodes.value = [{ id: 1, userId: null }];
+ nextStockApproverId = 2;
stockDialogVisible.value = true;
stockLoading.value = true;
try {
+ const approverRes = await approveUserList({ approveType: 9 });
+ stockApproverOptions.value = Array.isArray(approverRes?.data)
+ ? approverRes.data.map(item => ({
+ userId: item.userId,
+ userName: item.userName,
+ }))
+ : [];
const res = await productList({ salesLedgerId: id, type: 1 });
stockProductList.value = [];
stockProductList.value =
res.data.filter(item => item.productStockStatus == 0 || item.productStockStatus == 1) || [];
} catch (e) {
- proxy?.$modal?.msgError?.("鑾峰彇浜у搧鍒楄〃澶辫触");
+ proxy?.$modal?.msgError?.("鑾峰彇浜у搧鎴栧鎵逛汉澶辫触");
} finally {
stockLoading.value = false;
}
};
const submitStock = async () => {
+ const hasEmptyApprover = stockApproverNodes.value.some(node => !node.userId);
+ if (hasEmptyApprover) {
+ ElMessage.warning("璇蜂负鎵�鏈夊鎵硅妭鐐归�夋嫨瀹℃壒浜�");
+ return;
+ }
if (selectedStockProductIds.value.length === 0) {
ElMessage.warning("璇烽�夋嫨鑷冲皯涓�涓骇鍝佽繘琛屽叆搴�");
return;
@@ -2990,9 +3092,16 @@
proxy?.$modal?.loading?.("姝e湪鍏ュ簱锛岃绋嶅��...");
try {
+ const approveUserIds = stockApproverNodes.value.map(node => node.userId).join(",");
+ const approveUserName = stockApproverNodes.value
+ .map(node => stockApproverOptions.value.find(item => String(item.userId) === String(node.userId))?.userName)
+ .filter(Boolean)
+ .join(",");
await salesStock({
salesLedgerId: currentStockLedgerId.value,
salesLedgerProducts: selectedStockProductIds.value,
+ approveUserIds,
+ approveUserName,
});
proxy?.$modal?.msgSuccess?.("鍏ュ簱鎴愬姛");
stockDialogVisible.value = false;
@@ -3776,17 +3885,40 @@
otherAmountAddDialogVisible.value = false;
otherAmountAddId.value = null;
};
- // 瀵煎叆
- const handleImport = () => {
- importUpload.title = "瀵煎叆閿�鍞彴璐�";
+ const openImportDialog = (title, url) => {
+ importUpload.title = title;
+ importUpload.url = import.meta.env.VITE_APP_BASE_API + url;
importUpload.open = true;
+ importUpload.isUploading = false;
if (importUploadRef.value) {
importUploadRef.value.clearFiles();
}
};
+ // 瀵煎叆
+ const handleImport = () => {
+ currentImportCommand.value = "default";
+ openImportDialog("瀵煎叆閿�鍞彴璐�", "/sales/ledger/import");
+ };
+ // 鍘嗗彶杩佺Щ
+ const handleHistoryImportCommand = command => {
+ const url = HISTORY_IMPORT_URL_MAP[command];
+ if (!url) return;
+ currentImportCommand.value = command;
+ const title = command === "shipped" ? "鍘嗗彶杩佺Щ-宸插嚭搴�" : "鍘嗗彶杩佺Щ-鏈嚭搴�";
+ openImportDialog(title, url);
+ };
// 涓嬭浇瀵煎叆妯℃澘
const downloadTemplate = () => {
+ const command = currentImportCommand.value;
+ if (command && command !== "default") {
+ const templateUrl = HISTORY_IMPORT_TEMPLATE_URL_MAP[command];
+ const fileName = HISTORY_IMPORT_TEMPLATE_FILE_NAME_MAP[command];
+ if (templateUrl) {
+ proxy.download(templateUrl, {}, fileName || "閿�鍞彂璐у巻鍙叉暟鎹鍏ユā鏉�.xlsx");
+ return;
+ }
+ }
proxy.download("/sales/ledger/exportTemplate", {}, "閿�鍞彴璐﹀鍏ユā鏉�.xlsx");
};
const onClose = () => {
@@ -4793,4 +4925,54 @@
.ledger-qr-save-btn {
margin-bottom: 12px;
}
+
+ .approver-nodes-container {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 16px;
+ padding: 16px;
+ background-color: #f8f9fa;
+ border-radius: 4px;
+ border: 1px solid #e4e7ed;
+ }
+
+ .approver-node-item {
+ flex: 0 0 calc(33.333% - 12px);
+ min-width: 200px;
+ padding: 12px;
+ background-color: #fff;
+ border-radius: 4px;
+ border: 1px solid #dcdfe6;
+ transition: all 0.3s;
+ }
+
+ .approver-node-item:hover {
+ border-color: #409eff;
+ box-shadow: 0 2px 8px rgba(64, 158, 255, 0.1);
+ }
+
+ .approver-node-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 8px;
+ }
+
+ .approver-node-label {
+ font-size: 13px;
+ font-weight: 500;
+ color: #606266;
+ }
+
+ @media (max-width: 1200px) {
+ .approver-node-item {
+ flex: 0 0 calc(50% - 8px);
+ }
+ }
+
+ @media (max-width: 768px) {
+ .approver-node-item {
+ flex: 0 0 100%;
+ }
+ }
</style>
--
Gitblit v1.9.3