Browse Source

优化我的申请

hubin 1 year ago
parent
commit
edcdebfac4
1 changed files with 59 additions and 5 deletions
  1. 59 5
      src/views/approve/myApplication/index.vue

+ 59 - 5
src/views/approve/myApplication/index.vue

@@ -17,13 +17,22 @@
 					<el-button type="primary">操作我申请的</el-button>
 				</template>
 
+				<template #currentNodeSlot="scope">
+					<div v-if="scope.row.currentNode === 'complete'">-</div>
+					<div v-else>{{ scope.row.currentNode }}</div>
+				</template>
+
 				<template #instanceStateSlot="scope">
 					<el-tag v-if="scope.row.instanceState === 0" size="small" effect="plain">审批中</el-tag>
 					<el-tag v-if="scope.row.instanceState === 1" size="small" type="info" effect="plain">审批通过</el-tag>
 					<el-tag v-if="scope.row.instanceState === 2" size="small" type="warning" effect="plain">审批拒绝</el-tag>
-					<el-tag v-if="scope.row.instanceState === 2" size="small" type="warning" effect="plain">撤销审批</el-tag>
-					<el-tag v-if="scope.row.instanceState === 2" size="small" type="warning" effect="plain">超时结束</el-tag>
-					<el-tag v-if="scope.row.instanceState === 2" size="small" type="warning" effect="plain">强制终止</el-tag>
+					<el-tag v-if="scope.row.instanceState === 3" size="small" type="warning" effect="plain">撤销审批</el-tag>
+					<el-tag v-if="scope.row.instanceState === 4" size="small" type="warning" effect="plain">超时结束</el-tag>
+					<el-tag v-if="scope.row.instanceState === 5" size="small" type="warning" effect="plain">强制终止</el-tag>
+				</template>
+
+				<template #durationSlot="scope">
+					<div>{{ formatTime(scope.row.duration) }}</div>
 				</template>
 
 				<template #actionSlot="scope">
@@ -66,6 +75,25 @@ const forms = ref([
 	}
 ])
 
+function formatTime(milliseconds: any) {
+	let timeString = ''
+	if (milliseconds) {
+		let hours = Math.floor(milliseconds / 3600000)
+		let minutes = Math.floor((milliseconds % 3600000) / 60000)
+		let seconds = Math.floor((milliseconds % 60000) / 1000)
+		if (hours > 0) {
+			timeString += hours + '小时 '
+		}
+		if (minutes > 0) {
+			timeString += minutes + '分钟 '
+		}
+		if (seconds > 0) {
+			timeString += seconds + '秒'
+		}
+	}
+	return timeString
+}
+
 // table列表数据请求
 const queryList = async () => {
 	const { options, searchParams } = tableOpts
@@ -91,6 +119,14 @@ const columns = [
 		label: '流程名称',
 		minWidth: 80
 	},
+	{
+		prop: 'currentNode',
+		label: '当前所在节点',
+		minWidth: 80,
+		slots: {
+			default: 'currentNodeSlot'
+		}
+	},
 	{
 		prop: 'instanceState',
 		label: '流程状态',
@@ -101,12 +137,30 @@ const columns = [
 	},
 	{
 		prop: 'createBy',
-		label: '发人',
+		label: '发人',
 		minWidth: 100
 	},
 	{
 		prop: 'createTime',
-		label: '发布时间',
+		label: '发起时间',
+		minWidth: 126
+	},
+	{
+		prop: 'endTime',
+		label: '结束时间',
+		minWidth: 126
+	},
+	{
+		prop: 'duration',
+		label: '处理耗时',
+		minWidth: 100,
+		slots: {
+			default: 'durationSlot'
+		}
+	},
+	{
+		prop: 'expireTime',
+		label: '期望完成时间',
 		minWidth: 126
 	},
 	{