|
@@ -187,15 +187,16 @@ const submit = async () => {
|
|
|
const payload = { ...(form.value as any) };
|
|
const payload = { ...(form.value as any) };
|
|
|
if (did.value) payload.id = did.value;
|
|
if (did.value) payload.id = did.value;
|
|
|
const res = await useClientRequest.post(url, payload);
|
|
const res = await useClientRequest.post(url, payload);
|
|
|
|
|
+ if (!res || res.code !== 200) return
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
- if (res && res.code === 200) {
|
|
|
|
|
- uni.showToast({ title: did.value ? '保存成功' : '新增成功', icon: 'success' });
|
|
|
|
|
|
|
+ uni.showToast({ title: did.value ? '保存成功' : '新增成功', icon: 'success' });
|
|
|
uni.$emit('refreshStorageRoomList');
|
|
uni.$emit('refreshStorageRoomList');
|
|
|
uni.$emit('storage-room-detail-refresh');
|
|
uni.$emit('storage-room-detail-refresh');
|
|
|
- setTimeout(() => uni.navigateBack(), 300);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ setTimeout(() => uni.navigateBack({
|
|
|
|
|
+ delta: 1
|
|
|
|
|
+ }), 300);
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
- uni.hideLoading();
|
|
|
|
|
|
|
+ // uni.hideLoading();
|
|
|
console.error('保存库房失败:', e);
|
|
console.error('保存库房失败:', e);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|