入库出库添加防抖

This commit is contained in:
2024-05-17 11:45:50 +08:00
parent eb6abd6e9a
commit a59877663c
2 changed files with 66 additions and 60 deletions

View File

@@ -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;
}