|
|
|
@ -19,6 +19,7 @@ |
|
|
|
<span v-if="isRemoveMode" class="switch-text">{{ "移除" }}</span> |
|
|
|
<span v-else class="switch-text2">{{ "添加" }}</span> |
|
|
|
</div> |
|
|
|
<el-button class="new-label-btn" @click="openNewLabelDialog">新标签</el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="scrollable-content"> |
|
|
|
@ -144,6 +145,66 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 新标签弹框 --> |
|
|
|
<div v-if="showNewLabelDialog" class="edit-overlay"> |
|
|
|
<div class="edit-modal"> |
|
|
|
<div class="modal-header"> |
|
|
|
<span class="modal-title">新标签</span> |
|
|
|
<i class="el-icon-close close-btn" @click="closeNewLabelDialog"></i> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="modal-body"> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="form-label">物料编号</label> |
|
|
|
<el-input v-model="newLabelForm.partNo" placeholder="请输入物料编码" class="form-input" clearable disabled/> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="form-label">物料名称 </label> |
|
|
|
<el-input v-model="newLabelForm.partDesc" placeholder="请输入物料名称" class="form-input" clearable disabled/> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
|
<label class="form-label">WDR<span class="required">*</span></label> |
|
|
|
<el-input v-model="newLabelForm.wdrNo" placeholder="请输入WDR" class="form-input" disabled/> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
|
<label class="form-label">库位<span class="required">*</span></label> |
|
|
|
<el-input v-model="newLabelForm.locationId" placeholder="请输入库位" class="form-input" clearable/> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
|
<label class="form-label">高度(单位毫米)<span class="required">*</span></label> |
|
|
|
<el-input-number |
|
|
|
v-model="newLabelForm.height" |
|
|
|
:min="0" |
|
|
|
:controls="false" |
|
|
|
placeholder="请输入高度" |
|
|
|
class="form-input" |
|
|
|
style="width: 100%;" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
|
<label class="form-label">数量 <span class="required">*</span></label> |
|
|
|
<el-input-number |
|
|
|
v-model="newLabelForm.quantity" |
|
|
|
:min="0" |
|
|
|
:controls="false" |
|
|
|
placeholder="请输入数量" |
|
|
|
class="form-input" |
|
|
|
style="width: 100%;" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="modal-footer"> |
|
|
|
<button class="btn-cancel" @click="closeNewLabelDialog">取消</button> |
|
|
|
<button class="btn-confirm" @click="confirmNewLabel">确认</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 物料清单弹窗 --> |
|
|
|
<div v-if="showMaterialDialog" class="material-overlay"> |
|
|
|
<div class="material-modal"> |
|
|
|
@ -244,10 +305,20 @@ export default { |
|
|
|
height: 0, |
|
|
|
}, |
|
|
|
editIndex: -1, // 当前编辑的标签索引 |
|
|
|
// 新标签弹框相关 |
|
|
|
showNewLabelDialog: false, |
|
|
|
newLabelForm: { |
|
|
|
partNo: '', |
|
|
|
wdrNo: '', |
|
|
|
locationId: '', |
|
|
|
height: 0, |
|
|
|
quantity: 0, |
|
|
|
}, |
|
|
|
loading: false, |
|
|
|
releaseNo: '', |
|
|
|
sequenceNo: '', |
|
|
|
wdrNo: '', |
|
|
|
engChgLevel: '', |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -470,6 +541,75 @@ export default { |
|
|
|
this.editIndex = -1 |
|
|
|
}, |
|
|
|
|
|
|
|
// 打开新标签弹框 |
|
|
|
openNewLabelDialog() { |
|
|
|
this.newLabelForm = { |
|
|
|
partNo: this.componentPartNo, |
|
|
|
partDesc: this.componentPartDesc, |
|
|
|
wdrNo: this.wdrNo|| '*', |
|
|
|
locationId: '', |
|
|
|
height: 0, |
|
|
|
quantity: 0, |
|
|
|
} |
|
|
|
this.showNewLabelDialog = true |
|
|
|
}, |
|
|
|
|
|
|
|
// 关闭新标签弹框 |
|
|
|
closeNewLabelDialog() { |
|
|
|
this.showNewLabelDialog = false |
|
|
|
this.newLabelForm = { |
|
|
|
partNo: '', |
|
|
|
partDesc: '', |
|
|
|
wdrNo: '', |
|
|
|
locationId: '', |
|
|
|
height: 0, |
|
|
|
quantity: 0, |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 确认添加新标签 |
|
|
|
confirmNewLabel() { |
|
|
|
// 验证必填字段 |
|
|
|
if (!this.newLabelForm.wdrNo || !this.newLabelForm.wdrNo.trim()) { |
|
|
|
this.$message.warning('请输入物料wdr') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.newLabelForm.locationId || !this.newLabelForm.locationId.trim()) { |
|
|
|
this.$message.warning('请输入库位') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.newLabelForm.height || this.newLabelForm.height < 0) { |
|
|
|
this.$message.warning('请输入有效的高度') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.newLabelForm.quantity || this.newLabelForm.quantity <= 0) { |
|
|
|
this.$message.warning('请输入有效的数量') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 生成一个唯一的标签条码(使用时间戳) |
|
|
|
const labelCode = `NEW-${Date.now()}` |
|
|
|
|
|
|
|
// 添加到标签列表 |
|
|
|
this.labelList.push({ |
|
|
|
id: Date.now(), |
|
|
|
labelCode: labelCode, |
|
|
|
partNo: this.newLabelForm.partNo.trim(), |
|
|
|
quantity: Number(this.newLabelForm.quantity), |
|
|
|
batchNo: this.batchNo || '', |
|
|
|
locationId: this.newLabelForm.locationId || '', |
|
|
|
warehouseId: '', |
|
|
|
wdrNo: this.newLabelForm.wdrNo || '*', |
|
|
|
engChgLevel: this.engChgLevel || '1', |
|
|
|
height: Number(this.newLabelForm.height) || 0, |
|
|
|
newPrint: 'NEW', |
|
|
|
}) |
|
|
|
|
|
|
|
this.$message.success('添加成功') |
|
|
|
this.closeNewLabelDialog() |
|
|
|
}, |
|
|
|
|
|
|
|
// 确认编辑 |
|
|
|
confirmEdit() { |
|
|
|
// 验证必填字段 |
|
|
|
@ -531,6 +671,7 @@ export default { |
|
|
|
wdrNo: label.wdrNo || '*', |
|
|
|
engChgLevel: label.engChgLevel || '1', |
|
|
|
height: label.height, |
|
|
|
newPrint: label.newPrint || 'OLD', |
|
|
|
})), |
|
|
|
} |
|
|
|
this.loading = true |
|
|
|
@ -698,13 +839,16 @@ export default { |
|
|
|
this.releaseNo = this.$route.query.releaseNo |
|
|
|
this.sequenceNo = this.$route.query.sequenceNo |
|
|
|
this.wdrNo = this.$route.query.wdrNo |
|
|
|
this.engChgLevel = this.$route.query.engChgLevel |
|
|
|
console.log( |
|
|
|
'订单号:', |
|
|
|
this.orderNo, |
|
|
|
'订单类型:', |
|
|
|
this.orderType, |
|
|
|
'物料编码:', |
|
|
|
this.partNo |
|
|
|
this.partNo, |
|
|
|
'关联单号:', |
|
|
|
this.engChgLevel, |
|
|
|
) |
|
|
|
|
|
|
|
if (!this.orderNo) { |
|
|
|
@ -778,10 +922,30 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
.search-container .el-input { |
|
|
|
width: 240px; |
|
|
|
width: 250px; |
|
|
|
} |
|
|
|
|
|
|
|
.new-label-btn { |
|
|
|
border: 1px solid #17b3a3; |
|
|
|
background: #17b3a3; |
|
|
|
color: white; |
|
|
|
border-radius: 6px; |
|
|
|
padding: 8px 16px; |
|
|
|
font-size: 14px; |
|
|
|
cursor: pointer; |
|
|
|
transition: all 0.2s ease; |
|
|
|
margin-right: 12px; |
|
|
|
} |
|
|
|
|
|
|
|
.new-label-btn:hover { |
|
|
|
background: #13998c; |
|
|
|
border-color: #13998c; |
|
|
|
} |
|
|
|
|
|
|
|
.new-label-btn:active { |
|
|
|
transform: scale(0.98); |
|
|
|
} |
|
|
|
|
|
|
|
.manual-btn { |
|
|
|
|
|
|
|
border: 1px solid #1abc4a; |
|
|
|
@ -1426,6 +1590,7 @@ export default { |
|
|
|
border-radius: 12px; |
|
|
|
width: 100%; |
|
|
|
max-width: 400px; |
|
|
|
max-height: 90vh; |
|
|
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); |
|
|
|
overflow: hidden; |
|
|
|
display: flex; |
|
|
|
@ -1439,6 +1604,7 @@ export default { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
flex-shrink: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.edit-modal .modal-title { |
|
|
|
@ -1464,6 +1630,9 @@ export default { |
|
|
|
|
|
|
|
.edit-modal .modal-body { |
|
|
|
padding: 20px; |
|
|
|
overflow-y: auto; |
|
|
|
flex: 1; |
|
|
|
min-height: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.edit-modal .form-group { |
|
|
|
@ -1511,6 +1680,7 @@ export default { |
|
|
|
gap: 12px; |
|
|
|
justify-content: flex-end; |
|
|
|
border-top: 1px solid #f0f0f0; |
|
|
|
flex-shrink: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.edit-modal .btn-cancel { |
|
|
|
|