|
|
|
@ -11,29 +11,17 @@ |
|
|
|
|
|
|
|
<!-- 搜索框 --> |
|
|
|
<div class="search-container"> |
|
|
|
<el-input |
|
|
|
clearable |
|
|
|
class="compact-input" |
|
|
|
v-model="scanCode" |
|
|
|
placeholder="请扫描物料标签" |
|
|
|
prefix-icon="el-icon-search" |
|
|
|
@keyup.enter.native="handleScan" |
|
|
|
ref="scanInput" |
|
|
|
/> |
|
|
|
<el-input clearable class="compact-input" v-model="scanCode" placeholder="请扫描物料标签" prefix-icon="el-icon-search" |
|
|
|
@keyup.enter.native="handleScan" ref="scanInput" /> |
|
|
|
<div class="mode-switch"> |
|
|
|
<el-switch |
|
|
|
class="custom-switch" |
|
|
|
v-model="isRemoveMode" |
|
|
|
active-color="#ff4949" |
|
|
|
inactive-color="#13ce66" |
|
|
|
> |
|
|
|
<el-switch class="custom-switch" v-model="isRemoveMode" active-color="#ff4949" inactive-color="#13ce66"> |
|
|
|
</el-switch> |
|
|
|
<span v-if="isRemoveMode" class="switch-text">{{ "移除" }}</span> |
|
|
|
<span v-else class="switch-text2">{{ "添加" }}</span> |
|
|
|
</div> |
|
|
|
<div class="print-checkbox"> |
|
|
|
<el-button class="new-label-btn" @click="openNewLabelDialog">新标签</el-button> |
|
|
|
|
|
|
|
|
|
|
|
<el-checkbox v-model="enablePrint">打印标签</el-checkbox> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -84,11 +72,7 @@ |
|
|
|
|
|
|
|
<!-- 退料标签列表 - 参考发料标签卡片样式 --> |
|
|
|
<div class="label-card-container"> |
|
|
|
<div |
|
|
|
v-for="(label, index) in labelList" |
|
|
|
:key="label.id || index" |
|
|
|
class="label-card" |
|
|
|
> |
|
|
|
<div v-for="(label, index) in labelList" :key="label.id || index" class="label-card"> |
|
|
|
<div class="card-edit-icon" @click.stop="openEditDialog(label, index)"> |
|
|
|
<i class="el-icon-edit"></i> |
|
|
|
</div> |
|
|
|
@ -160,15 +144,17 @@ |
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
|
<label class="form-label">库位 <span class="required">*</span></label> |
|
|
|
<el-input v-model="editForm.locationId" placeholder="请输入库位" class="form-input" clearable/> |
|
|
|
<el-input v-model="editForm.locationId" placeholder="请输入库位" class="form-input" clearable /> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="form-label">高度(单位毫米)</label> |
|
|
|
<el-input v-model="editForm.height" type="number" :min="0" placeholder="请输入高度(单位毫米)" class="form-input" clearable/> |
|
|
|
<el-input v-model="editForm.height" type="number" :min="0" placeholder="请输入高度(单位毫米)" class="form-input" |
|
|
|
clearable /> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="form-label">退料数量 <span class="required">*</span></label> |
|
|
|
<el-input v-model="editForm.quantity" type="number" :min="0" placeholder="请输入标签数量" class="form-input" clearable/> |
|
|
|
<el-input v-model="editForm.quantity" type="number" :min="0" placeholder="请输入标签数量" class="form-input" |
|
|
|
clearable /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -190,45 +176,33 @@ |
|
|
|
<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/> |
|
|
|
<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/> |
|
|
|
<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/> |
|
|
|
<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/> |
|
|
|
<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%;" |
|
|
|
/> |
|
|
|
<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%;" |
|
|
|
/> |
|
|
|
<el-input-number v-model="newLabelForm.quantity" :min="0" :controls="false" placeholder="请输入数量" |
|
|
|
class="form-input" style="width: 100%;" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
@ -301,7 +275,7 @@ import { |
|
|
|
scanMaterialLabel, |
|
|
|
productionReturnConfirm, |
|
|
|
printLabelCommon, |
|
|
|
getMaterialLabelByIssueDetail |
|
|
|
getMaterialLabelByIssueDetail, |
|
|
|
} from '@/api/production/production-return' |
|
|
|
import moment from 'moment' |
|
|
|
|
|
|
|
@ -483,12 +457,8 @@ export default { |
|
|
|
} catch (error) { |
|
|
|
console.warn('恢复生产退料手动页面状态失败', error) |
|
|
|
} finally { |
|
|
|
sessionStorage.removeItem( |
|
|
|
'productionReturnPickingDetail_shouldRestore' |
|
|
|
) |
|
|
|
sessionStorage.removeItem( |
|
|
|
'productionReturnPickingDetail_state_manual' |
|
|
|
) |
|
|
|
sessionStorage.removeItem('productionReturnPickingDetail_shouldRestore') |
|
|
|
sessionStorage.removeItem('productionReturnPickingDetail_state_manual') |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
@ -502,7 +472,7 @@ export default { |
|
|
|
batchNo: this.batchNo, |
|
|
|
componentPartNo: this.componentPartNo, |
|
|
|
} |
|
|
|
scanMaterialLabel(params) |
|
|
|
scanMaterialLabel(params) |
|
|
|
.then(({ data }) => { |
|
|
|
if (data.code === 0 && data) { |
|
|
|
// 检查是否已经扫描过 |
|
|
|
@ -583,7 +553,7 @@ export default { |
|
|
|
this.newLabelForm = { |
|
|
|
partNo: this.componentPartNo, |
|
|
|
partDesc: this.componentPartDesc, |
|
|
|
wdrNo: this.wdrNo|| '*', |
|
|
|
wdrNo: this.wdrNo || '*', |
|
|
|
locationId: '', |
|
|
|
height: 0, |
|
|
|
quantity: 0, |
|
|
|
@ -611,7 +581,10 @@ export default { |
|
|
|
this.$message.warning('请输入物料wdr') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.newLabelForm.locationId || !this.newLabelForm.locationId.trim()) { |
|
|
|
if ( |
|
|
|
!this.newLabelForm.locationId || |
|
|
|
!this.newLabelForm.locationId.trim() |
|
|
|
) { |
|
|
|
this.$message.warning('请输入库位') |
|
|
|
return |
|
|
|
} |
|
|
|
@ -681,21 +654,36 @@ export default { |
|
|
|
this.$message.warning('扫描数量不能大于总领料数量和已退数量的差!') |
|
|
|
return |
|
|
|
} |
|
|
|
const hasNewPrint = this.labelList.some(item => { |
|
|
|
return typeof item !== null && item.newPrint === 'NEW'; |
|
|
|
}); |
|
|
|
if(hasNewPrint && !this.enablePrint){ |
|
|
|
const hasNewPrint = this.labelList.some((item) => { |
|
|
|
return typeof item !== null && item.newPrint === 'NEW' |
|
|
|
}) |
|
|
|
if (hasNewPrint && !this.enablePrint) { |
|
|
|
this.$message.warning('存在新标签,需勾选打印标签选项!') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 从 labelList 中移除 isInWh 为 'Y' 且 quantity 为 0 的标签 |
|
|
|
this.labelList = this.labelList.filter((label) => { |
|
|
|
return !(label.isInWh === 'Y' && (Number(label.quantity) === 0 || !label.quantity)); |
|
|
|
}); |
|
|
|
const hasInvalidLabel = this.labelList.some((label) => { |
|
|
|
const isInWh = label.isInWh |
|
|
|
const quantity = Number(label.quantity) |
|
|
|
return isInWh === 'Y' && !isNaN(quantity) && quantity === 0 |
|
|
|
}) |
|
|
|
|
|
|
|
if (hasInvalidLabel) { |
|
|
|
this.$message.warning('立库已有标签不能有数量') |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 从 labelList 中移除 isInWh 为 'Y' 或 quantity 为 0 的标签 |
|
|
|
let labelLists = this.labelList.filter((label) => { |
|
|
|
return !( |
|
|
|
label.isInWh === 'Y' || |
|
|
|
(Number(label.quantity) === 0 || !label.quantity) |
|
|
|
) |
|
|
|
}) |
|
|
|
|
|
|
|
// 如果过滤后没有标签了,提示用户 |
|
|
|
if (this.labelList.length === 0) { |
|
|
|
if (labelLists.length === 0) { |
|
|
|
this.$message.warning('没有可退料的标签') |
|
|
|
return |
|
|
|
} |
|
|
|
@ -711,13 +699,13 @@ export default { |
|
|
|
itemNo: this.itemNo, |
|
|
|
ifsReversedQty: this.qtyReversed, |
|
|
|
issueQty: this.quantity, |
|
|
|
notifyNo:this.notifyNo, |
|
|
|
lineItemNo:this.lineItemNo, |
|
|
|
notifyNo: this.notifyNo, |
|
|
|
lineItemNo: this.lineItemNo, |
|
|
|
releaseNo: this.releaseNo, |
|
|
|
sequenceNo: this.sequenceNo, |
|
|
|
umId: this.umId, |
|
|
|
// 退料标签列表 |
|
|
|
selectedMaterials: this.labelList.map((label) => ({ |
|
|
|
selectedMaterials: labelLists.map((label) => ({ |
|
|
|
labelCode: label.labelCode, |
|
|
|
issueQty: label.quantity, |
|
|
|
batchNo: label.batchNo, |
|
|
|
@ -730,18 +718,18 @@ export default { |
|
|
|
newPrint: label.newPrint || 'OLD', |
|
|
|
})), |
|
|
|
} |
|
|
|
console.log(returnParams); |
|
|
|
|
|
|
|
console.log(returnParams) |
|
|
|
|
|
|
|
this.loading = true |
|
|
|
|
|
|
|
productionReturnConfirm(returnParams) |
|
|
|
.then(({ data }) => { |
|
|
|
if (data.code === 0 && data) { |
|
|
|
this.$message.success('生产退料成功') |
|
|
|
const unitIds = data.unitIds || []; |
|
|
|
const unitIds = data.unitIds || [] |
|
|
|
// 根据勾选框决定是否打印 |
|
|
|
if (this.enablePrint && unitIds.length > 0) { |
|
|
|
this.printViaServer(unitIds); |
|
|
|
this.printViaServer(unitIds) |
|
|
|
} |
|
|
|
this.$router.back() |
|
|
|
this.loading = false |
|
|
|
@ -750,7 +738,7 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.$message.error(data.msg ||'操作失败') |
|
|
|
this.$message.error(data.msg || '操作失败') |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
this.loading = false |
|
|
|
@ -759,8 +747,8 @@ export default { |
|
|
|
|
|
|
|
async printViaServer(unitIds) { |
|
|
|
if (!unitIds || unitIds.length === 0) { |
|
|
|
console.warn('没有可打印的标签'); |
|
|
|
return; |
|
|
|
console.warn('没有可打印的标签') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.$emit('print-start') |
|
|
|
@ -770,9 +758,9 @@ export default { |
|
|
|
username: localStorage.getItem('userName'), |
|
|
|
site: localStorage.getItem('site'), |
|
|
|
unitIds: unitIds, |
|
|
|
labelType: "BIL标签" |
|
|
|
labelType: 'BIL标签', |
|
|
|
} |
|
|
|
console.log('打印请求:', printRequest); |
|
|
|
console.log('打印请求:', printRequest) |
|
|
|
|
|
|
|
const { data } = await printLabelCommon(printRequest) |
|
|
|
if (data.code === 200 || data.code === 0) { |
|
|
|
@ -786,7 +774,6 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 关闭打印弹框 |
|
|
|
closePrintDialog() { |
|
|
|
this.showPrintDialog = false |
|
|
|
@ -860,10 +847,10 @@ export default { |
|
|
|
batchNo: this.batchNo, |
|
|
|
site: localStorage.getItem('site'), |
|
|
|
partNo: this.componentPartNo, |
|
|
|
quantity:this.quantity |
|
|
|
quantity: this.quantity, |
|
|
|
} |
|
|
|
getMaterialLabelByIssueDetail(paramdetail).then(({data}) =>{ |
|
|
|
if(data.code == 0){ |
|
|
|
getMaterialLabelByIssueDetail(paramdetail).then(({ data }) => { |
|
|
|
if (data.code == 0) { |
|
|
|
this.labelList = data.labelInfo |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -921,7 +908,7 @@ export default { |
|
|
|
'物料编码:', |
|
|
|
this.partNo, |
|
|
|
'关联单号:', |
|
|
|
this.engChgLevel, |
|
|
|
this.engChgLevel |
|
|
|
) |
|
|
|
|
|
|
|
if (!this.orderNo) { |
|
|
|
@ -1029,12 +1016,11 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
.manual-btn { |
|
|
|
|
|
|
|
border: 1px solid #1abc4a; |
|
|
|
background: #1abc4a; |
|
|
|
color: white; |
|
|
|
border-radius: 6px; |
|
|
|
width:60px; |
|
|
|
width: 60px; |
|
|
|
font-size: 14px; |
|
|
|
cursor: pointer; |
|
|
|
transition: all 0.2s ease; |
|
|
|
|