Преглед изворни кода

复启权限、结单提示

HD_wangm пре 2 месеци
родитељ
комит
cb5c73292b

+ 1 - 1
pages/order/detail/resetIndex.uvue

@@ -89,7 +89,7 @@
         </scroll-view>
 
         <!-- 接单按钮 -->
-            <view class="accept-button-container" v-if="checkPermi(orderType == '2' ? ['gxt:maintenance:order:complete'] : ['gxt:repairOrder:finalize'])">
+            <view class="accept-button-container" v-if="checkPermi(orderType == '2' ? ['gxt:maintenance:order:resetStart'] : ['gxt:repairOrder:resetStart'])">
             <button class="accept-button" @click="handleSuspendOrder">{{ isDealing ? '复启中...' : '复 启' }}</button>
         </view>
 

+ 47 - 2
pages/order/detail/wbBackfillFinalize.uvue

@@ -846,7 +846,27 @@
 						realStartTime.value = (misInfo[0]['realStartTime'] as string | null) ?? ''
 						realEndTime.value = (misInfo[0]['realEndTime'] as string | null) ?? ''
 						// 查询相关工作班成员
-						await listWorkPerson(misNo.value).then(response => {
+						// await listWorkPerson(misNo.value).then(response => {
+						// 	const responseObj = response as UTSJSONObject
+						// 	const rows = responseObj['rows'] as UTSJSONObject[] | null
+						// 	workOrderPersonList.value = rows ?? []
+						// 	if (rows != null && rows.length > 0) {
+						// 		// 查询负责人信息并回填
+						// 		for (const person of workOrderPersonList.value) {
+						// 		  // 严格判断isLeader为1(兼容数字/字符串类型)
+						// 		  if (person.isLeader == 1) {
+						// 			teamLeaderName.value = (person.nickName as string | null) ?? '';
+						// 			break; // 找到后立即停止循环
+						// 		  }
+						// 		}
+						// 		const nickNames = rows
+						// 			.map((person: UTSJSONObject) => (person['nickName'] as string | null) ?? '')
+						// 			.join(',');
+						// 		workGroupMemberName.value = nickNames;
+						// 	}
+						// })
+						// 查询相关工作班成员
+						listWorkPerson(misNo.value).then(response => {
 							const responseObj = response as UTSJSONObject
 							const rows = responseObj['rows'] as UTSJSONObject[] | null
 							workOrderPersonList.value = rows ?? []
@@ -855,14 +875,39 @@
 								for (const person of workOrderPersonList.value) {
 								  // 严格判断isLeader为1(兼容数字/字符串类型)
 								  if (person.isLeader == 1) {
+									  teamLeaderId.value = (person.userId as Number | null) ?? null;
 									teamLeaderName.value = (person.nickName as string | null) ?? '';
 									break; // 找到后立即停止循环
 								  }
 								}
 								const nickNames = rows
-									.map((person: UTSJSONObject) => (person['nickName'] as string | null) ?? '')
+									.filter(person => person.isLeader != 1)
+									.map(person => (person.nickName as string | null) ?? '')
 									.join(',');
 								workGroupMemberName.value = nickNames;
+								
+								workOrderPersonList.value.map(person => {
+									// 构造查询参数:username 和 nickName
+									const queryParams = {
+									  userName: person.userName, // 假设person对象有username字段
+									  nickName: person.nickName  // 假设person对象有nickName字段
+									};
+									getUserList(queryParams).then(response => {
+										const responseObj = response as UTSJSONObject
+										const rows = responseObj['rows'] as UTSJSONObject[] | null
+										if (rows == null || rows.length == 0) {
+											let msg = "已匹配到MIS工单,但工作班成员'" + person.nickName + "'在系统中不存在,系统无法自动结单,请检查"
+											if (person.isLeader == 1) {
+											  msg = "已匹配到MIS工单,但工作负责人'" + person.nickName + "'在系统中不存在,系统无法自动结单,请检查"
+											}
+											uni.showToast({
+												title: msg,
+												icon: 'none',
+												duration: 3000 // 自定义显示时间,单位ms
+											});
+										}
+									});
+								})
 							}
 						})
 					}

+ 18 - 7
pages/order/detail/wbFinalize.uvue

