Browse Source

0412 新看板

master
ruanqi 1 year ago
parent
commit
7f44ff5a51
  1. 2
      src/api/production/generateReport.js
  2. 11
      src/views/modules/print/print_package_TCPlabel-NOOREVIEW.js
  3. 162
      src/views/modules/production/bagLabelsTCP.vue

2
src/api/production/generateReport.js

@ -77,3 +77,5 @@ export const scanLabel = data=>createAPI('/board/scanLabel','post',data);
export const checkIsPacking = data=>createAPI('/board/checkIsPacking','get',data); export const checkIsPacking = data=>createAPI('/board/checkIsPacking','get',data);
export const searchOutboundLabelScanList = data=>createAPI('/outbound/label/list','post',data); export const searchOutboundLabelScanList = data=>createAPI('/outbound/label/list','post',data);
export const getTCPPackagePrintDataList = data =>createAPI('/board/getTCPPackagePrintDataList','post',data)

11
src/views/modules/print/print_package_TCPlabel-NOOREVIEW.js

@ -30,11 +30,11 @@ export function printTCPPackageLabelNoPreview(printList) {
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial"); LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(115,18,123,25,"FQC:");
LODOP.ADD_PRINT_TEXT(115,18,58,25,"FQC:");
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial"); LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(115,141,111,25,printData.inspector);
LODOP.ADD_PRINT_TEXT(115,60,81,25,printData.inspector);
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial"); LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.SET_PRINT_STYLEA(0,"Bold",1);
@ -93,10 +93,13 @@ export function printTCPPackageLabelNoPreview(printList) {
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial"); LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(113,229,144,26,"Job No:"+printData.seqNo);
LODOP.ADD_PRINT_TEXT(115,141,146,26,"Job No:"+printData.seqNo);
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
LODOP.SET_PRINT_STYLEA(0,"Bold",1);
LODOP.ADD_PRINT_TEXT(115,274,99,25,"MFG:"+printData.tcpValue);
LODOP.SET_PRINT_STYLEA(0,"FontName","Arial"); LODOP.SET_PRINT_STYLEA(0,"FontName","Arial");
LODOP.SET_PRINT_STYLEA(0,"FontSize",12); LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
LODOP.SET_PRINT_STYLEA(0,"Bold",1); LODOP.SET_PRINT_STYLEA(0,"Bold",1);
if(printData.code=='CODE128') { if(printData.code=='CODE128') {
LODOP.ADD_PRINT_BARCODE(40,143,236,23, "128A",printData.partSpec); LODOP.ADD_PRINT_BARCODE(40,143,236,23, "128A",printData.partSpec);

162
src/views/modules/production/bagLabelsTCP.vue

@ -6,11 +6,13 @@ import {
linkWeighTPC, linkWeighTPC,
closeWeighTPC, closeWeighTPC,
reLinkWeighTPC, reLinkWeighTPC,
getTCPPackagePrintDataList,
} from "../../../api/production/generateReport"; } from "../../../api/production/generateReport";
import { import {
getPhotoAddressData getPhotoAddressData
} from '@/api/pad.js' } from '@/api/pad.js'
import {printTCPPackageLabelNoPreview} from "../print/print_package_TCPlabel-NOOREVIEW"; import {printTCPPackageLabelNoPreview} from "../print/print_package_TCPlabel-NOOREVIEW";
import {printPackageLabelNoPreview} from '../print/print_package_label-NOOREVIEW'
export default { export default {
data() { data() {
@ -37,6 +39,7 @@ export default {
photoUrl: '', photoUrl: '',
scanTime:'', scanTime:'',
scheduleJob:'', scheduleJob:'',
nowTime:'',
} }
}, },
mounted() { mounted() {
@ -49,6 +52,7 @@ export default {
beforeDestroy(){ beforeDestroy(){
this.closeWeighTPC(); this.closeWeighTPC();
window.removeEventListener('beforeunload', this.handleBeforeUnload); window.removeEventListener('beforeunload', this.handleBeforeUnload);
this.stopSchedule();
}, },
computed: { computed: {
seqNo: function () { seqNo: function () {
@ -85,6 +89,8 @@ export default {
this.soScheduleRouting = data.rows.find((item) => item.site === this.$store.state.user.site && item.seqNo === this.searchData.seqNo) this.soScheduleRouting = data.rows.find((item) => item.site === this.$store.state.user.site && item.seqNo === this.searchData.seqNo)
this.checkIsPacking() this.checkIsPacking()
} }
// console.log(data.rows[0].nowTime)
this.nowTime= data.rows[0].nowTime
if (data.row) { if (data.row) {
this.soScheduleRouting.qtyBag = data.row[0].qtyBag this.soScheduleRouting.qtyBag = data.row[0].qtyBag
this.soScheduleRouting.bag = data.row[0].bag this.soScheduleRouting.bag = data.row[0].bag
@ -102,12 +108,17 @@ export default {
} else { } else {
this.$message.error(data.msg) this.$message.error(data.msg)
this.cleanAll()
// this.cleanAll()
} }
}).catch((error) => { }).catch((error) => {
this.$message.error(error) this.$message.error(error)
this.cleanAll()
// this.cleanAll()
}) })
this.scheduleJob = setInterval(() => {
this.printTCPLabel();
}, 2000);
} else { } else {
this.$message.warning(data.msg) this.$message.warning(data.msg)
this.cleanAll() this.cleanAll()
@ -117,6 +128,64 @@ export default {
this.$message.error(error); this.$message.error(error);
}) })
}, },
linkTPC(){
linkWeighTPC(params).then(({data}) => {
if (data && data.code === 0) {
this.$message.success("称重器连接成功!")
} else {
this.$message.error(data.msg)
// this.cleanAll()
}
}).catch((error) => {
this.$message.error(error)
// this.cleanAll()
})
},
printTCPLabel(){
console.log(this.soScheduleRouting.site)
if (!this.soScheduleRouting.site) {
return false
}
console.log(this.nowTime)
if (this.nowTime==''||this.nowTime==null) {
return false
}
console.log(this.soScheduleRouting.qtyBag)
if (this.soScheduleRouting.qtyBag === null || this.soScheduleRouting.qtyBag === undefined) {
return false
}
console.log('2')
let params = {
nowTime:this.nowTime,
previousSeqNo: this.soScheduleRouting.previousSeqNo,
site: this.soScheduleRouting.site,
orderNo: this.soScheduleRouting.orderNo,
}
if (!params) {
return
}
console.log('3')
getTCPPackagePrintDataList(params).then(({data}) => {
if (data && data.code === 0) {
if(data.rows.length>0){
printTCPPackageLabelNoPreview(data.rows);
}
this.searchData.flag = '';
} else {
this.$message.warning(data.msg)
}
}).catch((error) => {
this.$message.error(error)
})
},
stopSchedule() {
if (this.scheduleJob) {
clearInterval(this.scheduleJob); // 使 clearInterval
this.scheduleJob = null; // scheduleJob null
}
},
cleanAll() { cleanAll() {
Object.keys(this.soScheduleRouting).forEach(key => { Object.keys(this.soScheduleRouting).forEach(key => {
this.soScheduleRouting[key] = ''; this.soScheduleRouting[key] = '';
@ -129,6 +198,8 @@ export default {
this.photoUrl = null; this.photoUrl = null;
// this.scanTime= ''; // this.scanTime= '';
this.closeWeighTPC(); this.closeWeighTPC();
this.nowTime='';
this.stopSchedule()
}, },
closeWeighTPC(){ closeWeighTPC(){
this.scanTime= ''; this.scanTime= '';
@ -165,26 +236,7 @@ export default {
this.soScheduleRouting = {}; this.soScheduleRouting = {};
}) })
}, },
printLabel() {
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
}
if (this.searchData.flag === 'Y') {
this.flag = true;
return;
}
this.printPackageLabelNoPreview(params)
},
printPackageLabelNoPreview(params) { printPackageLabelNoPreview(params) {
if (!params) { if (!params) {
this.$message.warning("参数为空") this.$message.warning("参数为空")
@ -202,15 +254,7 @@ export default {
this.$message.error(error) this.$message.error(error)
}) })
}, },
printLabelEntity() {
let params = {
previousSeqNo: this.soScheduleRouting.previousSeqNo,
site: this.soScheduleRouting.site,
orderNo: this.soScheduleRouting.orderNo
}
params.number = this.number;
this.printPackageLabelNoPreview(params)
},
getData(site, partNo) { getData(site, partNo) {
this.picData.partNo = partNo; this.picData.partNo = partNo;
this.picData.site = site; this.picData.site = site;
@ -273,21 +317,21 @@ export default {
<template> <template>
<div style="padding: 5px"> <div style="padding: 5px">
<el-form size="medium" class="title" :model="seqNo" label-position="top" :inline="true">
<el-form size="medium" class="title" :model="seqNo" label-position="top" :inline="true" @submit.native.prevent>
<el-form-item label="派工单号"> <el-form-item label="派工单号">
<el-input-number size="medium" style="width: 100%;margin-top: -5px;" :controls="false" ref="focusInput" :min="0" <el-input-number size="medium" style="width: 100%;margin-top: -5px;" :controls="false" ref="focusInput" :min="0"
v-model="searchData.seqNo" @keyup.enter.native="selectBySeqNo"></el-input-number> v-model="searchData.seqNo" @keyup.enter.native="selectBySeqNo"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label=" ">
<el-select v-model="searchData.flag" clearable>
<el-option value="" label="标准袋数"></el-option>
<el-option value="Y" label="零数袋"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label=" ">-->
<!-- <el-select v-model="searchData.flag" clearable>-->
<!-- <el-option value="" label="标准袋数"></el-option>-->
<!-- <el-option value="Y" label="零数袋"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label=" "> <el-form-item label=" ">
<!-- <el-button type="primary" @click="printLabel">打印标签</el-button>--> <!-- <el-button type="primary" @click="printLabel">打印标签</el-button>-->
<el-button type="primary" @click="">重连设备</el-button>
<el-button type="primary" @click="">取消连接</el-button>
<el-button type="primary" @click="linkTPC()">重连设备</el-button>
<el-button type="primary" @click="closeWeighTPC()">取消连接</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="content"> <div class="content">
@ -441,25 +485,25 @@ export default {
</div> </div>
</el-card> </el-card>
</div> </div>
<el-dialog title="提示" :visible.sync="flag" @open="()=>{
this.$nextTick(()=>{
this.$refs.dialogInput.focus();
})
}" @close="()=>{
this.number = 1
}" width="15vw" top="30vh">
<el-form label-position="top" class="title">
<el-form-item label="零数量">
<el-input-number size="medium" style="width: 100%;text-align: left" :controls="false" ref="dialogInput"
:min="1" v-model="number" @keyup.enter.native="selectBySeqNo"></el-input-number>
</el-form-item>
</el-form>
<div style="height: 20px;width: 100%"></div>
<div style="text-align: center;margin-bottom: 5px">
<el-button type="primary" @click="printLabelEntity">确定</el-button>
</div>
<div style="height: 5px;width: 100%"></div>
</el-dialog>
<!-- <el-dialog title="提示" :visible.sync="flag" @open="()=>{-->
<!-- this.$nextTick(()=>{-->
<!-- this.$refs.dialogInput.focus();-->
<!-- })-->
<!-- }" @close="()=>{-->
<!-- this.number = 1-->
<!-- }" width="15vw" top="30vh">-->
<!-- <el-form label-position="top" class="title">-->
<!-- <el-form-item label="零数量">-->
<!-- <el-input-number size="medium" style="width: 100%;text-align: left" :controls="false" ref="dialogInput"-->
<!-- :min="1" v-model="number" @keyup.enter.native="selectBySeqNo"></el-input-number>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- <div style="height: 20px;width: 100%"></div>-->
<!-- <div style="text-align: center;margin-bottom: 5px">-->
<!-- <el-button type="primary" @click="printLabelEntity">确定</el-button>-->
<!-- </div>-->
<!-- <div style="height: 5px;width: 100%"></div>-->
<!-- </el-dialog>-->
</div> </div>
</template> </template>

Loading…
Cancel
Save