Browse Source

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

hella_online_20240829
wangyufei 3 months ago
parent
commit
1976767453
  1. 2
      src/pages/index/index.vue
  2. 135
      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)

135
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:''
}; };
}, },
@ -143,7 +145,10 @@
this.id = option.id; this.id = option.id;
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(){
@ -471,60 +476,71 @@
if (res.success) { if (res.success) {
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) {
// this.showCommitSuccessMessage("<br><br><br><br>" + res.data)
uni.showLoading({ if (res.data) {
title: "提交成功,将跳转到打印页面", let isCheckPrint = getSwitchInfoByCode(this.switchCode)
mask: true if(!isCheckPrint){
}); uni.hideLoading()
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录<br>" + res.data.number)
let timerCount = 0 }else{
const timer1 = setInterval(async () => { uni.showLoading({
if (timerCount == 15) { title: "提交成功,将跳转到打印页面",
clearInterval(timer1) mask: true
uni.showToast({ });
title: "跳转打印页面失败",
icon: "none" //
}); let timerCount = 0
return; const timer1 = setInterval(async () => {
} if (timerCount == 15) {
await getPutawayJobList({ clearInterval(timer1)
filters: [{ uni.showToast({
column: "purchaseReceiptRecordNumber", title: "跳转打印页面失败",
action: "in", icon: "none"
value: res.data.number });
}], return;
pageNo: 1, }
pageSize: 1000, await getPutawayJobList({
}).then(res1 => { filters: [{
timerCount = timerCount + 1 column: "purchaseReceiptRecordNumber",
if (res1.data && res1.data.list && res1.data action: "in",
.list.length && (res1.data.total >= res value: res.data.number
.data.detailCount)) { }],
uni.hideLoading() pageNo: 1,
clearInterval(timer1) pageSize: 1000,
const dataParams = { }).then(res1 => {
toLocationCode: res1.data.list[0] timerCount = timerCount + 1
.toLocationCode, if (res1.data && res1.data.list && res1.data
number: res1.data.list[0].number, .list.length && (res1.data.total >= res
creator: res1.data.list[0].creator, .data.detailCount)) {
createTime: res1.data.list[0] uni.hideLoading()
.createTime, clearInterval(timer1)
ids: res1.data.list.map(item => const dataParams = {
item.masterId).join(',') toLocationCode: res1.data.list[0]
} .toLocationCode,
console.log(dataParams) number: res1.data.list[0].number,
uni.navigateTo({ creator: res1.data.list[0].creator,
url: '/pages/pointPutawayJob/index?data=' + createTime: res1.data.list[0]
encodeURIComponent(JSON .createTime,
.stringify(dataParams)) ids: res1.data.list.map(item =>
}) item.masterId).join(',')
} }
}) console.log(dataParams)
}, 2000) uni.navigateTo({
url: '/pages/pointPutawayJob/index?data=' +
encodeURIComponent(JSON
.stringify(dataParams))
})
}
})
}, 2000)
}
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
} }
@ -677,9 +693,10 @@
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
// navigateBack(1) navigateBack(1)
}) })
}, },
} }

Loading…
Cancel
Save