@@ -1314,8 +1314,9 @@
 									misNo.value = ''
 									// infoEntry.value = '2'
 									uni.showToast({
-										title: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式',
-										icon: 'none'
+										title: '该MIS工单已被其他工单关联,请检查是否重复操作。',
+										icon: 'none',
+										duration: 3000
 									});
 									return
 								} else {
@@ -1361,7 +1362,7 @@
 														uni.showToast({
 															title: msg,
 															icon: 'none',
-															duration: 2000 // 自定义显示时间,单位ms
+															duration: 3000 // 自定义显示时间,单位ms
 														});
 													}
 												});
@@ -1375,7 +1376,8 @@
 								// infoEntry.value = '2'
 								uni.showToast({
 									title: '已匹配到MIS工单,但未关联工作票号,系统无法自动结单,请进入工作票录入方式。',
-									icon: 'none'
+									icon: 'none',
+									duration: 3000
 								});
 								return
 							}
@@ -1384,11 +1386,19 @@
 							// infoEntry.value = '2'
 							uni.showToast({
 								title: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式',
-								icon: 'none'
+								icon: 'none',
+								duration: 3000
 							});
 							return
 						} else if(misInfo.length > 1) {
-							infoEntryDisabled.value = false
+							misNo.value = ''
+							// infoEntry.value = '2'
+							uni.showToast({
+								title: '已匹配到多个MIS工单,请手动结单,信息录入选择关联MIS。',
+								icon: 'none',
+								duration: 3000
+							});
+							return
 						}
 					}
 				} else {
@@ -1397,7 +1407,8 @@
 					// infoEntry.value = '2'
 					uni.showToast({
 						title: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式',
-						icon: 'none'
+						icon: 'none',
+						duration: 3000
 					});
 				}
 

+ 22 - 13
pages/order/detail/wxFinalize.uvue

@@ -1460,8 +1460,9 @@
 									misNo.value = ''
 									// infoEntry.value = '2'
 									uni.showToast({
-										title: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式',
-										icon: 'none'
+										title: '该MIS工单已被其他工单关联,请检查是否重复操作。',
+										icon: 'none',
+										duration: 3000
 									});
 									return
 								} else {
@@ -1500,14 +1501,14 @@
 													const responseObj = response as UTSJSONObject
 													const rows = responseObj['rows'] as UTSJSONObject[] | null
 													if (rows == null || rows.length == 0) {
-														let msg = "已匹配到MIS工单,但工作班成员'" + person.nickName + "'在系统中不存在,系统无法自动结单,请检查"
+														let msg = "已匹配到MIS工单,但工作班成员'" + person.nickName + "'在系统中不存在,系统无法自动结单,请检查"
 														if (person.isLeader == 1) {
-														  msg = "已匹配到MIS工单,但工作负责人'" + person.nickName + "'在系统中不存在,系统无法自动结单,请检查"
+														  msg = "已匹配到MIS工单,但工作负责人'" + person.nickName + "'在系统中不存在,系统无法自动结单,请检查"
 														}
 														uni.showToast({
 															title: msg,
 															icon: 'none',
-															duration: 2000 // 自定义显示时间,单位ms
+															duration: 3000 // 自定义显示时间,单位ms
 														});
 													}
 												});
@@ -1522,7 +1523,8 @@
 								// infoEntry.value = '2'
 								uni.showToast({
 									title: '已匹配到MIS工单,但未关联工作票号,系统无法自动结单,请进入工作票录入方式。',
-									icon: 'none'
+									icon: 'none',
+									duration: 3000
 								});
 								return
 							}
@@ -1530,21 +1532,28 @@
 							misNo.value = ''
 							// infoEntry.value = '2'
 							uni.showToast({
-								title: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式',
-								icon: 'none'
+								title: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式。',
+								icon: 'none',
+								duration: 3000
 							});
 							return
 						} else if(misInfo.length > 1) {
-							infoEntryDisabled.value = false
+							misNo.value = ''
+							// infoEntry.value = '2'
+							uni.showToast({
+								title: '已匹配到多个MIS工单,请手动结单,信息录入选择关联MIS。',
+								icon: 'none',
+								duration: 3000
+							});
+							return
 						}
 					}
 				} else {
-					infoEntryDisabled.value = true
 					misNo.value = ''
-					// infoEntry.value = '2'
 					uni.showToast({
-						title: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式',
-						icon: 'none'
+						title: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式。',
+						icon: 'none',
+						duration: 3000
 					});
 				}
 

+ 6 - 6
pages/order/index.uvue

@@ -145,9 +145,9 @@
 								<text class="btn-text">挂起</text>
 							</view>
 							<view
