Browse Source

打印还原

hella_online_20240829
zhang_li 3 months ago
parent
commit
13daee251d
  1. 129
      src/pages/package/job/overPackageJobDetail.vue
  2. 125
      src/pages/package/record/overPackageRecord.vue
  3. 51
      src/pages/purchaseReceipt/job/receiptDetail.vue

129
src/pages/package/job/overPackageJobDetail.vue

@ -42,7 +42,7 @@
打印设置 打印设置
</view> </view>
</template> </template>
<print ref="printService" @printCode="printCode" @templateCode="templateCode"></print> <!-- <print ref="printService" @printCode="printCode" @templateCode="templateCode"></print> -->
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>
</div> </div>
@ -106,7 +106,7 @@
import comScanPackagePack from '@/pages/package/coms/comScanPackagePack.vue' import comScanPackagePack from '@/pages/package/coms/comScanPackagePack.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import workStation from '@/mycomponents/workStation/workStation.vue' import workStation from '@/mycomponents/workStation/workStation.vue'
import print from '@/mycomponents/print/print.vue' // import print from '@/mycomponents/print/print.vue'
export default { export default {
name: 'issueDetail', name: 'issueDetail',
@ -117,7 +117,7 @@
comScanPackagePack, comScanPackagePack,
jobTop, jobTop,
workStation, workStation,
print // print
}, },
data() { data() {
return { return {
@ -129,8 +129,8 @@
scanOptions: [], scanOptions: [],
jobStatus: "", jobStatus: "",
printDeafult: {}, // // printDeafult: {}, //
templateDeafult: {} // // templateDeafult: {} //
}; };
}, },
@ -229,18 +229,18 @@
that.jobStatus = res.data.status that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList) that.detailSource = getDataSource(that.detailSource, that.subList)
this.$nextTick(() => { // this.$nextTick(() => {
if (uni.getStorageSync('overPackageJobDetailPointParams')) { // if (uni.getStorageSync('overPackageJobDetailPointParams')) {
const overPackageJobDetailPointParams = uni.getStorageSync( // const overPackageJobDetailPointParams = uni.getStorageSync(
'overPackageJobDetailPointParams') // 'overPackageJobDetailPointParams')
this.jobContent.printerUuid = overPackageJobDetailPointParams // this.jobContent.printerUuid = overPackageJobDetailPointParams
.printDeafult.value; // .printDeafult.value;
this.jobContent.modelCode = overPackageJobDetailPointParams // this.jobContent.modelCode = overPackageJobDetailPointParams
.templateDeafult.value; // .templateDeafult.value;
this.$refs.printService.setDefaultData(overPackageJobDetailPointParams // this.$refs.printService.setDefaultData(overPackageJobDetailPointParams
.printDeafult, overPackageJobDetailPointParams.templateDeafult) // .printDeafult, overPackageJobDetailPointParams.templateDeafult)
} // }
}) // })
setTimeout(r => { setTimeout(r => {
that.resizeCollapse(); that.resizeCollapse();
}, 100) }, 100)
@ -290,14 +290,14 @@
// }, // },
submit() { submit() {
if(!this.jobContent.printerUuid){ // if(!this.jobContent.printerUuid){
this.showErrorMessage("请选择打印机") // this.showErrorMessage("")
return; // return;
} // }
if(!this.jobContent.modelCode){ // if(!this.jobContent.modelCode){
this.showErrorMessage("请选择打印模板") // this.showErrorMessage("")
return; // return;
} // }
// //
var itemCodes = [] var itemCodes = []
let locationCode = this.detailSource[0].toLocationCode let locationCode = this.detailSource[0].toLocationCode
@ -364,52 +364,41 @@
console.log(params); console.log(params);
overPageSubmit(params).then(res => { overPageSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data == '打印任务已发送,等待打印机处理!') { // if (res.data == '') {
this.showCommitSuccessMessage(res.data)
const overPackageJobDetailPointParams = {
printDeafult: this.printDeafult,
templateDeafult: this.templateDeafult,
}
uni.setStorageSync('overPackageJobDetailPointParams', overPackageJobDetailPointParams)
} else {
this.showErrorMessage(res.data)
}
// if(res.data){
// this.showCommitSuccessMessage(res.data) // this.showCommitSuccessMessage(res.data)
// const overPackageJobDetailPointParams = { // const overPackageJobDetailPointParams = {
// printDeafult: this.printDeafult, // printDeafult: this.printDeafult,
// templateDeafult: this.templateDeafult, // templateDeafult: this.templateDeafult,
// } // }
// uni.setStorageSync('overPackageJobDetailPointParams', overPackageJobDetailPointParams) // uni.setStorageSync('overPackageJobDetailPointParams', overPackageJobDetailPointParams)
// } else { // } else {
// this.showErrorMessage("[" + res.msg + "]") // this.showErrorMessage(res.data)
// } // }
// if (res.data) { if (res.data) {
// let list = []; let list = [];
// res.data.forEach(item => { res.data.forEach(item => {
// list.push({ list.push({
// itemCode: item.itemCode, // itemCode: item.itemCode, //
// itemName: item.itemName, // itemName: item.itemName, //
// packName: item.packName, // packName: item.packName, //
// packageCode: item.number, // packageCode: item.number, //
// batch: item.batch, // batch: item.batch, //
// parentNumber: item.parentNumber, // parentNumber: item.parentNumber, //
// itemType: item.itemType, // itemType: item.itemType, //
// asnNumber: item.asnNumber, //ASN asnNumber: item.asnNumber, //ASN
// supplierCode: item.supplierCode, // supplierCode: item.supplierCode, //
// qty: item.qty, // qty: item.qty, //
// printTimes: getCurrDateTime(), // printTimes: getCurrDateTime(), //
// productionLineCode: item.productionLineCode, //线 productionLineCode: item.productionLineCode, //线
// barcodeString: item.barcodeString, // barcodeString: item.barcodeString, //
// barcodeBase64: '', barcodeBase64: '',
// }) })
// }) })
// this.showCommitSuccessMessage("<br><br>", list) this.showCommitSuccessMessage("提交成功<br>生成翻包记录<br>", list)
// } else { } else {
// this.showErrorMessage("[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
// } }
}).catch(error => { }).catch(error => {
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showErrorMessage(error)
@ -498,14 +487,14 @@
this.jobContent.creator = creator; this.jobContent.creator = creator;
return this.jobContent; return this.jobContent;
}, },
printCode(e) { // printCode(e) {
this.jobContent.printerUuid = e.value; // this.jobContent.printerUuid = e.value;
this.printDeafult = e // this.printDeafult = e
}, // },
templateCode(e) { // templateCode(e) {
this.jobContent.modelCode = e.value; // this.jobContent.modelCode = e.value;
this.templateDeafult = e // this.templateDeafult = e
}, // },
cancel() { cancel() {
let that = this; let that = this;
this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', res => { this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', res => {

125
src/pages/package/record/overPackageRecord.vue

@ -5,7 +5,7 @@
<com-blank-view @goScan='getBusinessType' v-if="detailSource.length==0"></com-blank-view> <com-blank-view @goScan='getBusinessType' v-if="detailSource.length==0"></com-blank-view>
</view> </view>
<print ref="printService" @printCode="printCode" @templateCode="templateCode"></print> <!-- <print ref="printService" @printCode="printCode" @templateCode="templateCode"></print> -->
<view class="page-wraper" v-if="detailSource.length>0"> <view class="page-wraper" v-if="detailSource.length>0">
<view class="cen_card" style="background-color: #fff; margin:10px 0px 0px 10px;"> <view class="cen_card" style="background-color: #fff; margin:10px 0px 0px 10px;">
<view class="cell_box uni-flex uni-row"> <view class="cell_box uni-flex uni-row">
@ -112,7 +112,7 @@
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import packUnit from '@/mycomponents/qty/packUnit.vue' import packUnit from '@/mycomponents/qty/packUnit.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import print from '@/mycomponents/print/print.vue' // import print from '@/mycomponents/print/print.vue'
import { import {
getCurrDateTime getCurrDateTime
@ -131,7 +131,7 @@
recordComDetailCard, recordComDetailCard,
packUnit, packUnit,
winComScanBalance, winComScanBalance,
print // print
}, },
onLoad(option){ onLoad(option){
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
@ -160,22 +160,21 @@
itemCode: "", itemCode: "",
resultData: {}, resultData: {},
printDeafult:{},// // printDeafult:{},//
templateDeafult:{}// // templateDeafult:{}//
}; };
}, },
onLoad() { onLoad() {
this.getBusinessType(); this.getBusinessType();
this.$nextTick(()=>{ // this.$nextTick(()=>{
if(uni.getStorageSync('overPackageRecordPointParams')){ // if(uni.getStorageSync('overPackageRecordPointParams')){
const overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams') // const overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams')
this.dataContent.printerUuid = overPackageRecordPointParams.printDeafult.value; // this.dataContent.printerUuid = overPackageRecordPointParams.printDeafult.value;
this.dataContent.modelCode = overPackageRecordPointParams.templateDeafult.value; // this.dataContent.modelCode = overPackageRecordPointParams.templateDeafult.value;
this.$refs.printService.setDefaultData(overPackageRecordPointParams.printDeafult,overPackageRecordPointParams.templateDeafult) // this.$refs.printService.setDefaultData(overPackageRecordPointParams.printDeafult,overPackageRecordPointParams.templateDeafult)
} // }
// })
})
}, },
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
@ -359,14 +358,14 @@
} }
}, },
commit() { commit() {
if(!this.dataContent.printerUuid){ // if(!this.dataContent.printerUuid){
this.showErrorMessage("请选择打印机") // this.showErrorMessage("")
return; // return;
} // }
if(!this.dataContent.modelCode){ // if(!this.dataContent.modelCode){
this.showErrorMessage("请选择打印模板") // this.showErrorMessage("")
return; // return;
} // }
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
if (!this.toPackUnit || this.toPackUnit == "包装规格") { if (!this.toPackUnit || this.toPackUnit == "包装规格") {
this.showErrorMessage("请选择目标包装规格") this.showErrorMessage("请选择目标包装规格")
@ -412,41 +411,41 @@
overPackageRecordSubmit(params).then(res => { overPackageRecordSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data == '打印任务已发送,等待打印机处理!') { // if (res.data == '') {
this.showCommitSuccessMessage(res.data) // this.showCommitSuccessMessage(res.data)
const overPackageRecordPointParams = { // const overPackageRecordPointParams = {
printDeafult:this.printDeafult, // printDeafult:this.printDeafult,
templateDeafult:this.templateDeafult, // templateDeafult:this.templateDeafult,
} // }
uni.setStorageSync('overPackageRecordPointParams',overPackageRecordPointParams) // uni.setStorageSync('overPackageRecordPointParams',overPackageRecordPointParams)
this.detailSource = [] // this.detailSource = []
}else {
this.showErrorMessage(res.data)
}
// if (res.data) {
// // let list = []
// // res.data.forEach(item => {
// // list.push({
// // itemCode: item.itemCode, //
// // itemName: item.itemName, //
// // packName: item.packName, //
// // packageCode: item.toPackingNumber, //
// // batch: item.toBatch, //
// // parentNumber: item.parentNumber, //
// // itemType: item.itemType, //
// // asnNumber: item.asnNumber, //ASN
// // supplierCode: item.supplierCode, //
// // qty: item.qty, //
// // printTimes: getCurrDateTime(), //
// // productionLineCode: item.productionLineCode, //线
// // barcodeString: item.barcodeString, //
// // barcodeBase64: '',
// // })
// // })
// this.showCommitSuccessMessage(res.msg)
// }else { // }else {
// this.showErrorMessage("[" + res.msg + "]") // this.showErrorMessage(res.data)
// } // }
if (res.data) {
let list = []
res.data.forEach(item => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
packName: item.packName, //
packageCode: item.toPackingNumber, //
batch: item.toBatch, //
parentNumber: item.parentNumber, //
itemType: item.itemType, //
asnNumber: item.asnNumber, //ASN
supplierCode: item.supplierCode, //
qty: item.qty, //
printTimes: getCurrDateTime(), //
productionLineCode: item.productionLineCode, //线
barcodeString: item.barcodeString, //
barcodeBase64: '',
})
})
this.showCommitSuccessMessage(res.msg)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => { }).catch(error => {
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showErrorMessage(error)
@ -487,14 +486,14 @@
this.dataContent.creator = creator; this.dataContent.creator = creator;
return this.dataContent; return this.dataContent;
}, },
printCode(e){ // printCode(e){
this.dataContent.printerUuid = e.value; // this.dataContent.printerUuid = e.value;
this.printDeafult = e // this.printDeafult = e
}, // },
templateCode(e){ // templateCode(e){
this.dataContent.modelCode = e.value; // this.dataContent.modelCode = e.value;
this.templateDeafult = e // this.templateDeafult = e
}, // },
showMessage(message) { showMessage(message) {
this.$refs.comMessage.showMessage(message, res => { this.$refs.comMessage.showMessage(message, res => {
if (res) {} if (res) {}

51
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -38,7 +38,18 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<!-- <div style="background: white;" v-if="operation=='receipt'" >
<uni-collapse>
<uni-collapse-item>
<template v-slot:title>
<view class="card_itemName" style="padding: 3px 5px; font-size: 28rpx;">
打印设置
</view>
</template>
<print ref="printService" @printCode="printCode" @templateCode="templateCode"></print>
</uni-collapse-item>
</uni-collapse>
</div> -->
<view class="page-footer"> <view class="page-footer">
<view style="background-color:ghostwhite; width: 100%; "> <view style="background-color:ghostwhite; width: 100%; ">
<view v-if="operation=='receipt'" class="uni-flex u-col-center space-between padding_10"> <view v-if="operation=='receipt'" class="uni-flex u-col-center space-between padding_10">
@ -106,6 +117,7 @@
import locationCompare from '@/mycomponents/location/locationCompare.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue'
import comReceiptDetailCard from '@/pages/purchaseReceipt/coms/comReceiptDetailCard.vue' import comReceiptDetailCard from '@/pages/purchaseReceipt/coms/comReceiptDetailCard.vue'
import jobTopAsn from '@/mycomponents/job/jobTopAsn.vue' import jobTopAsn from '@/mycomponents/job/jobTopAsn.vue'
// import print from '@/mycomponents/print/print.vue'
import { import {
productDismantleJobClose productDismantleJobClose
} from '@/api/request2.js'; } from '@/api/request2.js';
@ -121,7 +133,8 @@
winScanPack, winScanPack,
comReceiptDetailCard, comReceiptDetailCard,
locationCompare, locationCompare,
jobTopAsn jobTopAsn,
// print
}, },
data() { data() {
return { return {
@ -145,6 +158,10 @@
switchCode: "", switchCode: "",
isCheckLocation: 'purchaseReceiptLocationCodeValidate', // isCheckLocation: 'purchaseReceiptLocationCodeValidate', //
reasonText: "", reasonText: "",
// printDeafult: {}, //
// templateDeafult: {} //
}; };
}, },
@ -247,11 +264,22 @@
that.toLocationCode = that.jobToLocationCode; that.toLocationCode = that.jobToLocationCode;
} }
that.isAllReceived = false; that.isAllReceived = false;
// if (uni.getStorageSync('purchaseReceiptDetailPointParams')) {
// const purchaseReceiptDetailPointParams = uni.getStorageSync(
// 'purchaseReceiptDetailPointParams')
// this.jobContent.printerUuid = purchaseReceiptDetailPointParams
// .printDeafult.value;
// this.jobContent.modelCode = purchaseReceiptDetailPointParams
// .templateDeafult.value;
// this.$refs.printService.setDefaultData(purchaseReceiptDetailPointParams
// .printDeafult, purchaseReceiptDetailPointParams.templateDeafult)
// }
//ASN //ASN
if (this.scanMessage) { if (this.scanMessage) {
this.$refs.scanPopup.simulateScan(this.scanMessage); this.$refs.scanPopup.simulateScan(this.scanMessage);
} }
} else { } else {
that.showMessage('列表数据为0'); that.showMessage('列表数据为0');
} }
@ -495,6 +523,16 @@
this.showCommitSuccessMessage("提交成功<br>生成采购收货记录<br>" + res.data.number) this.showCommitSuccessMessage("提交成功<br>生成采购收货记录<br>" + res.data.number)
} else { } else {
// if (res.data == '') {
// this.showCommitSuccessMessage(res.data)
// const purchaseReceiptDetailPointParams = {
// printDeafult: this.printDeafult,
// templateDeafult: this.templateDeafult,
// }
// uni.setStorageSync('purchaseReceiptDetailPointParams', purchaseReceiptDetailPointParams)
// } else {
// this.showErrorMessage(res.data)
// }
uni.showLoading({ uni.showLoading({
title: "提交成功,将跳转到打印页面", title: "提交成功,将跳转到打印页面",
mask: true mask: true
@ -593,7 +631,14 @@
this.jobContent.creator = creator; this.jobContent.creator = creator;
return this.jobContent; return this.jobContent;
}, },
// printCode(e) {
// this.jobContent.printerUuid = e.value;
// this.printDeafult = e
// },
// templateCode(e) {
// this.jobContent.modelCode = e.value;
// this.templateDeafult = e
// },
checkLocation() { checkLocation() {
var isPass = true; var isPass = true;
if (this.toLocationCode == "" || this.toLocationCode == null) { if (this.toLocationCode == "" || this.toLocationCode == null) {

Loading…
Cancel
Save