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; }