|
|
@@ -352,26 +352,27 @@ export default {
|
|
|
storageData.isMes = 1;
|
|
|
try {
|
|
|
this.isSaveLoading = true;
|
|
|
- await storageApi.outStorage(storageData);
|
|
|
- approveTaskWithVariables({
|
|
|
+ const approveRes = await approveTaskWithVariables({
|
|
|
id: this.form.id,
|
|
|
reason: this.form.reason,
|
|
|
businessId: this.businessId,
|
|
|
variables: {
|
|
|
pass: true
|
|
|
}
|
|
|
- }).then((res) => {
|
|
|
- if (res.data.code != '-1') {
|
|
|
- this.$message.success(`出库成功!`);
|
|
|
- this.$emit('reload');
|
|
|
- this.cancel();
|
|
|
- }
|
|
|
- this.isSaveLoading = false;
|
|
|
});
|
|
|
+ if (approveRes.data.code == '-1') {
|
|
|
+ throw new Error(approveRes.data.msg || '审批失败');
|
|
|
+ }
|
|
|
+ await storageApi.outStorage(storageData);
|
|
|
+ this.$message.success(`出库成功!`);
|
|
|
+ this.$emit('reload');
|
|
|
+ this.cancel();
|
|
|
} catch (error) {
|
|
|
this.isSaveLoading = false;
|
|
|
console.error('出库失败:', error);
|
|
|
+ return;
|
|
|
}
|
|
|
+ this.isSaveLoading = false;
|
|
|
},
|
|
|
|
|
|
async _approveTaskWithVariables(status) {
|