|
|
|
@ -11,22 +11,10 @@ |
|
|
|
|
|
|
|
<!-- 搜索框 --> |
|
|
|
<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> |
|
|
|
@ -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> |
|
|
|
@ -164,11 +148,13 @@ |
|
|
|
</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> |
|
|
|
|
|
|
|
@ -209,26 +195,14 @@ |
|
|
|
|
|
|
|
<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') |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
@ -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'; |
|
|
|
}); |
|
|
|
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 |
|
|
|
} |
|
|
|
@ -717,7 +705,7 @@ export default { |
|
|
|
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,7 +718,7 @@ export default { |
|
|
|
newPrint: label.newPrint || 'OLD', |
|
|
|
})), |
|
|
|
} |
|
|
|
console.log(returnParams); |
|
|
|
console.log(returnParams) |
|
|
|
|
|
|
|
this.loading = true |
|
|
|
|
|
|
|
@ -738,10 +726,10 @@ export default { |
|
|
|
.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 |
|
|
|
@ -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,7 +847,7 @@ 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) { |
|
|
|
@ -921,7 +908,7 @@ export default { |
|
|
|
'物料编码:', |
|
|
|
this.partNo, |
|
|
|
'关联单号:', |
|
|
|
this.engChgLevel, |
|
|
|
this.engChgLevel |
|
|
|
) |
|
|
|
|
|
|
|
if (!this.orderNo) { |
|
|
|
@ -1029,7 +1016,6 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
.manual-btn { |
|
|
|
|
|
|
|
border: 1px solid #1abc4a; |
|
|
|
background: #1abc4a; |
|
|
|
color: white; |
|
|
|
|