Browse Source

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

zhangcl 2 weeks ago
parent
commit
aa75d30851

+ 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
 
   // 处理日期初始化(核心修改)