酸轧数据同步,轧辊新增产线新增各种产线
This commit is contained in:
@@ -26,25 +26,9 @@
|
||||
|
||||
<!-- 主内容区 - 左右布局 -->
|
||||
<div class="content-wrapper">
|
||||
<!-- 左侧:酸轧信息推荐 -->
|
||||
<!-- 左侧:L2 匹配面板 -->
|
||||
<div>
|
||||
<!-- 酸连轧最近10条记录展示 -->
|
||||
<el-card class="recent-records-card" v-if="acidRecentRecords && acidRecentRecords.length > 0">
|
||||
<div slot="header" class="card-header">
|
||||
<span><i class="el-icon-time"></i> 酸连轧最近记录</span>
|
||||
</div>
|
||||
|
||||
<el-table :data="acidRecentRecords" stripe size="small" @row-click="handleClickRecord">
|
||||
<el-table-column prop="currentCoilNo" label="加工前卷号" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="excoilId" label="出口卷号" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="exitWeight" label="出口重量(t)" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.exitWeight ? scope.row.exitWeight + ' t' : '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="team" label="班组" width="80"></el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<l2-match-panel :hot-coil-id="l2HotCoilId" @fill="applyL2Fill" />
|
||||
</div>
|
||||
<!-- 右侧:更新表单 -->
|
||||
<div>
|
||||
@@ -138,35 +122,6 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="质量状态" prop="qualityStatus">
|
||||
<el-select v-model="updateForm.qualityStatus" placeholder="请选择质量状态" style="width: 100%">
|
||||
<el-option v-for="item in dict.type.coil_quality_status" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="切边要求" prop="trimmingRequirement">
|
||||
<el-select v-model="updateForm.trimmingRequirement" placeholder="请选择切边要求" style="width: 100%">
|
||||
<el-option label="净边料" value="净边料" />
|
||||
<el-option label="毛边料" value="毛边料" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="包装要求" prop="packagingRequirement">
|
||||
<el-select v-model="updateForm.packagingRequirement" placeholder="请选择包装要求" style="width: 100%">
|
||||
<el-option label="裸包" value="裸包" />
|
||||
<el-option label="普包" value="普包" />
|
||||
<el-option label="简包" value="简包" />
|
||||
<el-option label="精包" value="精包" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="毛重(t)" prop="grossWeight">
|
||||
@@ -361,8 +316,6 @@
|
||||
<script>
|
||||
import { getMaterialCoil, updateMaterialCoil, getFirstHeatCoilMaterial } from '@/api/wms/coil';
|
||||
import { completeAction, getPendingAction } from '@/api/wms/pendingAction';
|
||||
// import { getTimingPlanList } from '@/api/l2/timing'
|
||||
import { getAcidTypingPrefill } from '@/api/pocket/acidTyping';
|
||||
import { saveCoilCache, getCoilCacheByCoilId, delCoilCache } from '@/api/wms/coilCache';
|
||||
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
|
||||
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
|
||||
@@ -373,6 +326,7 @@ import AbnormalForm from './components/AbnormalForm';
|
||||
import { generateCoilNoPrefix } from "@/utils/coil/coilNo";
|
||||
import { addCoilContractRel } from "@/api/wms/coilContractRel";
|
||||
import ContractSelect from "@/components/KLPService/ContractSelect";
|
||||
import L2MatchPanel from './panels/L2MatchPanel.vue';
|
||||
|
||||
|
||||
export default {
|
||||
@@ -384,7 +338,8 @@ export default {
|
||||
WarehouseSelect,
|
||||
TimeInput,
|
||||
AbnormalForm,
|
||||
ContractSelect
|
||||
ContractSelect,
|
||||
L2MatchPanel,
|
||||
},
|
||||
dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree', 'coil_business_purpose'],
|
||||
data() {
|
||||
@@ -479,9 +434,6 @@ export default {
|
||||
type: 'info',
|
||||
title: ''
|
||||
},
|
||||
isAcidRolling: false,
|
||||
// 酸连轧最近记录
|
||||
acidRecentRecords: [],
|
||||
// 异常信息
|
||||
abnormals: [],
|
||||
// 异常表单弹窗
|
||||
@@ -507,6 +459,9 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
l2HotCoilId() {
|
||||
return (this.currentInfo && this.currentInfo.enterCoilNo) || ''
|
||||
},
|
||||
// 动态显示标签
|
||||
getItemLabel() {
|
||||
if (this.updateForm.materialType === '成品') {
|
||||
@@ -530,98 +485,13 @@ export default {
|
||||
// 从路由参数获取coilId和actionId
|
||||
const coilId = this.$route.query.coilId;
|
||||
const actionId = this.$route.query.actionId;
|
||||
let actionType = ''
|
||||
const pendingActionRes = await getPendingAction(actionId)
|
||||
actionType = pendingActionRes.data.actionType
|
||||
|
||||
// 填写生产开始时间
|
||||
this.$set(this.updateForm, 'productionStartTime', pendingActionRes.data.createTime)
|
||||
|
||||
this.isAcidRolling = (actionType == 11)
|
||||
|
||||
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
|
||||
|
||||
if (!currentCoilNo) {
|
||||
this.acidPrefill.type = 'warning'
|
||||
this.acidPrefill.title = '当前钢卷号为空'
|
||||
} else {
|
||||
try {
|
||||
const prefillRes = await getAcidTypingPrefill(currentCoilNo)
|
||||
const prefill = prefillRes && prefillRes.data
|
||||
|
||||
if (!prefill || prefill.length === 0) {
|
||||
this.acidPrefill.type = 'info'
|
||||
this.acidPrefill.title = '未在二级系统中查找到对应信息,请自行填写'
|
||||
} else {
|
||||
// 处理返回的列表数据
|
||||
if (Array.isArray(prefill)) {
|
||||
this.acidRecentRecords = prefill;
|
||||
|
||||
// 使用第一条记录填充表单(保持原有逻辑)
|
||||
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 (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) {
|
||||
console.error('[typing] acid rolling prefill request failed:', e)
|
||||
this.acidPrefill.type = 'error'
|
||||
this.acidPrefill.title = '未在二级系统中查找到对应信息,故自动填写失败'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const currentCoilNoPrefix = generateCoilNoPrefix()
|
||||
@@ -653,6 +523,36 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
applyL2Fill(data) {
|
||||
if (data.entry_weight != null) {
|
||||
const w = parseFloat(data.entry_weight)
|
||||
if (!Number.isNaN(w)) {
|
||||
this.$set(this.updateForm, 'grossWeight', w)
|
||||
this.$set(this.updateForm, 'netWeight', w)
|
||||
}
|
||||
}
|
||||
if (data.exit_length != null) {
|
||||
const len = parseFloat(data.exit_length)
|
||||
if (!Number.isNaN(len)) {
|
||||
this.$set(this.updateForm, 'length', len)
|
||||
this.$set(this.updateForm, 'actualLength', len)
|
||||
}
|
||||
}
|
||||
if (data.exit_thick != null) this.$set(this.updateForm, 'actualThickness', parseFloat(data.exit_thick))
|
||||
if (data.exit_width != null) this.$set(this.updateForm, 'actualWidth', parseFloat(data.exit_width))
|
||||
// 包装要求
|
||||
if (data.park_type != null && data.park_type !== '') {
|
||||
this.$set(this.updateForm, 'packagingRequirement', data.park_type)
|
||||
}
|
||||
// 切边要求:1=净边料,0=毛边料
|
||||
if (data.trimming != null) {
|
||||
const t = String(data.trimming)
|
||||
if (t === '1') this.$set(this.updateForm, 'trimmingRequirement', '净边料')
|
||||
else if (t === '0') this.$set(this.updateForm, 'trimmingRequirement', '毛边料')
|
||||
}
|
||||
this.$message.success('L2 数据已写入表单')
|
||||
},
|
||||
|
||||
// 处理材料类型变化
|
||||
handleMaterialTypeChange(value) {
|
||||
// 清空物品选择
|
||||
@@ -667,17 +567,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
handleClickRecord(row) {
|
||||
this.updateForm = {
|
||||
...this.updateForm,
|
||||
currentCoilNo: row.excoilId,
|
||||
team: row.team,
|
||||
netWeight: row.exitWeight,
|
||||
grossWeight: row.exitWeight,
|
||||
length: row.exitLength,
|
||||
}
|
||||
},
|
||||
|
||||
// 加载钢卷信息
|
||||
async loadCoilInfo(coilId) {
|
||||
try {
|
||||
@@ -1050,7 +939,7 @@ export default {
|
||||
.content-wrapper {
|
||||
display: grid;
|
||||
margin-top: 10px;
|
||||
grid-template-columns: 600px 1fr;
|
||||
grid-template-columns: 340px 1fr;
|
||||
gap: 10px;
|
||||
align-items: stretch; // 改为stretch,让子元素高度一致
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user