feat: 页面功能完善
3.1 供货商管理页面 - 移除了右侧面板的"供货清单"Tab - 报价历史板块新增搜索功能(物料名称/报价单号/状态/日期范围) - 后端 Mapper 改造支持动态 SQL 过滤 3.2 报价请求与供应商报价关联 - 新增"供应商报价汇总"弹窗,展示 RFQ 下所有供应商的报价对比 - 报价单号改为可点击链接,跳转到供应商报价列表并按单号搜索 3.3 智慧比价详情页 - 修复了比价详情页路由(在 router/index.js 中补充) - 移除了评分维度展示(价格/交期/质量/服务评分条、综合分标签) - 精简为纯粹的供应商价格对比视图 3.4 其他修复 - 首页快捷操作路径修正(/bid/xxx → /xxx) - 停用 bid 目录后受影响的 router.push 路径全部修复 - biz_tenant 表缺失修复(创建建表 SQL 并执行) - 比价详情页路由注册补充 - goCompare 跳转路径修正
This commit is contained in:
@@ -17,3 +17,7 @@ export const getMonthlyTrend = () => request({ url: baseUrl + '/monthly-trend',
|
||||
export const getClientQuoteByMaterial = (materialId) => request({ url: baseUrl + '/by-material/' + materialId, method: 'get' })
|
||||
// 基于历史报价快速新建
|
||||
export const quickCreateFromQuote = (quoteId) => request({ url: baseUrl + '/quick-create/' + quoteId, method: 'post' })
|
||||
// 按客户+物料查询历史报价(编辑参考用)
|
||||
export const getClientQuoteHistory = (clientName, materialId) => request({ url: baseUrl + '/history', method: 'get', params: { clientName, materialId } })
|
||||
// 客户名称自动补全
|
||||
export const getClientNames = (keyword) => request({ url: baseUrl + '/client-names', method: 'get', params: { keyword } })
|
||||
|
||||
@@ -10,6 +10,7 @@ export const delMaterial = (ids) => request({ url: baseUrl + '/' + ids, method:
|
||||
// 物料详情页
|
||||
export const getSupplierQuotes = (id) => request({ url: baseUrl + '/' + id + '/supplier-quotes', method: 'get' })
|
||||
export const getClientQuotes = (id) => request({ url: baseUrl + '/' + id + '/client-quotes', method: 'get' })
|
||||
export const getSupplierQuoteReference = (id) => request({ url: baseUrl + '/' + id + '/supplier-reference', method: 'get' })
|
||||
export const listManufacturer = () => request({ url: baseUrl + '/manufacturer/list', method: 'get' })
|
||||
export const compareMaterials = (data) => request({ url: baseUrl + '/compare', method: 'post', data })
|
||||
|
||||
|
||||
@@ -9,5 +9,11 @@ export const acceptQuotation = (id) => request({ url: baseUrl + '/accept/' + id,
|
||||
export const rejectQuotation = (id) => request({ url: baseUrl + '/reject/' + id, method: 'put' })
|
||||
export const delQuotation = (ids) => request({ url: baseUrl + '/' + ids, method: 'delete' })
|
||||
|
||||
// 按供应商ID查询报价明细(展开为每行一条物料)
|
||||
export const getSupplierQuoteItems = (supplierId) => request({ url: baseUrl + '/supplier-items/' + supplierId, method: 'get' })
|
||||
// 按供应商ID查询报价明细(展开为每行一条物料,支持搜索过滤参数:materialName, quoteNo, quoteStatus, beginTime, endTime)
|
||||
export const getSupplierQuoteItems = (params) => {
|
||||
const { supplierId, ...query } = params;
|
||||
return request({ url: baseUrl + '/supplier-items/' + supplierId, method: 'get', params: query });
|
||||
}
|
||||
|
||||
// 根据RFQ ID查询所有供应商报价(用于RFQ页面的"供应商报价汇总"弹窗)
|
||||
export const getQuotationsByRfq = (rfqId) => request({ url: baseUrl + '/by-rfq/' + rfqId, method: 'get' })
|
||||
|
||||
@@ -108,23 +108,11 @@ export const dynamicRoutes = [
|
||||
path: '',
|
||||
component: () => import('@/views/bid/material/detail'),
|
||||
name: 'MaterialDetail',
|
||||
meta: { title: '物料详情', activeMenu: '/bid/material' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/quotemgr/clientquote/detail',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: () => import('@/views/bid/clientquote/detail'),
|
||||
name: 'ClientQuoteDetail',
|
||||
meta: { title: '甲方报价单详情', activeMenu: '/quotemgr/clientquote' }
|
||||
meta: { title: '物料详情', activeMenu: '/material' }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
path: '/bid/rfq/detail',
|
||||
component: Layout,
|
||||
@@ -135,7 +123,7 @@ export const dynamicRoutes = [
|
||||
path: '',
|
||||
component: () => import('@/views/bid/rfq/detail'),
|
||||
name: 'RfqDetail',
|
||||
meta: { title: '报价请求详情', activeMenu: '/bid/rfq' }
|
||||
meta: { title: '报价请求详情', activeMenu: '/rfq' }
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -149,7 +137,7 @@ export const dynamicRoutes = [
|
||||
path: '',
|
||||
component: () => import('@/views/bid/report/dashboard'),
|
||||
name: 'ReportDashboard',
|
||||
meta: { title: '采购总览看板', activeMenu: '/bid/report' }
|
||||
meta: { title: '采购总览看板', activeMenu: '/report' }
|
||||
}]
|
||||
},
|
||||
{
|
||||
@@ -161,7 +149,7 @@ export const dynamicRoutes = [
|
||||
path: '',
|
||||
component: () => import('@/views/bid/report/cost'),
|
||||
name: 'ReportCost',
|
||||
meta: { title: '采购成本分析', activeMenu: '/bid/report' }
|
||||
meta: { title: '采购成本分析', activeMenu: '/report' }
|
||||
}]
|
||||
},
|
||||
{
|
||||
@@ -173,7 +161,31 @@ export const dynamicRoutes = [
|
||||
path: '',
|
||||
component: () => import('@/views/bid/report/supplier'),
|
||||
name: 'ReportSupplier',
|
||||
meta: { title: '供应商绩效', activeMenu: '/bid/report' }
|
||||
meta: { title: '供应商绩效', activeMenu: '/report' }
|
||||
}]
|
||||
},
|
||||
{
|
||||
path: '/bid/clientquote/detail',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['bid:clientquote:add', 'bid:clientquote:edit'],
|
||||
children: [{
|
||||
path: '',
|
||||
component: () => import('@/views/bid/clientquote/detail'),
|
||||
name: 'ClientQuoteDetail',
|
||||
meta: { title: '甲方报价单详情', activeMenu: '/clientquote' }
|
||||
}]
|
||||
},
|
||||
{
|
||||
path: '/bid/comparison/detail',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['bid:comparison:query'],
|
||||
children: [{
|
||||
path: '',
|
||||
component: () => import('@/views/bid/comparison/detail'),
|
||||
name: 'ComparisonDetail',
|
||||
meta: { title: '智慧比价分析', activeMenu: '/bid/comparison' }
|
||||
}]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -12,21 +12,33 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cq-body">
|
||||
<div class="cq-left">
|
||||
|
||||
<el-card shadow="never" class="info-card">
|
||||
<div slot="header"><strong>基本信息</strong></div>
|
||||
<el-form :model="form" label-width="100px" size="small" :inline="false">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客户名称">
|
||||
<el-input v-model="form.clientName" placeholder="请输入客户/甲方名称" />
|
||||
<el-autocomplete
|
||||
v-model="form.clientName"
|
||||
:fetch-suggestions="queryClientSearch"
|
||||
placeholder="搜索选择客户"
|
||||
size="small"
|
||||
style="width:100%"
|
||||
:trigger-on-focus="true"
|
||||
@select="(item) => { if (item && item.value) form.clientName = item.value; }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联询价单">
|
||||
<el-select v-model="form.rfqId" placeholder="选择关联RFQ(可选)" clearable filterable style="width:100%"
|
||||
@change="onRfqSelect">
|
||||
<el-option v-for="r in rfqOptions" :key="r.rfqId" :label="r.rfqNo + ' — ' + r.rfqTitle" :value="r.rfqId" />
|
||||
</el-select>
|
||||
<el-form-item label="已生成RFQ">
|
||||
<div v-if="form.rfqNo" style="display:flex;align-items:center;gap:6px">
|
||||
<el-tag type="primary" size="small" style="cursor:pointer" @click="viewGeneratedRfq">{{ form.rfqNo }}</el-tag>
|
||||
<span style="color:#909399;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">{{ form.rfqTitle }}</span>
|
||||
</div>
|
||||
<span v-else style="color:#c0c4cc;font-size:12px">保存后点击「生成RFQ」创建</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -71,9 +83,9 @@
|
||||
<el-button style="float:right" type="primary" size="mini" icon="el-icon-plus" @click="addItem">添加行</el-button>
|
||||
</div>
|
||||
<div class="table-scroll-wrap">
|
||||
<el-table :data="form.items" border size="small">
|
||||
<el-table-column type="index" width="46" label="#" />
|
||||
<el-table-column label="物料名称" width="200">
|
||||
<el-table :data="form.items" border size="small" highlight-current-row @row-click="setActiveRow">
|
||||
<el-table-column type="index" width="40" label="#" />
|
||||
<el-table-column label="物料名称" width="170">
|
||||
<template slot-scope="s">
|
||||
<el-autocomplete
|
||||
v-model="s.row.materialName"
|
||||
@@ -105,47 +117,47 @@
|
||||
</el-autocomplete>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格型号" width="150">
|
||||
<el-table-column label="规格型号" width="130">
|
||||
<template slot-scope="s">
|
||||
<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="60">
|
||||
<el-table-column label="单位" width="50">
|
||||
<template slot-scope="s">
|
||||
<el-input v-model="s.row.unit" size="mini" placeholder="单位" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" width="80">
|
||||
<el-table-column label="数量" width="70">
|
||||
<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)" />
|
||||
<el-input v-model="s.row.quantity" size="mini" placeholder="0" @input="calcRow(s.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成本价(元)" width="100">
|
||||
<el-table-column label="成本价" width="80">
|
||||
<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)" />
|
||||
<el-input v-model="s.row.costPrice" size="mini" placeholder="0.00" @input="calcRow(s.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报价(元)" width="100">
|
||||
<el-table-column label="报价" width="80">
|
||||
<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)" />
|
||||
<el-input v-model="s.row.unitPrice" size="mini" placeholder="0.00" @input="calcRow(s.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额(元)" width="100" align="right">
|
||||
<el-table-column label="金额" width="75" align="right">
|
||||
<template slot-scope="s">
|
||||
<strong style="color:#409EFF">¥{{ s.row.totalPrice || '0.00' }}</strong>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="毛利率" width="70" align="center">
|
||||
<el-table-column label="毛利率" width="60" 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="70">
|
||||
<el-table-column label="交期" width="95">
|
||||
<template slot-scope="s">
|
||||
<el-input-number v-model="s.row.deliveryDays" :min="0" size="mini" controls-position="right" style="width:100%" />
|
||||
<el-input v-model="s.row.deliveryDays" size="mini" placeholder="0" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="50" align="center">
|
||||
<el-table-column label="操作" width="55" align="center">
|
||||
<template slot-scope="s">
|
||||
<el-button type="text" icon="el-icon-delete" style="color:#f56c6c" @click="removeItem(s.$index)" />
|
||||
</template>
|
||||
@@ -160,6 +172,62 @@
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div><!-- /cq-left -->
|
||||
|
||||
<div class="cq-right">
|
||||
<!-- 客户历史报价 -->
|
||||
<el-card shadow="never" class="ref-card">
|
||||
<div slot="header">
|
||||
<strong>客户历史报价</strong>
|
||||
<span style="font-size:12px;color:#909399;margin-left:8px" v-if="refClientHistory.length > 0">共 {{ refClientHistory.length }} 条</span>
|
||||
</div>
|
||||
<div v-if="!form.clientName" class="ref-empty">请先填写客户名称并选择物料</div>
|
||||
<div v-else-if="refLoading" class="ref-empty"><i class="el-icon-loading"></i> 加载中...</div>
|
||||
<div v-else-if="refClientHistory.length === 0" class="ref-empty">暂无该客户的历史报价</div>
|
||||
<el-table v-else :data="refClientHistory" size="mini" stripe highlight-current-row
|
||||
style="width:100%" @row-click="r => fillFromHistory(selectedRow, r)">
|
||||
<el-table-column label="物料名称" prop="materialName" min-width="80" show-overflow-tooltip />
|
||||
<el-table-column label="单价" width="70" align="right">
|
||||
<template slot-scope="s">¥{{ s.row.unitPrice }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="quantity" width="45" align="right" />
|
||||
<el-table-column label="日期" width="75" align="center">
|
||||
<template slot-scope="s">{{ s.row.createTime ? s.row.createTime.substring(0,10) : '-' }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div v-if="refClientHistory.length > 0" class="ref-tip">点击行可快速填入报价</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 供应商报价参考 -->
|
||||
<el-card shadow="never" class="ref-card" style="margin-top:12px">
|
||||
<div slot="header">
|
||||
<strong>供应商报价参考</strong>
|
||||
<span style="font-size:12px;color:#909399;margin-left:8px" v-if="refSupplierPrices.length > 0">最低 ¥{{ minSupplierPrice }}</span>
|
||||
</div>
|
||||
<div v-if="!_currentMaterialId" class="ref-empty">请先选择物料</div>
|
||||
<div v-else-if="refLoading" class="ref-empty"><i class="el-icon-loading"></i> 加载中...</div>
|
||||
<div v-else-if="refSupplierPrices.length === 0" class="ref-empty">暂无供应商报价</div>
|
||||
<el-table v-else :data="refSupplierPrices" size="mini" stripe highlight-current-row
|
||||
style="width:100%" @row-click="r => fillFromSupplier(selectedRow, r)">
|
||||
<el-table-column label="供应商" prop="supplierName" min-width="80" show-overflow-tooltip />
|
||||
<el-table-column label="单价" width="80" align="right">
|
||||
<template slot-scope="s">
|
||||
<span :class="{ 'min-price': s.row.unitPrice === minSupplierPrice }">¥{{ s.row.unitPrice }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交期" prop="deliveryDays" width="50" align="center" />
|
||||
<el-table-column label="状态" width="60" align="center">
|
||||
<template slot-scope="s">
|
||||
<span :style="{ color: s.row.quote_status === 'submitted' ? '#67c23a' : '#c0c4cc' }">{{ s.row.quote_status === 'submitted' ? '已报价' : '其他' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div v-if="refSupplierPrices.length > 0" class="ref-tip">点击行可快速填入报价,绿色为最低价</div>
|
||||
</el-card>
|
||||
</div><!-- /cq-right -->
|
||||
|
||||
</div><!-- /cq-body -->
|
||||
|
||||
<!-- Hidden PDF area -->
|
||||
<div id="cq-pdf-area" class="pdf-area" style="position:absolute;left:-9999px;top:0;width:794px;background:#fff">
|
||||
<div class="pdf-header">
|
||||
@@ -180,7 +248,7 @@
|
||||
<td class="meta-label">有效期</td><td class="meta-val">{{ form.validityDate | dateFmt }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="meta-label">关联询价单</td><td class="meta-val">{{ form.rfqNo || '-' }}</td>
|
||||
<td class="meta-label">已生成RFQ</td><td class="meta-val">{{ form.rfqNo || '未生成' }}</td>
|
||||
<td class="meta-label">币种</td><td class="meta-val">{{ form.currency || 'CNY' }}</td>
|
||||
</tr>
|
||||
<tr v-if="form.remark">
|
||||
@@ -221,9 +289,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getClientQuote, addClientQuote, updateClientQuote } from "@/api/bid/clientquote";
|
||||
import { listRfq } from "@/api/bid/rfq";
|
||||
import { listMaterial } from "@/api/bid/material";
|
||||
import { getClientQuote, addClientQuote, updateClientQuote, getClientQuoteHistory, getClientNames } from "@/api/bid/clientquote";
|
||||
import { createRfqFromQuote } from "@/api/bid/rfq";
|
||||
import { listMaterial, getSupplierQuoteReference } from "@/api/bid/material";
|
||||
import logoImg from "@/assets/logo/logo.png";
|
||||
import html2canvas from "html2canvas";
|
||||
import jsPDF from "jspdf";
|
||||
@@ -239,10 +307,14 @@ export default {
|
||||
loading: false,
|
||||
saving: false,
|
||||
pdfLoading: false,
|
||||
rfqOptions: [],
|
||||
logoSrc: logoImg,
|
||||
today: new Date().toLocaleDateString("zh-CN"),
|
||||
materialCache: [],
|
||||
// 参考信息区
|
||||
refClientHistory: [],
|
||||
refSupplierPrices: [],
|
||||
refLoading: false,
|
||||
selectedRow: null,
|
||||
form: {
|
||||
quoteId: null, quoteNo: "", clientName: "", rfqId: null, rfqNo: "", rfqTitle: "",
|
||||
status: "draft", validityDate: "", currency: "CNY", remark: "", totalAmount: 0,
|
||||
@@ -253,10 +325,23 @@ export default {
|
||||
computed: {
|
||||
grandTotal() {
|
||||
return (this.form.items || []).reduce((s, i) => s + (parseFloat(i.totalPrice) || 0), 0).toFixed(2);
|
||||
},
|
||||
minSupplierPrice() {
|
||||
if (!this.refSupplierPrices.length) return null;
|
||||
return Math.min(...this.refSupplierPrices.map(p => parseFloat(p.unitPrice) || Infinity));
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'form.clientName': function() {
|
||||
// 客户名称变化时,加载该客户全部历史报价物料
|
||||
if (this.form.clientName) {
|
||||
this.loadClientHistory();
|
||||
} else {
|
||||
this.refClientHistory = [];
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
listRfq({ pageSize: 200 }).then(r => { this.rfqOptions = r.rows || []; });
|
||||
const qid = this.$route.query.quoteId;
|
||||
if (qid && qid !== "__new__") {
|
||||
this.loadData(qid);
|
||||
@@ -282,9 +367,42 @@ export default {
|
||||
this.loading = false;
|
||||
}).catch(() => { this.loading = false; });
|
||||
},
|
||||
onRfqSelect(rfqId) {
|
||||
const rfq = this.rfqOptions.find(r => r.rfqId === rfqId);
|
||||
if (rfq) { this.form.rfqNo = rfq.rfqNo; this.form.rfqTitle = rfq.rfqTitle; }
|
||||
// 查看已生成的RFQ
|
||||
viewGeneratedRfq() {
|
||||
if (this.form.rfqId) {
|
||||
const route = this.$router.resolve({ path: '/bid/rfq/detail', query: { rfqId: this.form.rfqId } });
|
||||
window.open(route.href, '_blank');
|
||||
}
|
||||
},
|
||||
handleCreateRfq() {
|
||||
if (!this.form.quoteId) {
|
||||
this.$message.warning('请先保存报价单');
|
||||
return;
|
||||
}
|
||||
this.$confirm('基于当前报价单生成采购询价(RFQ)?').then(() => {
|
||||
return createRfqFromQuote(this.form.quoteId);
|
||||
}).then(res => {
|
||||
this.$message.success('RFQ已创建');
|
||||
// 更新当前表单的RFQ关联信息
|
||||
if (res.data) {
|
||||
this.form.rfqId = res.data.rfqId;
|
||||
this.form.rfqNo = res.data.rfqNo;
|
||||
this.form.rfqTitle = res.data.rfqTitle;
|
||||
}
|
||||
const route = this.$router.resolve({ path: '/bid/rfq/detail', query: { rfqId: this.form.rfqId, edit: '1' } });
|
||||
window.open(route.href, '_blank');
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 客户名称搜索(自动补全)
|
||||
queryClientSearch(query, cb) {
|
||||
if (!query || query.length < 1) {
|
||||
cb([]);
|
||||
return;
|
||||
}
|
||||
getClientNames(query).then(r => {
|
||||
const list = (r.data || []).map(n => ({ value: n }));
|
||||
cb(list);
|
||||
}).catch(() => cb([]));
|
||||
},
|
||||
// 物料搜索(自动补全)
|
||||
queryMaterialSearch(query, cb) {
|
||||
@@ -299,15 +417,34 @@ export default {
|
||||
value: m.materialName + (m.spec ? ' (' + m.spec + ')' : '')
|
||||
}));
|
||||
cb(this.materialCache.slice(0, 20));
|
||||
}).catch(() => cb([]));
|
||||
}).catch((err) => {
|
||||
console.error('物料搜索失败:', err);
|
||||
cb([]);
|
||||
});
|
||||
},
|
||||
onMaterialSelect(row, item) {
|
||||
console.log('物料选择:', item);
|
||||
if (!item) return;
|
||||
row.materialId = item.materialId;
|
||||
row.materialName = item.materialName;
|
||||
row.spec = item.spec || '';
|
||||
row.modelNo = item.spec || '';
|
||||
row.unit = item.unit || '件';
|
||||
this.selectedRow = row;
|
||||
// 选择物料后自动加载右侧参考数据
|
||||
if (item.materialId) {
|
||||
console.log('加载参考数据, materialId:', item.materialId, '客户:', this.form.clientName);
|
||||
this.loadReferenceData(item.materialId);
|
||||
} else {
|
||||
console.warn('物料ID为空,无法加载参考数据');
|
||||
}
|
||||
},
|
||||
setActiveRow(row) {
|
||||
this.selectedRow = row;
|
||||
// 点击不同物料行时自动更新右侧参考数据
|
||||
if (row && row.materialId && row.materialId !== this._currentMaterialId) {
|
||||
this.loadReferenceData(row.materialId);
|
||||
}
|
||||
},
|
||||
onMaterialChange(row) {
|
||||
// If user manually changed material name without selecting from list, clear materialId
|
||||
@@ -329,6 +466,62 @@ export default {
|
||||
if (!price) return "0.0";
|
||||
return (((price - cost) / price) * 100).toFixed(1);
|
||||
},
|
||||
// ===== 参考信息区 =====
|
||||
loadReferenceData(materialId) {
|
||||
console.log('开始加载参考数据, materialId:', materialId);
|
||||
this._currentMaterialId = materialId;
|
||||
this.refLoading = true;
|
||||
const promises = [];
|
||||
// 加载供应商报价参考
|
||||
promises.push(
|
||||
getSupplierQuoteReference(materialId).then(r => {
|
||||
console.log('供应商报价参考:', r.data);
|
||||
this.refSupplierPrices = r.data || [];
|
||||
}).catch((err) => {
|
||||
console.error('供应商报价参考加载失败:', err);
|
||||
this.refSupplierPrices = [];
|
||||
})
|
||||
);
|
||||
// 加载客户历史报价
|
||||
if (this.form.clientName && materialId) {
|
||||
console.log('加载客户历史报价:', this.form.clientName, materialId);
|
||||
promises.push(
|
||||
getClientQuoteHistory(this.form.clientName, materialId).then(r => {
|
||||
console.log('客户历史报价:', r.data);
|
||||
this.refClientHistory = r.data || [];
|
||||
}).catch((err) => {
|
||||
console.error('客户历史报价加载失败:', err);
|
||||
this.refClientHistory = [];
|
||||
})
|
||||
);
|
||||
} else {
|
||||
console.log('客户名称为空,跳过客户历史报价加载');
|
||||
this.refClientHistory = [];
|
||||
}
|
||||
Promise.all(promises).finally(() => { this.refLoading = false; });
|
||||
},
|
||||
loadClientHistory(materialId) {
|
||||
if (this.form.clientName) {
|
||||
getClientQuoteHistory(this.form.clientName, materialId || null).then(r => {
|
||||
this.refClientHistory = r.data || [];
|
||||
}).catch(() => { this.refClientHistory = []; });
|
||||
} else {
|
||||
this.refClientHistory = [];
|
||||
}
|
||||
},
|
||||
fillFromHistory(row, item) {
|
||||
if (!item || !row) return;
|
||||
row.costPrice = item.costPrice || 0;
|
||||
row.unitPrice = item.unitPrice || 0;
|
||||
row.deliveryDays = item.deliveryDays || null;
|
||||
this.calcRow(row);
|
||||
},
|
||||
fillFromSupplier(row, item) {
|
||||
if (!item || !row) return;
|
||||
row.unitPrice = item.unitPrice || 0;
|
||||
row.deliveryDays = item.deliveryDays || null;
|
||||
this.calcRow(row);
|
||||
},
|
||||
marginColor(row) {
|
||||
const m = parseFloat(this.calcMargin(row));
|
||||
if (m >= 20) return "#67c23a";
|
||||
@@ -387,19 +580,43 @@ export default {
|
||||
.info-card ::v-deep .el-card__body { padding: 20px; }
|
||||
.total-bar { display:flex; align-items:center; justify-content:flex-end; padding:16px 20px; border-top:1px solid #f0f2f5; background:#fafbfc; }
|
||||
|
||||
/* 表格滚动容器 - 窄屏时横向滚动 */
|
||||
.table-scroll-wrap { overflow-x: auto; }
|
||||
.table-scroll-wrap >>> .el-table { min-width: 900px; }
|
||||
/* 表格滚动容器 - 防止溢出 */
|
||||
.table-scroll-wrap { overflow: hidden; }
|
||||
.table-scroll-wrap >>> .el-table { }
|
||||
|
||||
/* 左右分栏布局 */
|
||||
.cq-body { display: flex; gap: 16px; align-items: flex-start; }
|
||||
.cq-left { flex: 0 0 74%; min-width: 0; }
|
||||
.cq-right { flex: 0 0 calc(26% - 16px); min-width: 0; position: sticky; top: 12px; }
|
||||
|
||||
/* 参考信息卡片 */
|
||||
.ref-card { }
|
||||
.ref-card ::v-deep .el-card__body { padding: 12px; }
|
||||
.ref-card ::v-deep .el-table__header-wrapper th { background: #f5f7fa; color: #606266; font-weight: 600; font-size: 11px; padding: 4px 0; }
|
||||
.ref-card ::v-deep .el-table__body-wrapper td { padding: 4px 0; font-size: 12px; }
|
||||
.ref-card ::v-deep .el-table__row { cursor: pointer; }
|
||||
.ref-card ::v-deep .el-table__row:hover td { background: #ecf5ff !important; }
|
||||
.ref-card ::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td { background: #fafbfc; }
|
||||
|
||||
.ref-empty { text-align: center; padding: 20px 0; color: #c0c4cc; font-size: 13px; }
|
||||
.ref-tip { text-align: center; padding: 6px 0 0; color: #909399; font-size: 11px; border-top: 1px solid #f0f2f5; margin-top: 6px; }
|
||||
.min-price { color: #67c23a; font-weight: 700; }
|
||||
|
||||
/* RFQ已生成信息 */
|
||||
.rfq-generated-info { padding: 4px 0; }
|
||||
.rfq-item { display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid #e4e7ed; border-radius:6px; cursor:pointer; transition:all .2s; }
|
||||
.rfq-item:hover { border-color:#409eff; background:#f0f7ff; }
|
||||
.rfq-title { font-size:12px; color:#606266; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:120px; }
|
||||
|
||||
/* 物料搜索建议下拉 */
|
||||
/* 物料搜索下拉样式 - 加宽并优化展示 */
|
||||
>>> .el-autocomplete-suggestion {
|
||||
min-width: 400px !important;
|
||||
max-width: 500px !important;
|
||||
min-width: 520px !important;
|
||||
max-width: 600px !important;
|
||||
}
|
||||
|
||||
>>> .el-autocomplete-suggestion__wrap {
|
||||
max-height: 400px !important;
|
||||
max-height: 450px !important;
|
||||
}
|
||||
|
||||
>>> .el-autocomplete-suggestion__list {
|
||||
@@ -407,7 +624,7 @@ export default {
|
||||
}
|
||||
|
||||
>>> .el-autocomplete-suggestion__list li {
|
||||
padding: 8px 12px;
|
||||
padding: 10px 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@@ -437,15 +654,19 @@ export default {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.ms-spec {
|
||||
color: #606266;
|
||||
background: #f5f7fa;
|
||||
padding: 2px 8px;
|
||||
padding: 3px 10px;
|
||||
border-radius: 3px;
|
||||
line-height: 1.4;
|
||||
line-height: 1.5;
|
||||
max-width: 100%;
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.ms-brand {
|
||||
|
||||
@@ -241,14 +241,14 @@ export default {
|
||||
handleAdd() {
|
||||
addClientQuote({ status: "draft", currency: "CNY", items: [] }).then(res => {
|
||||
const id = res.data && res.data.quoteId;
|
||||
if (id) this.$router.push({ path: "/quotemgr/clientquote/detail", query: { quoteId: id } });
|
||||
else this.$router.push({ path: "/quotemgr/clientquote/detail", query: { quoteId: "__new__" } });
|
||||
if (id) this.$router.push({ path: "/bid/clientquote/detail", query: { quoteId: id } });
|
||||
else this.$router.push({ path: "/bid/clientquote/detail", query: { quoteId: "__new__" } });
|
||||
}).catch(() => {
|
||||
this.$router.push({ path: "/quotemgr/clientquote/detail", query: { quoteId: "__new__" } });
|
||||
this.$router.push({ path: "/bid/clientquote/detail", query: { quoteId: "__new__" } });
|
||||
});
|
||||
},
|
||||
goDetail(row) {
|
||||
this.$router.push({ path: "/quotemgr/clientquote/detail", query: { quoteId: row.quoteId } });
|
||||
this.$router.push({ path: "/bid/clientquote/detail", query: { quoteId: row.quoteId } });
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm("确认删除报价单【" + row.quoteNo + "】?").then(() => {
|
||||
@@ -265,7 +265,7 @@ export default {
|
||||
return quickCreateFromQuote(row.quoteId);
|
||||
}).then(res => {
|
||||
this.$modal.msgSuccess("已创建新报价单草稿");
|
||||
this.$router.push({ path: "/quotemgr/clientquote/detail", query: { quoteId: res.data.quoteId } });
|
||||
this.$router.push({ path: "/bid/clientquote/detail", query: { quoteId: res.data.quoteId } });
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 查看详情弹窗
|
||||
@@ -287,7 +287,7 @@ export default {
|
||||
} catch(e) { this.$message.error("获取数据失败"); return; }
|
||||
}
|
||||
// 导航到详情页导出
|
||||
this.$router.push({ path: "/quotemgr/clientquote/detail", query: { quoteId: row.quoteId, exportPdf: '1' } });
|
||||
this.$router.push({ path: "/bid/clientquote/detail", query: { quoteId: row.quoteId, exportPdf: '1' } });
|
||||
},
|
||||
statusType(s) { return { draft: "info", sent: "primary", confirmed: "success", rejected: "danger" }[s] || "info"; },
|
||||
statusLabel(s) { return { draft: "草稿", sent: "已发送", confirmed: "已确认", rejected: "已拒绝" }[s] || s; }
|
||||
|
||||
@@ -161,8 +161,8 @@
|
||||
|
||||
<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="物料名称" width="200">
|
||||
<el-table-column type="index" width="40" label="#" />
|
||||
<el-table-column label="物料名称" width="170">
|
||||
<template slot-scope="s">
|
||||
<el-autocomplete
|
||||
v-model="s.row.materialName"
|
||||
@@ -191,47 +191,47 @@
|
||||
</el-autocomplete>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格型号" width="150">
|
||||
<el-table-column label="规格型号" width="130">
|
||||
<template slot-scope="s">
|
||||
<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="60">
|
||||
<el-table-column label="单位" width="50">
|
||||
<template slot-scope="s">
|
||||
<el-input v-model="s.row.unit" size="mini" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" width="80">
|
||||
<el-table-column label="数量" width="70">
|
||||
<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)" />
|
||||
<el-input v-model="s.row.quantity" size="mini" placeholder="0" @input="calcRow(s.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成本价(元)" width="100">
|
||||
<el-table-column label="成本价" width="80">
|
||||
<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)" />
|
||||
<el-input v-model="s.row.costPrice" size="mini" placeholder="0.00" @input="calcRow(s.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报价(元)" width="100">
|
||||
<el-table-column label="报价" width="80">
|
||||
<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)" />
|
||||
<el-input v-model="s.row.unitPrice" size="mini" placeholder="0.00" @input="calcRow(s.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额(元)" width="100" align="right">
|
||||
<el-table-column label="金额" width="75" align="right">
|
||||
<template slot-scope="s">
|
||||
<strong style="color:#409EFF">¥{{ itemTotal(s.row) }}</strong>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="毛利率" width="70" align="center">
|
||||
<el-table-column label="毛利率" width="60" 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="70">
|
||||
<el-table-column label="交期" width="95">
|
||||
<template slot-scope="s">
|
||||
<el-input-number v-model="s.row.deliveryDays" :min="0" size="mini" controls-position="right" style="width:100%" />
|
||||
<el-input v-model="s.row.deliveryDays" size="mini" placeholder="0" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="50" align="center">
|
||||
<el-table-column label="操作" width="55" 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>
|
||||
@@ -429,27 +429,14 @@ export default {
|
||||
|
||||
// ===== 新建 =====
|
||||
handleAdd() {
|
||||
this.form = { items: [], currency: "CNY", status: "draft", clientName: "", validityDate: "", remark: "" };
|
||||
this.dialogTitle = "新建甲方报价单";
|
||||
this.dialogOpen = true;
|
||||
// 跳转到 detail.vue 页面进行新增
|
||||
this.$router.push('/bid/clientquote/detail');
|
||||
},
|
||||
|
||||
// ===== 编辑 =====
|
||||
handleUpdate(row) {
|
||||
getClientQuote(row.quoteId).then(r => {
|
||||
const data = r.data || {};
|
||||
this.form = {
|
||||
quoteId: data.quoteId,
|
||||
clientName: data.clientName,
|
||||
status: data.status,
|
||||
validityDate: data.validityDate,
|
||||
currency: data.currency,
|
||||
remark: data.remark,
|
||||
items: (data.items || []).map(i => ({ ...i }))
|
||||
};
|
||||
this.dialogTitle = "编辑报价单 - " + data.quoteNo;
|
||||
this.dialogOpen = true;
|
||||
});
|
||||
// 跳转到 detail.vue 页面进行编辑,传递 quoteId
|
||||
this.$router.push({ path: '/bid/clientquote/detail', query: { quoteId: row.quoteId } });
|
||||
},
|
||||
|
||||
// ===== 保存 =====
|
||||
@@ -495,19 +482,9 @@ export default {
|
||||
this.$modal.msgSuccess("已创建新报价单草稿");
|
||||
this.getList();
|
||||
this.getStats();
|
||||
// 打开编辑
|
||||
if (res.data) {
|
||||
this.form = {
|
||||
quoteId: res.data.quoteId,
|
||||
clientName: res.data.clientName,
|
||||
status: res.data.status,
|
||||
validityDate: res.data.validityDate,
|
||||
currency: res.data.currency,
|
||||
remark: res.data.remark,
|
||||
items: (res.data.items || []).map(i => ({ ...i }))
|
||||
};
|
||||
this.dialogTitle = "编辑新建报价单 - " + res.data.quoteNo;
|
||||
this.dialogOpen = true;
|
||||
// 跳转到 detail.vue 编辑新创建的报价单
|
||||
if (res.data && res.data.quoteId) {
|
||||
this.$router.push({ path: '/bid/clientquote/detail', query: { quoteId: res.data.quoteId } });
|
||||
}
|
||||
}).catch(() => {});
|
||||
},
|
||||
|
||||
@@ -30,23 +30,9 @@
|
||||
<div v-else>
|
||||
<div class="supplier-cards">
|
||||
<div v-for="(sp, si) in item.prices" :key="sp.supplierId"
|
||||
class="supplier-card" :class="{ 'best-card': si === 0 }">
|
||||
<div class="card-rank">
|
||||
<span class="rank-num" :class="'rank-'+(si+1)">{{ si + 1 }}</span>
|
||||
<el-tag v-if="sp.rankBadge" size="mini" :type="badgeType(sp.rankBadge)">{{ sp.rankBadge }}</el-tag>
|
||||
</div>
|
||||
class="supplier-card">
|
||||
<div class="card-supplier">{{ sp.supplierName }}</div>
|
||||
<div class="card-score-big" :class="scoreClass(sp.compositeScore)">
|
||||
{{ sp.compositeScore.toFixed(1) }}<span class="score-unit">分</span>
|
||||
</div>
|
||||
<div class="card-price">¥{{ sp.unitPrice }} / {{ item.unit }}</div>
|
||||
<div class="dim-bars">
|
||||
<div class="dim-row" v-for="(d,di) in [{l:'价格',v:sp.priceScore},{l:'交期',v:sp.deliveryScore},{l:'质量',v:sp.qualityScore},{l:'服务',v:sp.serviceScore}]" :key="di">
|
||||
<span class="dim-label">{{ d.l }}</span>
|
||||
<el-progress :percentage="d.v" :stroke-width="6" :color="dimColor(d.v)" :show-text="false" class="dim-bar" />
|
||||
<span class="dim-val">{{ d.v.toFixed(0) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-meta">交货 {{ sp.deliveryDays }} 天<span v-if="sp.historyCount > 0"> · 历史 {{ sp.historyCount }} 次</span></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -63,11 +49,6 @@
|
||||
<template slot-scope="s">¥{{ s.row.totalPrice }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交期(天)" prop="deliveryDays" width="85" align="center" />
|
||||
<el-table-column label="价格" width="75" align="center"><template slot-scope="s"><span :class="scoreClass(s.row.priceScore)">{{ s.row.priceScore }}</span></template></el-table-column>
|
||||
<el-table-column label="交期" width="75" align="center"><template slot-scope="s"><span :class="scoreClass(s.row.deliveryScore)">{{ s.row.deliveryScore }}</span></template></el-table-column>
|
||||
<el-table-column label="质量" width="75" align="center"><template slot-scope="s"><span :class="scoreClass(s.row.qualityScore)">{{ s.row.qualityScore }}</span></template></el-table-column>
|
||||
<el-table-column label="服务" width="75" align="center"><template slot-scope="s"><span :class="scoreClass(s.row.serviceScore)">{{ s.row.serviceScore }}</span></template></el-table-column>
|
||||
<el-table-column label="综合" width="85" align="center"><template slot-scope="s"><strong :class="scoreClass(s.row.compositeScore)">{{ s.row.compositeScore }}</strong></template></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -77,12 +58,6 @@
|
||||
<el-tab-pane name="plan">
|
||||
<span slot="label">🎯 选择采购方案 <el-badge :value="result.recommendedPlans.length" type="primary" /></span>
|
||||
|
||||
<el-alert type="info" :closable="false" show-icon style="margin-bottom:20px">
|
||||
<template slot="title">
|
||||
评分权重:价格40% + 交期25% + 历史质量20% + 历史服务15%。勾选方案中您想要采购的物料行,最后点击「生成采购方案 PDF」。
|
||||
</template>
|
||||
</el-alert>
|
||||
|
||||
<div v-if="!result.recommendedPlans.length" class="no-quote" style="margin:40px auto">
|
||||
暂无可用报价,无法生成推荐方案
|
||||
</div>
|
||||
@@ -92,7 +67,6 @@
|
||||
<div class="plan-title">
|
||||
<span class="plan-rank">方案 {{ pi + 1 }}</span>
|
||||
<strong class="plan-supplier">{{ plan.supplierName }}</strong>
|
||||
<el-tag type="success" size="small" style="margin-left:12px">综合评分 {{ plan.avgCompositeScore.toFixed(1) }} 分</el-tag>
|
||||
</div>
|
||||
<div class="plan-actions">
|
||||
<el-checkbox v-model="planSelected[plan.supplierId]" @change="onPlanCheck(plan)">
|
||||
@@ -122,9 +96,6 @@
|
||||
<template slot-scope="s"><strong style="color:#409EFF">¥{{ s.row.totalPrice }}</strong></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交期(天)" prop="deliveryDays" width="85" align="center" />
|
||||
<el-table-column label="综合分" width="80" align="center">
|
||||
<template slot-scope="s"><strong :class="scoreClass(s.row.compositeScore)">{{ s.row.compositeScore }}</strong></template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- Hidden PDF area -->
|
||||
@@ -144,7 +115,6 @@
|
||||
<tr><td class="meta-label">询价单</td><td class="meta-val" colspan="3">{{ result.rfqNo }} — {{ result.rfqTitle }}</td></tr>
|
||||
<tr>
|
||||
<td class="meta-label">推荐供应商</td><td class="meta-val">{{ plan.supplierName }}</td>
|
||||
<td class="meta-label">综合评分</td><td class="meta-val score-good">{{ plan.avgCompositeScore.toFixed(1) }} / 100</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="meta-label">合计金额</td>
|
||||
@@ -152,24 +122,20 @@
|
||||
</tr>
|
||||
<tr><td class="meta-label">推荐依据</td><td class="meta-val" colspan="3">{{ plan.clusterReason }}</td></tr>
|
||||
</table>
|
||||
<div class="pdf-score-legend">
|
||||
<strong>评分权重说明:</strong>价格40% | 交期25% | 历史质量20% | 服务水平15%
|
||||
</div>
|
||||
<div class="pdf-section-title">采购物料明细</div>
|
||||
<table class="pdf-items-table">
|
||||
<thead><tr><th>#</th><th>物料名称</th><th>规格</th><th>单位</th><th>数量</th><th>单价</th><th>金额</th><th>交期(天)</th><th>综合分</th></tr></thead>
|
||||
<thead><tr><th>#</th><th>物料名称</th><th>规格</th><th>单位</th><th>数量</th><th>单价</th><th>金额</th><th>交期(天)</th></tr></thead>
|
||||
<tbody>
|
||||
<tr v-for="(it,ii) in selectedItems(plan)" :key="ii">
|
||||
<td>{{ ii + 1 }}</td><td>{{ it.materialName }}</td><td>{{ it.spec || '-' }}</td>
|
||||
<td>{{ it.unit }}</td><td>{{ it.quantity }}</td>
|
||||
<td>{{ it.unitPrice }}</td><td class="amount-cell">{{ it.totalPrice }}</td>
|
||||
<td>{{ it.deliveryDays }}</td>
|
||||
<td :class="'score-cell ' + scorePdfClass(it.compositeScore)">{{ it.compositeScore }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr><td colspan="6" style="text-align:right;font-weight:bold;padding:10px 8px">合计</td>
|
||||
<td class="amount-cell total-cell" colspan="3">¥{{ selectedTotal(plan) }}</td></tr>
|
||||
<td class="amount-cell total-cell" colspan="2">¥{{ selectedTotal(plan) }}</td></tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<div class="pdf-footer">本方案由福安德智慧报价系统自动生成 · {{ new Date().toLocaleString('zh-CN') }}</div>
|
||||
@@ -269,10 +235,6 @@ export default {
|
||||
} catch(e) { this.$message.error("导出失败:" + e.message); }
|
||||
finally { this.$set(this.pdfLoading, plan.supplierId, false); }
|
||||
},
|
||||
badgeType(b) { return { "综合最优": "success", "价格最低": "warning", "交期最快": "primary" }[b] || "info"; },
|
||||
scoreClass(s) { return s >= 80 ? "score-high" : s >= 60 ? "score-mid" : "score-low"; },
|
||||
scorePdfClass(s) { return s >= 80 ? "score-good" : s >= 60 ? "score-ok" : "score-weak"; },
|
||||
dimColor(v) { return v >= 80 ? "#67c23a" : v >= 60 ? "#e6a23c" : "#f56c6c"; }
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -292,21 +254,10 @@ export default {
|
||||
.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); } &.best-card { border-color:#67c23a; box-shadow:0 2px 8px rgba(103,194,58,.2); } }
|
||||
.card-rank { display:flex; align-items:center; gap:6px; margin-bottom:8px; }
|
||||
.rank-num { width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; &.rank-1 { background:#f7ba2a; color:#fff; } &.rank-2 { background:#c0c4cc; color:#fff; } &.rank-3 { background:#a57c52; color:#fff; } }
|
||||
.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-score-big { font-size:28px; font-weight:700; line-height:1; margin:8px 0; &.score-high { color:#67c23a; } &.score-mid { color:#e6a23c; } &.score-low { color:#f56c6c; } .score-unit { font-size:13px; font-weight:400; } }
|
||||
.card-price { font-size:13px; color:#409EFF; font-weight:600; margin-bottom:10px; }
|
||||
.dim-bars { display:flex; flex-direction:column; gap:4px; }
|
||||
.dim-row { display:flex; align-items:center; gap:6px; }
|
||||
.dim-label { font-size:11px; color:#909399; width:24px; flex-shrink:0; }
|
||||
.dim-bar { flex:1; }
|
||||
.dim-val { font-size:11px; color:#606266; width:24px; text-align:right; flex-shrink:0; }
|
||||
.card-meta { font-size:11px; color:#c0c4cc; margin-top:8px; }
|
||||
.score-high { color:#67c23a; font-weight:700; }
|
||||
.score-mid { color:#e6a23c; font-weight:600; }
|
||||
.score-low { color:#f56c6c; }
|
||||
.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,#f0f7ff,#fff); border-bottom:1px solid #e4e7ed; flex-wrap:wrap; gap:10px; }
|
||||
@@ -329,10 +280,6 @@ export default {
|
||||
.meta-label { background:#f5f7fa; color:#606266; font-weight:600; width:90px; }
|
||||
.meta-val { color:#303133; }
|
||||
.amount-big { color:#409EFF; font-weight:700; font-size:16px; }
|
||||
.score-good { color:#67c23a; font-weight:700; }
|
||||
.score-ok { color:#e6a23c; font-weight:600; }
|
||||
.score-weak { color:#f56c6c; }
|
||||
.pdf-score-legend { background:#f0f7ff; border:1px solid #c6e2ff; border-radius:4px; padding:8px 14px; font-size:12px; color:#606266; margin-bottom:16px; }
|
||||
.pdf-section-title { font-size:14px; font-weight:700; color:#1a2c4e; margin:0 0 10px; padding-left:8px; border-left:4px solid #1171c4; }
|
||||
.pdf-items-table { width:100%; border-collapse:collapse; margin-bottom:20px; th { background:#1171c4; color:#fff; padding:8px; text-align:center; font-weight:600; font-size:12px; } td { border:1px solid #e4e7ed; padding:7px 8px; text-align:center; font-size:12px; } tbody tr:nth-child(even) td { background:#f9fbff; } }
|
||||
.amount-cell { color:#409EFF; font-weight:600; }
|
||||
|
||||
@@ -77,7 +77,7 @@ export default {
|
||||
this.$router.push({ path: "/bid/comparison/detail", query: { rfqId: row.rfqId } });
|
||||
},
|
||||
goRfqDetail(row) {
|
||||
this.$router.push({ path: '/bid/rfq', query: { rfqId: row.rfqId, rfqNo: row.rfqNo, action: 'edit' } });
|
||||
this.$router.push({ path: '/rfq', query: { rfqId: row.rfqId, rfqNo: row.rfqNo, action: 'edit' } });
|
||||
},
|
||||
statusType(s) {
|
||||
const m = { draft: "info", open: "primary", closed: "success", cancelled: "danger" };
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
<div class="tab-toolbar">
|
||||
<span class="tab-title">甲方报价记录</span>
|
||||
<div class="tab-actions">
|
||||
<el-button size="mini" icon="el-icon-plus" type="primary" @click="goToHistory">查看全部历史</el-button>
|
||||
<el-button size="mini" icon="el-icon-download" @click="exportExcel">导出Excel</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -90,7 +89,7 @@
|
||||
<div v-if="!loading && list.length === 0" class="empty-state">
|
||||
<i class="el-icon-document"></i>
|
||||
<p>暂无甲方报价记录</p>
|
||||
<el-button size="small" type="primary" icon="el-icon-plus" @click="goToHistory">去创建报价</el-button>
|
||||
<el-button size="small" type="primary" icon="el-icon-plus" @click="goCreateQuote">去创建报价</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -139,11 +138,12 @@ export default {
|
||||
},
|
||||
viewQuote(row) {
|
||||
if (row.quoteId) {
|
||||
this.$router.push({ path: "/quotemgr/clientquote/detail", query: { quoteId: row.quoteId } });
|
||||
this.$router.push({ path: "/bid/clientquote/detail", query: { quoteId: row.quoteId } });
|
||||
}
|
||||
},
|
||||
goToHistory() {
|
||||
this.$router.push("/quotemgr/clientquote");
|
||||
/** 跳转到甲方报价详情页新建报价 */
|
||||
goCreateQuote() {
|
||||
this.$router.push({ path: '/bid/clientquote/detail' });
|
||||
},
|
||||
exportExcel() {
|
||||
this.$message.info('导出功能开发中');
|
||||
|
||||
@@ -235,7 +235,12 @@ export default {
|
||||
},
|
||||
|
||||
goBack() {
|
||||
this.$router.push('/bid/material');
|
||||
// 优先返回上一页,如果没有历史记录则返回物料列表
|
||||
if (window.history.length > 1) {
|
||||
this.$router.back();
|
||||
} else {
|
||||
this.$router.push('/bid/material');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
<!-- ── 搜索栏 ── -->
|
||||
<el-card shadow="never" class="search-card">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
|
||||
<el-form-item label="报价单号">
|
||||
<el-input v-model="queryParams.quoteNo" placeholder="报价单号" clearable style="width:150px" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="RFQ单号">
|
||||
<el-input v-model="queryParams.rfqNo" placeholder="询价单号" clearable style="width:150px" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
@@ -110,9 +113,9 @@
|
||||
<el-button size="mini" type="text" style="color:#67C23A" icon="el-icon-upload2"
|
||||
@click="handleSubmit(s.row)" v-if="s.row.status==='draft'">提交</el-button>
|
||||
<el-button size="mini" type="text" style="color:#67C23A" icon="el-icon-check"
|
||||
@click="handleAccept(s.row)" v-if="s.row.status==='submitted'">采纳</el-button>
|
||||
@click="handleAccept(s.row)" v-if="s.row.status==='submitted' && !isSupplier">采纳</el-button>
|
||||
<el-button size="mini" type="text" style="color:#F56C6C" icon="el-icon-close"
|
||||
@click="handleReject(s.row)" v-if="s.row.status==='submitted'">拒绝</el-button>
|
||||
@click="handleReject(s.row)" v-if="s.row.status==='submitted' && !isSupplier">拒绝</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" style="color:#f56c6c"
|
||||
@click="handleDelete(s.row)" v-if="s.row.status==='draft'">删除</el-button>
|
||||
</template>
|
||||
@@ -375,7 +378,7 @@ export default {
|
||||
rfqItemsLoading: false,
|
||||
rfqOptions: [], supplierOptions: [],
|
||||
logoSrc: logoImg,
|
||||
queryParams: { pageNum: 1, pageSize: 10, status: null, rfqNo: null, supplierName: null },
|
||||
queryParams: { pageNum: 1, pageSize: 10, status: null, rfqNo: null, quoteNo: null, supplierName: null },
|
||||
form: { items: [], currency: "CNY", validDays: 30, deliveryDays: null },
|
||||
rules: {
|
||||
rfqId: [{ required: true, message: "请选择询价单", trigger: "change" }],
|
||||
@@ -384,14 +387,26 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
/** 是否为供应商用户 */
|
||||
isSupplier() {
|
||||
return this.$store.getters.roles && this.$store.getters.roles.includes('supplier');
|
||||
},
|
||||
formTotal() {
|
||||
return (this.form.items || []).reduce((s, i) => s + (parseFloat(i.quantity || 0) * parseFloat(i.unitPrice || 0)), 0).toFixed(2);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 读取 URL 查询参数,实现跨页面跳转自动搜索
|
||||
const query = this.$route.query;
|
||||
if (query.rfqNo) this.queryParams.rfqNo = query.rfqNo;
|
||||
if (query.supplierName) this.queryParams.supplierName = query.supplierName;
|
||||
if (query.quoteNo) this.queryParams.quoteNo = query.quoteNo;
|
||||
this.getList();
|
||||
// 供应商只需加载自己可见的RFQ,无需加载全部供应商列表
|
||||
listRfq({ pageSize: 200 }).then(r => { this.rfqOptions = r.rows || []; });
|
||||
listSupplier({ pageSize: 200 }).then(r => { this.supplierOptions = r.rows || []; });
|
||||
if (!this.isSupplier) {
|
||||
listSupplier({ pageSize: 200 }).then(r => { this.supplierOptions = r.rows || []; });
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
@@ -408,7 +423,11 @@ export default {
|
||||
}).catch(() => { this.loading = false; });
|
||||
},
|
||||
handleQuery() { this.queryParams.pageNum = 1; this.getList(); },
|
||||
resetQuery() { this.resetForm("queryForm"); this.handleQuery(); },
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.quoteNo = null;
|
||||
this.handleQuery();
|
||||
},
|
||||
handleAdd() {
|
||||
this.form = { items: [], currency: "CNY", validDays: 30, deliveryDays: null, status: "draft" };
|
||||
this.dialogTitle = "新建报价单";
|
||||
|
||||
@@ -242,7 +242,7 @@ export default {
|
||||
})
|
||||
},
|
||||
goCompare(rfqId) {
|
||||
this.$router.push({ path: '/bid/comparison/detail', query: { rfqId } })
|
||||
this.$router.push({ path: '/comparison/detail', query: { rfqId } })
|
||||
},
|
||||
formatMoney(v) {
|
||||
const n = Number(v)
|
||||
|
||||
@@ -304,7 +304,7 @@ export default {
|
||||
viewClientQuote() {
|
||||
const quoteId = this.rfq ? this.rfq.clientQuoteId : this.editForm.clientQuoteId;
|
||||
if (quoteId) {
|
||||
this.$router.push({ path: '/quotemgr/clientquote/detail', query: { quoteId } });
|
||||
this.$router.push({ path: '/bid/clientquote/detail', query: { quoteId } });
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新建报价请求</el-button>
|
||||
<el-button v-if="!isSupplier" type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新建报价请求</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -48,12 +48,19 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" width="160" />
|
||||
<el-table-column label="操作" align="center" width="200" fixed="right">
|
||||
<el-table-column label="操作" align="center" width="280" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-if="scope.row.status==='draft'">编辑</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-s-promotion" @click="handlePublish(scope.row)" v-if="scope.row.status==='draft'">发布</el-button>
|
||||
<!-- 管理员操作 -->
|
||||
<template v-if="!isSupplier">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-if="scope.row.status==='draft'">编辑</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-s-promotion" @click="handlePublish(scope.row)" v-if="scope.row.status==='draft'">发布</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-if="scope.row.status==='draft'">删除</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-s-order" style="color:#67C23A"
|
||||
v-if="scope.row.status==='published'||scope.row.status==='completed'||scope.row.status==='closed'"
|
||||
@click="openQuoteSummary(scope.row)">供应商报价</el-button>
|
||||
</template>
|
||||
<!-- 供应商与管理员都可见 -->
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">详情</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-if="scope.row.status==='draft'">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -65,20 +72,21 @@
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="RFQ标题" prop="rfqTitle">
|
||||
<el-input v-model="form.rfqTitle" placeholder="请输入标题" />
|
||||
<el-input v-model="form.rfqTitle" placeholder="请输入标题" :disabled="viewOnly" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="截止日期" prop="deadline">
|
||||
<el-date-picker v-model="form.deadline" type="datetime" placeholder="选择截止日期" value-format="yyyy-MM-dd HH:mm:ss" style="width:100%" />
|
||||
<el-date-picker v-model="form.deadline" type="datetime" placeholder="选择截止日期"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" style="width:100%" :disabled="viewOnly" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="关联甲方报价">
|
||||
<el-select v-model="form.clientQuoteId" placeholder="选择甲方报价(可选)" filterable clearable style="width:100%"
|
||||
@change="onClientQuoteSelect">
|
||||
<el-select v-model="form.clientQuoteId" placeholder="选择甲方报价(可选)" filterable clearable
|
||||
style="width:100%" @change="onClientQuoteSelect" :disabled="viewOnly">
|
||||
<el-option v-for="q in clientQuoteOptions" :key="q.quoteId"
|
||||
:label="q.quoteNo + ' - ' + q.clientName" :value="q.quoteId" />
|
||||
</el-select>
|
||||
@@ -86,7 +94,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="交货地址" prop="deliveryAddr">
|
||||
<el-input v-model="form.deliveryAddr" placeholder="请输入交货地址" />
|
||||
<el-input v-model="form.deliveryAddr" placeholder="请输入交货地址" :disabled="viewOnly" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -95,27 +103,29 @@
|
||||
<el-table :data="form.items || []" border size="small">
|
||||
<el-table-column label="物料名称" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.materialName" size="small" placeholder="物料名称" />
|
||||
<el-input v-model="scope.row.materialName" size="small" placeholder="物料名称" :disabled="viewOnly" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格型号" min-width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.spec" size="small" />
|
||||
<el-input v-model="scope.row.spec" size="small" :disabled="viewOnly" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.unit" size="small" />
|
||||
<el-input v-model="scope.row.unit" size="small" :disabled="viewOnly" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.quantity" :min="0" :precision="2" size="small" style="width:90px" />
|
||||
<span v-if="viewOnly" style="color:#606266">{{ scope.row.quantity }}</span>
|
||||
<el-input-number v-else v-model="scope.row.quantity" :min="0" :precision="2" size="small" style="width:90px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预期单价" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number v-model="scope.row.expectedPrice" :min="0" :precision="2" size="small" style="width:110px" />
|
||||
<span v-if="viewOnly" style="color:#606266">{{ scope.row.expectedPrice || '-' }}</span>
|
||||
<el-input-number v-else v-model="scope.row.expectedPrice" :min="0" :precision="2" size="small" style="width:110px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参考来源" width="100">
|
||||
@@ -123,21 +133,21 @@
|
||||
<span v-if="scope.row._fromClient" style="color:#409eff;font-size:12px">甲方报价</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="60" align="center">
|
||||
<el-table-column label="操作" width="60" align="center" v-if="!viewOnly">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-delete" @click="removeItem(scope.$index)" style="color:#f56c6c" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button size="small" style="margin-top:8px" @click="addItem" icon="el-icon-plus">添加物料行</el-button>
|
||||
<el-button v-if="!viewOnly" size="small" style="margin-top:8px" @click="addItem" icon="el-icon-plus">添加物料行</el-button>
|
||||
|
||||
<el-form-item label="备注" prop="remark" style="margin-top:16px">
|
||||
<el-input v-model="form.remark" type="textarea" rows="2" />
|
||||
<el-input v-model="form.remark" type="textarea" rows="2" :disabled="viewOnly" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
<el-button @click="open=false">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm">保存草稿</el-button>
|
||||
<el-button @click="open=false">{{ viewOnly ? '关闭' : '取消' }}</el-button>
|
||||
<el-button v-if="!viewOnly" type="primary" @click="submitForm">保存草稿</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
@@ -152,6 +162,87 @@
|
||||
<el-button type="primary" @click="doPublish">确认发布</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- ── 供应商报价汇总弹窗 ── -->
|
||||
<el-dialog :title="'供应商报价汇总 - ' + (summaryRfq.rfqNo || '')" :visible.sync="summaryOpen"
|
||||
width="900px" top="6vh" append-to-body :close-on-click-modal="false">
|
||||
<div v-loading="summaryLoading">
|
||||
<!-- RFQ 上下文 -->
|
||||
<div class="summary-context">
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="8">
|
||||
<span class="ctx-label">RFQ编号</span>
|
||||
<span class="ctx-value">{{ summaryRfq.rfqNo }}</span>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<span class="ctx-label">标题</span>
|
||||
<span class="ctx-value">{{ summaryRfq.rfqTitle }}</span>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<span class="ctx-label">截止日期</span>
|
||||
<span class="ctx-value">{{ summaryRfq.deadline }}</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 报价概况 -->
|
||||
<div class="summary-stats" v-if="summaryQuoteList.length > 0">
|
||||
<div class="stat-item">
|
||||
<div class="stat-num">{{ summaryQuoteList.length }}</div>
|
||||
<div class="stat-lbl">供应商报价</div>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<div class="stat-num">{{ minPrice }}</div>
|
||||
<div class="stat-lbl">最低报价</div>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<div class="stat-num">{{ maxPrice }}</div>
|
||||
<div class="stat-lbl">最高报价</div>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<div class="stat-num">{{ avgPrice }}</div>
|
||||
<div class="stat-lbl">平均报价</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 报价表格 -->
|
||||
<el-table :data="summaryQuoteList" border size="small" style="width:100%" empty-text="暂未收到供应商报价">
|
||||
<el-table-column type="index" width="44" label="#" />
|
||||
<el-table-column label="供应商" prop="supplierName" min-width="160">
|
||||
<template slot-scope="s">
|
||||
<el-avatar :size="26" style="background:#1171c4;margin-right:6px;vertical-align:middle;display:inline-flex">
|
||||
{{ (s.row.supplierName||'?').charAt(0) }}
|
||||
</el-avatar>
|
||||
<span style="vertical-align:middle">{{ s.row.supplierName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报价单号" min-width="150">
|
||||
<template slot-scope="s">
|
||||
<el-link type="primary" :underline="false" @click="viewQuotation(s.row)">
|
||||
{{ s.row.quoteNo }}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" width="130" align="right">
|
||||
<template slot-scope="s">
|
||||
<strong style="color:#409EFF">¥{{ s.row.totalAmount | money }}</strong>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交期" prop="deliveryDays" width="70" align="center">
|
||||
<template slot-scope="s">{{ s.row.deliveryDays || '-' }}天</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="有效期" prop="validDays" width="70" align="center">
|
||||
<template slot-scope="s">{{ s.row.validDays || '-' }}天</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="90" align="center">
|
||||
<template slot-scope="s">
|
||||
<el-tag :type="qStatusType(s.row.status)" size="small">{{ qStatusLabel(s.row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="提交时间" prop="submitTime" width="150" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -159,24 +250,38 @@
|
||||
import { listRfq, getRfq, addRfq, updateRfq, publishRfq, delRfq, getClientQuoteOptions, createRfqFromQuote } from "@/api/bid/rfq";
|
||||
import { listSupplier } from "@/api/bid/supplier";
|
||||
import { getClientQuote } from "@/api/bid/clientquote";
|
||||
import { getQuotationsByRfq } from "@/api/bid/quotation";
|
||||
|
||||
export default {
|
||||
name: "Rfq",
|
||||
filters: {
|
||||
money(v) { return v ? Number(v).toFixed(2) : "0.00"; }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false, total: 0, list: [],
|
||||
open: false, title: "",
|
||||
viewOnly: false,
|
||||
publishOpen: false, publishRfqId: null, selectedSuppliers: [], supplierOptions: [],
|
||||
clientQuoteOptions: [],
|
||||
queryParams: { pageNum: 1, pageSize: 10, rfqNo: null, rfqTitle: null, status: null },
|
||||
form: { items: [] },
|
||||
rules: { rfqTitle: [{ required: true, message: "标题不能为空", trigger: "blur" }] }
|
||||
rules: { rfqTitle: [{ required: true, message: "标题不能为空", trigger: "blur" }] },
|
||||
|
||||
// ---- 供应商报价汇总弹窗 ----
|
||||
summaryOpen: false,
|
||||
summaryLoading: false,
|
||||
summaryRfq: {},
|
||||
summaryQuoteList: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.loadSuppliers();
|
||||
this.loadClientQuoteOptions();
|
||||
// 供应商用户不需要加载供应商列表和甲方报价选项
|
||||
if (!this.isSupplier) {
|
||||
this.loadSuppliers();
|
||||
this.loadClientQuoteOptions();
|
||||
}
|
||||
// 接收外部传入参数:生成RFQ后自动打开编辑弹窗
|
||||
this.$nextTick(() => {
|
||||
const rfqId = this.$route.query.rfqId;
|
||||
@@ -212,10 +317,20 @@ export default {
|
||||
getRfq(row.rfqId).then(r => {
|
||||
this.form = r.data || {};
|
||||
if (!this.form.items) this.form.items = [];
|
||||
this.viewOnly = false;
|
||||
this.open = true; this.title = "编辑报价请求";
|
||||
});
|
||||
},
|
||||
handleView(row) { this.handleUpdate(row); },
|
||||
/** 查看RFQ详情:管理员可编辑,供应商只读 */
|
||||
handleView(row) {
|
||||
getRfq(row.rfqId).then(r => {
|
||||
this.form = r.data || {};
|
||||
if (!this.form.items) this.form.items = [];
|
||||
this.viewOnly = this.isSupplier;
|
||||
this.open = true;
|
||||
this.title = this.isSupplier ? "报价请求详情" : "编辑报价请求";
|
||||
});
|
||||
},
|
||||
handlePublish(row) { this.publishRfqId = row.rfqId; this.selectedSuppliers = []; this.publishOpen = true; },
|
||||
doPublish() {
|
||||
publishRfq(this.publishRfqId, this.selectedSuppliers).then(() => {
|
||||
@@ -260,11 +375,111 @@ export default {
|
||||
/** 查看关联的甲方报价 */
|
||||
viewClientQuote(row) {
|
||||
if (row.clientQuoteId) {
|
||||
this.$router.push({ path: '/quotemgr/clientquote/detail', query: { quoteId: row.clientQuoteId } });
|
||||
this.$router.push({ path: '/bid/clientquote/detail', query: { quoteId: row.clientQuoteId } });
|
||||
}
|
||||
},
|
||||
statusType(s) { return { draft:"info", published:"warning", closed:"", completed:"success" }[s] || ""; },
|
||||
statusLabel(s) { return { draft:"草稿", published:"已发布", closed:"已关闭", completed:"已完成" }[s] || s; }
|
||||
statusLabel(s) { return { draft:"草稿", published:"已发布", closed:"已关闭", completed:"已完成" }[s] || s; },
|
||||
|
||||
/* ========== 供应商报价汇总 ========== */
|
||||
|
||||
/** 打开供应商报价汇总弹窗 */
|
||||
openQuoteSummary(row) {
|
||||
this.summaryRfq = { ...row };
|
||||
this.summaryOpen = true;
|
||||
this.summaryLoading = true;
|
||||
this.summaryQuoteList = [];
|
||||
getQuotationsByRfq(row.rfqId).then(r => {
|
||||
this.summaryQuoteList = r.data || [];
|
||||
this.summaryLoading = false;
|
||||
}).catch(() => {
|
||||
this.summaryLoading = false;
|
||||
});
|
||||
},
|
||||
|
||||
/** 点击报价单号跳转到供应商报价列表,按供应商名称和RFQ单号自动搜索过滤 */
|
||||
viewQuotation(row) {
|
||||
this.summaryOpen = false;
|
||||
this.$router.push({ path: '/quotation', query: { rfqNo: row.rfqNo, supplierName: row.supplierName, quoteNo: row.quoteNo } });
|
||||
},
|
||||
|
||||
/** 报价状态样式 */
|
||||
qStatusType(s) { return { draft: "info", submitted: "warning", accepted: "success", rejected: "danger" }[s] || "info"; },
|
||||
qStatusLabel(s) { return { draft: "草稿", submitted: "已提交", accepted: "已采纳", rejected: "已拒绝" }[s] || s; }
|
||||
},
|
||||
computed: {
|
||||
/** 是否为供应商用户 */
|
||||
isSupplier() {
|
||||
return this.$store.getters.roles && this.$store.getters.roles.includes('supplier');
|
||||
},
|
||||
/** 最低报价 */
|
||||
minPrice() {
|
||||
if (!this.summaryQuoteList.length) return '¥0.00';
|
||||
const vals = this.summaryQuoteList.map(q => Number(q.totalAmount) || 0).filter(v => v > 0);
|
||||
if (!vals.length) return '¥0.00';
|
||||
return '¥' + Math.min(...vals).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||
},
|
||||
/** 最高报价 */
|
||||
maxPrice() {
|
||||
if (!this.summaryQuoteList.length) return '¥0.00';
|
||||
const vals = this.summaryQuoteList.map(q => Number(q.totalAmount) || 0).filter(v => v > 0);
|
||||
if (!vals.length) return '¥0.00';
|
||||
return '¥' + Math.max(...vals).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||
},
|
||||
/** 平均报价 */
|
||||
avgPrice() {
|
||||
if (!this.summaryQuoteList.length) return '¥0.00';
|
||||
const vals = this.summaryQuoteList.map(q => Number(q.totalAmount) || 0).filter(v => v > 0);
|
||||
if (!vals.length) return '¥0.00';
|
||||
const avg = vals.reduce((s, v) => s + v, 0) / vals.length;
|
||||
return '¥' + avg.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* ── 供应商报价汇总弹窗 ── */
|
||||
.summary-context {
|
||||
padding: 12px 16px;
|
||||
background: #f5f7fa;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.ctx-label {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
.ctx-value {
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.summary-stats {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.summary-stats .stat-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 14px 10px;
|
||||
border-radius: 6px;
|
||||
background: linear-gradient(135deg, #f0f7ff, #e8f4fd);
|
||||
border: 1px solid #d9ecff;
|
||||
}
|
||||
.summary-stats .stat-num {
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
color: #1171c4;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.summary-stats .stat-lbl {
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
margin-top: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -159,6 +159,36 @@
|
||||
|
||||
<!-- Tab 3: 报价历史(按物料条目展开) -->
|
||||
<el-tab-pane label="报价历史" name="quotes">
|
||||
<!-- 搜索栏 -->
|
||||
<div class="quote-search-bar">
|
||||
<el-form :model="quoteQuery" size="small" :inline="true">
|
||||
<el-form-item label="物料名称">
|
||||
<el-input v-model="quoteQuery.materialName" placeholder="物料名称" clearable
|
||||
style="width:140px" @keyup.enter.native="loadQuotes" />
|
||||
</el-form-item>
|
||||
<el-form-item label="报价单号">
|
||||
<el-input v-model="quoteQuery.quoteNo" placeholder="报价单号" clearable
|
||||
style="width:140px" @keyup.enter.native="loadQuotes" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="quoteQuery.quoteStatus" placeholder="全部" clearable style="width:100px">
|
||||
<el-option label="草稿" value="draft" />
|
||||
<el-option label="已提交" value="submitted" />
|
||||
<el-option label="已采纳" value="accepted" />
|
||||
<el-option label="已拒绝" value="rejected" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="报价日期">
|
||||
<el-date-picker v-model="quoteQuery.dateRange" type="daterange"
|
||||
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
|
||||
value-format="yyyy-MM-dd" style="width:220px" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="loadQuotes">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuoteQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<el-table :data="quoteList" v-loading="quoteLoading" border size="small" style="width:100%">
|
||||
<el-table-column type="index" width="44" label="#" />
|
||||
@@ -203,29 +233,7 @@
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- Tab 4: 供货清单 -->
|
||||
<el-tab-pane label="供货清单" name="orders">
|
||||
<div class="tab-content">
|
||||
<el-table :data="orderList" v-loading="orderLoading" border size="small" style="width:100%">
|
||||
<el-table-column label="采购单号" prop="poNo" min-width="150" />
|
||||
<el-table-column label="采购标题" prop="rfqTitle" min-width="160" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="总金额" prop="totalAmount" width="120" align="right">
|
||||
<template slot-scope="scope">
|
||||
<span class="price-text">{{ scope.row.totalAmount ? '¥' + Number(scope.row.totalAmount).toLocaleString() : '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交货日期" prop="deliveryDate" width="110" align="center" />
|
||||
<el-table-column label="状态" width="90" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="orderStatusType(scope.row.status)" size="small">{{ orderStatusText(scope.row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div v-if="!orderList.length && !orderLoading" class="table-empty">暂无供货记录</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- Tab 5: 订单异议 -->
|
||||
<!-- Tab 4: 订单异议 -->
|
||||
<el-tab-pane label="订单异议" name="objections">
|
||||
<div class="tab-content">
|
||||
<el-table :data="objectionList" v-loading="objectionLoading" border size="small" style="width:100%">
|
||||
@@ -294,7 +302,6 @@
|
||||
|
||||
<script>
|
||||
import { listSupplier, getSupplier, addSupplier, updateSupplier, delSupplier } from "@/api/bid/supplier";
|
||||
import { listPurchaseorder } from "@/api/bid/purchaseorder";
|
||||
import { listObjection } from "@/api/bid/objection";
|
||||
import { getSupplierQuoteItems } from "@/api/bid/quotation";
|
||||
|
||||
@@ -328,17 +335,19 @@ export default {
|
||||
addDialogOpen: false,
|
||||
addForm: {},
|
||||
|
||||
// ---- 供货清单 ----
|
||||
orderLoading: false,
|
||||
orderList: [],
|
||||
|
||||
// ---- 订单异议 ----
|
||||
objectionLoading: false,
|
||||
objectionList: [],
|
||||
|
||||
// ---- 报价历史 ----
|
||||
quoteLoading: false,
|
||||
quoteList: []
|
||||
quoteList: [],
|
||||
quoteQuery: {
|
||||
materialName: null,
|
||||
quoteNo: null,
|
||||
quoteStatus: null,
|
||||
dateRange: null
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -405,7 +414,6 @@ export default {
|
||||
status: item.status || "0"
|
||||
};
|
||||
// 清空子列表
|
||||
this.orderList = [];
|
||||
this.objectionList = [];
|
||||
this.quoteList = [];
|
||||
},
|
||||
@@ -508,7 +516,15 @@ export default {
|
||||
loadQuotes() {
|
||||
if (!this.currentSupplier) return;
|
||||
this.quoteLoading = true;
|
||||
getSupplierQuoteItems(this.currentSupplier.supplierId)
|
||||
const params = {
|
||||
supplierId: this.currentSupplier.supplierId,
|
||||
materialName: this.quoteQuery.materialName || null,
|
||||
quoteNo: this.quoteQuery.quoteNo || null,
|
||||
quoteStatus: this.quoteQuery.quoteStatus || null,
|
||||
beginTime: this.quoteQuery.dateRange ? this.quoteQuery.dateRange[0] + ' 00:00:00' : null,
|
||||
endTime: this.quoteQuery.dateRange ? this.quoteQuery.dateRange[1] + ' 23:59:59' : null
|
||||
};
|
||||
getSupplierQuoteItems(params)
|
||||
.then(res => {
|
||||
this.quoteList = res.data || [];
|
||||
this.quoteLoading = false;
|
||||
@@ -518,6 +534,17 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
/** 重置报价历史搜索条件 */
|
||||
resetQuoteQuery() {
|
||||
this.quoteQuery = {
|
||||
materialName: null,
|
||||
quoteNo: null,
|
||||
quoteStatus: null,
|
||||
dateRange: null
|
||||
};
|
||||
this.loadQuotes();
|
||||
},
|
||||
|
||||
quoteStatusType(status) {
|
||||
const map = { accepted: 'success', submitted: 'primary', draft: 'info', rejected: 'danger' };
|
||||
return map[status] || 'info';
|
||||
@@ -537,30 +564,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/* ========== Tab: 供货清单 ========== */
|
||||
loadOrders() {
|
||||
if (!this.currentSupplier) return;
|
||||
this.orderLoading = true;
|
||||
listPurchaseorder({ supplierId: this.currentSupplier.supplierId, pageSize: 200 })
|
||||
.then(res => {
|
||||
this.orderList = res.rows || [];
|
||||
this.orderLoading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.orderLoading = false;
|
||||
});
|
||||
},
|
||||
|
||||
orderStatusType(status) {
|
||||
const map = { confirmed: "success", pending: "warning", cancelled: "danger", draft: "info" };
|
||||
return map[status] || "info";
|
||||
},
|
||||
|
||||
orderStatusText(status) {
|
||||
const map = { confirmed: "已确认", pending: "待处理", cancelled: "已取消", draft: "草稿" };
|
||||
return map[status] || status || "-";
|
||||
},
|
||||
|
||||
/* ========== Tab: 订单异议 ========== */
|
||||
loadObjections() {
|
||||
if (!this.currentSupplier) return;
|
||||
@@ -590,9 +593,6 @@ export default {
|
||||
if (val === "quotes" && !this.quoteList.length) {
|
||||
this.loadQuotes();
|
||||
}
|
||||
if (val === "orders" && !this.orderList.length) {
|
||||
this.loadOrders();
|
||||
}
|
||||
if (val === "objections" && !this.objectionList.length) {
|
||||
this.loadObjections();
|
||||
}
|
||||
@@ -600,15 +600,11 @@ export default {
|
||||
currentSupplier() {
|
||||
// 切换供应商时清除子列表
|
||||
this.quoteList = [];
|
||||
this.orderList = [];
|
||||
this.objectionList = [];
|
||||
// 如果当前在报价、采购单或异议Tab,自动加载
|
||||
// 如果当前在报价或异议Tab,自动加载
|
||||
if (this.activeTab === "quotes") {
|
||||
this.$nextTick(() => this.loadQuotes());
|
||||
}
|
||||
if (this.activeTab === "orders") {
|
||||
this.$nextTick(() => this.loadOrders());
|
||||
}
|
||||
if (this.activeTab === "objections") {
|
||||
this.$nextTick(() => this.loadObjections());
|
||||
}
|
||||
@@ -904,6 +900,18 @@ export default {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 报价历史搜索栏 */
|
||||
.quote-search-bar {
|
||||
margin-bottom: 16px;
|
||||
padding: 12px 16px;
|
||||
background: #fafafa;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #ebeef5;
|
||||
}
|
||||
.quote-search-bar .el-form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* 右侧占位 */
|
||||
.right-placeholder {
|
||||
display: flex;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="dashboard">
|
||||
<el-row :gutter="20" class="stat-row">
|
||||
<el-col :xs="12" :sm="6" v-for="item in statCards" :key="item.key">
|
||||
<el-col :xs="12" :sm="6" v-for="item in (isSupplier ? statCards.filter(c => c.key==='rfqs') : statCards)" :key="item.key">
|
||||
<div class="stat-card" :style="{ borderTopColor: item.color }">
|
||||
<div class="stat-icon" :style="{ background: item.color + '18', color: item.color }">
|
||||
<i :class="item.icon" />
|
||||
@@ -19,7 +19,7 @@
|
||||
<el-card class="panel-card">
|
||||
<div slot="header" class="panel-header">
|
||||
<span><i class="el-icon-document" /> 最近询价单</span>
|
||||
<router-link to="/bid/rfq" class="panel-more">查看全部</router-link>
|
||||
<router-link to="/rfq" class="panel-more">查看全部</router-link>
|
||||
</div>
|
||||
<el-table :data="recentRfqs" size="small" style="width:100%">
|
||||
<el-table-column prop="rfqNo" label="单号" width="160" />
|
||||
@@ -33,11 +33,11 @@
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="24" :lg="10">
|
||||
<el-col :xs="24" :lg="10" v-if="!isSupplier">
|
||||
<el-card class="panel-card">
|
||||
<div slot="header" class="panel-header">
|
||||
<span><i class="el-icon-shopping-cart-full" /> 最近采购单</span>
|
||||
<router-link to="/bid/purchaseorder" class="panel-more">查看全部</router-link>
|
||||
<router-link to="/purchaseorder" class="panel-more">查看全部</router-link>
|
||||
</div>
|
||||
<el-table :data="recentPos" size="small" style="width:100%">
|
||||
<el-table-column prop="poNo" label="单号" width="140" />
|
||||
@@ -53,11 +53,11 @@
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" style="margin-top:20px">
|
||||
<el-col :xs="24" :lg="10">
|
||||
<el-col :xs="24" :lg="10" v-if="!isSupplier">
|
||||
<el-card class="panel-card">
|
||||
<div slot="header" class="panel-header">
|
||||
<span><i class="el-icon-s-custom" /> 供应商列表</span>
|
||||
<router-link to="/bid/supplier" class="panel-more">查看全部</router-link>
|
||||
<router-link to="/supplier" class="panel-more">查看全部</router-link>
|
||||
</div>
|
||||
<el-table :data="suppliers" size="small" style="width:100%">
|
||||
<el-table-column prop="supplierName" label="供应商名称" show-overflow-tooltip />
|
||||
@@ -76,7 +76,7 @@
|
||||
<span><i class="el-icon-magic-stick" /> 快捷操作</span>
|
||||
</div>
|
||||
<div class="quick-actions">
|
||||
<router-link v-for="action in quickActions" :key="action.path" :to="action.path" class="quick-btn">
|
||||
<router-link v-for="action in (isSupplier ? supplierQuickActions : quickActions)" :key="action.path" :to="action.path" class="quick-btn">
|
||||
<div class="quick-icon" :style="{ background: action.color + '18', color: action.color }">
|
||||
<i :class="action.icon" />
|
||||
</div>
|
||||
@@ -97,6 +97,17 @@ import { listPurchaseorder } from "@/api/bid/purchaseorder"
|
||||
|
||||
export default {
|
||||
name: "Dashboard",
|
||||
computed: {
|
||||
isSupplier() {
|
||||
return this.$store.getters.roles && this.$store.getters.roles.includes('supplier');
|
||||
},
|
||||
supplierQuickActions() {
|
||||
return [
|
||||
{ label: "报价请求", icon: "el-icon-document", color: "#1171c4", path: "/rfq" },
|
||||
{ label: "我的报价", icon: "el-icon-money", color: "#67c23a", path: "/quotation" }
|
||||
];
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
stats: { suppliers: 0, materials: 0, rfqs: 0, pos: 0 },
|
||||
@@ -110,12 +121,12 @@ export default {
|
||||
{ key: "pos", label: "采购单", icon: "el-icon-shopping-cart-full", color: "#f56c6c" }
|
||||
],
|
||||
quickActions: [
|
||||
{ label: "新建询价单", icon: "el-icon-edit", color: "#1171c4", path: "/bid/rfq" },
|
||||
{ label: "物料管理", icon: "el-icon-goods", color: "#67c23a", path: "/bid/material" },
|
||||
{ label: "智慧比价", icon: "el-icon-data-analysis", color: "#e6a23c", path: "/bid/comparison" },
|
||||
{ label: "采购单", icon: "el-icon-shopping-cart-full", color: "#f56c6c", path: "/bid/purchaseorder" },
|
||||
{ label: "供应商", icon: "el-icon-s-cooperation", color: "#9b59b6", path: "/bid/supplier" },
|
||||
{ label: "供应商评价", icon: "el-icon-star-off", color: "#e67e22", path: "/bid/evaluation" }
|
||||
{ label: "新建询价单", icon: "el-icon-edit", color: "#1171c4", path: "/rfq" },
|
||||
{ label: "物料管理", icon: "el-icon-goods", color: "#67c23a", path: "/material" },
|
||||
{ label: "智慧比价", icon: "el-icon-data-analysis", color: "#e6a23c", path: "/comparison" },
|
||||
{ label: "采购单", icon: "el-icon-shopping-cart-full", color: "#f56c6c", path: "/purchaseorder" },
|
||||
{ label: "供应商", icon: "el-icon-s-cooperation", color: "#9b59b6", path: "/supplier" },
|
||||
{ label: "供应商评价", icon: "el-icon-star-off", color: "#e67e22", path: "/evaluation" }
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -124,6 +135,14 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
loadDashboard() {
|
||||
// 供应商只加载自己有权限的RFQ数据
|
||||
if (this.isSupplier) {
|
||||
listRfq({ pageNum: 1, pageSize: 5 }).then(r => {
|
||||
this.recentRfqs = r.rows || []
|
||||
this.stats.rfqs = r.total || 0
|
||||
}).catch(() => {})
|
||||
return
|
||||
}
|
||||
listSupplier({ pageNum: 1, pageSize: 5 }).then(r => {
|
||||
this.suppliers = r.rows || []
|
||||
this.stats.suppliers = r.total || 0
|
||||
|
||||
Reference in New Issue
Block a user