@@ -7,19 +7,12 @@
< span > 钢卷信息更新 < / span >
< / div >
< div class = "header-actions" >
< el-button v-if = "!readonly" type= "primary" size= "small" @click="handleSave" :loading= "loading"> 保存更新 < / el -button >
< el-button size = "small" @click ="handleCancel" :disabled = "loading" > { { readonly ? '返回' : '取消' } } < / el-button >
< el-button type = "primary" size= "small" @click ="handleSave" :loading= "loading" > 保存更新 < / el-button>
< / div >
< / div >
< el-alert
v-if = "acidPrefill.visible"
:title = "acidPrefill.title"
:type = "acidPrefill.type"
:closable = "false"
show -icon
style = "margin-bottom: 20px;"
/ >
< el-alert v-if = "acidPrefill.visible" :title="acidPrefill.title" :type="acidPrefill.type" :closable="false" show -icon
style = "margin-bottom: 20px;" / >
<!-- 主内容区 - 左右布局 -- >
< div class = "content-wrapper" >
@@ -91,15 +84,15 @@
< div class = "right-panel" >
< el-card class = "form-card" >
< div slot = "header" class = "card-header" >
< span > < i class = "el-icon-edit-outline" > < / i > { { readonly ? '查看信息' : '更新信息' } } < / span >
< el-button v-if = "!readonly" type= "text" size= "mini" @click="copyFromCurrent" icon= "el-icon-document-copy">
< span > < i class = "el-icon-edit-outline" > < / i > { { '更新信息' } } < / span >
<!-- < el-button type = "text" size= "mini" @click ="copyFromCurrent" icon = "el-icon-document-copy" >
复制当前信息
< / el -button >
< / el-button> -- >
< / div >
< el-form ref = "updateForm" :model = "updateForm" :rules = "rules" label -width = " 120px " size = "small" >
< el-form-item label = "当前钢卷号" prop = "currentCoilNo" >
< el-input v-model = "updateForm.currentCoilNo" placeholder="请输入当前钢卷号" :disabled="readonly" >
< el-input v-model = "updateForm.currentCoilNo" placeholder="请输入当前钢卷号" >
< template slot = "prepend" >
< i class = "el-icon-document" > < / i >
< / template >
@@ -107,56 +100,48 @@
< / el-form-item >
< el-form-item label = "班组" prop = "team" >
< el-select v-model = "updateForm.team" placeholder="请选择班组" style="width: 100%"
:disabled = "readonly" >
< el-select v-model = "updateForm.team" placeholder="请选择班组" style="width: 100%" >
< el -option key = "甲" label = "甲" value = "甲" / >
< el-option key = "乙" label = "乙" value = "乙" / >
< / el-select >
< / el-form-item >
< el-form-item label = "材料类型" prop = "materialType" >
< el-select v-model = "updateForm.materialType" placeholder="请选择材料类型" style="width: 100%"
:disabled = "readonly" @change ="handleMaterialTypeChange" >
< el-select v-model = "updateForm.materialType" placeholder="请选择材料类型" style="width: 100%" @change="handleMaterialTypeChange" >
< el -option label = "原料" value = "原料" / >
< el-option label = "成品" value = "成品" / >
< / el-select >
< / el-form-item >
< el-form-item :label = "getItemLabel" prop = "itemId"
:rules = "rules.itemId" >
< RawMaterialSelect v-if = "updateForm.materialType === '原料'" v-model="updateForm.itemId"
placeholder = "请选择原料" style = "width: 100%" clearable
: disabled = "readonly || !updateForm.materialType" / >
< el-form-item :label = "getItemLabel" prop = "itemId" :rules = "rules.itemId" >
< RawMaterialSelect v-if = "updateForm.materialType === '原料'" v-model="updateForm.itemId" placeholder="请选择原料"
style = "width: 100%" clearable :disabled = "! updateForm.materialType" / >
< ProductSelect v-else-if = "updateForm.materialType === '成品'" v-model="updateForm.itemId"
placeholder = "请选择成品" style = "width: 100%" clearable
: disabled = "readonly || !updateForm.materialType" / >
placeholder = "请选择成品" style = "width: 100%" clearable :disabled = "!updateForm.materialType" / >
< div v-else > 请先选择物料类型 < / div >
< / el -form -item >
< el-form-item label = "质量状态" prop = "qualityStatus" >
< el-select v-model = "updateForm.qualityStatus" placeholder="请选择质量状态" style="width: 100%"
:disabled = "readonly" >
< el-option v-for = "item in dict.type.coil_quality_status" :key="item.value" :label="item.label" :value= "item.value" / >
< 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-form-item label = "切边要求" prop = "trimmingRequirement" >
< el-select v-model = "updateForm.trimmingRequirement" placeholder="请选择切边要求" style="width: 100%"
:disabled = "readonly" >
< el-select v-model = "updateForm.trimmingRequirement" placeholder="请选择切边要求" style="width: 100%" >
< el -option label = "净边料" value = "净边料" / >
< el-option label = "毛边料" value = "毛边料" / >
< / el-select >
< / el-form-item >
< el-form-item label = "打包状态" prop = "packingStatus" >
< el-input v-model = "updateForm.packingStatus" placeholder="请输入打包状态"
:disabled = "readonly" >
< el-input v-model = "updateForm.packingStatus" placeholder="请输入打包状态" >
< / el -input >
< / el-form-item >
< el-form-item label = "包装要求" prop = "packagingRequirement" >
< el-select v-model = "updateForm.packagingRequirement" placeholder="请选择包装要求" style="width: 100%"
:disabled = "readonly" >
< el-select v-model = "updateForm.packagingRequirement" placeholder="请选择包装要求" style="width: 100%" >
< el -option label = "裸包" value = "裸包" / >
< el-option label = "普包" value = "普包" / >
< el-option label = "简包" value = "简包" / >
@@ -164,21 +149,21 @@
< / el-form-item >
< el-form-item label = "毛重(t)" prop = "grossWeight" >
< el-input-number precision= "3" :controls = "false" v-model = "updateForm.grossWeight" placeholder="请输入毛重" type="number" :step="0.01"
:disabled = "readonly " >
< el-input-number : precision= "3" :controls = "false" v-model = "updateForm.grossWeight" placeholder="请输入毛重"
type = "number" :step = "0.01 ">
< / el-input-number >
< / el-form-item >
< el-form-item label = "净重(t)" prop = "netWeight" >
< el-input-number precision= "3" :controls = "false" v-model = "updateForm.netWeight" placeholder="请输入净重" type="number" :step="0.01"
:disabled = "readonly " >
< el-input-number : precision= "3" :controls = "false" v-model = "updateForm.netWeight" placeholder="请输入净重"
type = "number" :step = "0.01 ">
< template slot = "append" > 吨 < / template >
< / el-input-number >
< / el-form-item >
< el-form-item label = "长度(m)" prop = "length" >
< el-input-number :controls = "false" v-model = "updateForm.length" placeholder="请输入长度" type="number" :step="0.01"
:disabled = "readonly " >
< el-input-number :controls = "false" v-model = "updateForm.length" placeholder="请输入长度" type="number"
:step = "0.01 ">
< template slot = "append" > 米 < / template >
< / el-input-number >
< / el-form-item >
@@ -192,25 +177,16 @@
< / el-form-item >
< el-form-item label = "逻辑库区" prop = "warehouseId" >
< WarehouseSelect
v-model = "updateForm.warehouseId"
placeholder = "请选择逻辑库区"
:disabled = "readonly"
/ >
< WarehouseSelect v-model = "updateForm.warehouseId" placeholder="请选择逻辑库区" / >
< / el-form-item >
< el-form-item label = "真实库区" prop = "actualWarehouseId" >
< ActualWarehouseSelect
v-model = "updateForm.actualWarehouseId"
placeholder = "请选择真实库区"
block
:disabled = "readonly"
/ >
< ActualWarehouseSelect v-model = "updateForm.actualWarehouseId" placeholder="请选择真实库区" block / >
< / el-form-item >
< el-form-item label = "备注" prop = "remark" >
< el-input v-model = "updateForm.remark" type="textarea" :rows="4" placeholder="请输入备注信息(非必填)" maxlength="500"
show -word -limit :disabled = "readonly" / >
show -word -limit / >
< / el-form-item >
< / el-form >
< / el-card >
@@ -221,8 +197,8 @@
< span > < i class = "el-icon-time" > < / i > 酸连轧最近记录 < / span >
< / div >
< el-table :data = "acidRecentRecords" stripe size = "small" >
< el-table-column prop = "currentCoilNo" label = "当前钢 卷号" width = "150" show -overflow -tooltip > < / el-table-column >
< el-table :data = "acidRecentRecords" stripe size = "small" @ row -click = " handleClickRecord " >
< el-table-column prop = "currentCoilNo" label = "加工前 卷号" width = "150" show -overflow -tooltip > < / el-table-column >
< el-table-column prop = "excoilId" label = "出口卷号" width = "150" show -overflow -tooltip > < / el-table-column >
< el-table-column prop = "exitWeight" label = "出口重量(t)" width = "100" >
< template slot -scope = " scope " >
@@ -241,7 +217,7 @@
< / div >
<!-- 变更历史 ( 占满整行 ) -- >
< div class = "history-section" >
<!-- < div class = "history-section" >
< el-card class = "history-card" >
< div slot = "header" class = "card-header" >
< span > < i class = "el-icon-time" > < / i > 变更历史 < / span >
@@ -252,8 +228,8 @@
< el-timeline v-if = "historySteps.length > 0" >
< el -timeline -item v-for = "(step, index) in historySteps" :key="index"
: timestamp = "`步骤 ${step.display_step || step.step}`" placement = "top"
: type = "step.operation === '新增' ? 'success' : 'primary'" >
: timestamp = "`步骤 ${step.display_step || step.step}`" placement = "top"
: type = "step.operation === '新增' ? 'success' : 'primary'" >
< div class = "history-item" >
< div class = "history-title" > { { step . operation || step . action } } < / div >
< div class = "history-detail" v-if = "step.operator" >
@@ -277,13 +253,13 @@
< p > 暂无变更历史 < / p >
< / div >
< / el-card >
< / div >
< / div > -- >
< / div >
< / template >
< script >
import { getMaterialCoil , updateMaterialCoil , getMaterialCoilTrace , checkCoilNo } from '@/api/wms/coil' ;
import { completeAction } from '@/api/wms/pendingAction' ;
import { completeAction , getPendingAction } from '@/api/wms/pendingAction' ;
import { listWarehouse } from '@/api/wms/warehouse' ;
import { listRawMaterialWithBom } from '@/api/wms/rawMaterial' ;
import { listProductWithBom } from '@/api/wms/product' ;
@@ -401,8 +377,6 @@ export default {
rawMaterialList : [ ] ,
productList : [ ] ,
itemSearchLoading : false ,
// 只读模式
readonly : false ,
// 酸连轧最近记录
acidRecentRecords : [ ]
} ;
@@ -446,16 +420,14 @@ export default {
// 先加载库区列表
await this . loadWarehouses ( ) ;
// 不再一次性加载所有数据,改为实时搜索
// await this.loadAllItems();
// 从路由参数获取coilId和actionId
const coilId = this . $route . query . coilId ;
const actionId = this . $route . query . actionId ;
cons t actionType = this . $route . query . actionType ;
const readonly = this . $route . query . readonly ;
le t actionType = ''
const pendingActionRes = await getPendingAction ( actionId )
actionType = pendingActionRes . data . actionType
this . isAcidRolling = actionType === '酸连轧工序'
this . isAcidRolling = actionType == 11
if ( this . isAcidRolling ) {
this . acidPrefill . visible = true
@@ -468,7 +440,6 @@ export default {
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'
@@ -478,7 +449,17 @@ export default {
const prefillRes = await getAcidTypingPrefill ( currentCoilNo )
const prefill = prefillRes && prefillRes . data
if ( ! prefill ) {
// this.acidRecentRecords = [
// {
// currentCoilNo: '12345678',
// excoilId: '12345678',
// exitWeight: 245.567,
// exitLength: 1490,
// team: '甲'
// }
// ]
// return;
if ( ! prefill || prefill . length === 0 ) {
this . acidPrefill . type = 'info'
this . acidPrefill . title = '未在二级系统中查找到对应信息,请自行填写'
} else {
@@ -546,11 +527,6 @@ export default {
if ( actionId ) {
this . actionId = actionId ;
}
// 设置只读模式
if ( readonly === 'true' || readonly === true ) {
this . readonly = true ;
}
} ,
methods : {
// 处理材料类型变化
@@ -570,6 +546,16 @@ export default {
}
} ,
handleClickRecord ( row ) {
this . updateForm = {
currentCoilNo : row . excoilId ,
team : row . team ,
netWeight : row . exitWeight ,
grossWeight : row . exitWeight ,
length : row . exitLength ,
}
} ,
// 加载钢卷信息
async loadCoilInfo ( coilId ) {
try {
@@ -885,7 +871,6 @@ export default {
. right - panel {
min - width : 0 ;
display : flex ;
flex - direction : column ;
gap : 20 px ; // 添加间距
}