fix(inquiry): 后台询价详情——询价备注取真实数据(清除占位文案); 报价列表改供应商维度主表(受邀未报价/已报价状态 + 展开查看商品报价清单)

This commit is contained in:
zou 2026-09-04 17:13:43 +08:00
parent 241c269e37
commit a7eed895fd

View File

@ -134,13 +134,14 @@ async function load() {
invoiceTypeName: mapLabel(INVOICE, resp.invoiceType), invoiceTypeName: mapLabel(INVOICE, resp.invoiceType),
inquiryValidDate: resp.inquiryValidDate || '--', inquiryValidDate: resp.inquiryValidDate || '--',
note: resp.note || '', note: resp.note || '',
detailNote: '', // 清除 FALLBACK 占位文案,备注一律取真实数据
enterpriseName: resp.inquiryParty || resp.inquiryEnterpriseName || FALLBACK.enterpriseName, enterpriseName: resp.inquiryParty || resp.inquiryEnterpriseName || FALLBACK.enterpriseName,
detailList: resp.inquiryDetailList || [], detailList: resp.inquiryDetailList || [],
fileList: resetFiles(resp), fileList: resetFiles(resp),
raw: resp, raw: resp,
} }
// 报价回复:按企业分组(getQuotationById 返回逐商品报价行) // 报价回复:受邀供应商 + 已报价企业商品清单
await loadQuotes(resp.orderId || resp.id) await Promise.all([loadInvited(resp.orderId || resp.id), loadQuotes(resp.orderId || resp.id)])
} else { } else {
detail.value = { ...FALLBACK, id: inquiryId.value } detail.value = { ...FALLBACK, id: inquiryId.value }
} }
@ -160,6 +161,59 @@ function resetFiles(resp: any): any[] {
const quoteGroups = ref<any[]>([]) const quoteGroups = ref<any[]>([])
const quoteLoading = ref(false) const quoteLoading = ref(false)
// 供应商维度报价列表:受邀供应商(含报价状态)+ 主动报价供应商补充
const supplierRows = computed(() => {
const groups = quoteGroups.value
const rows: any[] = []
const seen = new Set<number>()
// 已报价企业先入(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<any[]>([])
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) { async function loadQuotes(orderId: any) {
quoteLoading.value = true quoteLoading.value = true
try { try {
@ -267,7 +321,7 @@ watch(inquiryId, load)
<el-descriptions-item label="要求交货日期">{{ detail.deliveryDate || '--' }}</el-descriptions-item> <el-descriptions-item label="要求交货日期">{{ detail.deliveryDate || '--' }}</el-descriptions-item>
<el-descriptions-item label="发布时间" :span="2">{{ detail.createDate || detail.publishDate || '--' }}</el-descriptions-item> <el-descriptions-item label="发布时间" :span="2">{{ detail.createDate || detail.publishDate || '--' }}</el-descriptions-item>
<el-descriptions-item label="收货地址" :span="2">{{ detail.shippingAddress || '--' }}</el-descriptions-item> <el-descriptions-item label="收货地址" :span="2">{{ detail.shippingAddress || '--' }}</el-descriptions-item>
<el-descriptions-item label="询价备注" :span="2">{{ detail.note || detail.detailNote || '--' }}</el-descriptions-item> <el-descriptions-item label="询价备注" :span="2">{{ detail.note || '--' }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</div> </div>
@ -303,43 +357,60 @@ watch(inquiryId, load)
</div> </div>
</div> </div>
<!-- 报价列表(按企业分组) --> <!-- 报价列表(供应商维度:受邀未报价 / 已报价,展开查看商品清单) -->
<div class="rr-card"> <div class="rr-card">
<div class="rr-card-header"><h3 class="rr-card-title">报价列表 ({{ quoteGroups.reduce((a, g) => a + g.count, 0) }})</h3></div> <div class="rr-card-header"><h3 class="rr-card-title">报价列表 ({{ supplierRows.length }} 家供应商)</h3></div>
<div v-if="quoteLoading" class="rr-empty">加载报价中...</div> <div v-if="quoteLoading" class="rr-empty">加载报价中...</div>
<div v-else-if="!quoteGroups.length" class="rr-empty">暂无报价回复</div> <div v-else-if="!supplierRows.length" class="rr-empty">暂无受邀供应商与报价</div>
<div v-else class="rr-quote-groups"> <el-table v-else :data="supplierRows" border size="small" row-key="name">
<div v-for="(g, gi) in quoteGroups" :key="gi" class="rr-quote-group"> <el-table-column type="expand">
<div class="rr-quote-group-head"> <template #default="{ row }">
<b>{{ g.name }}</b> <div v-if="row.rows.length" class="rr-expand">
<span v-if="g.name !== '未报价'" class="rr-tag rr-tag-green">已报价</span> <el-table :data="row.rows" border size="small" class="rr-expand-table">
<span v-else class="rr-tag">待报价</span>
<span class="rr-quote-meta">{{ g.count }} 项{{ g.date ? ' · ' + g.date : '' }}</span>
</div>
<el-table :data="g.rows" border size="small">
<el-table-column type="index" label="#" width="46" align="center" /> <el-table-column type="index" label="#" width="46" align="center" />
<el-table-column prop="productName" label="商品" min-width="150" show-overflow-tooltip /> <el-table-column prop="productName" label="商品" min-width="150" show-overflow-tooltip />
<el-table-column prop="specification" label="规格" min-width="120"> <el-table-column prop="specification" label="规格" min-width="120">
<template #default="{ row }">{{ row.specification || '--' }}</template> <template #default="{ row: r }">{{ r.specification || '--' }}</template>
</el-table-column> </el-table-column>
<el-table-column label="报价单价(含税)" width="130" align="right"> <el-table-column label="报价单价(含税)" width="130" align="right">
<template #default="{ row }">¥ {{ Number(row.unitPriceTaxIncluded || row.unitPrice || 0).toLocaleString() }}</template> <template #default="{ row: r }">¥ {{ Number(r.unitPriceTaxIncluded || r.unitPrice || 0).toLocaleString() }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="quantity" label="数量" width="80" align="center" /> <el-table-column prop="quantity" label="数量" width="80" align="center" />
<el-table-column prop="unit" label="单位" width="70" align="center"> <el-table-column prop="unit" label="单位" width="70" align="center">
<template #default="{ row }">{{ row.unit || '件' }}</template> <template #default="{ row: r }">{{ r.unit || '件' }}</template>
</el-table-column> </el-table-column>
<el-table-column label="生产周期" min-width="110"> <el-table-column label="生产周期" min-width="110">
<template #default="{ row }">{{ row.productionCycle || '--' }}</template> <template #default="{ row: r }">{{ r.productionCycle || '--' }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="quotationNote" label="备注" min-width="130"> <el-table-column prop="quotationNote" label="备注" min-width="130">
<template #default="{ row }">{{ row.quotationNote || '--' }}</template> <template #default="{ row: r }">{{ r.quotationNote || '--' }}</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</div> <div v-else class="rr-tip">该供应商尚未提交报价</div>
<!-- 旧操作列说明 --> </template>
<div class="rr-tip mt10">报价详情可在前台「我的询价-询价详情-企业报价回复」查看</div> </el-table-column>
<el-table-column prop="name" label="供应商" min-width="200" show-overflow-tooltip />
<el-table-column label="报价状态" width="120" align="center">
<template #default="{ row }">
<span v-if="Number(row.status) === 1" class="rr-tag rr-tag-green">已报价</span>
<span v-else class="rr-tag rr-tag-amber">{{ row.invited ? '受邀未报价' : '未报价' }}</span>
</template>
</el-table-column>
<el-table-column label="报价时间" width="180">
<template #default="{ row }">{{ row.date || '--' }}</template>
</el-table-column>
<el-table-column label="商品项数" width="100" align="center">
<template #default="{ row }">{{ row.count || '--' }}</template>
</el-table-column>
<el-table-column label="报价合计" width="140" align="right">
<template #default="{ row }">
<span v-if="row.total > 0">¥ {{ Number(row.total).toLocaleString() }}</span>
<span v-else>--</span>
</template>
</el-table-column>
</el-table>
<div class="rr-tip mt10">受邀未报价的供应商将不展示报价清单,点击行展开可查看已报价企业的逐商品报价详情</div>
</div> </div>
</div> </div>
@ -371,4 +442,7 @@ watch(inquiryId, load)
.rr-empty { padding: 24px; text-align: center; color: var(--el-text-color-secondary); font-size: 13px; } .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); } .rr-tip { font-size: 12px; color: var(--el-text-color-secondary); }
.mt10 { margin-top: 10px; } .mt10 { margin-top: 10px; }
.rr-expand { padding: 10px 24px; }
.rr-expand-table { max-width: 960px; }
.rr-tag-amber { background: #fdf6ec; color: #e6a23c; }
</style> </style>