From a7eed895fd3181923d59a0a779cacbf397d61564 Mon Sep 17 00:00:00 2001 From: zou Date: Fri, 4 Sep 2026 17:13:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(inquiry):=20=E5=90=8E=E5=8F=B0=E8=AF=A2?= =?UTF-8?q?=E4=BB=B7=E8=AF=A6=E6=83=85=E2=80=94=E2=80=94=E8=AF=A2=E4=BB=B7?= =?UTF-8?q?=E5=A4=87=E6=B3=A8=E5=8F=96=E7=9C=9F=E5=AE=9E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?(=E6=B8=85=E9=99=A4=E5=8D=A0=E4=BD=8D=E6=96=87=E6=A1=88);=20?= =?UTF-8?q?=E6=8A=A5=E4=BB=B7=E5=88=97=E8=A1=A8=E6=94=B9=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E7=BB=B4=E5=BA=A6=E4=B8=BB=E8=A1=A8(=E5=8F=97?= =?UTF-8?q?=E9=82=80=E6=9C=AA=E6=8A=A5=E4=BB=B7/=E5=B7=B2=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E7=8A=B6=E6=80=81=20+=20=E5=B1=95=E5=BC=80=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=95=86=E5=93=81=E6=8A=A5=E4=BB=B7=E6=B8=85=E5=8D=95?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/inquiry/InquiryDetailView.vue | 150 ++++++++++++++++------ 1 file changed, 112 insertions(+), 38 deletions(-) diff --git a/src/modules/inquiry/InquiryDetailView.vue b/src/modules/inquiry/InquiryDetailView.vue index e50d5c7..0b9bda3 100644 --- a/src/modules/inquiry/InquiryDetailView.vue +++ b/src/modules/inquiry/InquiryDetailView.vue @@ -134,13 +134,14 @@ async function load() { invoiceTypeName: mapLabel(INVOICE, resp.invoiceType), inquiryValidDate: resp.inquiryValidDate || '--', note: resp.note || '', + detailNote: '', // 清除 FALLBACK 占位文案,备注一律取真实数据 enterpriseName: resp.inquiryParty || resp.inquiryEnterpriseName || FALLBACK.enterpriseName, detailList: resp.inquiryDetailList || [], fileList: resetFiles(resp), raw: resp, } - // 报价回复:按企业分组(getQuotationById 返回逐商品报价行) - await loadQuotes(resp.orderId || resp.id) + // 报价回复:受邀供应商 + 已报价企业商品清单 + await Promise.all([loadInvited(resp.orderId || resp.id), loadQuotes(resp.orderId || resp.id)]) } else { detail.value = { ...FALLBACK, id: inquiryId.value } } @@ -160,6 +161,59 @@ function resetFiles(resp: any): any[] { const quoteGroups = ref([]) const quoteLoading = ref(false) + +// 供应商维度报价列表:受邀供应商(含报价状态)+ 主动报价供应商补充 +const supplierRows = computed(() => { + const groups = quoteGroups.value + const rows: any[] = [] + const seen = new Set() + // 已报价企业先入(getQuotationById 分组,企业名非空) + for (const g of groups) { + if (!g.name || g.name === '未报价') continue + const entName = g.name + const row = { + name: entName, + status: 1, // 1=已报价 + date: g.rows.find((r: any) => r.quotationDate)?.quotationDate || '', + count: g.count, + total: g.total, + rows: g.rows, + invited: false, + } + rows.push(row) + } + // 受邀供应商:合并状态(邀请表报价状态 0=未报价 1=已报价 2=邀请再次报价) + for (const inv of invitedSuppliers.value) { + const id = Number(inv.invitedEnterpriseId) + const name = inv.enterpriseName || ('企业#' + id) + const existing = rows.find(r => r.name === name) + const quoted = Number(inv.quotationStatus) === 1 + if (existing) { + existing.invited = true + if (!quoted) existing.status = 0 + continue + } + rows.push({ + name, + status: quoted ? 1 : 0, + date: '', + count: 0, + total: 0, + rows: [], + invited: true, + }) + } + return rows +}) +const invitedSuppliers = ref([]) +async function loadInvited(orderId: any) { + try { + const res: any = await httpGet('/supplier/quotationinvited/listByOrder', { orderId: String(orderId) }) + if (res && Array.isArray(res)) invitedSuppliers.value = res + else if (res && Array.isArray(res?.list)) invitedSuppliers.value = res.list + else invitedSuppliers.value = [] + } catch { invitedSuppliers.value = [] } +} async function loadQuotes(orderId: any) { quoteLoading.value = true try { @@ -267,7 +321,7 @@ watch(inquiryId, load) {{ detail.deliveryDate || '--' }} {{ detail.createDate || detail.publishDate || '--' }} {{ detail.shippingAddress || '--' }} - {{ detail.note || detail.detailNote || '--' }} + {{ detail.note || '--' }} @@ -303,43 +357,60 @@ watch(inquiryId, load) - +
-

报价列表 ({{ quoteGroups.reduce((a, g) => a + g.count, 0) }})

+

报价列表 ({{ supplierRows.length }} 家供应商)

加载报价中...
-
暂无报价回复
-
-
-
- {{ g.name }} - 已报价 - 待报价 - {{ g.count }} 项{{ g.date ? ' · ' + g.date : '' }} -
- - - - - - - - - - - - - - - - - - - - -
-
- -
报价详情可在前台「我的询价-询价详情-企业报价回复」查看
+
暂无受邀供应商与报价
+ + + + + + + + + + + + + + + + + + +
受邀未报价的供应商将不展示报价清单,点击行展开可查看已报价企业的逐商品报价详情
@@ -371,4 +442,7 @@ watch(inquiryId, load) .rr-empty { padding: 24px; text-align: center; color: var(--el-text-color-secondary); font-size: 13px; } .rr-tip { font-size: 12px; color: var(--el-text-color-secondary); } .mt10 { margin-top: 10px; } +.rr-expand { padding: 10px 24px; } +.rr-expand-table { max-width: 960px; } +.rr-tag-amber { background: #fdf6ec; color: #e6a23c; }