|
@@ -26,10 +26,8 @@
|
|
|
<div class="area-divider"></div>
|
|
|
|
|
|
<!-- 表单 -->
|
|
|
- <el-descriptions :column="1" size="default">
|
|
|
- <el-descriptions-item label="申请人">kooriookami</el-descriptions-item>
|
|
|
- <el-descriptions-item label="日期">18100000000</el-descriptions-item>
|
|
|
- <el-descriptions-item label="员工">Suzhou</el-descriptions-item>
|
|
|
+ <el-descriptions v-loading="descItemsData.loading" :column="1" size="default">
|
|
|
+ <el-descriptions-item v-for="(v, i) of descItemsData.list" :key="i" :label="v.showLabel">{{ v.showValue }}</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
|
|
|
<div class="area-divider"></div>
|
|
@@ -116,7 +114,7 @@ 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 } from '@/api/flow/processTask'
|
|
|
+import { processTaskListHisTaskApi, processTaskApprovalInfo } from '@/api/flow/processTask'
|
|
|
import { formatTimestamp } from '@/utils/datetime'
|
|
|
import ReviewDialog from '../components/reviewDialog'
|
|
|
import AddSignDialog from '../components/addSignDialog'
|
|
@@ -130,9 +128,9 @@ const props = defineProps({
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
},
|
|
|
- messageId: {
|
|
|
- type: String,
|
|
|
- default: undefined
|
|
|
+ activeItem: {
|
|
|
+ type: Object,
|
|
|
+ default: () => ({})
|
|
|
}
|
|
|
})
|
|
|
const emit = defineEmits(['update:modelValue', 'successFn'])
|
|
@@ -145,6 +143,11 @@ const deliverToReviewVisible = ref(false)
|
|
|
const loseSignVisible = ref(false)
|
|
|
const rollbackVisible = ref(false)
|
|
|
const activeData = ref([])
|
|
|
+const descItemsData = ref({
|
|
|
+ origin: undefined,
|
|
|
+ list: [],
|
|
|
+ loading: false
|
|
|
+})
|
|
|
|
|
|
// 关闭按钮
|
|
|
const closeDrawer = () => {
|
|
@@ -190,7 +193,42 @@ const openComment = type => {
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
- processTaskListHisTaskApi(props.messageId).then(data => {
|
|
|
+ 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
|
|
|
})
|
|
|
})
|