feat:审批中心前端优化

This commit is contained in:
weifashi 2023-09-13 22:00:49 +08:00
parent 60f5341a9a
commit ae00f49b30

View File

@ -177,10 +177,10 @@
<!--审批操作--> <!--审批操作-->
<div class="approve-operation"> <div class="approve-operation">
<Button type="success" v-if="isShowAgreeBtn" @click="approve(1)">{{$L('同意')}}</Button> <Button type="success" v-if="isShowAgreeBtn" :loading="loadIng > 0" @click="approve(1)">{{$L('同意')}}</Button>
<Button type="error" v-if="isShowAgreeBtn" @click="approve(2)">{{$L('拒绝')}}</Button> <Button type="error" v-if="isShowAgreeBtn" :loading="loadIng > 0" @click="approve(2)">{{$L('拒绝')}}</Button>
<Button type="warning" v-if="isShowWarningBtn" @click="revocation">{{$L('撤销')}}</Button> <Button type="warning" v-if="isShowWarningBtn" :loading="loadIng > 0" @click="revocation">{{$L('撤销')}}</Button>
<Button @click="comment" type="success" ghost>+{{$L('添加评论')}}</Button> <Button type="success" @click="comment" ghost>+{{$L('添加评论')}}</Button>
</div> </div>
<!--加载中--> <!--加载中-->
@ -359,24 +359,26 @@ export default {
if (type != 1 && !desc) { if (type != 1 && !desc) {
return `请输入审批意见` return `请输入审批意见`
} }
this.$store.dispatch("call", { return new Promise((resolve, reject) => {
url: 'approve/task/complete', this.$store.dispatch("call", {
data: { url: 'approve/task/complete',
task_id: this.datas.task_id, data: {
pass: type == 1, task_id: this.datas.task_id,
comment: desc, pass: type == 1,
} comment: desc,
}).then(({msg}) => { }
$A.messageSuccess(msg); }).then(({msg}) => {
if (this.$route.name == 'manage-approve-details' || this.$route.name == 'manage-messenger') { $A.messageSuccess(msg);
this.getInfo() if (this.$route.name == 'manage-approve-details' || this.$route.name == 'manage-messenger') {
} else { this.getInfo()
this.$emit('approve') } else {
} this.$emit('approve')
}).catch(({msg}) => { }
$A.modalError(msg); resolve()
}); }).catch(({msg}) => {
return false reject(msg)
});
})
} }
}); });
}, },
@ -403,10 +405,8 @@ export default {
this.$emit('revocation') this.$emit('revocation')
} }
}).catch(({msg}) => { }).catch(({msg}) => {
$A.modalError(msg); reject(msg);
resolve();
}); });
return false
}) })
}, },
}); });