feat(bid): 优化报价单页面并新增RFQ详情路由

1. 合并规格和型号列为规格型号字段,简化表单布局
2. 调整表格列宽适配页面显示,新增表格横向滚动容器
3. 更新PDF导出表格表头与表单对齐
4. 新增/bid/rfq/detail路由用于跳转RFQ详情页
5. 修正物料数据同步逻辑,统一规格型号赋值
This commit is contained in:
2026-06-05 15:17:49 +08:00
parent ac2422ab8f
commit 5a1d7111cc
3 changed files with 58 additions and 50 deletions

View File

@@ -162,7 +162,7 @@
<div class="items-table-wrap">
<el-table :data="form.items" border size="small" class="items-table">
<el-table-column type="index" width="44" label="#" />
<el-table-column label="物料名称" min-width="200">
<el-table-column label="物料名称" width="200">
<template slot-scope="s">
<el-autocomplete
v-model="s.row.materialName"
@@ -191,52 +191,47 @@
</el-autocomplete>
</template>
</el-table-column>
<el-table-column label="规格" width="120">
<el-table-column label="规格型号" width="150">
<template slot-scope="s">
<el-input v-model="s.row.spec" size="mini" placeholder="规格" />
<el-input v-model="s.row.spec" size="mini" placeholder="规格型号" @change="s.row.modelNo = s.row.spec" />
</template>
</el-table-column>
<el-table-column label="型号" width="120">
<template slot-scope="s">
<el-input v-model="s.row.modelNo" size="mini" placeholder="型号" />
</template>
</el-table-column>
<el-table-column label="单位" width="70">
<el-table-column label="单位" width="60">
<template slot-scope="s">
<el-input v-model="s.row.unit" size="mini" />
</template>
</el-table-column>
<el-table-column label="数量" width="130">
<el-table-column label="数量" width="80">
<template slot-scope="s">
<el-input-number v-model="s.row.quantity" :min="0" size="mini" controls-position="right" style="width:100%" @change="calcRow(s.row)" />
</template>
</el-table-column>
<el-table-column label="成本价(元)" width="140">
<el-table-column label="成本价(元)" width="100">
<template slot-scope="s">
<el-input-number v-model="s.row.costPrice" :min="0" :precision="2" size="mini" controls-position="right" style="width:100%" @change="calcRow(s.row)" />
</template>
</el-table-column>
<el-table-column label="报价(元)" width="140">
<el-table-column label="报价(元)" width="100">
<template slot-scope="s">
<el-input-number v-model="s.row.unitPrice" :min="0" :precision="2" size="mini" controls-position="right" style="width:100%" @change="calcRow(s.row)" />
</template>
</el-table-column>
<el-table-column label="金额(元)" width="120" align="right">
<el-table-column label="金额(元)" width="100" align="right">
<template slot-scope="s">
<strong style="color:#409EFF">¥{{ itemTotal(s.row) }}</strong>
</template>
</el-table-column>
<el-table-column label="毛利率" width="80" align="center">
<el-table-column label="毛利率" width="70" align="center">
<template slot-scope="s">
<span :style="{ color: marginColor(s.row) }">{{ calcMargin(s.row) }}%</span>
</template>
</el-table-column>
<el-table-column label="交期(天)" width="100">
<el-table-column label="交期(天)" width="70">
<template slot-scope="s">
<el-input-number v-model="s.row.deliveryDays" :min="0" size="mini" controls-position="right" style="width:100%" />
</template>
</el-table-column>
<el-table-column label="操作" width="60" align="center" fixed="right">
<el-table-column label="操作" width="50" align="center">
<template slot-scope="s">
<el-button type="text" icon="el-icon-delete" style="color:#f56c6c" @click="form.items.splice(s.$index, 1)" />
</template>
@@ -300,21 +295,20 @@
<div class="section-title">报价明细</div>
<el-table :data="detailData.items || []" border size="small" style="margin-top:12px">
<el-table-column type="index" width="46" label="#" />
<el-table-column label="物料名称" prop="materialName" min-width="140" />
<el-table-column label="规格" prop="spec" width="110" />
<el-table-column label="型号" prop="modelNo" width="100" />
<el-table-column label="单位" prop="unit" width="60" align="center" />
<el-table-column label="数量" prop="quantity" width="80" align="right" />
<el-table-column label="成本价" width="100" align="right">
<el-table-column label="物料名称" prop="materialName" min-width="150" />
<el-table-column label="规格型号" prop="spec" width="130" />
<el-table-column label="单位" prop="unit" width="55" align="center" />
<el-table-column label="数量" prop="quantity" width="70" align="right" />
<el-table-column label="成本价" width="90" align="right">
<template slot-scope="s">¥{{ s.row.costPrice | money }}</template>
</el-table-column>
<el-table-column label="单价" width="110" align="right">
<el-table-column label="单价" width="90" align="right">
<template slot-scope="s">¥{{ s.row.unitPrice | money }}</template>
</el-table-column>
<el-table-column label="金额" width="110" align="right">
<el-table-column label="金额" width="90" align="right">
<template slot-scope="s"><strong style="color:#409EFF">¥{{ s.row.totalPrice | money }}</strong></template>
</el-table-column>
<el-table-column label="交期(天)" prop="deliveryDays" width="80" align="center" />
<el-table-column label="交期(天)" prop="deliveryDays" width="65" align="center" />
</el-table>
<!-- 关联的RFQ列表 -->
@@ -525,7 +519,7 @@ export default {
}).then(res => {
this.detailOpen = false;
this.$modal.msgSuccess("RFQ已创建");
this.$router.push({ path: '/bid/rfq', query: { rfqId: res.data.rfqId, rfqNo: res.data.rfqNo, action: 'edit' } });
this.$router.push({ path: '/bid/rfq/detail', query: { rfqId: res.data.rfqId, rfqNo: res.data.rfqNo, edit: '1' } });
}).catch(() => {});
},
@@ -545,7 +539,7 @@ export default {
},
viewRfqDetail(rfq) {
this.detailOpen = false;
this.$router.push({ path: '/bid/rfq', query: { rfqId: rfq.rfqId, rfqNo: rfq.rfqNo, action: 'edit' } });
this.$router.push({ path: '/bid/rfq/detail', query: { rfqId: rfq.rfqId } });
},
rfqStatusType(s) { return { draft:"info", published:"warning", closed:"", completed:"success" }[s] || ""; },
rfqStatusLabel(s) { return { draft:"草稿", published:"已发布", closed:"已关闭", completed:"已完成" }[s] || s; },
@@ -568,7 +562,7 @@ export default {
row.materialId = item.materialId;
row.materialName = item.materialName;
row.spec = item.spec || '';
row.modelNo = item.modelNo || item.spec || '';
row.modelNo = item.spec || '';
row.unit = item.unit || '件';
},