소스 검색

pms 新增/修改保养计划 点击 修改 按钮时的保养规则必填校验

zhangcl 3 달 전
부모
커밋
aa75d30851
2개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      src/views/pms/maintenance/IotMaintenancePlan.vue
  2. 6 0
      src/views/pms/maintenance/IotMaintenancePlanEdit.vue

+ 6 - 0
src/views/pms/maintenance/IotMaintenancePlan.vue

@@ -479,6 +479,12 @@ const configDialog = reactive({
 
 // 打开配置对话框
 const openConfigDialog = (row: IotMaintenanceBomVO) => {
+  // 新增规则校验:至少一个规则开启
+  if (row.mileageRule !== 0 && row.runningTimeRule !== 0 && row.naturalDateRule !== 0) {
+    message.error('请先设置保养规则')
+    return
+  }
+
   configDialog.current = row
 
   // 处理日期初始化(核心修改)

+ 6 - 0
src/views/pms/maintenance/IotMaintenancePlanEdit.vue

@@ -571,6 +571,12 @@ const configDialog = reactive({
 
 // 打开配置对话框
 const openConfigDialog = (row: IotMaintenanceBomVO) => {
+  // 新增规则校验:至少一个规则开启
+  if (row.mileageRule !== 0 && row.runningTimeRule !== 0 && row.naturalDateRule !== 0) {
+    message.error('请先设置保养规则')
+    return
+  }
+
   configDialog.current = row
 
   // 处理日期初始化(核心修改)