From 05913111a3d085994aa699da969934094d62b938 Mon Sep 17 00:00:00 2001
From: zhang_li <2235006734@qqq.com>
Date: Mon, 28 Oct 2024 08:54:54 +0800
Subject: [PATCH] =?UTF-8?q?YT-505=E6=88=90=E5=93=81=E5=8F=91=E8=B4=A7?=
=?UTF-8?q?=EF=BC=9A=E6=89=AB=E6=8F=8F=E6=95=B0=E9=87=8F=E5=A4=A7=E4=BA=8E?=
=?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=95=B0=E9=87=8F=E6=97=B6=EF=BC=8C=E5=A6=82?=
=?UTF-8?q?=E6=9E=9C=E9=85=8D=E7=BD=AE=E4=BA=86=E4=B8=8D=E5=85=81=E8=AE=B8?=
=?UTF-8?q?=E5=A4=A7=E4=BA=8E=E6=8E=A8=E8=8D=90=E6=95=B0=E9=87=8F=EF=BC=8C?=
=?UTF-8?q?=E5=88=99=E4=B8=8D=E5=8F=AF=E6=8F=90=E4=BA=A4=E4=BB=BB=E5=8A=A1?=
=?UTF-8?q?=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/mycomponents/qty/qtyEdit.vue | 8 +-
.../coms/comDeliverDetailCardBatch.vue | 6 +-
src/pages/deliver/job/deliverDetailBatch.vue | 23 +-
.../purchaseReceipt/job/receiptDetail.vue | 259 ++++++++++--------
4 files changed, 176 insertions(+), 120 deletions(-)
diff --git a/src/mycomponents/qty/qtyEdit.vue b/src/mycomponents/qty/qtyEdit.vue
index c8c7e11f..fccc8b47 100644
--- a/src/mycomponents/qty/qtyEdit.vue
+++ b/src/mycomponents/qty/qtyEdit.vue
@@ -89,7 +89,11 @@
allowEditStatus: {
type: Boolean,
default: false
- }
+ },
+ allowBiggerQty: {
+ type: String,
+ default: 'TRUE'
+ },
},
methods: {
openEditPopup(item, handleQty) {
@@ -119,7 +123,7 @@
res => {
this.allQty = balanceQty;
})
- } else if (this.allQty > balanceQty) {
+ } else if (this.allQty > balanceQty && this.allowBiggerQty == 'TRUE') {
this.$refs.comMessage.showConfirmWarningModal('数量[' + this.allQty + ']不允许大于任务数量[' + balanceQty + ']',
res => {
this.allQty = balanceQty;
diff --git a/src/pages/deliver/coms/comDeliverDetailCardBatch.vue b/src/pages/deliver/coms/comDeliverDetailCardBatch.vue
index f8138715..f8284f15 100644
--- a/src/pages/deliver/coms/comDeliverDetailCardBatch.vue
+++ b/src/pages/deliver/coms/comDeliverDetailCardBatch.vue
@@ -17,7 +17,7 @@
-
+
@@ -67,6 +67,10 @@ import {
type: Boolean,
default: true
},
+ allowBiggerQty: {
+ type: Boolean,
+ default: false
+ },
},
watch: {
diff --git a/src/pages/deliver/job/deliverDetailBatch.vue b/src/pages/deliver/job/deliverDetailBatch.vue
index ef0be975..8a1bb006 100644
--- a/src/pages/deliver/job/deliverDetailBatch.vue
+++ b/src/pages/deliver/job/deliverDetailBatch.vue
@@ -30,7 +30,7 @@
+ @updateData='updateData' :allowBiggerQty='allowBiggerQty'>
@@ -109,7 +109,8 @@
scanOptions: [],
status: "",
toLocationCode: "",
- jobStatus: ""
+ jobStatus: "",
+ allowBiggerQty:true,//开启数量校验提示
};
},
@@ -186,6 +187,7 @@
that.subList = res.data.subList;
that.detailSource = res.data;
that.toLocationCode = that.subList[0].toLocationCode
+ that.allowBiggerQty = res.data.allowBiggerQty;
that.resizeCollapse();
} else {
that.showMessage('未获取到详情');
@@ -247,6 +249,7 @@
checkCount() {
let str = ""
+ let str1 = ""
var taskQty = 0;
var totalQty = 0;
this.detailSource.subList.forEach(item => {
@@ -260,8 +263,13 @@
//如果允许部分提交任务有扫描记录就可以直接提交;如果不允许部分执行,任务数量和提交数量不一致给出提示
this.detailSource.subList.forEach(detail => {
if (this.jobContent.allowPartialComplete == "FALSE") {
- if (item.taskQty != item.totalQty) {
- str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n`
+ if (taskQty != totalQty) {
+ str += `物料号【${detail.itemCode}】任务数量【${taskQty}】与实际提交数量【${totalQty}】不一致\n`
+ }
+ }
+ if (this.allowBiggerQty) {
+ if (taskQty > totalQty) {
+ str1 += '数量[' + totalQty + ']不允许大于任务数量[' + taskQty + ']'
}
}
})
@@ -270,8 +278,12 @@
str = '不允许提交\n' + 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 => {
uni.hideLoading()
if (res.data) {
+
this.showCommitSuccessMessage("提交成功\n生成发货记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
diff --git a/src/pages/purchaseReceipt/job/receiptDetail.vue b/src/pages/purchaseReceipt/job/receiptDetail.vue
index 0ba7c527..9f86cf61 100644
--- a/src/pages/purchaseReceipt/job/receiptDetail.vue
+++ b/src/pages/purchaseReceipt/job/receiptDetail.vue
@@ -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 {
+ 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)
+ }
+ });
+ })
+
},