From bf75c762632fdbde2aefc740b52d758b0617a64b Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期六, 28 三月 2026 10:10:40 +0800
Subject: [PATCH] 供应商档案资质文件模块上传附件多个分页问题修复
---
src/views/procurementManagement/procurementLedger/index.vue | 167 ++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 109 insertions(+), 58 deletions(-)
diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index 4475f30..a7935b5 100644
--- a/src/views/procurementManagement/procurementLedger/index.vue
+++ b/src/views/procurementManagement/procurementLedger/index.vue
@@ -54,7 +54,6 @@
:summary-method="summarizeMainTable"
@expand-change="expandChange"
height="calc(100vh - 18.5em)"
- :row-class-name="tableRowClassName"
>
<el-table-column align="center" type="selection" width="55" />
<el-table-column type="expand">
@@ -113,30 +112,35 @@
prop="supplierName"
show-overflow-tooltip
/>
- <el-table-column label="璁㈠崟鐘舵��" width="100" align="center">
- <template #default="scope">
- <el-tag v-if="scope.row.isInvalid" type="danger" size="small">澶辨晥</el-tag>
- <el-tag v-else type="success" size="small">姝e父</el-tag>
- </template>
- </el-table-column>
<el-table-column
label="椤圭洰鍚嶇О"
prop="projectName"
width="420"
show-overflow-tooltip
/>
- <el-table-column
- label="瀹℃壒鐘舵��"
- prop="approvalStatus"
- width="200"
- show-overflow-tooltip
- >
+ <el-table-column label="瀹℃壒鐘舵��" width="140">
<template #default="scope">
<el-tag
- size="small"
- >
- {{ approvalStatusText[scope.row.approvalStatus] || '鏈煡鐘舵��' }}
- </el-tag>
+ v-if="(scope.row.approveStatus ?? scope.row.approvalStatus ?? scope.row.auditStatus) == 0"
+ type="warning"
+ >寰呭鏍�</el-tag>
+ <el-tag
+ v-else-if="(scope.row.approveStatus ?? scope.row.approvalStatus ?? scope.row.auditStatus) == 1"
+ type="primary"
+ >瀹℃牳涓�</el-tag>
+ <el-tag
+ v-else-if="(scope.row.approveStatus ?? scope.row.approvalStatus ?? scope.row.auditStatus) == 2"
+ type="success"
+ >瀹℃牳瀹屾垚</el-tag>
+ <el-tag
+ v-else-if="(scope.row.approveStatus ?? scope.row.approvalStatus ?? scope.row.auditStatus) == 3"
+ type="danger"
+ >瀹℃牳鏈�氳繃</el-tag>
+ <el-tag
+ v-else-if="(scope.row.approveStatus ?? scope.row.approvalStatus ?? scope.row.auditStatus) == 4"
+ type="info"
+ >宸查噸鏂版彁浜�</el-tag>
+ <el-tag v-else type="info">-</el-tag>
</template>
</el-table-column>
<el-table-column
@@ -246,8 +250,6 @@
v-model="form.supplierId"
placeholder="璇烽�夋嫨"
clearable
- filterable
- allow-create
>
<el-option
v-for="item in supplierList"
@@ -321,6 +323,48 @@
placeholder="璇烽�夋嫨"
clearable
/>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="24">
+ <el-form-item>
+ <template #label>
+ <span>瀹℃壒浜洪�夋嫨锛�</span>
+ <el-button type="primary" @click="addApproverNode" style="margin-left: 8px;">鏂板鑺傜偣</el-button>
+ </template>
+ <div style="display: flex; align-items: flex-end; flex-wrap: wrap;">
+ <div
+ v-for="(node, index) in approverNodes"
+ :key="node.id"
+ style="margin-right: 30px; text-align: center; margin-bottom: 10px;"
+ >
+ <div>
+ <span>瀹℃壒浜�</span>
+ 鈫�
+ </div>
+ <el-select
+ v-model="node.userId"
+ placeholder="閫夋嫨浜哄憳"
+ style="width: 140px; margin-bottom: 8px;"
+ >
+ <el-option
+ v-for="user in userList"
+ :key="user.userId"
+ :label="user.nickName"
+ :value="user.userId"
+ />
+ </el-select>
+ <div>
+ <el-button
+ type="danger"
+ size="small"
+ @click="removeApproverNode(index)"
+ v-if="approverNodes.length > 1"
+ >鍒犻櫎</el-button>
+ </div>
+ </div>
+ </div>
</el-form-item>
</el-col>
</el-row>
@@ -554,7 +598,7 @@
label="涓嶅惈绋庢�讳环(鍏�)锛�"
prop="taxExclusiveTotalPrice"
>
- <el-input
+ <el-input
v-model="productForm.taxExclusiveTotalPrice"
@change="reverseMathNum('taxExclusiveTotalPrice')"
/>
@@ -594,7 +638,7 @@
</div>
</template>
</el-dialog>
-
+
<!-- 浜岀淮鐮佹樉绀哄璇濇 -->
<el-dialog
v-model="qrCodeDialogVisible"
@@ -855,6 +899,8 @@
});
const total = ref(0);
const fileList = ref([]);
+const approverNodes = ref([{ id: 1, userId: null }]);
+let nextApproverId = 2;
import useUserStore from "@/store/modules/user";
import { modelList, productTreeList } from "@/api/basicData/product.js";
import dayjs from "dayjs";
@@ -864,13 +910,6 @@
// 浜岀淮鐮佺浉鍏冲彉閲�
const qrCodeDialogVisible = ref(false);
const qrCodeUrl = ref("");
-
-// 璁㈠崟瀹℃壒鐘舵�佹樉绀烘枃鏈�
-const approvalStatusText = {
- 0: '瀹℃壒涓�',
- 1: '瀹℃壒閫氳繃',
- 2: '瀹℃壒澶辫触'
-};
// 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
const operationType = ref("");
@@ -909,6 +948,13 @@
});
const { form, rules } = toRefs(data);
const { form: searchForm } = useFormData(data.searchForm);
+
+const addApproverNode = () => {
+ approverNodes.value.push({ id: nextApproverId++, userId: null });
+};
+const removeApproverNode = (index) => {
+ approverNodes.value.splice(index, 1);
+};
// 浜у搧琛ㄥ崟寮规鏁版嵁
const productFormVisible = ref(false);
@@ -1007,12 +1053,7 @@
purchaseListPage({ ...rest, ...page })
.then((res) => {
tableLoading.value = false;
- // tableData.value = res.data.records;
- // 澶勭悊鏁版嵁锛屾坊鍔犲け鏁堢姸鎬佹爣璁�
- tableData.value = res.data.records.map(record => ({
- ...record,
- isInvalid: record.isWhite === 1
- }));
+ tableData.value = res.data.records;
tableData.value.map((item) => {
item.children = [];
});
@@ -1068,6 +1109,8 @@
form.value = {};
productData.value = [];
fileList.value = [];
+ approverNodes.value = [{ id: 1, userId: null }];
+ nextApproverId = 2;
if (operationType.value == "add") {
createPurchaseNo().then((res) => {
form.value.purchaseContractNumber = res.data;
@@ -1080,8 +1123,7 @@
salesContractList.value = res;
});
getOptions().then((res) => {
- // 渚涘簲鍟嗚繃婊ゅ嚭isWhite=0 鐨勬暟鎹�
- supplierList.value = res.data.filter((item) => item.isWhite == 0);
+ supplierList.value = res.data;
});
form.value.recorderId = userStore.id;
form.value.entryDate = getCurrentDate();
@@ -1090,6 +1132,17 @@
getPurchaseById({ id: row.id, type: 2 }).then((res) => {
form.value = { ...res };
productData.value = form.value.productData;
+ const approveUserIds = form.value.approveUserIds || form.value.approverIds;
+ if (approveUserIds) {
+ const ids = String(approveUserIds)
+ .split(",")
+ .map((id) => Number(id.trim()))
+ .filter((id) => !Number.isNaN(id));
+ if (ids.length > 0) {
+ approverNodes.value = ids.map((id, idx) => ({ id: idx + 1, userId: id }));
+ nextApproverId = ids.length + 1;
+ }
+ }
if (form.value.salesLedgerFiles) {
fileList.value = form.value.salesLedgerFiles;
} else {
@@ -1128,9 +1181,9 @@
// 绉婚櫎鏂囦欢
function handleRemove(file) {
console.log("handleRemove", file.id);
- if (file.size > 1024 * 1024 * 10) {
+ if (file.size > 1024 * 1024 * 10) {
// 浠呭墠绔竻鐞嗭紝涓嶈皟鐢ㄥ垹闄ゆ帴鍙e拰鎻愮ず
- return;
+ return;
}
if (operationType.value === "edit") {
let ids = [];
@@ -1144,6 +1197,12 @@
const submitForm = () => {
proxy.$refs["formRef"].validate((valid) => {
if (valid) {
+ const hasEmptyApprover = approverNodes.value.some((node) => !node.userId);
+ if (hasEmptyApprover) {
+ proxy.$modal.msgWarning("璇蜂负鎵�鏈夊鎵硅妭鐐归�夋嫨瀹℃壒浜�");
+ return;
+ }
+ form.value.approveUserIds = approverNodes.value.map((node) => node.userId).join(",");
if (productData.value.length > 0) {
form.value.productData = proxy.HaveJson(productData.value);
} else {
@@ -1400,29 +1459,29 @@
if (field === 'taxInclusiveTotalPrice') {
// 宸茬煡鍚◣鎬讳环鍜屾暟閲忥紝鍙嶇畻鍚◣鍗曚环
if (productForm.value.quantity) {
- productForm.value.taxInclusiveUnitPrice =
+ productForm.value.taxInclusiveUnitPrice =
(Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(2);
}
// 宸茬煡鍚◣鎬讳环鍜屽惈绋庡崟浠凤紝鍙嶇畻鏁伴噺
else if (productForm.value.taxInclusiveUnitPrice) {
- productForm.value.quantity =
+ productForm.value.quantity =
(Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(2);
}
// 鍙嶇畻涓嶅惈绋庢�讳环
- productForm.value.taxExclusiveTotalPrice =
+ productForm.value.taxExclusiveTotalPrice =
(Number(productForm.value.taxInclusiveTotalPrice) / (1 + taxRate / 100)).toFixed(2);
} else if (field === 'taxExclusiveTotalPrice') {
// 鍙嶇畻鍚◣鎬讳环
- productForm.value.taxInclusiveTotalPrice =
+ productForm.value.taxInclusiveTotalPrice =
(Number(productForm.value.taxExclusiveTotalPrice) * (1 + taxRate / 100)).toFixed(2);
// 宸茬煡鏁伴噺锛屽弽绠楀惈绋庡崟浠�
if (productForm.value.quantity) {
- productForm.value.taxInclusiveUnitPrice =
+ productForm.value.taxInclusiveUnitPrice =
(Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.quantity)).toFixed(2);
}
// 宸茬煡鍚◣鍗曚环锛屽弽绠楁暟閲�
else if (productForm.value.taxInclusiveUnitPrice) {
- productForm.value.quantity =
+ productForm.value.quantity =
(Number(productForm.value.taxInclusiveTotalPrice) / Number(productForm.value.taxInclusiveUnitPrice)).toFixed(2);
}
}
@@ -1478,7 +1537,7 @@
proxy.$modal.msgWarning("浜岀淮鐮佹湭鐢熸垚");
return;
}
-
+
const a = document.createElement('a');
a.href = qrCodeUrl.value;
a.download = `閲囪喘鍚堝悓鍙蜂簩缁寸爜_${new Date().getTime()}.png`;
@@ -1538,7 +1597,7 @@
// 瑙f瀽鎵爜鍐呭锛堟ā鎷熻В鏋愪簩缁寸爜鏁版嵁锛�
const parseScanContent = (content) => {
if (!content) return;
-
+
// 妯℃嫙瑙f瀽浜岀淮鐮佸唴瀹癸紝杩欓噷鍙互鏍规嵁瀹為檯闇�姹傝皟鏁磋В鏋愰�昏緫
// 鍋囪鎵爜鍐呭鏍煎紡涓猴細鍚堝悓鍙穦渚涘簲鍟唡椤圭洰|閲戦|浠樻鏂瑰紡
const parts = content.split('|');
@@ -1573,11 +1632,11 @@
remark: scanAddForm.scanRemark,
type: 2
};
-
+
// 妯℃嫙鏂板鎴愬姛
proxy.$modal.msgSuccess("鎵爜鏂板鎴愬姛锛�");
closeScanAddDialog();
-
+
// 鍙互閫夋嫨鏄惁鍒锋柊鍒楄〃
// getList();
}
@@ -1633,19 +1692,11 @@
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
-// 娣诲姞琛岀被鍚嶆柟娉�
-const tableRowClassName = ({ row }) => {
- return row.isInvalid ? 'invalid-row' : '';
-};
+
onMounted(() => {
getList();
});
</script>
-<style scoped lang="scss">
-.invalid-row {
- opacity: 0.6;
- background-color: #f5f7fa;
-}
-</style>
+<style scoped lang="scss"></style>
--
Gitblit v1.9.3