diff --git a/src/api/production/generateReport.js b/src/api/production/generateReport.js index 14aba30..96da774 100644 --- a/src/api/production/generateReport.js +++ b/src/api/production/generateReport.js @@ -18,3 +18,6 @@ export const searchReportedQty= data => createAPI(`dailyPlan/searchReportedQty`, export const getStockPrint= data => createAPI(`dailyPlan/getStockPrint`, 'post', data); export const updatePrintStock= data => createAPI(`dailyPlan/updatePrintStock`, 'post', data); + +// 扫描派工单获取改派工单数据 +export const searchSeqNo= data => createAPI(`dailyPlan/searchSeqNo`, 'post', data); diff --git a/src/views/modules/production/generateReport.vue b/src/views/modules/production/generateReport.vue index c26f8e3..720a68e 100644 --- a/src/views/modules/production/generateReport.vue +++ b/src/views/modules/production/generateReport.vue @@ -65,6 +65,7 @@ 查询 + 扫描派工单 {{'导出'}} + - + + + + + + + + 搜索 + 关闭 + + @@ -274,19 +286,30 @@ + + + - - + - - + - - + + + + + + + + + + + +
@@ -306,7 +329,7 @@
- + @@ -386,7 +409,8 @@ import { getSOScheduleRoutingData , saveGenerateReportForSchedule, - searchReportedQty + searchReportedQty, + searchSeqNo } from '@/api/production/generateReport.js' import Chooselist from '@/views/modules/common/Chooselist' import { @@ -405,6 +429,10 @@ readonlyFlag: false, disabled: false }, + factorFlag:false, + KGReported:'', + KGApprove:'', + KGRework:'', saveHeaderData: { site: '', seqNo: '', @@ -433,8 +461,10 @@ scheduleType:'', userId:'', }, + scanSeqNo:'', qty1:'', qty2:'', + qty3:'', sopFlag:false, site: this.$store.state.user.site, operatorType: 0, @@ -486,6 +516,7 @@ site:'', partNo:'', }, + scanModalFlag:false, partDescription:'', fileTitle:'', fileName:'', @@ -505,6 +536,7 @@ this.height2 = window.innerHeight -100 }) }, + methods: { saveReport () { if (this.saveHeaderData.qtyReported == null || this.saveHeaderData.qtyReported <= 0) { @@ -626,6 +658,12 @@ this.setUp.reviewFlag = true; this.setUp.disabled = true; let currentData = JSON.parse(JSON.stringify(row)); + this.KGReported=0 + this.KGApprove=0 + this.KGRework=0 + this.saveHeaderData.qtyApprove=0 + this.saveHeaderData.qtyReported=0 + this.saveHeaderData.qtyRework=0 this.saveHeaderData.site = currentData.site; this.saveHeaderData.seqNo = currentData.seqNo; this.saveHeaderData.itemNo = currentData.itemNo; @@ -635,6 +673,7 @@ this.saveHeaderData.workCenterNo = currentData.sWorkCenterNo; this.saveHeaderData.workCenterDesc = currentData.workCenterDesc; this.saveHeaderData.orderRef1=currentData.orderRef1; + this.saveHeaderData.orderNo=currentData.orderNo; this.saveHeaderData.scheduleType=currentData.scheduleType; this.saveHeaderData.operatorId=currentData.operatorId; this.saveHeaderData.operatorName=currentData.operatorName; @@ -645,6 +684,16 @@ searchReportedQty(this.saveHeaderData).then(({data}) => { this.qty1 = data.row.qtyReported; this.qty2 =data.row.lastApproveQty; + if(data.row.weightFactor==-1){ + this.qty3 ="erp未维护数据" + this.KGReported='' + this.KGApprove='' + this.KGRework='' + this.factorFlag=true; + }else { + this.qty3 =data.row.weightFactor + this.factorFlag=false; + } }) }, closeDialog () { @@ -723,13 +772,13 @@ this.num=this.num+1; } this.fileName=this.photoDatas[this.num-1].attaFileNameDb; - this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")"; + this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")"; this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb; // this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb; }, lastPicture(){ if(this.photoDatas.length==0){ - this.fileTitle="文件名 ("+0+"/"+0+")"; + this.fileTitle="文件名 ("+0+"/"+0+")"; this.fileName=''; this.photoUrl=''; this.$alert('该物料没有上传图片!', '错误', { @@ -747,7 +796,134 @@ this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb; // this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb; }, + openScan(){ + this.scanSeqNo=''; + this.scanModalFlag=true; + this.$nextTick(() => { this.$refs.input.focus();}) + }, + searchSeqNo(){ + if(this.scanSeqNo==''){ + this.$alert("请扫描派工单!",'错误', { + confirmButtonText: '确定' + }) + return false; + } + let inData={ + site:this.$store.state.user.site, + seqNo:this.scanSeqNo + } + searchSeqNo(inData).then(({data}) => { + if (data.code == 0) { + if(data.row==null){ + this.$alert("派工单不存在!",'错误', { + confirmButtonText: '确定' + }) + return false; + } + let currentData = data.row; + if(currentData.closedFlag=='Y'){ + this.$alert("该派工单已关闭!",'错误', { + confirmButtonText: '确定' + }) + return false; + } + this.KGReported=0 + this.KGApprove=0 + this.KGRework=0 + this.saveHeaderData.qtyApprove=0 + this.saveHeaderData.qtyReported=0 + this.saveHeaderData.qtyRework=0 + this.scanModalFlag=false; + this.setUp.reviewFlag = true; + this.setUp.disabled = true; + this.saveHeaderData.site = currentData.site; + this.saveHeaderData.seqNo = currentData.seqNo; + this.saveHeaderData.itemNo = currentData.itemNo; + this.saveHeaderData.operationDesc = currentData.itemDesc; + this.saveHeaderData.partNo = currentData.partNo; + this.saveHeaderData.partDescription = currentData.partSpec; + this.saveHeaderData.workCenterNo = currentData.sWorkCenterNo; + this.saveHeaderData.workCenterDesc = currentData.workCenterDesc; + this.saveHeaderData.orderRef1=currentData.orderRef1; + this.saveHeaderData.orderNo=currentData.orderNo; + this.saveHeaderData.scheduleType=currentData.scheduleType; + this.saveHeaderData.operatorId=currentData.operatorId; + this.saveHeaderData.operatorName=currentData.operatorName; + this.saveHeaderData.userId=this.$store.state.user.name; + this.qty1=''; + this.qty2 =''; + this.saveHeaderData.planStartTime = this.dayjs(new Date()).format('YYYY-MM-DD 00:00:00') + searchReportedQty(this.saveHeaderData).then(({data}) => { + this.qty1 = data.row.qtyReported; + this.qty2 =data.row.lastApproveQty; + if(data.row.weightFactor==-1){ + this.qty3 ="erp未维护数据" + this.KGReported='' + this.KGApprove='' + this.KGRework='' + this.factorFlag=true; + }else { + this.qty3 =data.row.weightFactor + this.factorFlag=false; + } + }) + + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + qtyReportedBlur(){ + if(this.qty3&&this.qty3!=0&&this.qty3!='erp未维护数据'&&this.saveHeaderData.qtyReported!=''){ + this.KGReported=(this.saveHeaderData.qtyReported*this.qty3).toFixed(1) + } + if(this.saveHeaderData.qtyReported==''){ + this.KGReported='' + } + }, + qtyApproveBlur(){ + if(this.qty3&&this.qty3!=0&&this.qty3!='erp未维护数据'&&this.saveHeaderData.qtyApprove!=''){ + this.KGApprove=(this.saveHeaderData.qtyApprove*this.qty3).toFixed(1) + } + if(this.saveHeaderData.qtyApprove==''){ + this.KGApprove='' + } + }, + qtyReworkBlur(){ + if(this.qty3&&this.qty3!=0&&this.qty3!='erp未维护数据'&&this.saveHeaderData.qtyRework!=''){ + this.KGRework=(this.saveHeaderData.qtyRework*this.qty3).toFixed(1) + } + if(this.saveHeaderData.qtyRework==''){ + this.KGRework='' + } + }, + KGReportedBlur(){ + if(this.qty3&&this.qty3!=0&&this.qty3!='erp未维护数据'&&this.KGReported!=''){ + this.saveHeaderData.qtyReported=(this.KGReported/this.qty3).toFixed(1) + } + if(this.KGReported==''){ + this.saveHeaderData.qtyReported='' + } + }, + KGApproveBlur(){ + if(this.qty3&&this.qty3!=0&&this.qty3!='erp未维护数据'&&this.KGApprove!=''){ + this.saveHeaderData.qtyApprove=(this.KGApprove/this.qty3).toFixed(1) + } + if(this.KGApprove==''){ + this.saveHeaderData.qtyApprove='' + } + }, + KGReworkBlur(){ + if(this.qty3&&this.qty3!=0&&this.qty3!='erp未维护数据'&&this.KGRework!=''){ + this.saveHeaderData.qtyRework=(this.KGRework/this.qty3).toFixed(1) + } + if(this.KGRework==''){ + this.saveHeaderData.qtyRework='' + } + }, }, created () { } diff --git a/src/views/modules/production/print_seqNo_label.js b/src/views/modules/production/print_seqNo_label.js new file mode 100644 index 0000000..76d3636 --- /dev/null +++ b/src/views/modules/production/print_seqNo_label.js @@ -0,0 +1,29 @@ +/*调用js打印标签*/ +import getLodop from '@/utils/LodopFuncs.js' +/*打印材料卷标签*/ +export function printSeqNoLabel(printList) { + const LODOP = getLodop() + if (LODOP) { + //LODOP.SET_LICENSES("", "AF8A5800B84BCC5218BCF67B92627BEA", "", ""); + LODOP.SET_LICENSES("", "AF8A5800B84BCC5218BCF67B92627BEA", "", ""); + LODOP.SET_PRINTER_INDEXA("小标签打印机"); + //循环调用打印机 + for(let i = 0; i < printList.length; i++){ + let printData = printList[i]; + LODOP.NewPage(); + LODOP.SET_PRINT_PAGESIZE(0,300,200,""); + LODOP.ADD_PRINT_TEXT(52,21,72,35,"派工单号:"+printData.seqNo); + LODOP.SET_PRINT_STYLEA(0,"FontName","黑体"); + LODOP.SET_PRINT_STYLEA(0,"FontSize",9); + LODOP.SET_PRINT_STYLEA(0,"Alignment",2); + LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-5); + LODOP.ADD_PRINT_BARCODE(3,31,86,61,"QRCode",printData.seqNo); + + } + LODOP.PRINT_DESIGN(); + //LODOP.PREVIEW(); + // LODOP.PRINT(); + console.log("操作成功!") + } +} + diff --git a/src/views/modules/production/soscheduleRouting.vue b/src/views/modules/production/soscheduleRouting.vue index 463a7a9..a8aad9d 100644 --- a/src/views/modules/production/soscheduleRouting.vue +++ b/src/views/modules/production/soscheduleRouting.vue @@ -91,9 +91,10 @@ prop="" header-align="center" align="center" - min-width="60" + min-width="160" label="操作"> @@ -221,7 +222,9 @@ , cancelJob } from '@/api/production/generateReport.js' import Chooselist from '@/views/modules/common/Chooselist' - + import { + printSeqNoLabel, + } from "@/views/modules/production/print_seqNo_label.js" export default { name: 'soscheduleRouting', components: { @@ -418,8 +421,15 @@ } }) }) - } - + }, + toPrint(row){ + let array=[]; + let data={ + seqNo:row.seqNo, + } + array.push(data) + printSeqNoLabel(array) + }, }, created () { }