|
|
@ -601,7 +601,29 @@ |
|
|
|
if (!this.checkLocation()) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
var itemCodes = [] |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
}) |
|
|
|
|
|
|
|
//获取管理模式,封装参数 |
|
|
|
getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
this.managementType = this.managementList&&this.managementList[0]&&this.managementList[0].ManagementPrecision ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING' |
|
|
|
if(this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY'){ |
|
|
|
this.checkBatch() |
|
|
|
}else{ |
|
|
|
this.check() |
|
|
|
} |
|
|
|
} else { |
|
|
|
uni.hideLoading(); |
|
|
|
this.showErrorMessage(res.message); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 校验 |
|
|
|
check(){ |
|
|
|
//扫描数量和任务数量相等,直接提交 |
|
|
|
if (this.scanCount == this.subList.length) { |
|
|
|
this.submitJob(); |
|
|
@ -623,9 +645,34 @@ |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
//按批次的校验 |
|
|
|
checkBatch(){ |
|
|
|
//扫描数量和任务数量相等,直接提交 |
|
|
|
const scanCount1 = this.detailSource |
|
|
|
const current = this.detailSource.find(item=> item.handleQty<item.qty) |
|
|
|
if(current){ |
|
|
|
//扫描数量小于任务数量,判断是否允许部分提交 |
|
|
|
if (this.jobContent.allowPartialComplete == "TRUE") { |
|
|
|
//提交 |
|
|
|
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => { |
|
|
|
if (res) { |
|
|
|
this.submitJob() |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
//不允许部分提交,提示 |
|
|
|
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => { |
|
|
|
if (res) { |
|
|
|
this.openScanPopup(this.jobToLocationCode); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
this.submitJob(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
reject() { |
|
|
|
if (!this.reasonText) { |
|
|
|
this.showMessage("请输入拒收原因") |
|
|
@ -659,121 +706,109 @@ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
var itemCodes = [] |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
}) |
|
|
|
//获取管理模式,封装参数 |
|
|
|
getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
var params = this.setParams(); |
|
|
|
let that = this |
|
|
|
console.log(params) |
|
|
|
// return |
|
|
|
purchaseReceiptJobSubmit(params).then(res => { |
|
|
|
if (res.data) { |
|
|
|
let isCheckPrint = getSwitchInfoByCode(this.switchCode)//是否显示上架指引单 |
|
|
|
let isCheckPrint1 = getSwitchInfoByCode(this.switchCode1)//是否显示采购收货检验指引单 |
|
|
|
if (isCheckPrint1 && !isCheckPrint) { |
|
|
|
|
|
|
|
var params = this.setParams(); |
|
|
|
let that = this |
|
|
|
console.log(params) |
|
|
|
purchaseReceiptJobSubmit(params).then(res => { |
|
|
|
if (res.data) { |
|
|
|
let isCheckPrint = getSwitchInfoByCode(this.switchCode)//是否显示上架指引单 |
|
|
|
let isCheckPrint1 = getSwitchInfoByCode(this.switchCode1)//是否显示采购收货检验指引单 |
|
|
|
if (isCheckPrint1 && !isCheckPrint) { |
|
|
|
uni.hideLoading() |
|
|
|
// this.showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data.number) |
|
|
|
uni.redirectTo({ |
|
|
|
url: '/pages/pointPutawayJob/index?number=' + that.jobContent.number |
|
|
|
}) |
|
|
|
}else if(!isCheckPrint1 && !isCheckPrint){ |
|
|
|
this.showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data.number) |
|
|
|
}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({ |
|
|
|
title: "提交成功,将跳转到打印页面", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
|
|
|
|
// 获取上架任务 |
|
|
|
let timerCount = 0 |
|
|
|
const timer1 = setInterval(async () => { |
|
|
|
if (timerCount == 15) { |
|
|
|
clearInterval(timer1) |
|
|
|
uni.hideLoading() |
|
|
|
// this.showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data.number) |
|
|
|
uni.redirectTo({ |
|
|
|
url: '/pages/pointPutawayJob/index?number=' + that.jobContent.number |
|
|
|
}) |
|
|
|
}else if(!isCheckPrint1 && !isCheckPrint){ |
|
|
|
this.showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data.number) |
|
|
|
}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({ |
|
|
|
title: "提交成功,将跳转到打印页面", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
|
|
|
|
// 获取上架任务 |
|
|
|
let timerCount = 0 |
|
|
|
const timer1 = setInterval(async () => { |
|
|
|
if (timerCount == 15) { |
|
|
|
clearInterval(timer1) |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage("上架任务生成异常,请到收货记录里重新生成上架申请") |
|
|
|
return; |
|
|
|
this.showErrorMessage("上架任务生成异常,请到收货记录里重新生成上架申请") |
|
|
|
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) |
|
|
|
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( |
|
|
|
',') |
|
|
|
} |
|
|
|
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) |
|
|
|
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( |
|
|
|
',') |
|
|
|
} |
|
|
|
uni.hideLoading() |
|
|
|
if(!isCheckPrint1 && isCheckPrint){ |
|
|
|
uni.redirectTo({ |
|
|
|
url: '/pages/pointPutawayJob/index?data=' + |
|
|
|
encodeURIComponent(JSON.stringify(dataParams)) |
|
|
|
}) |
|
|
|
}else if(isCheckPrint1 && isCheckPrint){ |
|
|
|
uni.redirectTo({ |
|
|
|
url: '/pages/pointPutawayJob/index?number=' + that.jobContent.number + |
|
|
|
'&data=' + |
|
|
|
encodeURIComponent(JSON.stringify(dataParams)) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}, 2000) |
|
|
|
uni.hideLoading() |
|
|
|
if(!isCheckPrint1 && isCheckPrint){ |
|
|
|
uni.redirectTo({ |
|
|
|
url: '/pages/pointPutawayJob/index?data=' + |
|
|
|
encodeURIComponent(JSON.stringify(dataParams)) |
|
|
|
}) |
|
|
|
}else if(isCheckPrint1 && isCheckPrint){ |
|
|
|
uni.redirectTo({ |
|
|
|
url: '/pages/pointPutawayJob/index?number=' + that.jobContent.number + |
|
|
|
'&data=' + |
|
|
|
encodeURIComponent(JSON.stringify(dataParams)) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}, 2000) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.$refs.comMessage.showErrorMessage(error, res => { |
|
|
|
if (res) { |
|
|
|
navigateBack(1) |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
} else { |
|
|
|
uni.hideLoading(); |
|
|
|
this.showErrorMessage(res.message); |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}); |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.$refs.comMessage.showErrorMessage(error, res => { |
|
|
|
if (res) { |
|
|
|
navigateBack(1) |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|