loading调整

This commit is contained in:
2024-05-29 08:58:12 +08:00
parent 3cd40fa8a2
commit cf013208ff
5 changed files with 64 additions and 54 deletions

View File

@@ -2,8 +2,8 @@
"name" : "干巷仓库APP", "name" : "干巷仓库APP",
"appid" : "__UNI__A67E78B", "appid" : "__UNI__A67E78B",
"description" : "", "description" : "",
"versionName" : "2.2.1", "versionName" : "2.2.3",
"versionCode" : 221, "versionCode" : 223,
"transformPx" : false, "transformPx" : false,
"app-plus" : { "app-plus" : {
"usingComponents" : true, "usingComponents" : true,

View File

@@ -225,26 +225,28 @@ export default {
createBy: 'admin', createBy: 'admin',
secondNum: this.secondNum || 0 secondNum: this.secondNum || 0
}; };
GoodsActionApi.doConsolidationGoods(data).then((res) => { uni.$u.throttle(()=>{
if (res.code === 200) { GoodsActionApi.doConsolidationGoods(data).then((res) => {
uni.showModal({ if (res.code === 200) {
title: '提示', uni.showModal({
content: '拼箱成功!' + res.data.description, title: '提示',
showCancel: false, content: '拼箱成功!' + res.data.description,
confirmText: '确认' showCancel: false,
}); confirmText: '确认'
this.modalShow = false; });
this.loading = false; this.modalShow = false;
this.clear(); this.loading = false;
} else { this.clear();
uni.showToast({ } else {
icon: 'error', uni.showToast({
title: '拼箱失败!' icon: 'error',
}); title: '拼箱失败!'
this.modalShow = false; });
this.loading = false; this.modalShow = false;
} this.loading = false;
}); }
});
},5000)
}, },
modalCancel() { modalCancel() {
this.modalShow = false; this.modalShow = false;

View File

@@ -144,7 +144,7 @@
this.newMaterialList = []; this.newMaterialList = [];
this.loading = false; this.loading = false;
} else if (type === 2) { } else if (type === 2) {
if(this.loading){ if (this.loading) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '请等待加载完成!', content: '请等待加载完成!',
@@ -184,9 +184,9 @@
isStrict: this.isStrict isStrict: this.isStrict
}; };
this.loading = true; this.loading = true;
setTimeout(()=>{ setTimeout(() => {
this.loading = false; this.loading = false;
},10000) }, 10000)
WarehoseApi.checkWarehousing(checkData).then((res) => { WarehoseApi.checkWarehousing(checkData).then((res) => {
if (res.code === 200 && res.data) { if (res.code === 200 && res.data) {
this.newMaterialList.push(data); this.newMaterialList.push(data);
@@ -269,9 +269,9 @@
return; return;
} }
this.loading = true; this.loading = true;
setTimeout(()=>{ setTimeout(() => {
this.loading = false; this.loading = false;
},30000) }, 30000)
uni.showModal({ uni.showModal({
title: '入库操作', title: '入库操作',
content: '是否确认入库?', content: '是否确认入库?',
@@ -288,10 +288,10 @@
location: this.warehouseInfo.location, location: this.warehouseInfo.location,
packagelist: list packagelist: list
}; };
uni.$u.throttle(()=>{ uni.$u.throttle(() => {
WarehoseApi.handlerIntoProductWarehouse(data).then((res) => { WarehoseApi.handlerIntoProductWarehouse(data).then((res) => {
if (res.code === 200) { if (res.code === 200) {
if (!res.data) { if (res.data === 0 || !res.data) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '入库失败:' + res.msg, content: '入库失败:' + res.msg,
@@ -303,12 +303,14 @@
} }
uni.showToast({ uni.showToast({
icon: 'success', icon: 'success',
title: '入库成功!' title: '入库成功!' + res.msg
}); });
this.loading = false; this.loading = false;
this.oldMaterialList = JSON.parse(JSON.stringify(this.clearData this.oldMaterialList = JSON.parse(JSON.stringify(this
.clearData
.oldMaterialList)); .oldMaterialList));
this.newMaterialList = JSON.parse(JSON.stringify(this.clearData this.newMaterialList = JSON.parse(JSON.stringify(this
.clearData
.newMaterialList)); .newMaterialList));
// this.clear(); // this.clear();
} else { } else {
@@ -319,8 +321,10 @@
this.loading = false; this.loading = false;
} }
}); });
},5000) }, 5000)
} else {
this.loading = false;
} }
} }
}); });

View File

@@ -408,6 +408,7 @@
} }
uni.$u.throttle(() => { uni.$u.throttle(() => {
WarehoseApi.doMaterialOut(data).then((res) => { WarehoseApi.doMaterialOut(data).then((res) => {
if (res.code !== 200) { if (res.code !== 200) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',

View File

@@ -200,26 +200,29 @@
createBy: "admin", createBy: "admin",
firstNum: this.firstNum || 0 firstNum: this.firstNum || 0
}; };
GoodsActionApi.doUnpackingGoods(data).then((res) => { uni.$u.throttle(()=>{
if (res.code === 200) { GoodsActionApi.doUnpackingGoods(data).then((res) => {
uni.showModal({ if (res.code === 200) {
title: '提示', uni.showModal({
content: '拆箱成功!' + res.data.description, title: '提示',
showCancel: false, content: '拆箱成功!' + res.data.description,
confirmText: '确认' showCancel: false,
}); confirmText: '确认'
this.modalShow = false; });
this.loading = false; this.modalShow = false;
this.clear(); this.loading = false;
} else { this.clear();
uni.showToast({ } else {
icon: 'error', uni.showToast({
title: '拆箱失败!' icon: 'error',
}); title: '拆箱失败!'
this.modalShow = false; });
this.loading = false; this.modalShow = false;
} this.loading = false;
}); }
});
},5000)
}, },
modalCancel(){ modalCancel(){
this.modalShow = false; this.modalShow = false;