|
@@ -3,7 +3,7 @@
|
|
|
<el-drawer v-model="visibleDialog" class="custom-adrawer" direction="rtl" size="900" @close="handleCancel">
|
|
|
<template #header>
|
|
|
<div class="flow-header-box">
|
|
|
- <div class="flow-no">编号:12138</div>
|
|
|
+ <div class="flow-no">编号:{{ taskId }}</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<div class="flow-detail-container">
|
|
@@ -15,12 +15,12 @@
|
|
|
<!--头部-->
|
|
|
<div class="header-box">
|
|
|
<div class="summary-info">
|
|
|
- <div class="title">名片申请</div>
|
|
|
+ <div class="title">{{ taskObj.processName }}</div>
|
|
|
<FlowStatusTag :status="0" />
|
|
|
</div>
|
|
|
<div class="initiator-info">
|
|
|
<FlowNodeAvatar id="1" />
|
|
|
- <div class="begin-time">2023-11-01 12:00:17 提交</div>
|
|
|
+ <div class="begin-time">{{ taskObj.createTime }} 提交</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="area-divider"></div>
|
|
@@ -58,8 +58,8 @@
|
|
|
<template #footer>
|
|
|
<div class="flow-actions">
|
|
|
<el-button :icon="ChatLineSquare" @click="openComment('reviewVisible')">评论</el-button>
|
|
|
- <el-button :icon="Check" type="success" @click="openComment('consentOrRefuseVisible')">同意</el-button>
|
|
|
- <el-button :icon="Close" type="danger" @click="openComment('consentOrRefuseVisible')">拒绝</el-button>
|
|
|
+ <el-button :icon="Check" type="success" @click="openComment('consentOrRefuseVisible', 'agree')">同意</el-button>
|
|
|
+ <el-button :icon="Close" type="danger" @click="openComment('consentOrRefuseVisible', 'reject')">拒绝</el-button>
|
|
|
<el-dropdown style="margin-left: 12px">
|
|
|
<el-button :icon="More">更多</el-button>
|
|
|
<template #dropdown>
|
|
@@ -88,33 +88,38 @@
|
|
|
</el-drawer>
|
|
|
|
|
|
<!-- 评论弹窗-->
|
|
|
- <review-dialog v-if="reviewVisible" v-model="reviewVisible"></review-dialog>
|
|
|
+ <review-dialog v-if="reviewVisible" v-model="reviewVisible" :task-id="taskId"></review-dialog>
|
|
|
|
|
|
<!-- 加签弹窗 -->
|
|
|
- <add-sign-dialog v-if="addSignVisible" v-model="addSignVisible"></add-sign-dialog>
|
|
|
+ <add-sign-dialog v-if="addSignVisible" v-model="addSignVisible" :task-id="taskId"></add-sign-dialog>
|
|
|
|
|
|
<!-- 同意或拒绝弹窗 -->
|
|
|
- <consent-or-refuse-dialog v-if="consentOrRefuseVisible" v-model="consentOrRefuseVisible"></consent-or-refuse-dialog>
|
|
|
+ <consent-or-refuse-dialog
|
|
|
+ v-if="consentOrRefuseVisible"
|
|
|
+ v-model="consentOrRefuseVisible"
|
|
|
+ :task-id="taskId"
|
|
|
+ :current-type="currentDialog"
|
|
|
+ ></consent-or-refuse-dialog>
|
|
|
|
|
|
<!-- 转交审批弹窗 -->
|
|
|
- <deliver-to-review-dialog v-if="deliverToReviewVisible" v-model="deliverToReviewVisible"></deliver-to-review-dialog>
|
|
|
+ <deliver-to-review-dialog v-if="deliverToReviewVisible" v-model="deliverToReviewVisible" :task-id="taskId"></deliver-to-review-dialog>
|
|
|
|
|
|
<!-- 减签弹窗 -->
|
|
|
- <lose-sign-dialog v-if="loseSignVisible" v-model="loseSignVisible"></lose-sign-dialog>
|
|
|
+ <lose-sign-dialog v-if="loseSignVisible" v-model="loseSignVisible" :task-id="taskId"></lose-sign-dialog>
|
|
|
|
|
|
<!-- 回退弹窗 -->
|
|
|
- <rollback-dialog v-if="rollbackVisible" v-model="rollbackVisible"></rollback-dialog>
|
|
|
+ <rollback-dialog v-if="rollbackVisible" v-model="rollbackVisible" :task-id="taskId"></rollback-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { computed, ref, onMounted } from 'vue'
|
|
|
+import { computed, ref, onMounted, nextTick } from 'vue'
|
|
|
import FlowStatusStamp from '@/components/Flow/FlowStatusStamp.vue'
|
|
|
import FlowStatusTag from '@/components/Flow/FlowStatusTag.vue'
|
|
|
import FlowNodeAvatar from '@/components/Flow/FlowNodeAvatar.vue'
|
|
|
import FlowTypeDot from '@/components/Flow/FlowTypeDot.vue'
|
|
|
import { ChatLineSquare, Check, Close, Switch, DArrowLeft, Plus, Minus, More } from '@element-plus/icons-vue'
|
|
|
-import { processTaskListHisTaskApi, processTaskApprovalInfo } from '@/api/flow/processTask'
|
|
|
+import { processApprovalInfoApi, processTaskApprovalInfo } from '@/api/flow/processTask'
|
|
|
import { formatTimestamp } from '@/utils/datetime'
|
|
|
import ReviewDialog from '../components/reviewDialog'
|
|
|
import AddSignDialog from '../components/addSignDialog'
|
|
@@ -128,27 +133,41 @@ const props = defineProps({
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
},
|
|
|
- activeItem: {
|
|
|
+ taskObj: {
|
|
|
type: Object,
|
|
|
default: () => ({})
|
|
|
}
|
|
|
})
|
|
|
const emit = defineEmits(['update:modelValue', 'successFn'])
|
|
|
|
|
|
-// 各种操作弹窗显示隐藏
|
|
|
+// 各种操作弹窗显示隐藏 start
|
|
|
const reviewVisible = ref(false)
|
|
|
const addSignVisible = ref(false)
|
|
|
const consentOrRefuseVisible = ref(false)
|
|
|
const deliverToReviewVisible = ref(false)
|
|
|
const loseSignVisible = ref(false)
|
|
|
const rollbackVisible = ref(false)
|
|
|
+// 各种操作弹窗显示隐藏 end
|
|
|
const activeData = ref([])
|
|
|
-const descItemsData = ref({
|
|
|
- origin: undefined,
|
|
|
- list: [],
|
|
|
- loading: false
|
|
|
+const currentDialog = ref(null)
|
|
|
+
|
|
|
+const visibleDialog = computed({
|
|
|
+ get() {
|
|
|
+ return props.modelValue
|
|
|
+ },
|
|
|
+ set(val) {
|
|
|
+ emit('update:modelValue', val)
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
+const taskId = computed(() => {
|
|
|
+ return props.taskObj.taskId || ''
|
|
|
+})
|
|
|
+const descItemsData = ref({
|
|
|
+ origin: undefined,
|
|
|
+ list: [],
|
|
|
+ loading: false
|
|
|
+})
|
|
|
// 关闭按钮
|
|
|
const closeDrawer = () => {
|
|
|
emit('successFn')
|
|
@@ -159,17 +178,8 @@ const handleCancel = () => {
|
|
|
closeDrawer()
|
|
|
}
|
|
|
|
|
|
-const visibleDialog = computed({
|
|
|
- get() {
|
|
|
- return props.modelValue
|
|
|
- },
|
|
|
- set(val) {
|
|
|
- emit('update:modelValue', val)
|
|
|
- }
|
|
|
-})
|
|
|
-
|
|
|
// 操作按钮
|
|
|
-const openComment = type => {
|
|
|
+const openComment = (type, item) => {
|
|
|
switch (type) {
|
|
|
case 'reviewVisible':
|
|
|
reviewVisible.value = !reviewVisible.value
|
|
@@ -178,6 +188,7 @@ const openComment = type => {
|
|
|
addSignVisible.value = !addSignVisible.value
|
|
|
break
|
|
|
case 'consentOrRefuseVisible':
|
|
|
+ currentDialog.value = item
|
|
|
consentOrRefuseVisible.value = !consentOrRefuseVisible.value
|
|
|
break
|
|
|
case 'deliverToReviewVisible':
|
|
@@ -192,46 +203,49 @@ const openComment = type => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-onMounted(() => {
|
|
|
- const cur = props.activeItem || {}
|
|
|
- descItemsData.value.loading = true
|
|
|
- processTaskApprovalInfo(cur.taskId)
|
|
|
- .then(data => {
|
|
|
- // console.log(data, 'data.......')
|
|
|
- descItemsData.value.origin = data
|
|
|
- try {
|
|
|
- descItemsData.value.list = JSON.parse(data.formContent).map(item => {
|
|
|
- const showLabel = item.title
|
|
|
- let showValue = item.local_value
|
|
|
- const options = item.options
|
|
|
- if (Array.isArray(options) && showValue !== undefined) {
|
|
|
- if (Array.isArray(showValue)) {
|
|
|
- showValue = showValue.reduce(val => {
|
|
|
- const cur = options.find(option => option.value === val)
|
|
|
- return cur?.label || val
|
|
|
- }, [])
|
|
|
- } else {
|
|
|
- const cur = options.find(option => option.value === showValue)
|
|
|
- showValue = cur?.label || showValue
|
|
|
- }
|
|
|
- }
|
|
|
- return {
|
|
|
- showLabel,
|
|
|
- showValue
|
|
|
- }
|
|
|
- })
|
|
|
- } catch (e) {
|
|
|
- console.error('解析 descItems 数据出现问题', e)
|
|
|
- descItemsData.value.list = []
|
|
|
- }
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- descItemsData.value.loading = false
|
|
|
- })
|
|
|
- processTaskListHisTaskApi(cur.instanceId).then(data => {
|
|
|
- activeData.value = data
|
|
|
- })
|
|
|
+nextTick(() => {
|
|
|
+ const cur = props.taskObj || {}
|
|
|
+ processApprovalInfoApi(cur.taskId).then(data => {
|
|
|
+ console.log(JSON.stringify(data))
|
|
|
+ activeData.value = data
|
|
|
+ })
|
|
|
+ // 提交的表单 数据展示
|
|
|
+ descItemsData.value.loading = true
|
|
|
+ processTaskApprovalInfo(cur.taskId)
|
|
|
+ .then(data => {
|
|
|
+ // console.log(data, 'data.......')
|
|
|
+ descItemsData.value.origin = data
|
|
|
+ try {
|
|
|
+ descItemsData.value.list = JSON.parse(data.formContent).map(item => {
|
|
|
+ const showLabel = item.title
|
|
|
+ let showValue = item.local_value
|
|
|
+ const options = item.options
|
|
|
+ if (Array.isArray(options) && showValue !== undefined) {
|
|
|
+ if (Array.isArray(showValue)) {
|
|
|
+ showValue = showValue.reduce(val => {
|
|
|
+ const cur = options.find(option => option.value === val)
|
|
|
+ return cur?.label || val
|
|
|
+ }, [])
|
|
|
+ } else {
|
|
|
+ const cur = options.find(option => option.value === showValue)
|
|
|
+ showValue = cur?.label || showValue
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ showLabel,
|
|
|
+ showValue
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } catch (e) {
|
|
|
+ console.error('解析 descItems 数据出现问题', e)
|
|
|
+ descItemsData.value.list = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ descItemsData.value.loading = false
|
|
|
+ })
|
|
|
})
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|