Browse Source

需求-工作流列表调整

dufeng 5 months ago
parent
commit
e11698ac4e

+ 42 - 3
pages/workflowTask/approveCenter/approveList.js

@@ -50,10 +50,36 @@ export default {
 	  searchKeyWord: {
 	    handler: function (val) {
 		  this.list = []
-	      this.queryParam['processDefinitionName'] = val
+          console.log(val,'搜索关键字', this.type)
+          if(this.type === 'myLaunch'){
+            this.queryParam['processInstanceId'] = val||undefined
+          }else{
+            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: {
@@ -61,6 +87,19 @@ export default {
 		},
 		searchKeyWord: {
 			type: String
-		}
+		},
+        type: {
+            type: String,
+            required: true
+        },
+        applyTime: {
+			type: Array
+		},
+        processDefinitionName: {
+			type: String
+		},
+        processStatus: {
+			type: Number
+		},
 	}
 }

+ 6 - 6
pages/workflowTask/approveCenter/ccList.vue

@@ -11,13 +11,13 @@
 				: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" >
+				<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.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.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>
@@ -38,8 +38,8 @@
 		mixins: [approveList],
 		data() {
 			return {
-				baseApi: '/workflow',
-				listApi: 'task/runTaskList',
+				baseApi: '/cusFlowTask',
+				listApi: 'myCcList',
 				customQueryParam: {
 				    category: 'todo',
 				    taskCategory: 'cc',

+ 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,

+ 72 - 9
pages/workflowTask/approveCenter/index.vue

@@ -2,7 +2,7 @@
 	<view class="approve-container">
 		<view class="approve-search">
 			<u-search
-			placeholder="查询流程"
+			:placeholder="type==='myLaunch'?'单号模糊搜索':'请输入关键字搜索'"
 			v-model="keyword"
 			bg-color="#fff"
 			margin="16rpx 24rpx"
@@ -19,18 +19,29 @@
 			: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" 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/>
+			<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'"/>
+			<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'
@@ -53,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() {
@@ -71,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 = ''
@@ -113,4 +169,11 @@
 			background-color: #F2F2F2 !important;
 		}
 	}
+    .approve-search-options{
+        ::v-deep {
+            .u-cell{
+                padding: 6px 16px;
+            }
+        }
+    }
 </style>

+ 13 - 5
pages/workflowTask/approveCenter/launchList.vue

@@ -10,12 +10,19 @@
 				:key="index" 
 				:index='item.id'    
 				@content-click="(id) => handle2ProcessTask('', item.id, item.category, item.procDefId, false)">
-				<di-descriptions :title="item.name" label-col="3" value-col="9" :border-bottom="true" >
+				<di-descriptions :title="item.processDefinitionName" label-col="3" value-col="9" :border-bottom="true" >
 					<u-tag slot="right" size="mini" :text="item.statusLabel" :type="statusColorMap[item.statusLabel]" mode="light" />
-					<di-descriptions-item label="流程名称" :value="item.processDefinitionName" :ellipsis="true"/>
+					<!-- <di-descriptions-item label="流程名称" :value="item.processDefinitionName" :ellipsis="true"/>
 					<di-descriptions-item label="开始时间" :value="item.startTime" :ellipsis="true"/>
 					<di-descriptions-item label="结束时间" :value="item.endTime" :ellipsis="true"/>
-					<di-descriptions-item label="流程耗时" :value="item.durationLabel" :ellipsis="true"/>
+					<di-descriptions-item label="流程耗时" :value="item.durationLabel" :ellipsis="true"/> -->
+                    <!-- 后端说单号是id 查询是procInstId -->
+					<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;">
                         <u-col :span="2" v-if="item.endTime == null">
                           <u-button type="primary" plain size="mini"  @click="handle2Click(item.id, 'cancel')">撤销</u-button>
@@ -36,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',

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

@@ -11,13 +11,14 @@
 				: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" >
+				<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.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.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>
@@ -33,8 +34,8 @@
 		mixins: [approveList],
 		data() {
 			return {
-				baseApi: '/workflow',
-				listApi: 'task/runTaskList',
+				baseApi: '/cusFlowTask',
+				listApi: 'myMeddleList',
 				customQueryParam: {
 				    // category: 'todo',
 				    // taskCategory: 'cc',

+ 9 - 5
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,8 +33,8 @@
 		mixins: [approveList],
 		data() {
 			return {
-				baseApi: '/workflow',
-				listApi: 'task/runTaskList',
+				baseApi: '/cusFlowTask',
+				listApi: 'myTodoList',
 				customQueryParam: {
 				    category: 'todo',
 					taskCategory: 'todo',