From d088628a4b421e7e0a8363b8b75529d8b2ecfe89 Mon Sep 17 00:00:00 2001 From: lyh <liuyuanheng@xalxzn.com> Date: 星期一, 24 二月 2025 10:07:14 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/flowable/components/ActCancelBtn.vue | 74 +++++++++++++++++++++++++++++++++++++ 1 files changed, 74 insertions(+), 0 deletions(-) diff --git a/src/views/flowable/components/ActCancelBtn.vue b/src/views/flowable/components/ActCancelBtn.vue new file mode 100644 index 0000000..02af66f --- /dev/null +++ b/src/views/flowable/components/ActCancelBtn.vue @@ -0,0 +1,74 @@ +<style lang="less"> +</style> +<template> + <span> + <a-button :type="btnType" @click="cancel()" >{{text}}</a-button> + <a-modal title="纭鎾ゅ洖" v-model="modalCancelVisible" :mask-closable="false" :width="500"> + <a-form ref="delForm" v-model="cancelForm" :label-width="70" v-if="modalCancelVisible"> + <a-form-item label="鎾ゅ洖鍘熷洜" prop="reason"> + <a-input type="textarea" v-model="cancelForm.reason" :rows="4" /> + </a-form-item> + </a-form> + <div slot="footer"> + <a-button type="text" @click="modalCancelVisible = false">鍙栨秷</a-button> + <a-button type="primary" :disabled="submitLoading" @click="handelSubmitCancel">鎻愪氦</a-button> + </div> + </a-modal> + </span> +</template> + +<script> +import {deleteByDataId} from "@views/flowable/api/process"; + +export default { + name: 'ActCancelBtn', + components: {}, + props: { + btnType: { type: String, default: 'link', required: false }, + /**/ + dataId: { + type: String, + default: '', + required: true + }, + text: { + type: String, + default: '鎾ゅ洖', + required: false + } + }, + data() { + return { + modalCancelVisible: false, + cancelForm: { + reason: '' + }, + submitLoading: false, + }; + }, + created() { + }, + watch: { + }, + methods: { + cancel() { + this.modalCancelVisible = true; + }, + handelSubmitCancel() { + this.submitLoading = true; + deleteByDataId(this.dataId, this.cancelForm.reason) + .then(res => { + if (res.success) { + this.$message.success('鎿嶄綔鎴愬姛'); + this.modalCancelVisible = false; + this.$emit('success'); + } else { + this.$message.error(res.message); + } + }) + .finally(() => (this.submitLoading = false)); + } + } + +}; +</script> -- Gitblit v1.9.3