Przeglądaj źródła

结单提示优化、复启权限修改

HD_wangm 2 miesięcy temu
rodzic
commit
983f2d37a6

+ 8 - 4
pages/order/detail/wbBackfillFinalize.uvue

@@ -900,10 +900,14 @@
 											if (person.isLeader == 1) {
 											  msg = "已匹配到MIS工单,但工作负责人'" + person.nickName + "'在系统中不存在,系统无法自动结单,请检查"
 											}
-											uni.showToast({
-												title: msg,
-												icon: 'none',
-												duration: 3000 // 自定义显示时间,单位ms
+											uni.showModal({
+											  title: '提示',
+											  content: msg,
+											  showCancel: false, // 只显示确定按钮
+											  confirmText: '确定',
+											  confirmColor: '#007aff',
+											  success: (res) => {
+											  }
 											});
 										}
 									});

+ 50 - 30
pages/order/detail/wbFinalize.uvue

@@ -818,7 +818,7 @@
 		const responseObj = response as UTSJSONObject
 		const rows = responseObj['rows'] as UTSJSONObject[] | null
 		if (rows != null && rows.length > 0) {
-			uni.showToast({ title: 'MIS工单:' + misNo.value + '已存在', icon: 'none' })
+			uni.showToast({ title: '该MIS工单已被其他工单关联!请重新选择!', icon: 'none' })
 			misNo.value = ''
 			return
 		}
