diff --git a/klp-ui/src/views/wms/coil/typing.vue b/klp-ui/src/views/wms/coil/typing.vue index f04ea961..cd5a5d1e 100644 --- a/klp-ui/src/views/wms/coil/typing.vue +++ b/klp-ui/src/views/wms/coil/typing.vue @@ -108,7 +108,7 @@ + :disabled="readonly"> @@ -116,33 +116,33 @@ + :disabled="readonly" @change="handleMaterialTypeChange"> + :rules="rules.itemId"> + placeholder="请选择原料" style="width: 100%" clearable + :disabled="readonly || !updateForm.materialType" /> + placeholder="请选择成品" style="width: 100%" clearable + :disabled="readonly || !updateForm.materialType" />
请先选择物料类型
- + + :disabled="readonly"> + :disabled="readonly"> @@ -150,13 +150,13 @@ + :disabled="readonly"> + :disabled="readonly"> @@ -165,20 +165,20 @@ + :disabled="readonly"> + :disabled="readonly"> + :disabled="readonly"> @@ -210,10 +210,33 @@ + show-word-limit :disabled="readonly" /> + + + +
+ 酸连轧最近记录 +
+ + + + + + + + + + + + +
@@ -229,8 +252,8 @@ + :timestamp="`步骤 ${step.display_step || step.step}`" placement="top" + :type="step.operation === '新增' ? 'success' : 'primary'">
{{ step.operation || step.action }}
@@ -325,7 +348,7 @@ export default { rules: { currentCoilNo: [ { required: true, message: '请输入当前钢卷号', trigger: 'blur' }, - // 仅在新增的时候校验 + // 仅在新增的时候校验 { validator: (rule, value, callback) => { // 没有coilId则为新增 触发校验 @@ -379,7 +402,9 @@ export default { productList: [], itemSearchLoading: false, // 只读模式 - readonly: false + readonly: false, + // 酸连轧最近记录 + acidRecentRecords: [] }; }, computed: { @@ -457,28 +482,56 @@ export default { 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 (Array.isArray(prefill)) { + this.acidRecentRecords = prefill; - if (prefill.exitLength != null && prefill.exitLength !== '') { - const len = Number(prefill.exitLength) - if (!Number.isNaN(len)) { - this.$set(this.updateForm, 'length', len) - } - } + // 使用第一条记录填充表单(保持原有逻辑) + const firstRecord = prefill[0]; + if (firstRecord) { + if (firstRecord.exitWeight != null && firstRecord.exitWeight !== '') { + const w = Number(firstRecord.exitWeight) + if (!Number.isNaN(w)) { + this.$set(this.updateForm, 'grossWeight', w) + this.$set(this.updateForm, 'netWeight', w) + } + } - if (prefill.team) { - this.$set(this.updateForm, 'team', prefill.team) + if (firstRecord.exitLength != null && firstRecord.exitLength !== '') { + const len = Number(firstRecord.exitLength) + if (!Number.isNaN(len)) { + this.$set(this.updateForm, 'length', len) + } + } + + if (firstRecord.team) { + this.$set(this.updateForm, 'team', firstRecord.team) + } + } + } 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) { @@ -833,6 +886,7 @@ export default { min-width: 0; display: flex; flex-direction: column; + gap: 20px; // 添加间距 } /* 确保两侧卡片高度一致 */ @@ -849,6 +903,11 @@ export default { } } +// 新增:最近记录卡片样式 +.recent-records-card { + flex: none; // 不伸缩,只占据内容所需空间 +} + /* 变更历史区域(占满整行) */ .history-section { margin-top: 20px;