Browse Source

feat(process): 新增抄送流程

wangpx 7 tháng trước cách đây
mục cha
commit
ada5a45d12
3 tập tin đã thay đổi với 51 bổ sung25 xóa
  1. 25 0
      api/process.js
  2. 3 3
      components/ygoa/processList.vue
  3. 23 22
      pages/process/index.vue

+ 25 - 0
api/process.js

@@ -72,6 +72,31 @@ export function getUserProcess(params) {
 	})
 }
 
+// 获取用户抄送流程
+export function getUserCopyProcess(params) {
+	return request({
+		url: '/bpmTaskAction.do',
+		method: 'post',
+		params: {
+			task: 'mine',
+			time: Date.now(),
+			iscrypt: 1
+		},
+		isSession: true,
+		header: {
+			'Content-Type': 'application/x-www-form-urlencoded'
+		},
+		data: {
+			insName: null,
+			starttime: null,
+			endtime: null,
+			distributedUser: null,
+			p: params.page,
+			pSize: params.pageNum
+		}
+	})
+}
+
 //获取用户在办流程
 export function getUserProcessing(params) {
 	return request({

+ 3 - 3
components/ygoa/processList.vue

@@ -28,9 +28,9 @@
 										</uni-col>
 										<uni-col :xs="5" :sm="2" v-if="current !== 0">
 											<view class="process_status">
-												<uni-tag v-if="current === 1" text="审批中" type="success"></uni-tag>
-												<uni-tag v-else-if="current === 2" text="审批中" type="success"></uni-tag>
-												<uni-tag v-else-if="current === 3" text="已办结" type="primary"></uni-tag>
+												<uni-tag v-if="current === 2" text="审批中" type="success"></uni-tag>
+												<uni-tag v-else-if="current === 3" text="审批中" type="success"></uni-tag>
+												<uni-tag v-else-if="current === 4" text="已办结" type="primary"></uni-tag>
 											</view>
 										</uni-col>
 									</uni-row>

+ 23 - 22
pages/process/index.vue

@@ -69,7 +69,7 @@
 	import { reactive, ref, onMounted } from 'vue';
 	import $tab from '@/plugins/tab.js'
 	import $modal from '@/plugins/modal.js'
-	import { getUserProcess, getUserProcessed, getUserProcessing, getUserAllProcess, cancelProcessFlow, getProcessList, getProcessFormInfo } from '@/api/process';
+	import { getUserProcess, getUserProcessed, getUserProcessing, getUserAllProcess, getUserCopyProcess, cancelProcessFlow, getProcessList, getProcessFormInfo } from '@/api/process';
 	import { useUserStore } from '@/store/user';
 
 	onMounted(() => {
@@ -178,9 +178,9 @@
 	}
 
 	// 分段器选项
-	const items = reactive(['我的', '待办', '在办', '办结'])
+	const items = reactive(['我的', '抄送', '待办', '在办', '办结'])
 	// 分段器选项
-	const current = ref(1)
+	const current = ref(items.findIndex(item => item == '待办'))
 	// 子组件
 	const processListRef = ref(null)
 
@@ -196,6 +196,13 @@
 
 	// 获取待办列表数据
 	const point = ref(0)
+	const requestMap = [
+		getUserAllProcess, // 我的
+		getUserCopyProcess, // 抄送
+		getUserProcess, // 待办
+		getUserProcessing, // 在办
+		getUserProcessed // 办结
+	]
 	function getProcessData({ pageNo, pSize }, callback) {
 		const flag = point.value = new Date().getTime()
 		const params = {
@@ -206,17 +213,14 @@
 			control: 1,
 			queryParams: queryParams.value
 		}
-		const requestMap = [
-			getUserAllProcess, // 我的
-			getUserProcess, // 待办
-			getUserProcessing, // 在办
-			getUserProcessed // 办结
-		]
-		requestMap[current.value](params).then(({ returnParams }) => {
-			// processes.value = returnParams.list
+		requestMap[current.value](params).then(( { returnParams, Rows, Total } ) => {
 			// 只加载最新数据 防止快速连续点击分段器造成数据错乱
 			if (flag == point.value) {
-				callback(returnParams.list, returnParams.total, pageNo)
+				callback(
+					current.value == 1 ? Rows : returnParams.list, 
+					current.value == 1 ? Total : returnParams.total, 
+					pageNo
+				)
 			}
 		})
 	}
@@ -230,21 +234,18 @@
 			control: 1,
 			queryParams: queryParams.value
 		}
-		const requestMap = [
-			getUserAllProcess, // 我的
-			getUserProcess, // 待办
-			getUserProcessing, // 在办
-			getUserProcessed // 办结
-		]
-		requestMap[current.value](params).then(({ returnParams }) => {
-			// processes.value.push(...returnParams.list)
-			callback(returnParams.list, returnParams.total, pageNo)
+		requestMap[current.value](params).then(( { returnParams, Rows, Total } ) => {
+			callback(
+				current.value == 1 ? Rows : returnParams.list, 
+				current.value == 1 ? Total : returnParams.total, 
+				pageNo
+			)
 		})
 	}
 	// 跳转到流程详情页
 	function handleToProcessDetail({ username, insId, tinsId, insName, control }) {
 		let url = '/pages/process/detail/index?insId=' + insId + '&insName=' + insName + '&control=' + control
-		if (tinsId) {
+		if (tinsId && current.value != 1) { // 排除抄送流程的tinsId
 			url = url + '&tinsId=' + tinsId
 		}
 		// console.log('url', url)