Browse Source

抄送流程干预

hzh 7 months ago
parent
commit
ab3ab46afd

+ 14 - 0
pages/home/home.vue

@@ -63,6 +63,20 @@
 						}
 					},
 					{
+						title: '抄送我的',
+						icon: require('@/static/images/workflow/todo.png'),
+						options: {
+							type: 'cc'
+						}
+					},
+					{
+						title: '流程干预',
+						icon: require('@/static/images/workflow/todo.png'),
+						options: {
+							type: 'manager'
+						}
+					},
+					{
 						title: '请假申请',
 						forbidClick: true,
 						icon: require('@/static/images/menu/leave.png')

+ 1 - 1
pages/workflowTask/approveCenter/approveList.js

@@ -50,7 +50,7 @@ export default {
 	  searchKeyWord: {
 	    handler: function (val) {
 		  this.list = []
-	      this.queryParam['name'] = val
+	      this.queryParam['processDefinitionName'] = val
 		  this.handlePullDownRefresh()
 	    }
 	  }

+ 74 - 0
pages/workflowTask/approveCenter/ccList.vue

@@ -0,0 +1,74 @@
+<template>
+	<scroll-view :style="{height: `calc(${approveListHeight}px - 20rpx)`}" class="di-scroll" scroll-y @scrolltolower="handleOnreachBottom" :refresher-triggered="triggered"
+		refresher-enabled @refresherrefresh="handlePullDownRefresh">
+		<view class="di-scroll-list">
+			<!-- 右滑 -->
+			<u-swipe-action
+				style="margin-bottom: 20rpx;border-radius: 10rpx;overflow: hidden;"
+				v-for="(item, index) in list"
+				:show="activeIndex === item[primaryKey]"
+				:key="index" 
+				:index='item.id'
+				@content-click="(id) => handleClickContext(id, item)">
+				<!-- 				@content-click="(id) => handle2ProcessTask(item.id, item.procInstId, 'cc', item.procDefId,false)" -->
+				<di-descriptions :title="item.processInstanceName" label-col="3" value-col="9" :border-bottom="true" >
+					<template slot="right" v-if="categoryMap[item.category]">
+						<u-tag size="mini" :text="categoryMap[item.category].label" :type="categoryMap[item.category].type" mode="light" />
+					</template>
+					<di-descriptions-item label="流程名称" :value="item.processDefinitionName" :ellipsis="true"/>
+					<di-descriptions-item label="节点名称" :value="item.name" :ellipsis="true"/>
+					<di-descriptions-item label="开始时间" :value="item.createTime" :ellipsis="true"/>
+	<!-- 				<di-descriptions-item label="办结时间" :value="item.endTime" :ellipsis="true"/> -->
+				</di-descriptions>
+			</u-swipe-action>
+		</view>
+		<u-loadmore v-if="!triggered" :status="status" :loadText='loadText' margin-top="24" margin-bottom="20" />
+	</scroll-view>
+</template>
+
+<script>
+	import approveList from './approveList'
+	export default {
+		mixins: [approveList],
+		data() {
+			return {
+				baseApi: '/workflow',
+				listApi: 'task/runTaskList',
+				customQueryParam: {
+				    category: 'todo',
+				    taskCategory: 'cc',
+					// findByCurrentUserId: true,
+					// orderBy: 'startTime:DESC'
+				},
+				categoryMap: {
+				  todo: {
+				    label: '待办',
+				    type: 'primary'
+				  },
+				  hold: {
+				    label: '暂存',
+				    type: 'warning'
+				  },
+				  cc: {
+				    label: '抄送',
+				    type: 'success'
+				  }
+				}
+			}
+		},
+		methods: {
+			async handleClickContext (id, item) {
+			  /* if (!item.assignee) {
+			    await this.claim(item.id)
+			  } */
+			  this.handle2ProcessTask(id, item.procInstId, item.category, item.procDefId, true)
+			},
+		}
+	}
+</script>
+
+<style>
+.di-scroll-list {
+	background: none;
+}
+</style>

+ 8 - 1
pages/workflowTask/approveCenter/index.vue

@@ -23,6 +23,8 @@
 		<view class="approve-list">
 			<todo-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" v-if="type === 'todo'"/>
 			<done-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" v-else-if="type === 'done'"/>
+			<cc-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" v-else-if="type === 'cc'"/>
+			<manager-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" v-else-if="type === 'manager'"/>
 			<launch-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" v-else/>
 		</view>
 	</view>
@@ -33,11 +35,16 @@
 	import doneList from './doneList'
 	import launchList from './launchList'
 	import todoList from './todoList'
+	import ccList from './ccList'
+	import managerList from './managerList'
+	
 	export default {
 		components: {
 				todoList,
 				launchList,
-				doneList
+				doneList,
+				ccList,
+				managerList,
 		},
 		data() {
 			return {

+ 81 - 0
pages/workflowTask/approveCenter/managerList.vue

@@ -0,0 +1,81 @@
+<template>
+	<scroll-view :style="{height: `calc(${approveListHeight}px - 20rpx)`}" class="di-scroll" scroll-y @scrolltolower="handleOnreachBottom" :refresher-triggered="triggered"
+		refresher-enabled @refresherrefresh="handlePullDownRefresh">
+		<view class="di-scroll-list">
+			<!-- 右滑 -->
+			<u-swipe-action
+				style="margin-bottom: 20rpx;border-radius: 10rpx;overflow: hidden;"
+				v-for="(item, index) in list"
+				:show="activeIndex === item[primaryKey]"
+				:key="index" 
+				:index='item.id'
+				@content-click="(id) => handleClickContext(id, item)">
+				<!-- 				@content-click="(id) => handle2ProcessTask(item.id, item.procInstId, 'cc', item.procDefId,false)" -->
+				<di-descriptions :title="item.processInstanceName" label-col="3" value-col="9" :border-bottom="true" >
+					<!-- <template slot="right" v-if="categoryMap[item.category]">
+						<u-tag size="mini" :text="categoryMap[item.category].label" :type="categoryMap[item.category].type" mode="light" />
+					</template> -->
+					<di-descriptions-item label="流程名称" :value="item.processDefinitionName" :ellipsis="true"/>
+					<di-descriptions-item label="节点名称" :value="item.name" :ellipsis="true"/>
+					<di-descriptions-item label="开始时间" :value="item.createTime" :ellipsis="true"/>
+	<!-- 				<di-descriptions-item label="办结时间" :value="item.endTime" :ellipsis="true"/> -->
+				</di-descriptions>
+			</u-swipe-action>
+		</view>
+		<u-loadmore v-if="!triggered" :status="status" :loadText='loadText' margin-top="24" margin-bottom="20" />
+	</scroll-view>
+</template>
+
+<script>
+	import approveList from './approveList'
+	
+	export default {
+		mixins: [approveList],
+		data() {
+			return {
+				baseApi: '/workflow',
+				listApi: 'task/runTaskList',
+				customQueryParam: {
+				    // category: 'todo',
+				    // taskCategory: 'cc',
+					manager: true,
+					// findByCurrentUserId: true,
+					// orderBy: 'startTime:DESC'
+				},
+				categoryMap: {
+				  todo: {
+				    label: '待办',
+				    type: 'primary'
+				  },
+				  hold: {
+				    label: '暂存',
+				    type: 'warning'
+				  },
+				  cc: {
+				    label: '抄送',
+				    type: 'success'
+				  }
+				}
+			}
+		},
+		methods: {
+			async handleClickContext (id, item) {
+			  /* if (!item.assignee) {
+			    await this.claim(item.id)
+			  } */
+			  this.handle2ProcessTask(id, item.procInstId, item.category, item.procDefId, true)
+			},
+			handle2ProcessTask(id, instId, category, definitionId, allowDeal) {
+				uni.navigateTo({
+					url:`/pages/workflowTask/webviewPages/dealTask?id=${id}&definitionId=${definitionId}&instId=${instId}&category=${category}&allowDeal=${allowDeal}&withManager=true`
+				})
+			},
+		}
+	}
+</script>
+
+<style>
+.di-scroll-list {
+	background: none;
+}
+</style>

+ 2 - 1
pages/workflowTask/approveCenter/todoList.vue

@@ -32,7 +32,8 @@
 				baseApi: '/workflow',
 				listApi: 'task/runTaskList',
 				customQueryParam: {
-				    category: 'todo'
+				    category: 'todo',
+					taskCategory: 'todo',
 				},
 				categoryMap: {
 				  todo: {

+ 2 - 0
pages/workflowTask/index.vue

@@ -23,6 +23,8 @@
 					myLaunch: '我发起的',
 					todo: '我的待办',
 					done: '我的已办',
+					cc: '抄送我的',
+					manager: '流程干预',
 				},
 				diStatusBarHeight: 0
 			};

+ 18 - 1
pages/workflowTask/webviewPages/dealTask.vue

@@ -1,9 +1,15 @@
 <template>
-	<web-view :src="`${webviewServer}/mobile/dealTask?definitionId=${definitionId}&category=${category}&taskId=${taskId}&withDealTask=${withDealTask}&processInstanceId=${processInstanceId}&fromMobile=true&authtoken=${authtoken}`"></web-view>
+	<web-view v-if="url" :src="url"></web-view>
 </template>
 
 <script>
 	import webview from './webview'
+	
+	function isNull(data) {
+	  let str = `${data}`
+	  return str == 'null' || str == 'undefined' || str == '';
+	}
+	
 	export default {
 		mixins: [webview],
 		data() {
@@ -13,14 +19,25 @@
 				taskId: '',
 				category: '',
 				withDealTask: '',
+				withManager: '',
+				
+				url: '',
 			};
 		},
 		onLoad(options) {
+			
 			this.processInstanceId = options.instId
 			this.definitionId = options.definitionId
 			this.taskId = options.id
 			this.category = options.category
 			this.withDealTask = options.allowDeal
+			this.withManager = options.withManager
+			
+			let url = `${this.webviewServer}/mobile/dealTask?definitionId=${this.definitionId}&category=${this.category}&taskId=${this.taskId}&withDealTask=${this.withDealTask}&processInstanceId=${this.processInstanceId}&fromMobile=true&authtoken=${this.authtoken}`
+			if(!isNull(this.withManager)) {
+				url+=`&withManager=${this.withManager}`
+			}
+			this.url = url
 		}
 	}
 </script>

+ 1 - 1
pages/workflowTask/webviewPages/webview.js

@@ -1,6 +1,6 @@
 let server_url = window.location.host
 if(process.env.NODE_ENV === 'development'){
-    server_url = 'tq.5000v.com:8025'//'tq.5000v.com:8025'
+    server_url = 'tq.5000v.com:8035'//'tq.5000v.com:8025'
 }
 export default {
 	data() {

+ 1 - 1
utils/constant.js

@@ -10,7 +10,7 @@ const ENV = 'dev'
 const BASE_URL = '/wf-api'
 let server_url = window.location.host
 if(process.env.NODE_ENV === 'development'){
-    server_url = 'tq.5000v.com:8025'
+    server_url = 'tq.5000v.com:8035'
 }
 
 // 后端多环境配置