소스 검색

解决微信公众号通知的url链接操作完后还能点击操作的问题

wangqiang 8 달 전
부모
커밋
930db83e38
2개의 변경된 파일30개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 0
      api/flowable/taskService.js
  2. 22 2
      pages/workbench/task/TaskForm.vue

+ 8 - 0
api/flowable/taskService.js

@@ -2,6 +2,14 @@ import request from "../../common/request"
 import { FLOW_PATH as prefix } from "../AppPath";
 
 export default {
+	getTaskAuditUsersForApp (procInsId) {
+		return request({
+			url: prefix + "/flowable/task/getTaskAuditUsersForApp",
+			method: "get",
+			params: { procInsId: procInsId },
+		});
+	},
+
   start (params) {
 		return request({
 			url: prefix + "/flowable/task/start",

+ 22 - 2
pages/workbench/task/TaskForm.vue

@@ -52,7 +52,7 @@
 					<view class="bottom-wrap  flex">
 						<view class="flex-sub"  v-show="button.isHide === '0'"
 						 v-for="(button, index) in buttons" :key="index" >
-						 <u-button type="primary" class=" buttonBox" :color="colors[index]" @click="submit(button, buttons)" :text="button.name"></u-button>
+						 <u-button type="primary" class=" buttonBox" :color="colors[index]" :disabled="testFlag" @click="submit(button, buttons)" :text="button.name"></u-button>
 						</view>
 					</view>
 				</u--form>
@@ -133,6 +133,7 @@
 </template>
 
 <script>
+	import {mapState, mapMutations, mapActions} from 'vuex'
 	import HolidayForm from '@/pages/dailyOfficeWork/holiday/HolidayForm.vue'
 	import DepartRegistrationAddForm from '@/pages/human/depart/registration/DepartRegistrationAddForm.vue'
 	import HandoverAddForm from '@/pages/human/depart/handover/HandoverAddForm.vue'
@@ -156,7 +157,10 @@
 	import MeetingRoomForm from '@/pages/dailyOfficeWork/daily/MeetingRoomForm.vue'
 	var  graceChecker = require("@/common/graceChecker.js");
 	export default {
-		onLoad: function (option) {
+		computed: mapState({
+			userInfo: (state) => state.user.userInfo,
+		}),
+		onLoad: async function (option) {
 		    this.flow = JSON.parse(decodeURIComponent(option.flow));
 			this.procDefId = this.flow.procDefId
 			this.procDefKey = this.flow.procDefKey
@@ -177,6 +181,21 @@
 			uni.setNavigationBarTitle({
 			    title: this.title
 			});
+
+			// 获取当前节点审核人  与  当前登录人的ID 进行对比,如果不是审核人,那么不允许操作
+			let userId = this.userInfo.id
+
+			// 获取 URL 中的 'flow' 参数
+			const flowParam = this.$route.query.flow;
+			// 将 URL 编码的 'flow' 参数解析为 JSON 对象
+			const flowObject = JSON.parse(decodeURIComponent(flowParam));
+			await taskService.getTaskAuditUsersForApp(this.procInsId).then((data) => {
+				console.log('getTaskAuditUsersForApp.data', data)
+				if (!data.includes(userId)) {
+					this.testFlag = true
+				}
+			})
+
 		},
 		async mounted () {
 			  if (this.formType === '2') { //外置表单
@@ -281,6 +300,7 @@
 		},
 		data() {
 			return {
+				testFlag: false,
 				days: '',
 				flow: null,
 				tabIndex: 0,