From cf013208ff0c9b23c8dccaf77b3846363f43a1cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AD=A3=E6=98=93?= Date: Wed, 29 May 2024 08:58:12 +0800 Subject: [PATCH] =?UTF-8?q?loading=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 4 +-- pages/consolidation/consolidation.vue | 42 +++++++++++++------------- pages/inWarehouse/inWarehouse.vue | 28 +++++++++-------- pages/outWarehouse/outWarehouse.vue | 1 + pages/unpacking/unpacking.vue | 43 ++++++++++++++------------- 5 files changed, 64 insertions(+), 54 deletions(-) diff --git a/manifest.json b/manifest.json index 55c1d6f..956b488 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "干巷仓库APP", "appid" : "__UNI__A67E78B", "description" : "", - "versionName" : "2.2.1", - "versionCode" : 221, + "versionName" : "2.2.3", + "versionCode" : 223, "transformPx" : false, "app-plus" : { "usingComponents" : true, diff --git a/pages/consolidation/consolidation.vue b/pages/consolidation/consolidation.vue index 7976e9c..37c76d4 100644 --- a/pages/consolidation/consolidation.vue +++ b/pages/consolidation/consolidation.vue @@ -225,26 +225,28 @@ export default { createBy: 'admin', secondNum: this.secondNum || 0 }; - GoodsActionApi.doConsolidationGoods(data).then((res) => { - if (res.code === 200) { - uni.showModal({ - title: '提示', - content: '拼箱成功!' + res.data.description, - showCancel: false, - confirmText: '确认' - }); - this.modalShow = false; - this.loading = false; - this.clear(); - } else { - uni.showToast({ - icon: 'error', - title: '拼箱失败!' - }); - this.modalShow = false; - this.loading = false; - } - }); + uni.$u.throttle(()=>{ + GoodsActionApi.doConsolidationGoods(data).then((res) => { + if (res.code === 200) { + uni.showModal({ + title: '提示', + content: '拼箱成功!' + res.data.description, + showCancel: false, + confirmText: '确认' + }); + this.modalShow = false; + this.loading = false; + this.clear(); + } else { + uni.showToast({ + icon: 'error', + title: '拼箱失败!' + }); + this.modalShow = false; + this.loading = false; + } + }); + },5000) }, modalCancel() { this.modalShow = false; diff --git a/pages/inWarehouse/inWarehouse.vue b/pages/inWarehouse/inWarehouse.vue index 764a76f..f32d828 100644 --- a/pages/inWarehouse/inWarehouse.vue +++ b/pages/inWarehouse/inWarehouse.vue @@ -144,7 +144,7 @@ this.newMaterialList = []; this.loading = false; } else if (type === 2) { - if(this.loading){ + if (this.loading) { uni.showModal({ title: '提示', content: '请等待加载完成!', @@ -184,9 +184,9 @@ isStrict: this.isStrict }; this.loading = true; - setTimeout(()=>{ + setTimeout(() => { this.loading = false; - },10000) + }, 10000) WarehoseApi.checkWarehousing(checkData).then((res) => { if (res.code === 200 && res.data) { this.newMaterialList.push(data); @@ -269,9 +269,9 @@ return; } this.loading = true; - setTimeout(()=>{ + setTimeout(() => { this.loading = false; - },30000) + }, 30000) uni.showModal({ title: '入库操作', content: '是否确认入库?', @@ -288,10 +288,10 @@ location: this.warehouseInfo.location, packagelist: list }; - uni.$u.throttle(()=>{ + uni.$u.throttle(() => { WarehoseApi.handlerIntoProductWarehouse(data).then((res) => { if (res.code === 200) { - if (!res.data) { + if (res.data === 0 || !res.data) { uni.showModal({ title: '提示', content: '入库失败:' + res.msg, @@ -303,12 +303,14 @@ } uni.showToast({ icon: 'success', - title: '入库成功!' + title: '入库成功!' + res.msg }); this.loading = false; - this.oldMaterialList = JSON.parse(JSON.stringify(this.clearData + this.oldMaterialList = JSON.parse(JSON.stringify(this + .clearData .oldMaterialList)); - this.newMaterialList = JSON.parse(JSON.stringify(this.clearData + this.newMaterialList = JSON.parse(JSON.stringify(this + .clearData .newMaterialList)); // this.clear(); } else { @@ -319,8 +321,10 @@ this.loading = false; } }); - },5000) - + }, 5000) + + } else { + this.loading = false; } } }); diff --git a/pages/outWarehouse/outWarehouse.vue b/pages/outWarehouse/outWarehouse.vue index 9dd3de1..66e5f6a 100644 --- a/pages/outWarehouse/outWarehouse.vue +++ b/pages/outWarehouse/outWarehouse.vue @@ -408,6 +408,7 @@ } uni.$u.throttle(() => { WarehoseApi.doMaterialOut(data).then((res) => { + if (res.code !== 200) { uni.showModal({ title: '提示', diff --git a/pages/unpacking/unpacking.vue b/pages/unpacking/unpacking.vue index af9089f..0a3c6fc 100644 --- a/pages/unpacking/unpacking.vue +++ b/pages/unpacking/unpacking.vue @@ -200,26 +200,29 @@ createBy: "admin", firstNum: this.firstNum || 0 }; - GoodsActionApi.doUnpackingGoods(data).then((res) => { - if (res.code === 200) { - uni.showModal({ - title: '提示', - content: '拆箱成功!' + res.data.description, - showCancel: false, - confirmText: '确认' - }); - this.modalShow = false; - this.loading = false; - this.clear(); - } else { - uni.showToast({ - icon: 'error', - title: '拆箱失败!' - }); - this.modalShow = false; - this.loading = false; - } - }); + uni.$u.throttle(()=>{ + GoodsActionApi.doUnpackingGoods(data).then((res) => { + if (res.code === 200) { + uni.showModal({ + title: '提示', + content: '拆箱成功!' + res.data.description, + showCancel: false, + confirmText: '确认' + }); + this.modalShow = false; + this.loading = false; + this.clear(); + } else { + uni.showToast({ + icon: 'error', + title: '拆箱失败!' + }); + this.modalShow = false; + this.loading = false; + } + }); + },5000) + }, modalCancel(){ this.modalShow = false;