diff --git a/src/router/index.js b/src/router/index.js index c5e9f69..738ef5c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -89,6 +89,7 @@ const globalRoutes = [ { path: "/customerIssuePDA", name: "customerIssuePDA", component: resolve => require(["@/views/modules/customerIssue/customerIssuePDA.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: false } }, { path: "/customerIssuePDAList", name: "customerIssuePDAList", component: resolve => require(["@/views/modules/customerIssue/customerIssuePDAList.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, { path: "/customerIssuePDAIssueList", name: "customerIssuePDAIssueList", component: resolve => require(["@/views/modules/customerIssue/customerIssuePDAIssueList.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, + { path: "/customerIssuePrintSelect", name: "customerIssuePrintSelect", component: resolve => require(["@/views/modules/customerIssue/customerIssuePrintSelect.vue"], resolve), meta: { transition: 'instant', preload: true, keepAlive: true } }, // 客户订单发货 {path: "/saleshipping",name: "saleshipping", component: resolve => require(["@/views/modules/sales-delivery/index.vue"], resolve), meta: { transition: 'instant' ,preload: true,keepAlive: true}}, diff --git a/src/views/main.vue b/src/views/main.vue index 5ad805a..0bf7f8a 100644 --- a/src/views/main.vue +++ b/src/views/main.vue @@ -105,13 +105,7 @@ - - -
+
- {{ - orderInfo.type === "customerOrder" ? "客户订单号" : "发料申请单号" - }}:{{ orderInfo.orderNo }}     批次号:{{ batchNo }} + 申请单号:{{ orderInfo.orderNo }}     行号:{{ itemNo }}
- {{ orderInfo.type === "customerOrder" ? "关联单号" : "关联客户订单" }}:{{ - orderInfo.transactionId - }}  申请单发量:{{unissureQty}} -
-
- {{ orderInfo.partNo }} + 物料号:{{ orderInfo.partNo }}
{{ orderInfo.description }} @@ -46,11 +39,11 @@
已发数量
-
{{ qtyIssued }}
+
{{ assignedQty }}
发料数量
-
{{ orderInfo.quantity }}
+
{{ qtyIssued }}
本次
@@ -98,6 +91,9 @@ 确定发料 +
+ + + + + +
+
+ + + + + +
+
+ + +
+
+ + + + + +
+
@@ -178,6 +269,17 @@ export default { unissureQty: 0, // 需求数量 itemNo: '', // 物料ID loading: false, + // 打印弹框相关 + showPrintDialog: false, + printLabelList: [], + printAllChecked: true, + assignedQty: 0, // 已发数量 + // 数量输入弹框相关 + showQCDialog: false, + showBOXDialog: false, + qcQuantity: 1, + boxQuantity: 1, + currentPrintType: '', // 当前选择的打印类型 } }, computed: { @@ -211,7 +313,6 @@ export default { const params = { scannedLabel: labelCode, orderNo: this.orderNo, - orderType: this.orderType, site: localStorage.getItem('site'), batchNo: this.batchNo, componentPartNo: this.partNo, @@ -327,7 +428,6 @@ export default { const issueParams = { site: localStorage.getItem('site'), workOrderNo: this.orderNo, - orderType: this.orderType, batchNo: this.batchNo, componentPartNo: this.partNo, transactionId: this.transactionId, @@ -352,9 +452,20 @@ export default { .then(({ data }) => { if (data.code === 0 && data) { this.$message.success('客户发料成功') - this.$router.push({ - name: 'customerIssuePDA', - }) + // 跳转到打印选择页面,携带扫描列表 + try { + const payload = this.labelList.map((label) => ({ + labelCode: label.labelCode, + issueQty: label.quantity, + batchNo: label.batchNo, + partNo: label.partNo, + locationId: label.locationId, + warehouseId: label.warehouseId, + wdrNo: label.wdrNo || '*', + })) + sessionStorage.setItem('customerIssueScannedLabels', JSON.stringify(payload)) + } catch (e) {} + this.$router.push({ name: 'customerIssuePrintSelect' }) this.loading = false } else { this.$message.error(data.message || '操作失败') @@ -389,47 +500,153 @@ export default { // 加载订单详情 loadOrderDetails() { - const params = { - orderNo: this.orderNo, - orderType: this.orderType, - site: localStorage.getItem('site'), - partNo: this.partNo, + this.orderInfo.orderNo = this.orderNo + this.orderInfo.itemNo = this.itemNo + this.orderInfo.partNo = this.partNo + }, + + // 打开打印弹框 + openPrintDialog() { + if (this.labelList.length === 0) { + this.$message.warning('请先扫描发料标签') + return } - console.log('加载订单详情参数:', params) + + // 复制标签列表并添加选中状态 + this.printLabelList = this.labelList.map(label => ({ + ...label, + __checked: true + })) + this.printAllChecked = true + this.showPrintDialog = true + }, - // 物料详情接口 - getInventoryPart(params) - .then(({ data }) => { - if (data && data.code === 0) { - this.orderInfo = data.inventoryPart[0] - this.orderInfo.type = this.orderType - this.orderInfo.orderNo = this.orderNo - this.orderInfo.transactionId = this.transactionId - this.orderInfo.quantity = this.quantity - } else { - this.$message.error(data.msg || '获取订单详情失败') - } - }) - .catch(() => { - this.$message.error('获取订单详情失败') - }) + // 关闭打印弹框 + closePrintDialog() { + this.showPrintDialog = false + this.printLabelList = [] + this.printAllChecked = true + }, + + // 全选/取消全选 + togglePrintAll(checked) { + this.printLabelList.forEach(label => { + this.$set(label, '__checked', checked) + }) + }, + + // 执行打印 + onPrint(type) { + const selected = this.printLabelList.filter(label => label.__checked) + if (selected.length === 0) { + this.$message.warning('请至少选择一条记录') + return + } + + // 将选择结果暂存,供后续打印页面使用 + try { + const payload = selected.map(label => ({ + labelCode: label.labelCode, + issueQty: label.quantity, + batchNo: label.batchNo, + partNo: label.partNo, + locationId: label.locationId, + warehouseId: label.warehouseId, + wdrNo: label.wdrNo || '*', + })) + sessionStorage.setItem('customerIssuePrintSelected', JSON.stringify(payload)) + sessionStorage.setItem('customerIssuePrintType', type) + this.$message.success('已准备打印:' + type) + this.closePrintDialog() + + // 根据实际打印流程跳转或调用打印 + // this.$router.push({ name: 'somePrintPage' }) + } catch (e) { + this.$message.error('打印准备失败') + } + }, + + // 打开数量输入弹框 + openQuantityDialog(type) { + const selected = this.printLabelList.filter(label => label.__checked) + if (selected.length === 0) { + this.$message.warning('请至少选择一条记录') + return + } + + this.currentPrintType = type + if (type === 'QC') { + this.showQCDialog = true + } else if (type === 'BOX') { + this.showBOXDialog = true + } + }, + + // 关闭数量输入弹框 + closeQuantityDialog() { + this.showQCDialog = false + this.showBOXDialog = false + this.currentPrintType = '' + }, + + // 确认QC打印 + confirmQCPrint() { + if (!this.qcQuantity || this.qcQuantity <= 0) { + this.$message.warning('请输入有效的QC打印数量') + return + } + + this.executePrint('QC', this.qcQuantity) + }, + + // 确认BOX打印 + confirmBOXPrint() { + if (!this.boxQuantity || this.boxQuantity <= 0) { + this.$message.warning('请输入有效的BOX打印数量') + return + } + + this.executePrint('BOX', this.boxQuantity) + }, + + // 执行打印(带数量) + executePrint(type, quantity) { + const selected = this.printLabelList.filter(label => label.__checked) + + try { + const payload = selected.map(label => ({ + labelCode: label.labelCode, + issueQty: label.quantity, + batchNo: label.batchNo, + partNo: label.partNo, + locationId: label.locationId, + warehouseId: label.warehouseId, + wdrNo: label.wdrNo || '*', + })) + sessionStorage.setItem('customerIssuePrintSelected', JSON.stringify(payload)) + sessionStorage.setItem('customerIssuePrintType', type) + sessionStorage.setItem('customerIssuePrintQuantity', quantity.toString()) + this.$message.success(`已准备打印:${type},数量:${quantity}`) + this.closeQuantityDialog() + this.closePrintDialog() + + // 根据实际打印流程跳转或调用打印 + // this.$router.push({ name: 'somePrintPage' }) + } catch (e) { + this.$message.error('打印准备失败') + } }, }, mounted() { // 获取路由参数 - console.log('路由参数:', this.$route.query.material) + console.log('路由参数:', this.$route.query) this.orderNo = this.$route.query.workOrderNo - this.orderType = this.$route.query.material.orderType || 'customerOrder' - this.partNo = this.$route.query.material.partNo - this.transactionId = this.$route.query.material.ifsTransactionID - this.accountingId = this.$route.query.material.ifsAccountingID - this.quantity = this.$route.query.material.quantity - this.batchNo = this.$route.query.material.batchNo - this.unissureQty = this.$route.query.material.unissureQty - this.itemNo = this.$route.query.material.itemNo - this.qtyIssued = this.$route.query.material.qtyIssued || 0 + this.partNo = this.$route.query.partNo + this.itemNo = this.$route.query.itemNo + this.qtyIssued = this.$route.query.issureQty + this.assignedQty = this.$route.query.assignedQty if (!this.orderNo) { this.$message.error('参数错误') @@ -1029,6 +1246,205 @@ export default { border-color: #13998c; } +/* 打印弹框样式 */ +.print-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: 10px; +} + +.print-modal { + background: white; + border-radius: 12px; + width: 100%; + max-width: 500px; + max-height: 80vh; + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); + overflow: hidden; + display: flex; + flex-direction: column; +} + +.print-modal .modal-header { + background: #17b3a3; + color: white; + padding: 12px 16px; + display: flex; + justify-content: space-between; + align-items: center; +} + +.print-modal .modal-title { + font-size: 16px; + font-weight: 500; + margin: 0; +} + +.print-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; +} + +.print-modal .close-btn:hover { + color: #e0e0e0; +} + +.print-modal .modal-body { + padding: 6px; + flex: 1; + overflow: hidden; + display: flex; + flex-direction: column; +} + +.print-section-title { + display: flex; + align-items: center; + justify-content: space-between; + padding: 8px 0; + margin-bottom: 12px; + border-bottom: 1px solid #e0e0e0; +} + +.print-section-title .title-left { + display: flex; + align-items: center; +} + +.print-section-title .title-left i { + color: #17b3a3; + font-size: 16px; + margin-right: 8px; +} + +.print-section-title .title-left span { + color: #17b3a3; + font-size: 14px; + font-weight: 500; +} + +.print-section-title .title-right { + display: flex; + align-items: center; +} + +.print-label-list { + flex: 1; + /* 允许列表区域在弹框内上下滚动,避免只显示固定条数 */ + max-height: 50vh; + overflow-y: auto; + overflow-x: hidden; + position: relative; /* 为粘性表头提供更高的层叠上下文控制 */ + border: 1px solid #e0e0e0; + border-radius: 6px; +} + +.print-label-list .list-header { + display: flex; + background: #f8f9fa; + padding: 10px 8px; + border-bottom: 1px solid #e0e0e0; + font-size: 12px; + color: #666; + font-weight: 500; + position: sticky; + top: 0; + z-index: 5; /* 保证表头覆盖列表项与复选框 */ +} + +.print-label-list .list-item { + display: flex; + padding: 10px 8px; + border-bottom: 1px solid #f0f0f0; + font-size: 12px; + color: #333; + align-items: center; + min-height: 36px; +} + +.print-label-list .list-item:last-child { + border-bottom: none; +} + +.print-label-list .col-no { + width: 30px; + text-align: center; +} + +.print-label-list .col-label { + flex: 1.5; + text-align: center; + word-break: break-all; + white-space: normal; + line-height: 1.2; +} + +.print-label-list .col-part { + flex: 1.2; + text-align: center; +} + +.print-label-list .col-qty { + width: 70px; + text-align: center; +} + +.print-label-list .col-check { + width: 50px; + text-align: center; +} + +/* 放大复选框(仅作用于打印弹框列表区域) */ +.print-label-list .col-check ::v-deep .el-checkbox { + transform: scale(1.2); + transform-origin: center center; +} + +/* 调整放大后与行高的对齐 */ +.print-label-list .col-check { + display: flex; + align-items: center; + justify-content: center; +} + +.print-modal .modal-footer { + padding: 16px 20px; + display: flex; + gap: 12px; + justify-content: flex-end; + border-top: 1px solid #f0f0f0; +} + +.print-modal .btn-secondary { + padding: 10px 20px; + border-radius: 6px; + font-size: 14px; + cursor: pointer; + transition: all 0.2s; + border: 1px solid #17b3a3; + background: white; + color: #17b3a3; +} + +.print-modal .btn-secondary:hover { + background: #17b3a3; + color: white; +} + /* 响应式设计 */ @media (max-width: 360px) { .header-bar { @@ -1075,4 +1491,137 @@ export default { flex: 1.2; } } + +/* 数量输入弹框样式 */ +.quantity-overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.5); + z-index: 10000; + display: flex; + align-items: center; + justify-content: center; + padding: 20px; +} + +.quantity-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; +} + +.quantity-modal .modal-header { + background: #17b3a3; + color: white; + padding: 12px 16px; + display: flex; + justify-content: space-between; + align-items: center; +} + +.quantity-modal .modal-title { + font-size: 16px; + font-weight: 500; + margin: 0; +} + +.quantity-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; +} + +.quantity-modal .close-btn:hover { + color: #e0e0e0; +} + +.quantity-modal .modal-body { + padding: 20px; +} + +.quantity-modal .form-group { + margin-bottom: 16px; +} + +.quantity-modal .form-label { + display: block; + font-size: 14px; + color: #333; + margin-bottom: 6px; + font-weight: 500; +} + +.quantity-modal .required { + color: #ff4949; +} + +.quantity-modal .form-input { + width: 100%; +} + +.quantity-modal .form-input ::v-deep .el-input__inner { + height: 40px; + border: 2px solid #dcdfe6; + border-radius: 6px; + font-size: 14px; + padding: 0 12px; +} + +.quantity-modal .form-input ::v-deep .el-input__inner:focus { + border-color: #17b3a3; + outline: none; +} + +.quantity-modal .modal-footer { + padding: 16px 20px; + display: flex; + gap: 12px; + justify-content: flex-end; + border-top: 1px solid #f0f0f0; +} + +.quantity-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; +} + +.quantity-modal .btn-cancel:hover { + background: #f5f7fa; + border-color: #c0c4cc; +} + +.quantity-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; +} + +.quantity-modal .btn-confirm:hover { + background: #13998c; + border-color: #13998c; +} diff --git a/src/views/modules/customerIssue/customerIssuePDAList.vue b/src/views/modules/customerIssue/customerIssuePDAList.vue index 5f81870..add84b3 100644 --- a/src/views/modules/customerIssue/customerIssuePDAList.vue +++ b/src/views/modules/customerIssue/customerIssuePDAList.vue @@ -95,7 +95,7 @@ export default { .then(({ data }) => { this.loading = false; if (data && data.code === 0) { - this.issueList = data.issueForShopOrder || []; + this.issueList = data.data || []; } else { this.$message.error(data.msg || '获取发料记录失败'); this.issueList = []; @@ -127,6 +127,8 @@ export default { }, }, mounted() { + console.log("路由星系",this.$route.query); + this.workOrderNo = this.$route.query.workOrderNo; this.partNo = this.$route.query.partNo; this.unissureQty = this.$route.query.unissureQty; @@ -143,7 +145,7 @@ export default { .header-left i { margin-right: 8px; font-size: 18px; } .header-right { cursor: pointer; font-size: 16px; font-weight: 500; } .content-area { flex: 1; overflow-y: auto; } -.work-order-list { overflow-y: auto; padding: 12px 16px; } +.work-order-list { overflow-y: auto; } .material-card { background: white; border-radius: 8px; margin-bottom: 12px; padding: 16px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); cursor: pointer; transition: all 0.2s ease; border: 2px solid transparent; } .material-card:hover { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); transform: translateY(-1px); } .material-card:active { transform: translateY(0); } diff --git a/src/views/modules/customerIssue/customerIssuePrintSelect.vue b/src/views/modules/customerIssue/customerIssuePrintSelect.vue new file mode 100644 index 0000000..6bec1f9 --- /dev/null +++ b/src/views/modules/customerIssue/customerIssuePrintSelect.vue @@ -0,0 +1,167 @@ + + + + + +