二级系统联合寻找数据

This commit is contained in:
2026-02-03 16:11:02 +08:00
parent b04360b770
commit 17016c8177
9 changed files with 202 additions and 1 deletions

View File

@@ -832,11 +832,14 @@ export default {
}
// 跳转并传递参数
const currentActionTypeLabel = this.$route?.query?.actionType
this.$router.push({
path: path,
query: {
coilId: row.coilId,
actionId: row.actionId
actionId: row.actionId,
...(currentActionTypeLabel ? { actionType: currentActionTypeLabel } : {})
}
})
}).catch(error => {

View File

@@ -12,6 +12,15 @@
</div>
</div>
<el-alert
v-if="acidPrefill.visible"
:title="acidPrefill.title"
:type="acidPrefill.type"
:closable="false"
show-icon
style="margin-bottom: 20px;"
/>
<!-- 主内容区 - 左右布局 -->
<div class="content-wrapper">
<!-- 左侧当前信息 -->
@@ -255,6 +264,7 @@ import { completeAction } from '@/api/wms/pendingAction';
import { listWarehouse } from '@/api/wms/warehouse';
import { listRawMaterialWithBom } from '@/api/wms/rawMaterial';
import { listProductWithBom } from '@/api/wms/product';
import { getAcidTypingPrefill } from '@/api/pocket/acidTyping';
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
import ProductSelect from "@/components/KLPService/ProductSelect";
@@ -358,6 +368,12 @@ export default {
warehouseList: [],
historySteps: [],
actionId: null,
acidPrefill: {
visible: false,
type: 'info',
title: ''
},
isAcidRolling: false,
// 原材料和产品列表(实时搜索,不再保存完整备份)
rawMaterialList: [],
productList: [],
@@ -411,10 +427,67 @@ export default {
// 从路由参数获取coilId和actionId
const coilId = this.$route.query.coilId;
const actionId = this.$route.query.actionId;
const actionType = this.$route.query.actionType;
const readonly = this.$route.query.readonly;
this.isAcidRolling = actionType === '酸连轧工序'
if (this.isAcidRolling) {
this.acidPrefill.visible = true
this.acidPrefill.type = 'info'
this.acidPrefill.title = '正在结合酸轧二级系统自动填写部分信息...'
}
if (coilId) {
await this.loadCoilInfo(coilId);
if (this.isAcidRolling) {
const currentCoilNo = this.currentInfo && this.currentInfo.currentCoilNo
console.log('[typing] acid rolling actionType detected, will call prefill API with currentCoilNo (encoilid)=', currentCoilNo)
if (!currentCoilNo) {
this.acidPrefill.type = 'warning'
this.acidPrefill.title = '当前钢卷号为空'
} else {
try {
const prefillRes = await getAcidTypingPrefill(currentCoilNo)
const prefill = prefillRes && prefillRes.data
if (!prefill) {
this.acidPrefill.type = 'info'
this.acidPrefill.title = '未在二级系统中查找到对应信息,请自行填写'
} else {
if (prefill.exitWeight != null && prefill.exitWeight !== '') {
const w = Number(prefill.exitWeight)
if (!Number.isNaN(w)) {
this.$set(this.updateForm, 'grossWeight', w)
this.$set(this.updateForm, 'netWeight', w)
}
}
if (prefill.exitLength != null && prefill.exitLength !== '') {
const len = Number(prefill.exitLength)
if (!Number.isNaN(len)) {
this.$set(this.updateForm, 'length', len)
}
}
if (prefill.team) {
this.$set(this.updateForm, 'team', prefill.team)
}
this.acidPrefill.type = 'success'
this.acidPrefill.title = '已结合酸轧二级系统完成部分信息填写'
console.log('[typing] acid rolling prefill applied:', prefill)
}
} catch (e) {
console.error('[typing] acid rolling prefill request failed:', e)
this.acidPrefill.type = 'error'
this.acidPrefill.title = '未在二级系统中查找到对应信息,故自动填写失败'
}
}
}
}
if (actionId) {