|
@@ -2,6 +2,12 @@
|
|
|
<!-- 同意 拒绝 弹窗 同意/拒绝审批 -->
|
|
|
<el-dialog v-model="operaVisibleDialog" class="le-dialog" :title="currentTip + '审批'" width="700" destroy-on-close :close-on-click-modal="false">
|
|
|
<el-form ref="formRef" v-loading="uploadLoading" label-position="top" element-loading-text="图片上传中..." :model="form" label-width="80px">
|
|
|
+ <el-form-item label="回退节点" prop="nodeKey" :rules="[{ required: true, message: '请选择回退节点' }]" v-if="props.rejectStrategy === 3">
|
|
|
+ <el-select v-model="form.nodeKey" placeholder="请选择回退节点">
|
|
|
+ <el-option v-for="item in rollbackOptions" :key="item.nodeKey" :label="item.nodeName" :value="item.nodeKey" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="审批意见" prop="content" :rules="[{ required: true, message: '审批意见不能为空' }]">
|
|
|
<el-input v-model="form.content" type="textarea" placeholder="请输入内容" maxlength="64" show-word-limit> </el-input>
|
|
|
</el-form-item>
|
|
@@ -31,11 +37,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { computed, reactive, ref } from 'vue'
|
|
|
+import { computed, onMounted, reactive, ref, watch } from 'vue'
|
|
|
import FileUpload from '@/components/FileUpload.vue'
|
|
|
-import { processConsentTaskApi, processRejectionTaskApi } from '@/api/flow/processTask'
|
|
|
+import { processConsentTaskApi, processPreviousNodeNameApi, processRejectionTaskApi } from '@/api/flow/processTask'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
-import {debounce} from "lodash-es";
|
|
|
+import { debounce } from 'lodash-es'
|
|
|
|
|
|
const props = defineProps({
|
|
|
// 弹窗是否显示
|
|
@@ -57,16 +63,22 @@ const props = defineProps({
|
|
|
formData: {
|
|
|
type: Object,
|
|
|
default: () => ({})
|
|
|
+ },
|
|
|
+ // 拒绝策略
|
|
|
+ rejectStrategy: {
|
|
|
+ type: Number || undefined,
|
|
|
+ default: undefined
|
|
|
}
|
|
|
})
|
|
|
const btnDisabled = ref(false)
|
|
|
const form = reactive({
|
|
|
+ nodeKey: undefined,
|
|
|
content: ''
|
|
|
// attachment: []
|
|
|
})
|
|
|
const formRef = ref(null)
|
|
|
const uploadLoading = ref(false)
|
|
|
-
|
|
|
+const rollbackOptions = ref([])
|
|
|
const $myEmit = defineEmits(['update:modelValue', 'successCb'])
|
|
|
|
|
|
const submitForm = debounce(() => {
|
|
@@ -121,6 +133,21 @@ const currentTip = computed(() => {
|
|
|
})
|
|
|
|
|
|
const clearValidate = () => {}
|
|
|
+
|
|
|
+// 回退节点列表
|
|
|
+const getProcessPreviousNodeNameApi = async () => {
|
|
|
+ const res = await processPreviousNodeNameApi(props.taskId)
|
|
|
+ rollbackOptions.value = res || []
|
|
|
+}
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => props.rejectStrategy,
|
|
|
+ item => {
|
|
|
+ if (+item === 3) {
|
|
|
+ getProcessPreviousNodeNameApi()
|
|
|
+ }
|
|
|
+ }
|
|
|
+)
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|