@@ -1313,12 +1313,15 @@
 								if (rows != null && rows.length > 0) {
 									misNo.value = ''
 									// infoEntry.value = '2'
-									uni.showToast({
-										title: '该MIS工单已被其他工单关联,请检查是否重复操作。',
-										icon: 'none',
-										duration: 3000
+									uni.showModal({
+									  title: '提示',
+									  content: '已匹配到' + misNo2 + '工单,但该MIS工单已被其他工单关联,请检查是否重复操作。',
+									  showCancel: false, // 只显示确定按钮
+									  confirmText: '确定',
+									  confirmColor: '#007aff', // 自定义按钮颜色,匹配你的UI风格
+									  success: (res) => {
+									  }
 									});
-									return
 								} else {
 									misNo.value = (misInfo[0]['misNo'] as string | null) ?? ''
 									realStartTime.value = (misInfo[0]['realStartTime'] as string | null) ?? ''
@@ -1359,10 +1362,14 @@
 														if (person.isLeader == 1) {
 														  msg = "已匹配到MIS工单,但工作负责人'" + person.nickName + "'在系统中不存在,系统无法自动结单,请检查"
 														}
-														uni.showToast({
-															title: msg,
-															icon: 'none',
-															duration: 3000 // 自定义显示时间,单位ms
+														uni.showModal({
+														  title: '提示',
+														  content: msg,
+														  showCancel: false, // 只显示确定按钮
+														  confirmText: '确定',
+														  confirmColor: '#007aff',
+														  success: (res) => {
+														  }
 														});
 													}
 												});
@@ -1374,41 +1381,54 @@
 							} else {
 								misNo.value = ''
 								// infoEntry.value = '2'
-								uni.showToast({
-									title: '已匹配到MIS工单,但未关联工作票号,系统无法自动结单,请进入工作票录入方式。',
-									icon: 'none',
-									duration: 3000
+								uni.showModal({
+								  title: '提示',
+								  content: '已匹配到MIS工单,但未关联工作票号,系统无法自动结单,请进入工作票录入方式。',
+								  showCancel: false, // 只显示确定按钮
+								  confirmText: '确定',
+								  confirmColor: '#007aff',
+								  success: (res) => {
+								  }
 								});
-								return
 							}
 						} else if(misInfo.length == 0) {
 							misNo.value = ''
 							// infoEntry.value = '2'
-							uni.showToast({
-								title: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式',
-								icon: 'none',
-								duration: 3000
+							uni.showModal({
+							  title: '提示',
+							  content: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式。',
+							  showCancel: false, // 只显示确定按钮
+							  confirmText: '确定',
+							  confirmColor: '#007aff',
+							  success: (res) => {
+							  }
 							});
-							return
 						} else if(misInfo.length > 1) {
 							misNo.value = ''
 							// infoEntry.value = '2'
-							uni.showToast({
-								title: '已匹配到多个MIS工单,请手动结单,信息录入选择关联MIS。',
-								icon: 'none',
-								duration: 3000
+							uni.showModal({
+							  title: '提示',
+							  content: '已匹配到多个MIS工单,请手动结单,信息录入选择关联MIS。',
+							  showCancel: false, // 只显示确定按钮
+							  confirmText: '确定',
+							  confirmColor: '#007aff',
+							  success: (res) => {
+							  }
 							});
-							return
 						}
 					}
 				} else {
-					infoEntryDisabled.value = true
+					// infoEntryDisabled.value = true
 					misNo.value = ''
 					// infoEntry.value = '2'
-					uni.showToast({
-						title: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式',
-						icon: 'none',
-						duration: 3000
+					uni.showModal({
+					  title: '提示',
+					  content: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式。',
+					  showCancel: false, // 只显示确定按钮
+					  confirmText: '确定',
+					  confirmColor: '#007aff',
+					  success: (res) => {
+					  }
 					});
 				}
 

+ 59 - 30
pages/order/detail/wxFinalize.uvue

@@ -915,7 +915,7 @@
 		const responseObj = response as UTSJSONObject
 		const rows = responseObj['rows'] as UTSJSONObject[] | null
 		if (rows != null && rows.length > 0) {
-			uni.showToast({ title: 'MIS工单:' + misNo.value + '已存在', icon: 'none' })
+			uni.showToast({ title: '该MIS工单已被其他工单关联!请重新选择!', icon: 'none' })
 			misNo.value = ''
 			return
 		}
@@ -1458,13 +1458,15 @@
 								const rows = responseObj['rows'] as UTSJSONObject[] | null
 								if (rows != null && rows.length > 0) {
 									misNo.value = ''
-									// infoEntry.value = '2'
-									uni.showToast({
-										title: '该MIS工单已被其他工单关联,请检查是否重复操作。',
-										icon: 'none',
-										duration: 3000
+									uni.showModal({
+									  title: '提示',
+									  content: '已匹配到' + misNo2 + '工单,但该MIS工单已被其他工单关联,请检查是否重复操作。',
+									  showCancel: false, // 只显示确定按钮
+									  confirmText: '确定',
+									  confirmColor: '#007aff', // 自定义按钮颜色,匹配你的UI风格
+									  success: (res) => {
+									  }
 									});
-									return
 								} else {
 									misNo.value = (misInfo[0]['misNo'] as string | null) ?? ''
 									realStartTime.value = (misInfo[0]['realStartTime'] as string | null) ?? ''
@@ -1505,10 +1507,19 @@
 														if (person.isLeader == 1) {
 														  msg = "已匹配到MIS工单,但工作负责人'" + person.nickName + "'在系统中不存在,系统无法自动结单,请检查。"
 														}
-														uni.showToast({
-															title: msg,
-															icon: 'none',
-															duration: 3000 // 自定义显示时间,单位ms
+														// uni.showToast({
+														// 	title: msg,
+														// 	icon: 'none',
+														// 	duration: 3000 // 自定义显示时间,单位ms
+														// });
+														uni.showModal({
+														  title: '提示',
+														  content: msg,
+														  showCancel: false, // 只显示确定按钮
+														  confirmText: '确定',
+														  confirmColor: '#007aff',
+														  success: (res) => {
+														  }
 														});
 													}
 												});
@@ -1521,39 +1532,57 @@
 							} else {
 								misNo.value = ''
 								// infoEntry.value = '2'
-								uni.showToast({
-									title: '已匹配到MIS工单,但未关联工作票号,系统无法自动结单,请进入工作票录入方式。',
-									icon: 'none',
-									duration: 3000
+								uni.showModal({
+								  title: '提示',
+								  content: '已匹配到MIS工单,但未关联工作票号,系统无法自动结单,请进入工作票录入方式。',
+								  showCancel: false, // 只显示确定按钮
+								  confirmText: '确定',
+								  confirmColor: '#007aff',
+								  success: (res) => {
+								  }
 								});
-								return
 							}
 						} else if(misInfo.length == 0) {
 							misNo.value = ''
 							// infoEntry.value = '2'
-							uni.showToast({
-								title: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式。',
-								icon: 'none',
-								duration: 3000
+							uni.showModal({
+							  title: '提示',
+							  content: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式。',
+							  showCancel: false, // 只显示确定按钮
+							  confirmText: '确定',
+							  confirmColor: '#007aff',
+							  success: (res) => {
+							  }
 							});
-							return
 						} else if(misInfo.length > 1) {
 							misNo.value = ''
 							// infoEntry.value = '2'
-							uni.showToast({
-								title: '已匹配到多个MIS工单,请手动结单,信息录入选择关联MIS。',
-								icon: 'none',
-								duration: 3000
+							// uni.showToast({
+							// 	title: '已匹配到多个MIS工单,请手动结单,信息录入选择关联MIS。',
+							// 	icon: 'none',
+							// 	duration: 3000
+							// });
+							uni.showModal({
+							  title: '提示',
+							  content: '已匹配到多个MIS工单,请手动结单,信息录入选择关联MIS。',
+							  showCancel: false, // 只显示确定按钮
+							  confirmText: '确定',
+							  confirmColor: '#007aff',
+							  success: (res) => {
+							  }
 							});
-							return
 						}
 					}
 				} else {
 					misNo.value = ''
-					uni.showToast({
-						title: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式。',
-						icon: 'none',
-						duration: 3000
+					uni.showModal({
+					  title: '提示',
+					  content: '未找到匹配的MIS工单,请确认风机停复机时间是否已录入工效通系统或请进入工作票录入方式。',
+					  showCancel: false, // 只显示确定按钮
+					  confirmText: '确定',
+					  confirmColor: '#007aff',
+					  success: (res) => {
+					  }
 					});
 				}
 

+ 22 - 4
pages/order/index.uvue

@@ -73,7 +73,7 @@
 								<text class="btn-text">接单</text>
 							</view>
 							<view
-								v-if="(getOrderStatus(item) == 'assigned' || getOrderStatus(item) == 'to_finish')
+								v-if="(getOrderStatus(item) == 'assigned' || getOrderStatus(item) == 'to_finish' || getOrderStatus(item) == 'completed')
 								&& canHandleOrder(item,'shutdown') && (item as acceptOrderInfoExtend).pauseTime == null"
 								class="btn-primary info-value"
 								@click.stop="handleItemClick(item,'shutdown')"
@@ -145,7 +145,7 @@
 								<text class="btn-text">挂起</text>
 							</view>
 							<view
-								v-if="getOrderStatus(item) == 'to_finish' && canHandleOrder(item, 'resetStart')"
+								v-if="(getOrderStatus(item) == 'to_finish' || getOrderStatus(item) == 'assigned') && canHandleOrder(item, 'resetStart')"
 								class="btn-primary info-value"
 								@click.stop="handleItemClick(item, 'resetStart')"
 								>
@@ -641,6 +641,9 @@ const canHandleOrder = (item: any | null, buttonType: string | ''): boolean => {
 		} else if(buttonType != '' && buttonType == "restart") {
 			// 复运
 			permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:restart'] : ['gxt:repairOrder:restart']
+		} else if(buttonType != '' && buttonType == "resetStart" && orderItem.orderType == 1) {
+			// 复启
+			permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:resetStart'] : ['gxt:repairOrder:resetStart']
 		}
 	} else if(orderItem.workOrderStatus == 'to_finish') {
 		if(buttonType != '' && buttonType == "suspend" ) {
@@ -679,8 +682,13 @@ const canHandleOrder = (item: any | null, buttonType: string | ''): boolean => {
 		// 停机
 		permit = ['gxt:maintenance:order:shutdown']
 	} else if(orderItem.workOrderStatus == 'completed') {
-		// 复运
-		permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:restart'] : ['gxt:repairOrder:restart']
+		if(buttonType != '' && buttonType == "restart") {
+			// 复运
+			permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:restart'] : ['gxt:repairOrder:restart']
+		} else if(buttonType != '' && buttonType == "shutdown" && orderItem.orderType == 2) {
+			//停机
+			permit = ['gxt:maintenance:order:shutdown']
+		}
 	} else {
 		return false
 	}
@@ -715,6 +723,11 @@ const canHandleOrder = (item: any | null, buttonType: string | ''): boolean => {
 				uni.navigateTo({
 					url: `/pages/order/detail/restartIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
 				})
+			} else if(buttonType != '' && buttonType == "resetStart" && orderItem.orderType == 1) {
+				// 跳转到复启页面
+				uni.navigateTo({
+					url: `/pages/order/detail/resetIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
+				})
 			} else {
 				// 跳转到接单页面
 				uni.navigateTo({
@@ -792,6 +805,11 @@ const canHandleOrder = (item: any | null, buttonType: string | ''): boolean => {
 				uni.navigateTo({
 					url: `/pages/order/detail/restartIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
 				})
+			} else if(buttonType != '' && buttonType == "shutdown") {
+				// 跳转到停机页面
+				uni.navigateTo({
+					url: `/pages/order/detail/shutdownIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
+				})
 			}
 		} else {
 			uni.navigateTo({

+ 24 - 6
pages/order/pendingOrder.uvue

@@ -41,7 +41,7 @@
 								<text class="btn-text">接单</text>
 							</view>
 							<view
-								v-if="(getOrderStatus(item) == 'assigned' || getOrderStatus(item) == 'to_finish')
+								v-if="(getOrderStatus(item) == 'assigned' || getOrderStatus(item) == 'to_finish' || getOrderStatus(item) == 'completed')
 								&& canHandleOrder(item,'shutdown') && (item as acceptOrderInfoExtend).pauseTime == null"
 								class="btn-primary info-value"
 								@click.stop="handleItemClick(item,'shutdown')"
@@ -106,7 +106,7 @@
 								<text class="btn-text">挂起</text>
 							</view>
 							<view
-								v-if="getOrderStatus(item) == 'to_finish' && canHandleOrder(item, 'resetStart')"
+								v-if="(getOrderStatus(item) == 'to_finish' || getOrderStatus(item) == 'assigned') && canHandleOrder(item, 'resetStart')"
 								class="btn-primary info-value"
 								@click.stop="handleItemClick(item, 'resetStart')"
 								>
@@ -205,7 +205,10 @@ type acceptOrderInfoExtend = {
 			} else if(buttonType != '' && buttonType == "restart") {
 				// 复运
 				permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:restart'] : ['gxt:repairOrder:restart']
-			}
+			} else if(buttonType != '' && buttonType == "resetStart") {
+	  			// 复启
+	  			permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:resetStart'] : ['gxt:repairOrder:resetStart']
+	  		}
 	  } else if(orderItem.workOrderStatus == 'to_finish') {
 	  		if(buttonType != '' && buttonType == "suspend" && (orderItem.teamLeaderId == parseInt(userId.value) || roles.value.includes("管理员"))) {
 	  			// 挂起
@@ -215,7 +218,7 @@ type acceptOrderInfoExtend = {
 	  			permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:return'] : ['gxt:repairOrder:return']
 	  		} else if(buttonType != '' && buttonType == "resetStart") {
 	  			// 复启
-	  			permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:finalize'] : ['gxt:repairOrder:finalize']
+	  			permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:resetStart'] : ['gxt:repairOrder:resetStart']
 	  		} else if(buttonType != '' && buttonType == "complete") {
 				// 结单
 				permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:complete'] : ['gxt:repairOrder:finalize']
@@ -236,8 +239,13 @@ type acceptOrderInfoExtend = {
 			// 接单退回
 			permit = ['gxt:repairOrder:acceptReturn']
 		} else if(orderItem.workOrderStatus == 'completed') {
-			// 复运
-			permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:restart'] : ['gxt:repairOrder:restart']
+			if(buttonType != '' && buttonType == "restart") {
+				// 复运
+				permit = orderItem.orderType == 2 ? ['gxt:maintenance:order:restart'] : ['gxt:repairOrder:restart']
+			} else if(buttonType != '' && buttonType == "shutdown" && orderItem.orderType == 2) {
+				//停机
+				permit = ['gxt:maintenance:order:shutdown']
+			}
 		} else {
 	  		return false
 		}
@@ -614,6 +622,11 @@ type acceptOrderInfoExtend = {
 				uni.navigateTo({
 					url: `/pages/order/detail/restartIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
 				})
+			} else if(buttonType != '' && buttonType == "resetStart") {
+				// 跳转到复启页面
+				uni.navigateTo({
+					url: `/pages/order/detail/resetIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
+				})
 			} else {
 				// 跳转到接单页面
 				uni.navigateTo({
@@ -685,6 +698,11 @@ type acceptOrderInfoExtend = {
 				uni.navigateTo({
 					url: `/pages/order/detail/restartIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
 				})
+			}  else if(buttonType != '' && buttonType == "shutdown") {
+				// 跳转到停机页面
+				uni.navigateTo({
+					url: `/pages/order/detail/shutdownIndex?id=${orderItem.id}&orderType=${orderItem.orderType}`
+				})
 			}
 		} else {
 			uni.navigateTo({