From 9bb79138c72cbf0b211b0683ffd79b5122dcf72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=AE=8F=E6=96=8C?= <2164406372@qq.com> Date: Wed, 6 Aug 2025 10:09:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E9=83=A8=E8=BF=94=E5=B7=A5=E8=BF=94?= =?UTF-8?q?=E4=BF=AE=E6=8A=A5=E5=B7=A5=E9=92=88=E5=AF=B9=E8=BF=94=E5=B7=A5?= =?UTF-8?q?=E8=BF=94=E4=BF=AE=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E6=A0=87=E7=AD=BE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/production/reworkRecord.vue | 109 +++++++++++++++++- 1 file changed, 108 insertions(+), 1 deletion(-) diff --git a/src/views/modules/production/reworkRecord.vue b/src/views/modules/production/reworkRecord.vue index 0a257f4..673140c 100644 --- a/src/views/modules/production/reworkRecord.vue +++ b/src/views/modules/production/reworkRecord.vue @@ -6,10 +6,11 @@ import { saveRework, getRework, removeRework, - cancelRework, queryOperator + cancelRework, queryOperator, getPackagePrintDataList, getSOScheduleRoutingDataPrint, checkIsPacking } from '../../../api/production/generateReport' import dayjs from 'dayjs' import decimal, {Decimal} from 'decimal.js' +import {printPackageLabelNoPreview} from "../print/print_package_label-NOOREVIEW"; export default { components:{ chooseList, @@ -40,6 +41,8 @@ export default { site:this.$store.state.user.site, type:undefined, }, + soScheduleRouting: {}, + printDataList: [], reportWorkDialog:false, saveType:undefined, numberOrWeight:undefined,//0数量,1重量 @@ -221,10 +224,111 @@ export default { }) }) }, + getSOScheduleRoutingData(seqNo) { + let params = { + seqNo: seqNo, + userId: this.$store.state.user.name + } + getSOScheduleRoutingDataPrint(params).then(({data}) => { + if (data && data.code === 0) { + if (data.total === 0) { + this.$message.warning("派工单不存在") + return + } else if (data.total === 1) { + this.soScheduleRouting = data.rows[0]; + this.checkIsPacking() + } else { + this.soScheduleRouting = data.rows.find((item) => item.site === this.$store.state.user.site && item.seqNo === this.searchData.seqNo) + this.checkIsPacking() + } + if (data.row) { + this.soScheduleRouting.qtyBag = data.row[0].qtyBag + this.soScheduleRouting.bag = data.row[0].bag + this.soScheduleRouting.qty = data.row[0].qty + this.soScheduleRouting.carton = data.row[0].carton + } + if (data.data) { + this.soScheduleRouting.sScheduledDate2 = data.data.sScheduledDate; + this.soScheduleRouting.operatorName2 = data.data.operatorName; + this.soScheduleRouting.approveQty2 = data.data.qtyApprove; + } + this.printLabel() + } else { + this.$message.warning(data.msg) + } + }).catch((error) => { + this.$message.error(error); + }) + }, + async checkIsPacking() { + let params = { + site: this.soScheduleRouting.site, + workCenterNo: this.soScheduleRouting.sWorkCenterNo, + } + await checkIsPacking(params).then(({data}) => { + if (!data || data.code != 0) { + this.soScheduleRouting = {} + this.$message.warning(data.msg) + } + }).catch((error) => { + this.$message.error(error) + this.soScheduleRouting = {} + }) + }, + printLabel() { + if (!this.saveRework.seqNo ||this.saveRework.seqNo=='' || this.saveRework.seqNo == null){ + this.$message.warning("请输入描派工单号"); + return; + } + if (!this.soScheduleRouting.site) { + this.$message.warning("请先扫描派工单号") + return + } + if (this.soScheduleRouting.qtyBag === null || this.soScheduleRouting.qtyBag === undefined) { + this.$message.warning("未维护每袋数量") + return; + } + let params = { + previousSeqNo: this.soScheduleRouting.previousSeqNo, + site: this.soScheduleRouting.site, + orderNo: this.soScheduleRouting.orderNo, + seqNo: this.saveRework.seqNo + } + this.printPackageLabelNoPreview(params) + }, + printPackageLabelNoPreview(params) { + if (!params) { + this.$message.warning("参数为空") + return + } + // 发起请求 + getPackagePrintDataList(params).then(({data}) => { + + this.printDataList = data.rows + this.printDataList.forEach(item => { + item.receiveDate = this.saveRework.reworkEndDate + item.inspector = this.saveRework.operatorId + item.unitQty = this.saveRework.qtyApprove + }) + this.$message.success(this.printDataList) + if (data && data.code === 0) { + printPackageLabelNoPreview(this.printDataList); + } else { + this.$message.warning(data.msg) + } + }).catch((error) => { + this.$message.error(error) + }) + }, getRework(){ + if (!this.saveRework.seqNo ||this.saveRework.seqNo=='' || this.saveRework.seqNo == null) { + this.$message.warning("派工单号为空") + return + } let params = { seqNo: this.saveRework.seqNo } + let seqNo = this.saveRework.seqNo getRework(params).then(({data})=>{ if (data && data.code === 0){ this.seqNoReworkRecordDialog = false; @@ -235,6 +339,8 @@ export default { this.saveRework.productionTime = new Decimal(dayjs(new Date()).diff(this.saveRework.createTime,'hour',true)).toFixed(2, Decimal.ROUND_HALF_UP) this.saveRework.productionTime = new Decimal(this.saveRework.productionTime).toSignificantDigits() }) + //打印功能 + this.getSOScheduleRoutingData(seqNo) this.reportWorkDialog = true }else { this.$alert(data.msg, '错误信息', { @@ -546,6 +652,7 @@ export default { 取消 确定 + 打印