完善单元格合并逻辑

This commit is contained in:
2026-06-27 14:10:56 +08:00
parent 66d2b33db5
commit fa333ff557
4 changed files with 96 additions and 20 deletions

View File

@@ -124,6 +124,14 @@ export function listDeliveryPlans(query) {
})
}
// 刷新到货(拿已上传卷号去 WMS 实时复核,签收的自动翻为已到货)
export function refreshArrival(planId) {
return request({
url: `/erp/purchasePlan/${planId}/refreshArrival`,
method: 'put'
})
}
// 某计划的到货上传批次(每次上传一条)
export function listDeliveryBatches(planId) {
return request({

View File

@@ -59,16 +59,19 @@
<span class="pd-d-title">{{ current.planNo }}</span>
<span class="pd-badge" :class="current.planStatus === '1' ? 'p1' : 'p0'">{{ current.planStatus === '1' ? '已到齐' : '到货中' }}</span>
</div>
<el-upload
:headers="upload.headers"
:action="uploadUrl"
:show-file-list="false"
accept=".xlsx,.xls"
:on-success="handleUploadSuccess"
:on-error="handleUploadError"
>
<el-button type="primary" size="small" icon="el-icon-upload2">上传到货表格</el-button>
</el-upload>
<div class="pd-head-act">
<el-button size="small" icon="el-icon-refresh" :loading="refreshing" @click="doRefreshArrival">刷新到货</el-button>
<el-upload
:headers="upload.headers"
:action="uploadUrl"
:show-file-list="false"
accept=".xlsx,.xls"
:on-success="handleUploadSuccess"
:on-error="handleUploadError"
>
<el-button type="primary" size="small" icon="el-icon-upload2">上传到货表格</el-button>
</el-upload>
</div>
</div>
<div class="pd-meta">
@@ -169,7 +172,8 @@ import {
getPurchasePlan,
listDeliveryPlans,
listDeliveryBatches,
listDeliveryByBatch
listDeliveryByBatch,
refreshArrival
} from '@/api/erp/purchasePlan'
import { getToken } from '@/utils/auth'
@@ -188,6 +192,7 @@ export default {
currentBatch: {},
batchRows: [],
batchRowsLoading: false,
refreshing: false,
upload: { headers: { Authorization: 'Bearer ' + getToken() } },
progressColor: '#5b8db8'
}
@@ -222,7 +227,11 @@ export default {
this.current = { ...p }
this.currentBatch = {}
this.batchRows = []
this.refreshDetail()
// 打开即静默复核一次 WMS 到货状态,保证看到的是最新
const planId = p.planId
refreshArrival(planId).catch(() => {}).finally(() => {
if (this.current.planId === planId) this.refreshDetail()
})
},
refreshDetail() {
const planId = this.current.planId
@@ -230,6 +239,16 @@ export default {
getPurchasePlan(planId).then(res => { this.current = { ...this.current, ...(res.data || {}) } })
this.loadBatches()
},
doRefreshArrival() {
if (!this.current.planId) return
this.refreshing = true
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 => {
@@ -302,6 +321,7 @@ $sub: #909399;
p { font-size: 13px; }
}
.pd-d-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid $line; }
.pd-head-act { display: flex; gap: 10px; align-items: center; ::v-deep .el-button { margin: 0; } }
.pd-d-title { font-size: 15px; font-weight: 600; color: $ink; margin-right: 8px; }
.pd-badge {
font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 2px; border: 1px solid #dcdfe6; color: $sub; background: #fafafa;