diff --git a/src/views/modules/production-return/productionReturnPDAIssueList.vue b/src/views/modules/production-return/productionReturnPDAIssueList.vue index a63723e..abea414 100644 --- a/src/views/modules/production-return/productionReturnPDAIssueList.vue +++ b/src/views/modules/production-return/productionReturnPDAIssueList.vue @@ -92,26 +92,44 @@ --> - -
-
-
NO.
-
物料标签
- -
库位
-
高度
-
退料数量
-
- -
-
{{ index+1 }}
-
{{ label.labelCode }}
- -
{{ label.locationId }}
-
{{ label.height }}
-
- {{ label.quantity }} - + +
+
+
+ +
+
+
+ 标签号: + {{ label.labelCode }} +
+
+ 批次号: + {{ label.batchNo }} +
+
+ 库位号: + {{ label.locationId || '-' }} +
+
+ 高度: + {{ label.height || '-' }} +
+
+ 退料数量: + {{ label.quantity || 0 }} + 是否被占用: + + {{ label.isInWh === 'Y' ? '是' : '否' }} + +
@@ -667,15 +685,11 @@ export default { this.$message.warning('请先扫描退料标签') return } - - /* if (!this.returnReason) { - this.$message.warning("请选择退料原因"); - return; - } */ if (this.totalScannedQty > this.orderInfo.quantity - this.qtyReversed) { this.$message.warning('扫描数量不能大于总领料数量和已退数量的差!') return } + const hasNewPrint = this.labelList.some(item => { return typeof item !== null && item.newPrint === 'NEW'; }); @@ -684,6 +698,32 @@ export default { return } + 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 (labelLists.length === 0) { + this.$message.warning('没有可退料的标签') + return + } + const returnParams = { site: localStorage.getItem('site'), workOrderNo: this.orderNo, @@ -697,8 +737,9 @@ export default { issueQty: this.quantity, notifyNo:this.notifyNo, lineItemNo:this.lineItemNo, + umId: this.umId, // 退料标签列表 - selectedMaterials: this.labelList.map((label) => ({ + selectedMaterials: labelLists.map((label) => ({ labelCode: label.labelCode, issueQty: label.quantity, batchNo: label.batchNo, @@ -965,6 +1006,18 @@ export default { this.$message.error('获取订单详情失败') }) + const paramdetail = { + workOrderNo: this.orderNo, + batchNo: this.batchNo, + site: localStorage.getItem('site'), + partNo: this.partNo, + quantity:this.quantity + } + getMaterialLabelByIssueDetail(paramdetail).then(({data}) =>{ + if(data.code == 0){ + this.labelList = data.labelInfo + } + }) }, addWmsLabel() { if (!this.printData.materialCode1.trim()) { @@ -1014,6 +1067,7 @@ export default { this.sequenceNo = this.$route.query.material.sequenceNo this.wdrNo = this.$route.query.material.wdrNo this.engChgLevel = this.$route.query.material.engChgLevel + this.umId = this.$route.query.material.umId if (!this.orderNo) { this.$message.error('参数错误') @@ -1365,94 +1419,106 @@ export default { color: #0d8f7f; } -/* 标签列表 */ -.label-list { - background: white; - margin: 0 10px 12px; - border-radius: 0 0 8px 8px; - overflow: hidden; +/* 标签列表 - 卡片容器(参考 productionReturnPickingDetail.vue) */ +.label-card-container { + padding: 0 8px 8px; + background: #f5f5f5; } -.list-header { - display: flex; - background: #f8f9fa; - padding: 12px 8px; - border-bottom: 1px solid #e0e0e0; - font-size: 12px; - color: #666; - font-weight: 500; - position: sticky; - top: 0; - z-index: 1; +/* 标签卡片 - 更紧凑样式 */ +.label-card { + background: white; + border-radius: 4px; + margin-bottom: 6px; + padding: 6px 8px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); + border: 1px solid #e0e0e0; + cursor: pointer; + transition: all 0.2s ease; + position: relative; } -.list-item { - display: flex; - padding: 12px 8px; - border-bottom: 1px solid #f0f0f0; - font-size: 12px; - color: #333; - align-items: flex-start; - min-height: 40px; +.label-card:hover { + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12); + border-color: #17b3a3; } -.list-item:last-child { - border-bottom: none; +.label-card:active { + transform: scale(0.98); } -.col-no { +/* 编辑图标 - 右上角 */ +.card-edit-icon { + position: absolute; + top: 6px; + right: 6px; width: 20px; - text-align: center; + height: 20px; + display: flex; + align-items: center; + justify-content: center; + background: #f0f0f0; + border-radius: 3px; + cursor: pointer; + transition: all 0.2s ease; + z-index: 10; } -.col-label { - flex: 1.5; - text-align: center; - word-break: break-all; - white-space: normal; - line-height: 1.2; +.card-edit-icon:hover { + background: #17b3a3; + color: white; } -.col-part { - flex: 1.5; - text-align: center; +.card-edit-icon i { + font-size: 12px; + color: #17b3a3; } -.col-batch { - flex: 1.5; - text-align: center; +.card-edit-icon:hover i { + color: white; } -.col-qty { - width: 80px; - text-align: center; - cursor: pointer; - position: relative; +/* 卡片内容 */ +.card-content { + padding-right: 28px; +} + +.card-row { display: flex; align-items: center; - justify-content: center; - gap: 4px; + font-size: 11px; + line-height: 1.5; + margin-bottom: 3px; } -.quantity-display { - font-size: 12px; - color: #333; +.card-row:last-child { + margin-bottom: 0; } -.edit-icon { - font-size: 12px; - color: #17b3a3; - opacity: 0.7; - transition: opacity 0.2s ease; +.card-label { + color: #666; + min-width: 65px; + flex-shrink: 0; + font-size: 11px; } -.col-qty:hover .edit-icon { - opacity: 1; +.card-value { + color: #333; + flex: 1; + word-break: break-all; + font-size: 11px; } -.col-qty:hover { - background-color: #f0fffe; - border-radius: 4px; +.card-value.highlight { + color: #17b3a3; + font-weight: bold; + font-size: 12px; +} + +.card-value.is-occupied { + color: #ff4949; + font-weight: bold; + font-size: 12px; } .empty-labels { diff --git a/src/views/modules/production-return/productionReturnPickingDetail.vue b/src/views/modules/production-return/productionReturnPickingDetail.vue index ef49ca1..67c95d9 100644 --- a/src/views/modules/production-return/productionReturnPickingDetail.vue +++ b/src/views/modules/production-return/productionReturnPickingDetail.vue @@ -11,29 +11,17 @@
- +
- + {{ "移除" }} {{ "添加" }}
@@ -84,11 +72,7 @@
-
+
@@ -160,15 +144,17 @@
- +
- +
- +
@@ -190,45 +176,33 @@ @@ -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;