入库出库添加防抖

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

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