Browse Source

Merge branch 'master' into guotouhami

dufeng 4 months ago
parent
commit
7e7d7d57d5

+ 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')

+ 35 - 6
pages/workflowTask/approveCenter/approveList.js

@@ -50,16 +50,36 @@ export default {
 	  searchKeyWord: {
 	    handler: function (val) {
 		  this.list = []
-          console.log('搜索关键字', this.type)
+          console.log(val,'搜索关键字', this.type)
           if(this.type === 'myLaunch'){
-            this.queryParam['procInstId'] = val||undefined
+            this.queryParam['processInstanceId'] = val||undefined
           }else{
-            this.queryParam['name'] = val
+            this.queryParam['queryName'] = val
           }
-	      
 		  this.handlePullDownRefresh()
 	    }
-	  }
+	  },
+      applyTime:{
+        handler: function (val) {
+            console.log('改变',val)
+            this.queryParam['applyTime'] = val||undefined
+            this.handlePullDownRefresh()
+        }
+      },
+      processDefinitionName:{
+        handler: function (val) {
+            console.log('改变',val)
+            this.queryParam['processDefinitionName'] = val||undefined
+            this.handlePullDownRefresh()
+        }
+      },
+      processStatus:{
+        handler: function (val) {
+            console.log('改变',val)
+            this.queryParam['processStatus'] = val||undefined
+            this.handlePullDownRefresh()
+        }
+      }
 	},
 	props: {
 		approveListHeight: {
@@ -71,6 +91,15 @@ export default {
         type: {
             type: String,
             required: true
-        }
+        },
+        applyTime: {
+			type: Array
+		},
+        processDefinitionName: {
+			type: String
+		},
+        processStatus: {
+			type: Number
+		},
 	}
 }

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

@@ -0,0 +1,94 @@
+<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.processDefinitionName" 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.processInstanceId" :ellipsis="true"/>
+                    <di-descriptions-item label="申请人" :value="item.applyUserName" :ellipsis="true"/>
+                    <di-descriptions-item label="申请时间" :value="item.applyTime" :ellipsis="true"/>
+					<u-row style="justify-content: flex-end;">
+					    <u-col :span="2">
+					      <u-button type="primary" plain size="mini"  @click="handleRead(item.id, 'read')">已读</u-button>
+					     </u-col>
+					   
+					</u-row>
+	<!-- 				<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: '/cusFlowTask',
+				listApi: 'myCcList',
+				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)
+			},
+			async handleRead(taskId,taskOperate) {
+				let {code,msg} = await this.$dibootApi.put('/workflow/task/taskOperate', {
+				  taskId,
+				  taskOperate
+				})
+				if (code == 0) {
+					uni.showToast({
+					    title: msg,
+					    icon: 'none'
+					})
+					this.page.pageIndex = 1
+					this.getList(true)
+				}
+			},
+		}
+	}
+</script>
+
+<style>
+.di-scroll-list {
+	background: none;
+}
+</style>

+ 8 - 6
pages/workflowTask/approveCenter/doneList.vue

@@ -10,10 +10,12 @@
 				:key="index" 
 				:index='item.id'
 				@content-click="(id) => handle2ProcessTask(id, item.procInstId, '', item.procDefId,false)">
-				<di-descriptions :title="item.processInstanceName" label-col="3" value-col="9" :border-bottom="true" >
-					<di-descriptions-item label="节点名称" :value="item.name" :ellipsis="true"/>
-					<di-descriptions-item label="开始时间" :value="item.startTime" :ellipsis="true"/>
-					<di-descriptions-item label="办结时间" :value="item.endTime" :ellipsis="true"/>
+				<di-descriptions :title="item.processDefinitionName" label-col="3" value-col="9" :border-bottom="true" >
+					<di-descriptions-item label="流程单号" :value="item.processInstanceId" :ellipsis="true"/>
+                    <di-descriptions-item label="申请人" :value="item.applyUserName" :ellipsis="true"/>
+                    <di-descriptions-item label="申请时间" :value="item.applyTime" :ellipsis="true"/>
+                    <di-descriptions-item label="已办节点" :value="item.name" :ellipsis="true"/>
+                    <di-descriptions-item label="办结时间" :value="item.endTime" :ellipsis="true"/>
 				</di-descriptions>
 			</u-swipe-action>
 		</view>
