Browse Source

PC打印

hella_online_20240829
wangyufei 2 months ago
parent
commit
11d164628a
  1. 54
      src/pages/fg/receiptByPlan.vue
  2. 66
      src/pages/fg/receiptNoPlan.vue

54
src/pages/fg/receiptByPlan.vue

@ -103,11 +103,15 @@
planReceiptSubmit,
createPutawayRequestByPlan,
createInspectRequestByPlan,
getPlanByNumber
getPlanByNumber,
getBalanceToPackage,
batchPrintingLable
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import storage from '@/common/utils/storage.js'
import {
getRemoveOption,
@ -453,14 +457,50 @@
this.$refs.scanPopup.losefocus();
}
},
getH5BatchPrintingLable( number) {
let _this = this
batchPrintingLable(number).then(resLable => {
console.log('batchPrintingLable', resLable)
const webUrl = `${import.meta.env.VITE_JMREPORT_BASE_URL}/jmreport/view/922734157577715712`
const webData = {
token: storage.getStorage(storage.constant.token),
asn_number: resLable.data
}
uni.redirectTo({
url: `/pages/pointProductReceipt/webview?url=${webUrl}&webData=${JSON.stringify(webData)}`
});
})
},
print(pointData){
let _this = this
// #ifdef APP
if (pointData.length > 0) {
uni.navigateTo({
url: `/pages/point/index?points=${JSON.stringify(pointData)}`
});
}
// #endif
// #ifdef H5
let packingNumber = []
pointData.forEach(item=>{
packingNumber.push(item.packageCode)
})
getBalanceToPackage({
packingNumber: packingNumber.join(',')
}).then(res => {
console.log('PC打印', res)
_this.getH5BatchPrintingLable(res.data.number)
}).catch(error => {
_this.showErrorMessage(error)
})
// #endif
},
showCommitSuccessMessage(hint, pointData) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
if (pointData.length > 0) {
uni.navigateTo({
url: `/pages/point/index?points=${JSON.stringify(pointData)}`
});
}
this.print(pointData)
})
},

66
src/pages/fg/receiptNoPlan.vue

@ -100,12 +100,14 @@
planReceiptSubmit,
createPutawayRequestByPlan,
createInspectRequestByPlan,
getPlanByNumber
getPlanByNumber,
getBalanceToPackage,
batchPrintingLable
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import storage from '@/common/utils/storage.js'
import {
getRemoveOption,
deepCopyData,
@ -411,20 +413,58 @@
this.$refs.scanPopup.losefocus();
}
},
getH5BatchPrintingLable( number) {
let _this = this
batchPrintingLable(number).then(resLable => {
console.log('batchPrintingLable', resLable)
const webUrl = `${import.meta.env.VITE_JMREPORT_BASE_URL}/jmreport/view/922734157577715712`
const webData = {
token: storage.getStorage(storage.constant.token),
asn_number: resLable.data
}
uni.redirectTo({
url: `/pages/pointProductReceipt/webview?url=${webUrl}&webData=${JSON.stringify(webData)}`
});
})
},
print(pointData){
let _this = this
// #ifdef APP
if (pointData.length > 0) {
if (this.scanedQty + this.showList.length == this.dataContent.planQty) {
uni.redirectTo({
url: `/pages/point/index?points=${JSON.stringify(pointData)}`
});
} else {
uni.navigateTo({
url: `/pages/point/index?points=${JSON.stringify(pointData)}`
});
}
}
// #endif
// #ifdef H5
let packingNumber = []
pointData.forEach(item=>{
packingNumber.push(item.packageCode)
})
getBalanceToPackage({
packingNumber: packingNumber.join(',')
}).then(res => {
console.log('PC打印', res)
_this.getH5BatchPrintingLable(res.data.number)
}).catch(error => {
_this.showErrorMessage(error)
})
// #endif
},
showCommitSuccessMessage(hint, pointData) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
if (pointData.length > 0) {
if (this.scanedQty + this.showList.length == this.dataContent.planQty) {
uni.redirectTo({
url: `/pages/point/index?points=${JSON.stringify(pointData)}`
});
} else {
uni.navigateTo({
url: `/pages/point/index?points=${JSON.stringify(pointData)}`
});
}
}
this.print(pointData)
})
},

Loading…
Cancel
Save