diff --git a/src/api/production/production-return.js b/src/api/production/production-return.js index 5d9fcba..700a435 100644 --- a/src/api/production/production-return.js +++ b/src/api/production/production-return.js @@ -28,4 +28,5 @@ export const productionReturnUnissueConfirm = data => createAPI(`/pda/production export const printLabelInfo = data => createAPI('/label/setting/printLabel','post',data) // 打印标签 -export const printLabelCommon = data => createAPI('/label/setting/printLabelCommon','post',data) \ No newline at end of file +export const printLabelCommon = data => createAPI('/label/setting/printLabelCommon','post',data) +export const createNewReturnHandlingUnits = data => createAPI(`/pda/production/return/createNewReturnHandlingUnits`,'post',data) \ No newline at end of file diff --git a/src/views/modules/production-issue/directIssueDetail.vue b/src/views/modules/production-issue/directIssueDetail.vue index f906880..a470e50 100644 --- a/src/views/modules/production-issue/directIssueDetail.vue +++ b/src/views/modules/production-issue/directIssueDetail.vue @@ -23,64 +23,78 @@ - -
-
-
- 工单号:{{ workOrderNo }}  行号:{{itemNo}} -
+ +
+ 是否部分领料 +
- -
- 物料编码:{{ componentPartNo }} -
-
- 物料名称:{{ componentPartDesc }} -
+ +
+ +
+
+
+ 工单号:{{ workOrderNo }}  行号:{{itemNo}} +
-
-
-
需求数量
-
{{ requiredQty }}
+ +
+ 物料编码:{{ componentPartNo }}
-
-
已发数量
-
{{ issuedQty }}
+
+ 物料名称:{{ componentPartDesc }}
-
-
本次
-
{{ totalScannedQty }}
+ +
+
+
需求数量
+
{{ requiredQty }}
+
+
+
已发数量
+
{{ issuedQty }}
+
+
+
本次
+
{{ totalScannedQty }}
+
-
-
-
- - 出库信息确认 -
-
- -
-
-
NO.
-
标签条码
-
库位
-
批次号
-
数量
+
+
+ + 出库信息确认 +
- -
-
-
{{ index+1 }}
-
{{ label.labelCode }}
-
{{label.locationId}}
-
{{ label.batchNo }}
-
{{ label.quantity }}
+ +
+
+
NO.
+
标签条码
+
库位
+
批次号
+
剩余高
+
数量
-
-

暂无扫描标签

+
+
+
{{ index+1 }}
+
{{ label.labelCode }}
+
{{label.locationId}}
+
{{ label.batchNo }}
+
{{ label.height.toFixed(3) }}
+
+ {{ label.quantity }} + +
+
+ +
+

暂无扫描标签

+
@@ -97,6 +111,47 @@ 取消
+ + +
+
+ + + + + +
+
@@ -113,6 +168,7 @@ export default { return { scanCode: '', isRemoveMode: false, + isPartial: false, scannedLabels: [], workOrderNo: '', componentPartNo: '', @@ -121,12 +177,19 @@ export default { issuedQty: 0, itemNo: '', loading: false, - issueInfo:{} + issueInfo: {}, + quantityDialogVisible: false, + currentEditLabel: {}, + currentEditIndex: -1, + editQuantity: 0, + editHeight: 0, } }, computed: { totalScannedQty() { - return this.scannedLabels.reduce((sum, l) => sum + (l.quantity || 0), 0) + const total = this.scannedLabels.reduce((sum, l) => sum + (l.quantity || 0), 0) + // 处理浮点数精度问题,保留4位小数 + return Math.round(total * 10000) / 10000 }, }, methods: { @@ -163,7 +226,7 @@ export default { this.$message.error('标签物料编码与选择的材料不匹配') return } */ - this.scannedLabels.push({ + const newLabel = { id: Date.now(), labelCode, componentPartNo: data.labelInfo.partNo, @@ -171,12 +234,22 @@ export default { batchNo: data.labelInfo.batchNo, warehouseId: data.labelInfo.warehouseId, locationId: data.labelInfo.locationId, + height: data.labelInfo.height || 0, wdrNo: data.labelInfo.wdrNo, engChgLevel: data.labelInfo.engChgLevel, - }) - console.log(this.scannedLabels); - + } + this.scannedLabels.push(newLabel) + console.log(this.scannedLabels) + this.$message.success('扫描成功') + + // 如果勾选了"是否部分",添加后直接弹出修改数量弹框 + if (this.isPartial) { + const newIndex = this.scannedLabels.length - 1 + this.$nextTick(() => { + this.handleLabelClick(newLabel, newIndex) + }) + } } else { this.$message.error(data.msg || '标签验证失败') } @@ -223,7 +296,6 @@ export default { this.$message.warning('请先扫描材料标签') return } - const params = { site: localStorage.getItem('site'), @@ -231,8 +303,9 @@ export default { componentPartNo: this.componentPartNo, operatorName: localStorage.getItem('userName'), itemNo: this.itemNo, - releaseNo:this.issueInfo.releaseNo, - sequenceNo:this.issueInfo.sequenceNo, + releaseNo: this.issueInfo.releaseNo, + sequenceNo: this.issueInfo.sequenceNo, + isPartial: this.isPartial, selectedMaterials: this.scannedLabels.map((l, i) => ({ labelCode: l.labelCode, issueQty: l.quantity, @@ -241,6 +314,7 @@ export default { locationId: l.locationId, materialCode: l.materialCode, wdrNo: l.wdrNo, + height: l.height, engChgLevel: l.engChgLevel, })), } @@ -259,7 +333,8 @@ export default { }) .catch(() => { this.$message.error('发料失败') - }).finally(()=>{ + }) + .finally(() => { this.loading = false }) }, @@ -275,7 +350,7 @@ export default { sequenceNo: this.$route.query.sequenceNo, requiredQty: Number(this.$route.query.requiredQty || 0), issuedQty: Number(this.$route.query.issuedQty || 0), - partDesc: this.$route.query.partDesc || '' + partDesc: this.$route.query.partDesc || '', } /* if (!this.workOrderNo || !this.materialCode) { @@ -289,6 +364,35 @@ export default { sessionStorage.setItem('directIssue_shouldRestore', 'true') this.$router.back() }, + // 处理标签点击事件 + handleLabelClick(label, index) { + if (!this.isPartial) return + this.currentEditLabel = { ...label } + this.currentEditIndex = index + this.editHeight = label.height + this.editQuantity = label.quantity + this.quantityDialogVisible = true + }, + // 确认修改数量 + confirmQuantityChange() { + if (this.editHeight < 0) { + this.$message.warning('高度不能小于0') + return + } + if (this.editQuantity <= 0) { + this.$message.warning('数量必须大于0') + return + } + if ( + this.currentEditIndex >= 0 && + this.currentEditIndex < this.scannedLabels.length + ) { + this.scannedLabels[this.currentEditIndex].quantity = this.editQuantity + this.scannedLabels[this.currentEditIndex].height = this.editHeight + this.$message.success('数量修改成功') + this.quantityDialogVisible = false + } + }, }, mounted() { this.initFromRoute() @@ -364,6 +468,17 @@ export default { .custom-switch { transform: scale(1.3); } +.partial-checkbox-container { + padding: 8px 16px; + background: white; + border-top: 1px solid #f0f0f0; + display: flex; + align-items: center; +} +.partial-checkbox-container ::v-deep .el-checkbox__label { + font-size: 14px; + color: #333; +} .switch-text { position: absolute; left: 25%; @@ -410,9 +525,15 @@ export default { width: 60px; height: 28px; } +/* 统一滚动容器 */ +.scrollable-content { + flex: 1; + overflow-y: auto; + min-height: 0; +} + /* 工单列表 */ .work-order-list { - overflow-y: auto; padding: 12px 16px; } @@ -420,7 +541,6 @@ export default { .work-order-card { background: white; border-radius: 8px; - margin-bottom: 12px; padding: 16px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); cursor: pointer; @@ -467,7 +587,7 @@ export default { justify-content: space-between; padding: 6px 8px; background: white; - margin: 0 16px; + margin: 0 8px; margin-top: 4px; border-radius: 8px 8px 0 0; border-bottom: 2px solid #17b3a3; @@ -522,7 +642,6 @@ export default { overflow: hidden; display: flex; flex-direction: column; - max-height: calc(100vh - 320px); } .list-header { display: flex; @@ -535,7 +654,6 @@ export default { flex-shrink: 0; } .list-body { - overflow-y: auto; flex: 1; min-height: 0; } @@ -547,12 +665,22 @@ export default { color: #333; align-items: flex-start; min-height: 40px; + transition: background-color 0.2s; } .list-item:last-child { border-bottom: none; } +.list-item.clickable { + cursor: pointer; +} +.list-item.clickable:hover { + background-color: #f5f5f5; +} +.list-item.clickable:active { + background-color: #e8e8e8; +} .col-no { - width: 20px; + width: 10px; text-align: center; } .col-label { @@ -567,6 +695,7 @@ export default { text-align: center; } .col-qty { + flex: 0.6; width: 60px; text-align: center; } @@ -600,6 +729,165 @@ export default { .action-btn:active { transform: scale(0.98); } +/* 编辑弹框样式 */ +.edit-overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.5); + z-index: 9999; + display: flex; + align-items: center; + justify-content: center; + padding: 20px; +} + +.edit-modal { + background: white; + border-radius: 12px; + width: 100%; + max-width: 400px; + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); + overflow: hidden; + display: flex; + flex-direction: column; +} + +.edit-modal .modal-header { + background: #17b3a3; + color: white; + padding: 12px 16px; + display: flex; + justify-content: space-between; + align-items: center; +} + +.edit-modal .modal-title { + font-size: 16px; + font-weight: 500; + margin: 0; +} + +.edit-modal .close-btn { + font-size: 16px; + cursor: pointer; + color: white; + transition: color 0.2s ease; + padding: 4px; + display: flex; + align-items: center; + justify-content: center; +} + +.edit-modal .close-btn:hover { + color: #e0e0e0; +} + +.edit-modal .modal-body { + padding: 20px; +} + +.edit-modal .form-group { + margin-bottom: 16px; +} + +.edit-modal .form-group:last-child { + margin-bottom: 0; +} + +.edit-modal .form-label { + display: block; + font-size: 14px; + color: #333; + margin-bottom: 6px; + font-weight: 500; +} + +.edit-modal .required { + color: #ff4949; +} + +.edit-modal .form-input { + width: 100%; +} + +.edit-modal .form-input ::v-deep .el-input__inner { + height: 40px; + border: 2px solid #dcdfe6; + border-radius: 6px; + font-size: 14px; + padding: 0 12px; +} + +.edit-modal .form-input ::v-deep .el-input__inner:focus { + border-color: #17b3a3; + outline: none; +} + +.edit-modal .form-input ::v-deep .el-input__inner:disabled { + background: #f5f7fa; + color: #c0c4cc; + border-color: #e4e7ed; +} + +.edit-modal .form-input ::v-deep .el-input-number { + width: 100%; +} + +.edit-modal .form-input ::v-deep .el-input-number .el-input__inner { + height: 40px; + border: 2px solid #dcdfe6; + border-radius: 6px; + font-size: 14px; + padding: 0 12px; +} + +.edit-modal .form-input ::v-deep .el-input-number .el-input__inner:focus { + border-color: #17b3a3; + outline: none; +} + +.edit-modal .modal-footer { + padding: 16px 20px; + display: flex; + gap: 12px; + justify-content: flex-end; + border-top: 1px solid #f0f0f0; +} + +.edit-modal .btn-cancel { + padding: 10px 20px; + border-radius: 6px; + font-size: 14px; + cursor: pointer; + transition: all 0.2s; + border: 1px solid #dcdfe6; + background: white; + color: #606266; +} + +.edit-modal .btn-cancel:hover { + background: #f5f7fa; + border-color: #c0c4cc; +} + +.edit-modal .btn-confirm { + padding: 10px 20px; + border-radius: 6px; + font-size: 14px; + cursor: pointer; + transition: all 0.2s; + border: 1px solid #17b3a3; + background: #17b3a3; + color: white; +} + +.edit-modal .btn-confirm:hover { + background: #13998c; + border-color: #13998c; +} @media (max-width: 360px) { .header-bar { padding: 8px 12px; @@ -623,7 +911,7 @@ export default { min-width: 50px; } .label-list { - margin: 0 12px 8px; + margin: 0 8px 8px; } } diff --git a/src/views/modules/production-issue/productionPickingDetail.vue b/src/views/modules/production-issue/productionPickingDetail.vue index 9021cd1..61efe69 100644 --- a/src/views/modules/production-issue/productionPickingDetail.vue +++ b/src/views/modules/production-issue/productionPickingDetail.vue @@ -13,94 +13,89 @@
- +
- + {{ '移除' }} {{ '添加' }}
+ +
+ 是否部分领料 +
-
-
- 出库单号:{{ outboundInfo.outboundNo }} -
-
- 工单号:{{ outboundInfo.orderNo }} -
-
- 物料号:{{ outboundInfo.componentPartNo }} -
+
+
+
+ 出库单号:{{ outboundInfo.outboundNo }} +
+
+ 工单号:{{ outboundInfo.orderNo }} +
+
+ 物料号:{{ outboundInfo.componentPartNo }} +
-
-
-
行号
-
- {{ outboundInfo.lineItemNo }} +
+
+
行号
+
+ {{ outboundInfo.lineItemNo }} +
-
-
-
需求数量
-
- {{ outboundInfo.qtyToIssue }} +
+
需求数量
+
+ {{ outboundInfo.qtyToIssue }} +
-
-
-
本次数量
-
- {{ totalScannedQty }} +
+
本次数量
+
+ {{ totalScannedQty }} +
-
- -
-
- - 出库信息确认 -
- -
- - -
-
-
NO.
-
标签条码
-
库位
-
标签数量
+ +
+
+ + 出库信息确认 +
-
-
-
{{ labelList.length - index }}
-
{{ label.labelCode }}
-
{{ label.locationId }}
-
{{ label.quantity }}
+ +
+
+
NO.
+
标签条码
+
库位
+
剩余高度
+
标签数量
- -
-

暂无扫描标签

+
+
+
{{ labelList.length - index }}
+
{{ label.labelCode }}
+
{{ label.locationId }}
+
+ {{ label.quantity }} + +
+
+ + +
+

暂无扫描标签

+
@@ -117,64 +112,57 @@ 取消
- - -
-
+ +
+
+