@@ -27,8 +29,8 @@
 		mixins: [approveList],
 		data() {
 			return {
-				baseApi: '/workflow',
-				listApi: 'task/taskList',
+				baseApi: '/cusFlowTask',
+				listApi: 'myDoneList',
 				customQueryParam: {
 				    taskCategory: 'done',
 					findByCurrentUserId: true,

+ 76 - 6
pages/workflowTask/approveCenter/index.vue

@@ -2,7 +2,7 @@
 	<view class="approve-container">
 		<view class="approve-search">
 			<u-search
-			:placeholder="type==='myLaunch'?'单号模糊查询':'请输入关键字搜索'"
+			:placeholder="type==='myLaunch'?'单号模糊搜索':'请输入关键字搜索'"
 			v-model="keyword"
 			bg-color="#fff"
 			margin="16rpx 24rpx"
@@ -19,25 +19,43 @@
 			:show-action="false"
 			input-align="center"
 			/>
-		</view>
+            <!-- 添加条件 -->
+            <u-cell-group class="approve-search-options" v-if="type==='myLaunch'">
+                <u-cell-item title="申请时间" @click="calendarShow=true" :value="applyTimeName"></u-cell-item>
+                <u-cell-item title="所属流程" @click="processInstanceShow=true" :value="processDefinitionName"></u-cell-item>
+                <u-cell-item title="流程状态" @click="processStatusShow=true" :value="processStatusName"></u-cell-item>
+            </u-cell-group>
+            <u-calendar v-model="calendarShow" mode="range" @change="calendarChange"></u-calendar>
+            <u-select v-model="processInstanceShow" :list="processInstancelist" @confirm="processInstanceConfirm"></u-select>
+            <u-select v-model="processStatusShow" :list="processStatusList" @confirm="processStatusConfirm"></u-select>
+            <!-- <u-button type="primary" size="mini" style="width: 100%;margin: 2px;">重置</u-button> -->
+        </view>
 		<view class="approve-list">
 			<todo-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" :type="type" v-if="type === 'todo'"/>
 			<done-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" :type="type" v-else-if="type === 'done'"/>
-			<launch-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" :type="type" v-else/>
+			<cc-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" :type="type" v-else-if="type === 'cc'"/>
+			<manager-list :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" :type="type" v-else-if="type === 'manager'"/>
+			<launch-list :processStatus="processStatus" :processDefinitionName="processDefinitionName" :applyTime="applyTime" :approve-list-height="approveListHeight" :search-key-word="searchKeyWord" :type="type" v-else/>
 		</view>
 	</view>
 </template>
 
 <script>
+    import {dibootApi} from '@/utils/dibootApi'
 	import variables from '@/styles/variables.scss'
 	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 {
@@ -46,11 +64,42 @@
 				current: 0,
 				variables,
 				searchHeight: 0,
-				approveContainerHeight: 0
+				approveContainerHeight: 0,
+
+                calendarShow: false,
+                processInstanceShow:false,
+                processStatusShow:false,
+                
+                applyTime:[],//申请时间
+                applyTimeName:'',
+                processDefinitionName:'',//流程实例
+                processInstancelist:[],//流程列表
+                processStatus:'',//流程状态
+                processStatusName:'',//流程状态名称
+                // 流程状态:1.进行中、2.已完成、3.已撤销、4.不通过
+                processStatusList:[
+                    { label: '全部', value: undefined },
+                    { label: '进行中', value: 1 },
+                    { label: '已完成', value: 2 },
+                    { label: '已撤销', value: 3 },
+                    { label: '不通过', value: 4 },
+                ]
 			};
 		},
-		created() {
+        created() {
 			this.computedHeight()
+            //获取列表
+                  dibootApi.get('/workflow/processDefinition/list', {
+                      noPage: true
+                    }).then((result) => {
+                        this.processInstancelist=result.data.map(e=>{
+                            return {
+                                label:e.name,
+                                value:e.name
+                            }
+                        })
+                        this.processInstancelist.unshift({ label: '全部', value: undefined })
+                    })
 		},
 		computed: {
 			approveListHeight() {
@@ -64,6 +113,20 @@
 			}
 		},
 		methods: {
+            processStatusConfirm(e){
+                console.log('e',e)
+                this.processStatus=e[0].value
+                this.processStatusName=e[0].label
+            },
+            processInstanceConfirm(e){
+                console.log('e',e)
+                this.processDefinitionName=e[0].value
+            },
+            calendarChange(e){
+                console.log(e);
+                this.applyTime=[e.startDate,e.endDate]
+                this.applyTimeName=e.startDate+'至'+e.endDate
+            },
 			handleChange(index) {
 				this.current = index
 				this.keyword = ''
@@ -106,4 +169,11 @@
 			background-color: #F2F2F2 !important;
 		}
 	}
+    .approve-search-options{
+        ::v-deep {
+            .u-cell{
+                padding: 6px 16px;
+            }
+        }
+    }
 </style>

+ 7 - 6
pages/workflowTask/approveCenter/launchList.vue

@@ -17,10 +17,10 @@
 					<di-descriptions-item label="结束时间" :value="item.endTime" :ellipsis="true"/>
 					<di-descriptions-item label="流程耗时" :value="item.durationLabel" :ellipsis="true"/> -->
                     <!-- 后端说单号是id 查询是procInstId -->
-					<di-descriptions-item label="流程单号" :value="item.id" :ellipsis="true"/>
-					<di-descriptions-item label="当前节点" :value="item.nodeKeyName" :ellipsis="true"/>
-					<di-descriptions-item label="申请人" :value="item.startUserName" :ellipsis="true"/>
-					<di-descriptions-item label="申请时间" :value="item.startTime" :ellipsis="true"/>
+					<di-descriptions-item label="流程单号" :value="item.processInstanceId" :ellipsis="true"/>
+					<di-descriptions-item label="当前节点" :value="item.taskDefName" :ellipsis="true"/>
+					<di-descriptions-item label="申请人" :value="item.applyUserName" :ellipsis="true"/>
+					<di-descriptions-item label="申请时间" :value="item.applyTime" :ellipsis="true"/>
 
 
                     <u-row style="justify-content: flex-end;">
@@ -43,10 +43,11 @@
 	import approveList from './approveList'
 	export default {
 		mixins: [approveList],
+        // inject: ['applyTime'],
 		data() {
 			return {
-				baseApi: '/workflow/processLaunch',
-				listApi: 'myProcessList',
+				baseApi: '/cusFlowTask',
+				listApi: 'myApplyList',
 				statusColorMap: {
 				  '已完成': 'success',
 				  '进行中': 'warning',

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

@@ -0,0 +1,82 @@
+<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.processDefinitionName" 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.processInstanceId" :ellipsis="true"/>
+                    <di-descriptions-item label="当前节点" :value="item.name" :ellipsis="true"/>
+                    <di-descriptions-item label="申请人" :value="item.applyUserName" :ellipsis="true"/>
+                    <di-descriptions-item label="申请时间" :value="item.applyTime" :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: '/cusFlowTask',
+				listApi: 'myMeddleList',
+				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>

+ 12 - 7
pages/workflowTask/approveCenter/todoList.vue

@@ -10,12 +10,16 @@
 				:key="index" 
 				:index='item.id'
 				@content-click="(id) => handleClickContext(id, item)">
-				<di-descriptions :title="item.processInstanceName" label-col="3" value-col="9" :border-bottom="true" >
+				<di-descriptions :title="item.processDefinitionName" 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.name" :ellipsis="true"/>
-					<di-descriptions-item label="开始时间" :value="item.createTime" :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.processInstanceId" :ellipsis="true"/>
+                    <di-descriptions-item label="待办节点" :value="item.name" :ellipsis="true"/>
+                    <di-descriptions-item label="申请人" :value="item.applyUserName" :ellipsis="true"/>
+                    <di-descriptions-item label="申请时间" :value="item.applyTime" :ellipsis="true"/>
 				</di-descriptions>
 			</u-swipe-action>
 		</view>
@@ -29,10 +33,11 @@
 		mixins: [approveList],
 		data() {
 			return {
-				baseApi: '/workflow',
-				listApi: 'task/runTaskList',
+				baseApi: '/cusFlowTask',
+				listApi: 'myTodoList',
 				customQueryParam: {
-				    category: 'todo'
+				    category: 'todo',
+					taskCategory: 'todo',
 				},
 				categoryMap: {
 				  todo: {
@@ -52,7 +57,7 @@
 		},
     methods: {
       async handleClickContext (id, item) {
-       /* if (!item.assignee) {
+        /* if (!item.assignee) {
           await this.claim(item.id)
         } */
         this.handle2ProcessTask(id, item.procInstId, item.category, item.procDefId, true)