feat(bid): 新增历史报价参考功能并修复多租户与数据库约束问题
1. 为比价功能新增历史报价查询逻辑,当物料无当前RFQ报价时补充同物料其他RFQ的最近报价 2. 修复BizComparisonController的多租户ID获取逻辑,兼容无租户场景 3. 扩展报价单状态范围,将draft状态纳入有效报价统计 4. 新增发货单相关数据库表与修复脚本,修正biz_delivery_order的非空约束问题 5. 优化前端比价页面布局,移除旧的卡片式报价展示,统一使用表格展示 6. 修复类型转换与空指针风险,完善工具类方法的兼容性处理 7. 优化评分排序与徽章标记逻辑,避免覆盖自定义徽章
This commit is contained in:
@@ -28,14 +28,6 @@
|
||||
|
||||
<div v-if="!item.prices || !item.prices.length" class="no-quote">暂无供应商报价</div>
|
||||
<div v-else>
|
||||
<div class="supplier-cards">
|
||||
<div v-for="(sp, si) in item.prices" :key="sp.supplierId"
|
||||
class="supplier-card">
|
||||
<div class="card-supplier">{{ sp.supplierName }}</div>
|
||||
<div class="card-price">¥{{ sp.unitPrice }} / {{ item.unit }}</div>
|
||||
<div class="card-meta">交货 {{ sp.deliveryDays }} 天<span v-if="sp.historyCount > 0"> · 历史 {{ sp.historyCount }} 次</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="item.prices" border size="small" class="detail-table">
|
||||
<el-table-column label="供应商" prop="supplierName" min-width="140" />
|
||||
<el-table-column label="报价单号" prop="quoteNo" width="130" />
|
||||
@@ -169,12 +161,24 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
const rfqId = this.$route.query.rfqId;
|
||||
if (rfqId) this.loadData(rfqId);
|
||||
this.loadByRoute();
|
||||
},
|
||||
watch: {
|
||||
/** 路由 query 变化时重新加载(不同 RFQ 切换时组件复用,created 不会再次触发) */
|
||||
'$route.query.rfqId': function(newId) {
|
||||
if (newId) this.loadData(newId);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadByRoute() {
|
||||
const rfqId = this.$route.query.rfqId;
|
||||
if (rfqId) this.loadData(rfqId);
|
||||
},
|
||||
loadData(rfqId) {
|
||||
this.loading = true;
|
||||
this.result = null;
|
||||
this.planSelected = {};
|
||||
this.selectedRows = {};
|
||||
compareRfq(rfqId).then(r => {
|
||||
this.result = r.data;
|
||||
// init selection = all items
|
||||
@@ -253,11 +257,6 @@ export default {
|
||||
.item-spec { color:rgba(255,255,255,.8); font-size:13px; }
|
||||
.item-qty { margin-left:auto; font-size:12px; color:rgba(255,255,255,.8); }
|
||||
.no-quote { padding:20px; color:#909399; background:#fafafa; border:1px dashed #e4e7ed; border-radius:4px; text-align:center; }
|
||||
.supplier-cards { display:flex; gap:12px; padding:16px 0; overflow-x:auto; }
|
||||
.supplier-card { flex:0 0 200px; border:1px solid #e4e7ed; border-radius:8px; padding:14px; background:#fff; &:hover { box-shadow:0 4px 16px rgba(0,0,0,.1); } }
|
||||
.card-supplier { font-size:13px; font-weight:600; color:#303133; margin-bottom:6px; }
|
||||
.card-price { font-size:13px; color:#e4393c; font-weight:600; margin-bottom:10px; }
|
||||
.card-meta { font-size:11px; color:#c0c4cc; margin-top:8px; }
|
||||
.price-low { color:#67c23a; font-weight:700; }
|
||||
.plan-card { border:1px solid #e4e7ed; border-radius:8px; margin-bottom:24px; overflow:hidden; background:#fff; position:relative; }
|
||||
.plan-header { display:flex; align-items:center; justify-content:space-between; padding:14px 20px; background:linear-gradient(90deg,#fafafa,#fff); border-bottom:1px solid #e4e7ed; flex-wrap:wrap; gap:10px; }
|
||||
|
||||
Reference in New Issue
Block a user