修复采购和集成酸轧细节
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<div class="pd-wb">
|
||||
<div class="pd-main">
|
||||
<!-- 左:审核通过的计划 -->
|
||||
<!-- 左:审核通过的采购合同 -->
|
||||
<aside class="pd-col pd-plans">
|
||||
<div class="pd-col-tool">
|
||||
<el-input
|
||||
v-model="queryParams.keyword"
|
||||
size="small"
|
||||
clearable
|
||||
placeholder="搜索计划号 / 合同号 / 供货商"
|
||||
placeholder="搜索合同号 / 出卖方"
|
||||
prefix-icon="el-icon-search"
|
||||
@keyup.enter.native="handleQuery"
|
||||
@clear="handleQuery"
|
||||
@@ -26,14 +26,14 @@
|
||||
<span class="pd-no">{{ p.planNo }}</span>
|
||||
<span class="pd-pct" :class="{ done: Number(p.progress) >= 100 }">{{ (Number(p.progress) || 0).toFixed(0) }}%</span>
|
||||
</div>
|
||||
<div class="pd-li-r2">{{ (p.contractCodes || []).join('、') || '无合同号' }}</div>
|
||||
<div class="pd-li-r2">{{ p.supplier || '—' }}</div>
|
||||
<el-progress :percentage="Number(p.progress) || 0" :stroke-width="4" :show-text="false" :color="progressColor" />
|
||||
<div class="pd-li-r3">
|
||||
<span>{{ p.supplier || '—' }}</span>
|
||||
<span>{{ p.arrivedCount || 0 }}/{{ p.planQty || 0 }} 卷<i v-if="p.planStatus === '1'" class="pd-arch">已齐</i></span>
|
||||
<span>已到 {{ p.arrivedCount || 0 }} · 在途 {{ p.inTransitCount || 0 }}</span>
|
||||
<span v-if="p.planStatus === '1'" class="pd-arch">已到齐</span>
|
||||
</div>
|
||||
</li>
|
||||
<li v-if="!loading && !planList.length" class="pd-empty">暂无审核通过的计划</li>
|
||||
<li v-if="!loading && !planList.length" class="pd-empty">暂无审核通过的合同</li>
|
||||
</ul>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
@@ -50,7 +50,7 @@
|
||||
<section class="pd-col pd-detail">
|
||||
<div v-if="!current.planId" class="pd-placeholder">
|
||||
<i class="el-icon-truck"></i>
|
||||
<p>从左侧选择一条审核通过的计划,上传到货表格按卷号比对</p>
|
||||
<p>从左侧选择一条采购合同</p>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
@@ -75,89 +75,51 @@
|
||||
</div>
|
||||
|
||||
<div class="pd-meta">
|
||||
<div class="pd-meta-i"><label>合同号</label><span>{{ (current.contractCodes || []).join('、') || '—' }}</span></div>
|
||||
<div class="pd-meta-i"><label>供货商</label><span>{{ current.supplier || '—' }}</span></div>
|
||||
<div class="pd-meta-i"><label>已到货 / 要求</label><span>{{ current.arrivedCount || 0 }} / {{ current.planQty || 0 }} 卷 · {{ fmt(current.arrivedWeight) }} / {{ fmt(current.planWeight) }} T</span></div>
|
||||
<div class="pd-meta-i"><label>出卖方</label><span>{{ current.supplier || '—' }}</span></div>
|
||||
<div class="pd-meta-i"><label>关联销售合同</label><span>{{ (current.contractCodes || []).join('、') || '—' }}</span></div>
|
||||
<div class="pd-meta-i"><label>要求总重量</label><span>{{ fmt(current.planWeight) }} T</span></div>
|
||||
<div class="pd-meta-i"><label>已到 / 在途</label><span>{{ current.arrivedCount || 0 }} 卷({{ fmt(current.arrivedWeight) }} T) / {{ current.inTransitCount || 0 }} 卷</span></div>
|
||||
<div class="pd-meta-i wide">
|
||||
<label>到货百分比(按重量)</label>
|
||||
<label>到货进度(按重量)</label>
|
||||
<el-progress
|
||||
:percentage="Number(current.progress) || 0"
|
||||
:stroke-width="14" :text-inside="true" :color="progressColor"
|
||||
:format="p => p.toFixed(1) + '%'"
|
||||
/>
|
||||
</div>
|
||||
<div class="pd-meta-i wide">
|
||||
<label>到货百分比(按卷数)</label>
|
||||
<el-progress
|
||||
:percentage="Number(current.progressQty) || 0"
|
||||
:stroke-width="14" :text-inside="true" color="#3a8a4d"
|
||||
:format="p => p.toFixed(1) + '%'"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-tabs v-model="activeTab" class="pd-tabs">
|
||||
<el-tab-pane name="items">
|
||||
<span slot="label">采购要求(到货 重量{{ (Number(current.progress) || 0).toFixed(0) }}% / 卷数{{ (Number(current.progressQty) || 0).toFixed(0) }}%)</span>
|
||||
<p class="pd-req-tip">采购要求只说明买什么、买多少;到货按上传表格的卷号在钢卷表确认,进度见上方与「到货记录」。</p>
|
||||
<el-tab-pane label="采购要求" name="items">
|
||||
<el-table :data="current.items" border size="mini" max-height="420">
|
||||
<el-table-column label="#" type="index" width="40" align="center" />
|
||||
<el-table-column label="产品" prop="productType" min-width="70" show-overflow-tooltip />
|
||||
<el-table-column label="材质" prop="material" min-width="78" show-overflow-tooltip />
|
||||
<el-table-column label="牌号" prop="grade" min-width="72" />
|
||||
<el-table-column label="宽度" prop="width" min-width="68" />
|
||||
<el-table-column label="厚度" prop="thickness" min-width="68" />
|
||||
<el-table-column label="宽公差" prop="widthTolerance" min-width="70" />
|
||||
<el-table-column label="厚公差" prop="thicknessTolerance" min-width="70" />
|
||||
<el-table-column label="重量(T)" prop="weight" min-width="76" align="right" />
|
||||
<el-table-column label="数量" prop="quantity" min-width="58" align="right" />
|
||||
<el-table-column label="供货商" prop="supplier" min-width="88" show-overflow-tooltip />
|
||||
<template slot="empty"><span>无采购明细</span></template>
|
||||
<el-table-column label="#" type="index" width="44" align="center" />
|
||||
<el-table-column label="规格" prop="spec" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column label="总重量(T)" prop="weight" min-width="110" align="right" />
|
||||
<el-table-column label="厂商" prop="manufacturer" min-width="180" show-overflow-tooltip />
|
||||
<template slot="empty"><span>无采购要求</span></template>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane name="batches">
|
||||
<span slot="label">到货记录({{ batches.length }} 次上传)</span>
|
||||
<div class="pd-batch-wrap">
|
||||
<el-table
|
||||
:data="batches"
|
||||
border size="mini" max-height="200" v-loading="batchLoading"
|
||||
highlight-current-row @row-click="viewBatch"
|
||||
>
|
||||
<el-table-column label="上传时间" prop="createTime" width="150" align="center" />
|
||||
<el-table-column label="文件" prop="fileName" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column label="行数" prop="rowCount" width="64" align="center" />
|
||||
<el-table-column label="匹配卷数" prop="matchedCount" width="84" align="center" />
|
||||
<el-table-column label="上传后到货%" width="110" align="center">
|
||||
<template slot-scope="s">{{ (Number(s.row.arrivedPercent) || 0).toFixed(0) }}%</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="录入人" prop="createBy" width="90" align="center" />
|
||||
<el-table-column label="操作" width="64" align="center">
|
||||
<template slot-scope="s"><el-button type="text" size="mini" @click.stop="viewBatch(s.row)">查看</el-button></template>
|
||||
</el-table-column>
|
||||
<template slot="empty"><span>暂无上传记录,点右上角「上传到货表格」</span></template>
|
||||
</el-table>
|
||||
|
||||
<div class="pd-batch-rows" v-if="currentBatch.batchId">
|
||||
<div class="pd-sub-title">「{{ currentBatch.fileName }}」到货明细(卷号在钢卷表确认到货的高亮为已到货)</div>
|
||||
<el-table :data="batchRows" border stripe size="mini" max-height="300" v-loading="batchRowsLoading"
|
||||
:row-class-name="rowClass">
|
||||
<el-table-column label="日期" prop="arrivalDate" width="100" align="center" />
|
||||
<el-table-column label="牌号" prop="grade" width="78" align="center" />
|
||||
<el-table-column label="规格" prop="spec" width="105" align="center" />
|
||||
<el-table-column label="卷号" prop="coilNo" width="120" align="center" />
|
||||
<el-table-column label="单卷(T)" prop="coilWeight" width="78" align="right" />
|
||||
<el-table-column label="车号" prop="truckNo" width="95" align="center" />
|
||||
<el-table-column label="销售" prop="salesCode" width="80" align="center" />
|
||||
<el-table-column label="到货" width="72" align="center">
|
||||
<template slot-scope="s">
|
||||
<span class="pd-mtag" :class="s.row.arrived === 1 ? 'yes' : 'no'">{{ s.row.arrived === 1 ? '已到货' : '未到' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template slot="empty"><span>该批次无明细</span></template>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<el-tab-pane :label="'到货明细(' + deliveryList.length + ')'" name="delivery">
|
||||
<el-table
|
||||
:data="deliveryList" border stripe size="mini" max-height="420"
|
||||
v-loading="deliveryLoading" :row-class-name="rowClass"
|
||||
>
|
||||
<el-table-column label="日期" prop="arrivalDate" width="100" align="center" />
|
||||
<el-table-column label="牌号" prop="grade" width="78" align="center" />
|
||||
<el-table-column label="规格" prop="spec" width="105" align="center" />
|
||||
<el-table-column label="卷号" prop="coilNo" width="120" align="center" />
|
||||
<el-table-column label="单卷(T)" prop="coilWeight" width="78" align="right" />
|
||||
<el-table-column label="车号" prop="truckNo" width="95" align="center" />
|
||||
<el-table-column label="件数" prop="pieceCount" width="56" align="center" />
|
||||
<el-table-column label="销售" prop="salesCode" width="80" align="center" />
|
||||
<el-table-column label="状态" width="76" align="center">
|
||||
<template slot-scope="s">
|
||||
<span class="pd-mtag" :class="statusClass(s.row)">{{ statusText(s.row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template slot="empty"><span>暂无到货记录,点右上角「上传到货表格」</span></template>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@@ -170,8 +132,7 @@
|
||||
import {
|
||||
getPurchasePlan,
|
||||
listDeliveryPlans,
|
||||
listDeliveryBatches,
|
||||
listDeliveryByBatch,
|
||||
listDelivery,
|
||||
refreshArrival
|
||||
} from '@/api/erp/purchasePlan'
|
||||
import { getToken } from '@/utils/auth'
|
||||
@@ -186,11 +147,8 @@ export default {
|
||||
queryParams: { pageNum: 1, pageSize: 20, keyword: undefined },
|
||||
current: {},
|
||||
activeTab: 'items',
|
||||
batches: [],
|
||||
batchLoading: false,
|
||||
currentBatch: {},
|
||||
batchRows: [],
|
||||
batchRowsLoading: false,
|
||||
deliveryList: [],
|
||||
deliveryLoading: false,
|
||||
refreshing: false,
|
||||
upload: { headers: { Authorization: 'Bearer ' + getToken() } },
|
||||
progressColor: '#5b8db8'
|
||||
@@ -224,9 +182,8 @@ export default {
|
||||
selectPlan(p) {
|
||||
this.activeTab = 'items'
|
||||
this.current = { ...p }
|
||||
this.currentBatch = {}
|
||||
this.batchRows = []
|
||||
// 打开即静默复核一次 WMS 到货状态,保证看到的是最新
|
||||
this.deliveryList = []
|
||||
// 打开即静默按钢卷表复核一次到货状态
|
||||
const planId = p.planId
|
||||
refreshArrival(planId).catch(() => {}).finally(() => {
|
||||
if (this.current.planId === planId) this.refreshDetail()
|
||||
@@ -236,7 +193,8 @@ export default {
|
||||
const planId = this.current.planId
|
||||
if (!planId) return
|
||||
getPurchasePlan(planId).then(res => { this.current = { ...this.current, ...(res.data || {}) } })
|
||||
this.loadBatches()
|
||||
this.deliveryLoading = true
|
||||
listDelivery(planId).then(res => { this.deliveryList = res.data || [] }).finally(() => { this.deliveryLoading = false })
|
||||
},
|
||||
doRefreshArrival() {
|
||||
if (!this.current.planId) return
|
||||
@@ -244,23 +202,23 @@ export default {
|
||||
refreshArrival(this.current.planId).then(() => {
|
||||
this.$modal.msgSuccess('已按钢卷表刷新到货状态')
|
||||
this.refreshDetail()
|
||||
if (this.currentBatch.batchId) this.viewBatch(this.currentBatch)
|
||||
this.getList(true)
|
||||
}).finally(() => { this.refreshing = false })
|
||||
},
|
||||
loadBatches() {
|
||||
this.batchLoading = true
|
||||
listDeliveryBatches(this.current.planId).then(res => {
|
||||
this.batches = res.data || []
|
||||
}).finally(() => { this.batchLoading = false })
|
||||
},
|
||||
viewBatch(b) {
|
||||
this.currentBatch = { ...b }
|
||||
this.batchRowsLoading = true
|
||||
listDeliveryByBatch(b.batchId).then(res => { this.batchRows = res.data || [] }).finally(() => { this.batchRowsLoading = false })
|
||||
},
|
||||
rowClass({ row }) {
|
||||
return row.arrived === 1 ? 'pd-row-matched' : ''
|
||||
if (row.arrived === 1) return 'pd-row-arrived'
|
||||
if (row.inTransit === 1) return 'pd-row-transit'
|
||||
return ''
|
||||
},
|
||||
statusText(row) {
|
||||
if (row.arrived === 1) return '已到货'
|
||||
if (row.inTransit === 1) return '在途'
|
||||
return '未到'
|
||||
},
|
||||
statusClass(row) {
|
||||
if (row.arrived === 1) return 'yes'
|
||||
if (row.inTransit === 1) return 'transit'
|
||||
return 'no'
|
||||
},
|
||||
handleUploadSuccess(res) {
|
||||
if (res.code === 200) {
|
||||
@@ -270,7 +228,7 @@ export default {
|
||||
} else {
|
||||
this.$modal.msgSuccess(res.msg || '导入成功')
|
||||
}
|
||||
this.activeTab = 'batches'
|
||||
this.activeTab = 'delivery'
|
||||
this.refreshDetail()
|
||||
this.getList(true)
|
||||
} else {
|
||||
@@ -311,7 +269,7 @@ $sub: #909399;
|
||||
.pd-pct { font-size: 12px; font-weight: 600; color: $sub; &.done { color: #3a8a4d; } }
|
||||
.pd-li-r2 { font-size: 12px; color: $sub; margin: 4px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.pd-li-r3 { display: flex; justify-content: space-between; font-size: 11px; color: $sub; margin-top: 4px; }
|
||||
.pd-arch { font-style: normal; color: #3a8a4d; margin-left: 6px; }
|
||||
.pd-arch { font-style: normal; color: #3a8a4d; }
|
||||
.pd-empty { text-align: center; color: $sub; padding: 36px 12px; font-size: 13px; }
|
||||
|
||||
.pd-placeholder {
|
||||
@@ -326,26 +284,20 @@ $sub: #909399;
|
||||
font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 2px; border: 1px solid #dcdfe6; color: $sub; background: #fafafa;
|
||||
&.p1 { color: #3a8a4d; border-color: #b7d9bf; background: #f0f9f1; }
|
||||
}
|
||||
.pd-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 24px; padding: 16px 18px; }
|
||||
.pd-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; padding: 16px 18px; }
|
||||
.pd-meta-i {
|
||||
display: flex; flex-direction: column; font-size: 13px;
|
||||
label { color: $sub; font-size: 12px; margin-bottom: 3px; }
|
||||
span { color: $ink; }
|
||||
&.wide { grid-column: span 3; }
|
||||
&.wide { grid-column: span 2; }
|
||||
}
|
||||
.pd-tabs { padding: 0 18px 18px; }
|
||||
.pd-nocoil { color: #c0c4cc; }
|
||||
.pd-req-tip { font-size: 12px; color: #909399; margin: 0 0 10px; line-height: 1.6; }
|
||||
.pd-istat {
|
||||
font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 2px; border: 1px solid #dcdfe6; color: $sub;
|
||||
&.s2 { color: #3a8a4d; border-color: #b7d9bf; background: #f0f9f1; }
|
||||
}
|
||||
.pd-batch-rows { margin-top: 14px; }
|
||||
.pd-sub-title { font-size: 13px; font-weight: 600; color: $ink; border-left: 3px solid $accent; padding-left: 8px; margin: 6px 0 10px; }
|
||||
.pd-mtag {
|
||||
font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 2px; border: 1px solid #dcdfe6; color: $sub;
|
||||
&.yes { color: #3a8a4d; border-color: #b7d9bf; background: #f0f9f1; }
|
||||
&.transit { color: #d6a256; border-color: #ecd4a6; background: #fdf6ec; }
|
||||
&.no { color: $sub; }
|
||||
}
|
||||
::v-deep .pd-row-matched { background: #f3f9f4; }
|
||||
::v-deep .pd-row-arrived { background: #f3f9f4; }
|
||||
::v-deep .pd-row-transit { background: #fdf9f0; }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user