fix(inquiry): 后台询价详情——询价备注取真实数据(清除占位文案); 报价列表改供应商维度主表(受邀未报价/已报价状态 + 展开查看商品报价清单)
This commit is contained in:
parent
241c269e37
commit
a7eed895fd
@ -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<any[]>([])
|
||||
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) {
|
||||
quoteLoading.value = true
|
||||
try {
|
||||
@ -267,7 +321,7 @@ watch(inquiryId, load)
|
||||
<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.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>
|
||||
</div>
|
||||
|
||||
@ -303,43 +357,60 @@ watch(inquiryId, load)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 报价列表(按企业分组) -->
|
||||
<!-- 报价列表(供应商维度:受邀未报价 / 已报价,展开查看商品清单) -->
|
||||
<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-else-if="!quoteGroups.length" class="rr-empty">暂无报价回复</div>
|
||||
<div v-else class="rr-quote-groups">
|
||||
<div v-for="(g, gi) in quoteGroups" :key="gi" class="rr-quote-group">
|
||||
<div class="rr-quote-group-head">
|
||||
<b>{{ g.name }}</b>
|
||||
<span v-if="g.name !== '未报价'" class="rr-tag rr-tag-green">已报价</span>
|
||||
<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">
|
||||
<div v-else-if="!supplierRows.length" class="rr-empty">暂无受邀供应商与报价</div>
|
||||
<el-table v-else :data="supplierRows" border size="small" row-key="name">
|
||||
<el-table-column type="expand">
|
||||
<template #default="{ row }">
|
||||
<div v-if="row.rows.length" class="rr-expand">
|
||||
<el-table :data="row.rows" border size="small" class="rr-expand-table">
|
||||
<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="specification" label="规格" min-width="120">
|
||||
<template #default="{ row }">{{ row.specification || '--' }}</template>
|
||||
<template #default="{ row: r }">{{ r.specification || '--' }}</template>
|
||||
</el-table-column>
|
||||
<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 prop="quantity" label="数量" width="80" 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 label="生产周期" min-width="110">
|
||||
<template #default="{ row }">{{ row.productionCycle || '--' }}</template>
|
||||
<template #default="{ row: r }">{{ r.productionCycle || '--' }}</template>
|
||||
</el-table-column>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 旧操作列说明 -->
|
||||
<div class="rr-tip mt10">报价详情可在前台「我的询价-询价详情-企业报价回复」查看</div>
|
||||
<div v-else class="rr-tip">该供应商尚未提交报价</div>
|
||||
</template>
|
||||
</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>
|
||||
|
||||
@ -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; }
|
||||
</style>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user