-								v-if="getOrderStatus(item) == 'to_finish' && canHandleOrder(item, 'finalize')"
+								v-if="getOrderStatus(item) == 'to_finish' && canHandleOrder(item, 'resetStart')"
 								class="btn-primary info-value"
-								@click.stop="handleItemClick(item, 'finalize')"
+								@click.stop="handleItemClick(item, 'resetStart')"
 								>
 								<text class="btn-text">复启</text>
 							</view>
@@ -649,9 +649,9 @@ const canHandleOrder = (item: any | null, buttonType: string | ''): boolean => {
 		} else if(buttonType != '' && buttonType == "return" && orderItem.orderType == 1 && (orderItem.teamLeaderId == parseInt(userId.value) || roles.value.includes("管理员"))) {
 			// 退回
 			permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:return'] : ['gxt:repairOrder:return']
-		} else if(buttonType != '' && buttonType == "finalize" && orderItem.orderType == 1) {
+		} else if(buttonType != '' && buttonType == "resetStart" && orderItem.orderType == 1) {
 			// 复启
-			permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:complete'] : ['gxt:repairOrder:finalize']
+			permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:resetStart'] : ['gxt:repairOrder:resetStart']
 		  // } else if(buttonType != '' && buttonType == "complete" && (orderItem.teamLeaderId == parseInt(userId.value) || roles.value.includes("管理员"))) {
 		} else if(buttonType != '' && buttonType == "complete") {
 			// 结单
@@ -732,7 +732,7 @@ const canHandleOrder = (item: any | null, buttonType: string | ''): boolean => {
 				uni.navigateTo({
 					url: `/pages/order/detail/returnIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
 				})
-			} else if(buttonType != '' && buttonType == "finalize") {
+			} else if(buttonType != '' && buttonType == "resetStart" && orderItem.orderType == 1) {
 				// 跳转到复启页面
 				uni.navigateTo({
 					url: `/pages/order/detail/resetIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
@@ -748,7 +748,7 @@ const canHandleOrder = (item: any | null, buttonType: string | ''): boolean => {
 					url: `/pages/order/detail/wxFinalize?id=${orderItem.id}&orderType=${orderItem.orderType}`
 				})
 			} else if(buttonType != '' && buttonType == "complete" && orderItem.orderType == 2 && orderItem.orderEntryType == '2') {
-				// 跳转到复启页面
+				// 跳转到补录结单页面
 				uni.navigateTo({
 					url: `/pages/order/detail/wbBackfillFinalize?id=${orderItem.id}&orderType=${orderItem.orderType}`
 				})

+ 4 - 4
pages/order/pendingOrder.uvue

@@ -106,9 +106,9 @@
 								<text class="btn-text">挂起</text>
 							</view>
 							<view
-								v-if="getOrderStatus(item) == 'to_finish' && canHandleOrder(item, 'finalize')"
+								v-if="getOrderStatus(item) == 'to_finish' && canHandleOrder(item, 'resetStart')"
 								class="btn-primary info-value"
-								@click.stop="handleItemClick(item, 'finalize')"
+								@click.stop="handleItemClick(item, 'resetStart')"
 								>
 								<text class="btn-text">复启</text>
 							</view>
@@ -213,7 +213,7 @@ type acceptOrderInfoExtend = {
 	  		} else if(buttonType != '' && buttonType == "return" && orderItem.orderType == 1 && (orderItem.teamLeaderId == parseInt(userId.value) || roles.value.includes("管理员"))) {
 	  			// 退回
 	  			permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:return'] : ['gxt:repairOrder:return']
-	  		} else if(buttonType != '' && buttonType == "finalize" && orderItem.orderType == 1 && (orderItem.teamLeaderId == parseInt(userId.value) || roles.value.includes("管理员"))) {
+	  		} else if(buttonType != '' && buttonType == "resetStart") {
 	  			// 复启
 	  			permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:finalize'] : ['gxt:repairOrder:finalize']
 	  		} else if(buttonType != '' && buttonType == "complete") {
@@ -631,7 +631,7 @@ type acceptOrderInfoExtend = {
 				uni.navigateTo({
 					url: `/pages/order/detail/returnIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
 				})
-			} else if(buttonType != '' && buttonType == "finalize") {
+			} else if(buttonType != '' && buttonType == "resetStart") {
 				// 跳转到复启页面
 				uni.navigateTo({
 					url: `/pages/order/detail/resetIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`