소스 검색

pms 保养选择设备提示信息

zhangcl 3 일 전
부모
커밋
4b212ad7bd
4개의 변경된 파일24개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 0
      src/locales/en.ts
  2. 2 0
      src/locales/ru.ts
  3. 2 0
      src/locales/zh-CN.ts
  4. 18 2
      src/views/pms/maintenance/MainPlanDeviceList.vue

+ 2 - 0
src/locales/en.ts

@@ -984,6 +984,8 @@ export default {
     DelayDate:'DelayDate(D)',
     MaintItemsGroup:'MaintItemsGroup',
     MaintItems:'MaintItems',
+    haveMaintItems:'have Items',
+    noMaintItems:'no Items',
     deviceBomMaterials:'DeviceBomMaterials',
     nextMaintTime:'NextMaintTime(H)',
     nextMaintKil:'NextMaintKil(KM)',

+ 2 - 0
src/locales/ru.ts

@@ -963,6 +963,8 @@ export default {
     DelayDate:'推迟自然日期(D)',
     MaintItemsGroup:'保养项组',
     MaintItems:'保养项',
+    haveMaintItems:'有保养项',
+    noMaintItems:'无保养项',
     deviceBomMaterials:'保养项物料',
     nextMaintTime:'距离下次保养运行时长(H)',
     nextMaintKil:'距离下次保养公里数(KM)',

+ 2 - 0
src/locales/zh-CN.ts

@@ -979,6 +979,8 @@ export default {
     DelayDate:'推迟自然日期(D)',
     MaintItemsGroup:'保养项组',
     MaintItems:'保养项',
+    haveMaintItems:'有保养项',
+    noMaintItems:'无保养项',
     deviceBomMaterials:'保养项物料',
     nextMaintTime:'距离下次保养运行时长(H)',
     nextMaintKil:'距离下次保养公里数(KM)',

+ 18 - 2
src/views/pms/maintenance/MainPlanDeviceList.vue

@@ -93,7 +93,7 @@
             </template>
             <template #default="{ row }">
               <div :class="{'no-maintenance': !row.hasSetMaintenanceBom, 'has-maintenance': row.hasSetMaintenanceBom}">
-                {{ row.hasSetMaintenanceBom ? '有保养项' : '无保养项' }}
+                {{ row.hasSetMaintenanceBom ? t('mainPlan.haveMaintItems') : t('mainPlan.noMaintItems') }}
               </div>
             </template>
           </el-table-column>
@@ -441,9 +441,25 @@ const handleClose = () => {
 // 确认选择
 const handleConfirm = () => {
   if (selectedRows.value.length === 0) {
-    ElMessage.warning('请至少选择一个物料')
+    ElMessage.warning('请至少选择一个设备')
     return
   }
+
+  // 检查是否有设备没有保养项
+  const hasInvalidDevice = selectedRows.value.some(
+    row => row.hasSetMaintenanceBom === false
+  )
+
+  if (hasInvalidDevice) {
+    // 显示警告信息
+    ElMessage.warning({
+      message: '请选择有保养项的设备',
+      duration: 3000,
+      grouping: true
+    })
+    return // 不关闭弹窗
+  }
+
   emit('choose', selectedRows.value.map(row => ({
     ...row,
     // 确保返回必要字段