diff --git a/pages/inWarehouse/inWarehouse.vue b/pages/inWarehouse/inWarehouse.vue index dd57fe3..764a76f 100644 --- a/pages/inWarehouse/inWarehouse.vue +++ b/pages/inWarehouse/inWarehouse.vue @@ -288,36 +288,39 @@ location: this.warehouseInfo.location, packagelist: list }; - WarehoseApi.handlerIntoProductWarehouse(data).then((res) => { - if (res.code === 200) { - if (!res.data) { - uni.showModal({ - title: '提示', - content: '入库失败:' + res.msg, - showCancel: false, - confirmText: '确定' + uni.$u.throttle(()=>{ + WarehoseApi.handlerIntoProductWarehouse(data).then((res) => { + if (res.code === 200) { + if (!res.data) { + uni.showModal({ + title: '提示', + content: '入库失败:' + res.msg, + showCancel: false, + confirmText: '确定' + }); + this.loading = false; + return; + } + uni.showToast({ + icon: 'success', + title: '入库成功!' + }); + this.loading = false; + this.oldMaterialList = JSON.parse(JSON.stringify(this.clearData + .oldMaterialList)); + this.newMaterialList = JSON.parse(JSON.stringify(this.clearData + .newMaterialList)); + // this.clear(); + } else { + uni.showToast({ + icon: 'error', + title: '入库失败!' }); this.loading = false; - return; } - uni.showToast({ - icon: 'success', - title: '入库成功!' - }); - this.loading = false; - this.oldMaterialList = JSON.parse(JSON.stringify(this.clearData - .oldMaterialList)); - this.newMaterialList = JSON.parse(JSON.stringify(this.clearData - .newMaterialList)); - // this.clear(); - } else { - uni.showToast({ - icon: 'error', - title: '入库失败!' - }); - this.loading = false; - } - }); + }); + },5000) + } } }); diff --git a/pages/outWarehouse/outWarehouse.vue b/pages/outWarehouse/outWarehouse.vue index f263329..9dd3de1 100644 --- a/pages/outWarehouse/outWarehouse.vue +++ b/pages/outWarehouse/outWarehouse.vue @@ -406,47 +406,50 @@ this.loading = false; return; } - WarehoseApi.doMaterialOut(data).then((res) => { - if (res.code !== 200) { - uni.showModal({ - title: '提示', - content: '出库异常', - showCancel: false, - confirmText: '确认' - }); - this.loading = false; - return; - } else { - if (res.data.item1 == 100) { + uni.$u.throttle(() => { + WarehoseApi.doMaterialOut(data).then((res) => { + if (res.code !== 200) { uni.showModal({ title: '提示', - content: '此物料已经出库完成,不可以再出库', + content: '出库异常', showCancel: false, confirmText: '确认' }); - this.newMaterialList = []; - this.loading = false; - } else if (res.data.item2 == 200) { - uni.showModal({ - title: '提示', - content: '不是此物料最早批次,无法出库', - showCancel: false, - confirmText: '确认' - }); - this.newMaterialList = []; this.loading = false; + return; } else { - uni.showModal({ - title: '提示', - content: '出库成功!已成功出库' + res.data.item1 + '箱', - showCancel: false, - confirmText: '确认' - }); - this.newMaterialList = []; - this.loading = false; + if (res.data.item1 == 100) { + uni.showModal({ + title: '提示', + content: '此物料已经出库完成,不可以再出库', + showCancel: false, + confirmText: '确认' + }); + this.newMaterialList = []; + this.loading = false; + } else if (res.data.item2 == 200) { + uni.showModal({ + title: '提示', + content: '不是此物料最早批次,无法出库', + showCancel: false, + confirmText: '确认' + }); + this.newMaterialList = []; + this.loading = false; + } else { + uni.showModal({ + title: '提示', + content: '出库成功!已成功出库' + res.data + .item1 + '箱', + showCancel: false, + confirmText: '确认' + }); + this.newMaterialList = []; + this.loading = false; + } } - } - }); + }); + }, 5000) } else { this.loading = false; }