Browse Source

PDA采购收货任务执行,是否打印的开关

hella_online_20240829
wangyufei 3 months ago
parent
commit
1976767453
  1. 2
      src/pages/index/index.vue
  2. 121
      src/pages/purchaseReceipt/job/receiptDetail.vue

2
src/pages/index/index.vue

@ -387,7 +387,7 @@
console.log("包装规格获取失败", res) console.log("包装规格获取失败", res)
}) })
var switchCode="FgPutawayLocationCodeValidate,SemiPutawayLocationCodeValidate,PurchasePutawayToLocationCodeValidate,IssueToLocationCodeValidate,fgProductReceipCommitValidate"; var switchCode="FgPutawayLocationCodeValidate,SemiPutawayLocationCodeValidate,PurchasePutawayToLocationCodeValidate,IssueToLocationCodeValidate,fgProductReceipCommitValidate,purchasereceiptPrintPDA";
getSwitchByCode(switchCode).then(res=>{ getSwitchByCode(switchCode).then(res=>{
uni.setStorageSync("switch", res.data) uni.setStorageSync("switch", res.data)

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

@ -73,7 +73,8 @@
getCurrDateTime, getCurrDateTime,
getPackingNumberAndBatch, getPackingNumberAndBatch,
compareAsc, compareAsc,
navigateBack navigateBack,
getSwitchInfoByCode
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -134,7 +135,8 @@
isAllReceived: false, isAllReceived: false,
operation: '', operation: '',
scanedPackingNumber: '', scanedPackingNumber: '',
status:'' status:'',
switchCode:''
}; };
}, },
@ -144,6 +146,9 @@
this.scanedPackingNumber = option.scaned || ''; this.scanedPackingNumber = option.scaned || '';
this.operation = option.operation; this.operation = option.operation;
this.status = option.status; this.status = option.status;
this.switchCode = "purchasereceiptPrintPDA"
}, },
onShow(){ onShow(){
@ -472,58 +477,69 @@
this.managementList = res.list; this.managementList = res.list;
var params = this.setParams() var params = this.setParams()
purchaseReceiptJobSubmit(params).then(res => { purchaseReceiptJobSubmit(params).then(res => {
if (res.data) { if (res.data) {
// this.showCommitSuccessMessage("<br><br><br><br>" + res.data) let isCheckPrint = getSwitchInfoByCode(this.switchCode)
uni.showLoading({ if(!isCheckPrint){
title: "提交成功,将跳转到打印页面", uni.hideLoading()
mask: true
}); this.showCommitSuccessMessage("提交成功<br>生成采购收货记录<br>" + res.data.number)
}else{
// uni.showLoading({
let timerCount = 0 title: "提交成功,将跳转到打印页面",
const timer1 = setInterval(async () => { mask: true
if (timerCount == 15) { });
clearInterval(timer1)
uni.showToast({ //
title: "跳转打印页面失败", let timerCount = 0
icon: "none" const timer1 = setInterval(async () => {
}); if (timerCount == 15) {
return;
}
await getPutawayJobList({
filters: [{
column: "purchaseReceiptRecordNumber",
action: "in",
value: res.data.number
}],
pageNo: 1,
pageSize: 1000,
}).then(res1 => {
timerCount = timerCount + 1
if (res1.data && res1.data.list && res1.data
.list.length && (res1.data.total >= res
.data.detailCount)) {
uni.hideLoading()
clearInterval(timer1) clearInterval(timer1)
const dataParams = { uni.showToast({
toLocationCode: res1.data.list[0] title: "跳转打印页面失败",
.toLocationCode, icon: "none"
number: res1.data.list[0].number, });
creator: res1.data.list[0].creator, return;
createTime: res1.data.list[0]
.createTime,
ids: res1.data.list.map(item =>
item.masterId).join(',')
}
console.log(dataParams)
uni.navigateTo({
url: '/pages/pointPutawayJob/index?data=' +
encodeURIComponent(JSON
.stringify(dataParams))
})
} }
}) await getPutawayJobList({
}, 2000) filters: [{
column: "purchaseReceiptRecordNumber",
action: "in",
value: res.data.number
}],
pageNo: 1,
pageSize: 1000,
}).then(res1 => {
timerCount = timerCount + 1
if (res1.data && res1.data.list && res1.data
.list.length && (res1.data.total >= res
.data.detailCount)) {
uni.hideLoading()
clearInterval(timer1)
const dataParams = {
toLocationCode: res1.data.list[0]
.toLocationCode,
number: res1.data.list[0].number,
creator: res1.data.list[0].creator,
createTime: res1.data.list[0]
.createTime,
ids: res1.data.list.map(item =>
item.masterId).join(',')
}
console.log(dataParams)
uni.navigateTo({
url: '/pages/pointPutawayJob/index?data=' +
encodeURIComponent(JSON
.stringify(dataParams))
})
}
})
}, 2000)
}
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
@ -678,8 +694,9 @@
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
// navigateBack(1) navigateBack(1)
}) })
}, },
} }

Loading…
Cancel
Save