Browse Source

YT-505成品发货:扫描数量大于任务数量时,如果配置了不允许大于推荐数量,则不可提交任务。

intex_online20241111
张立 6 months ago
parent
commit
05913111a3
  1. 8
      src/mycomponents/qty/qtyEdit.vue
  2. 6
      src/pages/deliver/coms/comDeliverDetailCardBatch.vue
  3. 23
      src/pages/deliver/job/deliverDetailBatch.vue
  4. 255
      src/pages/purchaseReceipt/job/receiptDetail.vue

8
src/mycomponents/qty/qtyEdit.vue

@ -89,7 +89,11 @@
allowEditStatus: { allowEditStatus: {
type: Boolean, type: Boolean,
default: false default: false
} },
allowBiggerQty: {
type: String,
default: 'TRUE'
},
}, },
methods: { methods: {
openEditPopup(item, handleQty) { openEditPopup(item, handleQty) {
@ -119,7 +123,7 @@
res => { res => {
this.allQty = balanceQty; this.allQty = balanceQty;
}) })
} else if (this.allQty > balanceQty) { } else if (this.allQty > balanceQty && this.allowBiggerQty == 'TRUE') {
this.$refs.comMessage.showConfirmWarningModal('数量[' + this.allQty + ']不允许大于任务数量[' + balanceQty + ']', this.$refs.comMessage.showConfirmWarningModal('数量[' + this.allQty + ']不允许大于任务数量[' + balanceQty + ']',
res => { res => {
this.allQty = balanceQty; this.allQty = balanceQty;

6
src/pages/deliver/coms/comDeliverDetailCardBatch.vue

@ -17,7 +17,7 @@
</uni-swipe-action> </uni-swipe-action>
</view> </view>
</view> </view>
<qtyEdit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></qtyEdit> <qtyEdit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true" :allowBiggerQty='allowBiggerQty'></qtyEdit>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> <detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="message"></comMessage> <comMessage ref="message"></comMessage>
</template> </template>
@ -67,6 +67,10 @@ import {
type: Boolean, type: Boolean,
default: true default: true
}, },
allowBiggerQty: {
type: Boolean,
default: false
},
}, },
watch: { watch: {

23
src/pages/deliver/job/deliverDetailBatch.vue

@ -30,7 +30,7 @@
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view> <view>
<comDeliverDetailCardBatch ref='comIssueDetailCard' :dataContent="detailSource" :settingParam="jobContent" <comDeliverDetailCardBatch ref='comIssueDetailCard' :dataContent="detailSource" :settingParam="jobContent"
@updateData='updateData'> @updateData='updateData' :allowBiggerQty='allowBiggerQty'>
</comDeliverDetailCardBatch> </comDeliverDetailCardBatch>
</view> </view>
</scroll-view> </scroll-view>
@ -109,7 +109,8 @@
scanOptions: [], scanOptions: [],
status: "", status: "",
toLocationCode: "", toLocationCode: "",
jobStatus: "" jobStatus: "",
allowBiggerQty:true,//
}; };
}, },
@ -186,6 +187,7 @@
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = res.data; that.detailSource = res.data;
that.toLocationCode = that.subList[0].toLocationCode that.toLocationCode = that.subList[0].toLocationCode
that.allowBiggerQty = res.data.allowBiggerQty;
that.resizeCollapse(); that.resizeCollapse();
} else { } else {
that.showMessage('未获取到详情'); that.showMessage('未获取到详情');
@ -247,6 +249,7 @@
checkCount() { checkCount() {
let str = "" let str = ""
let str1 = ""
var taskQty = 0; var taskQty = 0;
var totalQty = 0; var totalQty = 0;
this.detailSource.subList.forEach(item => { this.detailSource.subList.forEach(item => {
@ -260,8 +263,13 @@
// //
this.detailSource.subList.forEach(detail => { this.detailSource.subList.forEach(detail => {
if (this.jobContent.allowPartialComplete == "FALSE") { if (this.jobContent.allowPartialComplete == "FALSE") {
if (item.taskQty != item.totalQty) { if (taskQty != totalQty) {
str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n` str += `物料号【${detail.itemCode}】任务数量【${taskQty}】与实际提交数量【${totalQty}】不一致\n`
}
}
if (this.allowBiggerQty) {
if (taskQty > totalQty) {
str1 += '数量[' + totalQty + ']不允许大于任务数量[' + taskQty + ']'
} }
} }
}) })
@ -270,8 +278,12 @@
str = '不允许提交\n' + str str = '不允许提交\n' + str
this.showErrorMessage(str) this.showErrorMessage(str)
} }
if (str1) {
str = '不允许提交\n' + str
this.showErrorMessage(str)
}
return str ? false : true return str || str1 ? false : true
}, },
@ -291,6 +303,7 @@
deliverJobSubmit(params).then(res => { deliverJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成发货记录\n" + res.data) this.showCommitSuccessMessage("提交成功\n生成发货记录\n" + res.data)
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")

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

@ -601,7 +601,29 @@
if (!this.checkLocation()) { if (!this.checkLocation()) {
return 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) { if (this.scanCount == this.subList.length) {
this.submitJob(); this.submitJob();
@ -625,7 +647,32 @@
} }
}, },
//
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() { reject() {
if (!this.reasonText) { if (!this.reasonText) {
this.showMessage("请输入拒收原因") this.showMessage("请输入拒收原因")
@ -659,121 +706,109 @@
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
var itemCodes = []
this.detailSource.forEach(item => { var params = this.setParams();
itemCodes.push(item.itemCode) let that = this
}) console.log(params)
// purchaseReceiptJobSubmit(params).then(res => {
getManagementPrecisions(itemCodes, this.toLocationCode, res => { if (res.data) {
if (res.success) { let isCheckPrint = getSwitchInfoByCode(this.switchCode)//
this.managementList = res.list; let isCheckPrint1 = getSwitchInfoByCode(this.switchCode1)//
var params = this.setParams(); if (isCheckPrint1 && !isCheckPrint) {
let that = this uni.hideLoading()
console.log(params) // this.showCommitSuccessMessage("\n\n" + res.data.number)
// return uni.redirectTo({
purchaseReceiptJobSubmit(params).then(res => { url: '/pages/pointPutawayJob/index?number=' + that.jobContent.number
if (res.data) { })
let isCheckPrint = getSwitchInfoByCode(this.switchCode)// }else if(!isCheckPrint1 && !isCheckPrint){
let isCheckPrint1 = getSwitchInfoByCode(this.switchCode1)// this.showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data.number)
if (isCheckPrint1 && !isCheckPrint) { }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() uni.hideLoading()
// this.showCommitSuccessMessage("\n\n" + res.data.number) this.showErrorMessage("上架任务生成异常,请到收货记录里重新生成上架申请")
uni.redirectTo({ return;
url: '/pages/pointPutawayJob/index?number=' + that.jobContent.number }
}) await getPutawayJobList({
}else if(!isCheckPrint1 && !isCheckPrint){ filters: [{
this.showCommitSuccessMessage("提交成功\n生成采购收货记录\n" + res.data.number) column: "purchaseReceiptRecordNumber",
}else { action: "in",
// if (res.data == '') { value: res.data.number
// this.showCommitSuccessMessage(res.data) }],
// const purchaseReceiptDetailPointParams = { pageNo: 1,
// printDeafult: this.printDeafult, pageSize: 1000,
// templateDeafult: this.templateDeafult, }).then(res1 => {
// } timerCount = timerCount + 1
// uni.setStorageSync('purchaseReceiptDetailPointParams', purchaseReceiptDetailPointParams) if (res1.data && res1.data.list && res1
// } else { .data
// this.showErrorMessage(res.data) .list.length && (res1.data.total >= res
// } .data.detailCount)) {
uni.showLoading({ uni.hideLoading()
title: "提交成功,将跳转到打印页面", clearInterval(timer1)
mask: true const dataParams = {
}); toLocationCode: res1.data.list[
0]
// .toLocationCode,
let timerCount = 0 number: res1.data.list[0]
const timer1 = setInterval(async () => { .number,
if (timerCount == 15) { creator: res1.data.list[0]
clearInterval(timer1) .creator,
uni.hideLoading() createTime: res1.data.list[0]
this.showErrorMessage("上架任务生成异常,请到收货记录里重新生成上架申请") .createTime,
return; 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))
})
} }
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)
} }
})
}, 2000)
}
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.$refs.comMessage.showErrorMessage(error, res => {
if (res) {
navigateBack(1)
}
});
})
} else { } else {
uni.hideLoading(); this.showErrorMessage("提交失败[" + res.msg + "]")
this.showErrorMessage(res.message);
} }
}); }).catch(error => {
uni.hideLoading()
this.$refs.comMessage.showErrorMessage(error, res => {
if (res) {
navigateBack(1)
}
});
})
}, },

Loading…
Cancel
Save