|
|
@@ -9,6 +9,7 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
+ <el-alert v-if="outInQueryError" :title="outInQueryError" type="error" :closable="false" />
|
|
|
<div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
|
|
|
<el-button
|
|
|
icon="el-icon-edit-outline"
|
|
|
@@ -18,6 +19,7 @@
|
|
|
v-if="
|
|
|
taskDefinitionKey != 'storemanApprove' ||
|
|
|
(taskDefinitionKey == 'storemanApprove' &&
|
|
|
+ !outInQueryLoading && !outInQueryError &&
|
|
|
outInData.verifyStatus == 2)
|
|
|
"
|
|
|
@click="handleAudit(1)"
|
|
|
@@ -32,6 +34,7 @@
|
|
|
@click="storemanApprove"
|
|
|
v-if="
|
|
|
['storemanApprove'].includes(taskDefinitionKey) &&
|
|
|
+ !outInQueryLoading && !outInQueryError &&
|
|
|
([0, 3].includes(outInData.verifyStatus) || !outInData.verifyStatus)
|
|
|
"
|
|
|
>申请出库
|
|
|
@@ -129,6 +132,8 @@
|
|
|
outInData: {
|
|
|
verifyStatus: ''
|
|
|
},
|
|
|
+ outInQueryError: '',
|
|
|
+ outInQueryLoading: true,
|
|
|
rules: {
|
|
|
reason: [
|
|
|
{ required: true, message: '请输入审批建议', trigger: 'blur' }
|
|
|
@@ -138,16 +143,21 @@
|
|
|
},
|
|
|
async created() {
|
|
|
if (this.taskDefinitionKey == 'storemanApprove') {
|
|
|
- let data = await getReturnSaleOrderrecordDetail(this.businessId);
|
|
|
try {
|
|
|
- this.outInData = await getOutInBySourceBizNo(data.returnNo);
|
|
|
+ let data = await getReturnSaleOrderrecordDetail(this.businessId);
|
|
|
+ this.outInData = (await getOutInBySourceBizNo(data.returnNo)) || { verifyStatus: 0 };
|
|
|
} catch (error) {
|
|
|
- this.outInData.verifyStatus = 0;
|
|
|
+ this.outInQueryError = '退货出库单查询失败,请核对单据后重试';
|
|
|
+ } finally {
|
|
|
+ this.outInQueryLoading = false;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
async storemanApprove() {
|
|
|
+ if (this.outInQueryLoading || this.outInQueryError) {
|
|
|
+ return this.$message.error(this.outInQueryError || '退货出库单查询中,请稍后重试');
|
|
|
+ }
|
|
|
this.$refs.formRef.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
let res = await this.getTableValue();
|