Просмотр исходного кода

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-eam into dev

liujt 2 месяцев назад
Родитель
Сommit
d82fc72c54
36 измененных файлов с 4840 добавлено и 1204 удалено
  1. 16 0
      src/api/ledgerAssets/index.js
  2. BIN
      src/assets/g.gif
  3. BIN
      src/assets/g.mp3
  4. BIN
      src/assets/r.gif
  5. BIN
      src/assets/r.mp3
  6. BIN
      src/assets/y.gif
  7. BIN
      src/assets/y.mp3
  8. 116 0
      src/components/GlobalAudioUnlockButton.vue
  9. 1 1
      src/components/addPatrolPlanDialog/index.vue
  10. 199 0
      src/utils/audioManager.js
  11. 2 1
      src/utils/dict/warehouse.js
  12. 326 52
      src/views/equipmentOperationMonitoring/index.vue
  13. 38 1
      src/views/ledgerAssets/accountingLedger/components/list.vue
  14. 40 1
      src/views/ledgerAssets/boat/components/boat-list.vue
  15. 41 8
      src/views/ledgerAssets/equipment/components/equipment-list.vue
  16. 59 1
      src/views/ledgerAssets/material/components/material-list.vue
  17. 40 1
      src/views/ledgerAssets/meter/components/equipment-list.vue
  18. 38 1
      src/views/ledgerAssets/mould/components/mould-list.vue
  19. 38 1
      src/views/ledgerAssets/office/components/data-list.vue
  20. 38 1
      src/views/ledgerAssets/sparepart/components/sparepart-list.vue
  21. 38 1
      src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue
  22. 40 1
      src/views/ledgerAssets/turnoverDisks/components/equipment-list.vue
  23. 1136 931
      src/views/maintenance/components/programRulesDialog.vue
  24. 7 7
      src/views/maintenance/patrol/workOrder/index.vue
  25. 70 0
      src/views/maintenance/service/index.vue
  26. 187 0
      src/views/maintenance/service/plan/components/plan-search.vue
  27. 732 0
      src/views/maintenance/service/plan/details.vue
  28. 260 0
      src/views/maintenance/service/plan/index.vue
  29. 169 0
      src/views/maintenance/service/workOrder/components/work-search.vue
  30. 708 0
      src/views/maintenance/service/workOrder/details.vue
  31. 384 0
      src/views/maintenance/service/workOrder/index.vue
  32. 46 97
      src/views/warning/warningMessage/components/message-search.vue
  33. 15 9
      src/views/warning/warningMessage/index.vue
  34. 46 87
      src/views/warning/warningSetting/components/setting-search.vue
  35. 8 0
      src/views/warning/warningSetting/index.vue
  36. 2 2
      vue.config.js

+ 16 - 0
src/api/ledgerAssets/index.js

@@ -183,3 +183,19 @@ export async function batchUnbind(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+//批量停机
+export async function batchStop(data) {
+  const res = await request.post(`/main/asset/batchStop`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//批量运行
+export async function batchRun(data) {
+  const res = await request.post(`/main/asset/batchRun`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

BIN
src/assets/g.gif


BIN
src/assets/g.mp3


BIN
src/assets/r.gif


BIN
src/assets/r.mp3


BIN
src/assets/y.gif


BIN
src/assets/y.mp3


+ 116 - 0
src/components/GlobalAudioUnlockButton.vue

@@ -0,0 +1,116 @@
+<!-- src/components/GlobalAudioUnlockButton.vue -->
+<template>
+  <div class="audio-control-btn" @click="handleToggle">
+    <span class="icon">{{ buttonIcon }}</span>
+    <span class="tooltip">{{ buttonTooltip }}</span>
+  </div>
+</template>
+
+<script>
+import audioManager from '@/utils/audioManager';
+
+export default {
+  name: 'GlobalAudioUnlockButton',
+  data() {
+    return {
+      // 当前实际静音状态
+      isMuted: audioManager.isMuted,
+      // 是否曾经解锁过(刷新后保留)
+      hasUnlockedBefore: audioManager.hasUnlockedBefore,
+    };
+  },
+  computed: {
+    buttonIcon() {
+      if (this.isMuted) {
+        return '🔇'; // 静音状态
+      } else {
+        return '🔊'; // 有声状态
+      }
+    },
+    buttonTooltip() {
+      if (this.isMuted) {
+        if (this.hasUnlockedBefore) {
+          return '点击恢复声音';
+        } else {
+          return '点击开启声音';
+        }
+      } else {
+        return '声音已开启';
+      }
+    },
+  },
+  methods: {
+    handleToggle() {
+      // 点击按钮,如果当前静音则解除静音,否则静音(可选)
+      if (this.isMuted) {
+        // 解除静音(用户手势触发的)
+        audioManager.unmute();
+        // 更新本地状态
+        this.isMuted = false;
+        this.hasUnlockedBefore = true;
+      } else {
+        // 如果已经开启,点击后静音(也可以注释掉,让用户只能开启不能关闭,避免误操作)
+        audioManager.mute();
+        this.isMuted = true;
+        this.hasUnlockedBefore = false;
+      }
+    },
+  },
+  mounted() {
+    // 可定期检查状态变化(例如其他模块调用 unmute 后更新UI),但单例数据变更后,组件内的 data 不会自动更新,
+    // 所以可以采用 watch 或者事件总线,但为了简化,我们可以在点击时手动更新。
+    // 或者将 isMuted 改为 computed 直接从 audioManager 获取,但需要响应式。
+    // 更稳健:使用 Vue 的 observable 或直接使用 data 并在 unmute/mute 时触发更新。
+    // 但这里因为按钮操作是自己触发的,且其他模块也可能调用,我们可以通过事件总线或 Vuex。
+    // 简单起见,我们不去监听外部变化,只保证自己的点击更新正确。
+    // 如果外部(如导航点击)调用 audioManager.unmute(),按钮图标不会自动刷新。
+    // 解决方案:在 audioManager 中触发事件,或使用 Vuex。
+    // 为保持简洁,这里我们提供一个手动刷新的方法,或者建议用户只通过这个按钮控制。
+    // 如果你的导航点击也需要调用 unmute,可以在调用后调用 this.$refs.btn.updateStatus() 等。
+    // 但推荐只通过这个按钮控制,避免多处控制状态混乱。
+  },
+};
+</script>
+
+<style scoped>
+.audio-control-btn {
+  position: fixed;
+  top: 115px;
+  right: 75px;
+  width: 56px;
+  height: 56px;
+  border-radius: 50%;
+  background: rgba(0, 0, 0, 0.7);
+  color: white;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  font-size: 28px;
+  cursor: pointer;
+  z-index: 9999;
+  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
+  transition: transform 0.2s, background 0.2s;
+  user-select: none;
+}
+.audio-control-btn:hover {
+  transform: scale(1.1);
+  background: rgba(0, 0, 0, 0.9);
+}
+.audio-control-btn .tooltip {
+  position: absolute;
+  bottom: 70px;
+  right: 0;
+  background: rgba(0, 0, 0, 0.8);
+  color: #fff;
+  padding: 4px 12px;
+  border-radius: 12px;
+  font-size: 12px;
+  white-space: nowrap;
+  opacity: 0;
+  pointer-events: none;
+  transition: opacity 0.2s;
+}
+.audio-control-btn:hover .tooltip {
+  opacity: 1;
+}
+</style>

+ 1 - 1
src/components/addPatrolPlanDialog/index.vue

@@ -401,7 +401,7 @@
           groupId: [
             {
               required: true,
-              message: '请选择选择巡点检部门',
+              message: '请选择选择部门',
               trigger: 'change'
             }
           ],

+ 199 - 0
src/utils/audioManager.js

@@ -0,0 +1,199 @@
+// src/utils/audioManager.js
+
+class AudioManager {
+  constructor() {
+    // 从 sessionStorage 读取是否曾经解锁(仅用于UI提示)
+    this.hasUnlockedBefore = sessionStorage.getItem('audioUnlocked') === 'true';
+    // 当前实际静音状态(页面加载后默认为 true)
+    this.isMuted = true;
+    // 存储所有活跃的音频实例及播放状态
+    this.audioInstances = [];
+
+    // 🎯 全局默认播放次数(你可以根据需要改为 1 或 3)
+    this.defaultRepeatCount = 3; // 默认循环3次
+
+    // 被浏览器策略拦截后待重试的播放队列
+    this._pendingPlaybacks = [];
+
+    // 全局用户手势监听(用于重试被拦截的播放)
+    this._setupUserGestureRetry();
+  }
+
+  /**
+   * 停止所有正在播放的音频
+   */
+  stopAll() {
+    this.audioInstances.forEach((item) => {
+      item.audio.pause();
+      item.audio.src = '';
+      item.audio.onended = null; // 清除事件监听
+    });
+    this.audioInstances = [];
+    console.log('🛑 已停止所有音频');
+  }
+
+  /**
+   * 恢复 AudioContext(绕过浏览器自动播放限制)
+   */
+  _resumeAudioContext() {
+    if (this._audioContext && this._audioContext.state === 'suspended') {
+      this._audioContext.resume().catch(() => {});
+    }
+  }
+
+  /**
+   * 设置用户手势后重试被拦截的播放
+   */
+  _setupUserGestureRetry() {
+    const retryAll = () => {
+      if (!this._pendingPlaybacks.length) return;
+      const tasks = [...this._pendingPlaybacks];
+      this._pendingPlaybacks = [];
+      tasks.forEach((fn) => fn());
+    };
+    const handler = () => {
+      retryAll();
+      document.removeEventListener('click', handler);
+      document.removeEventListener('touchstart', handler);
+      document.removeEventListener('keydown', handler);
+    };
+    document.addEventListener('click', handler, { once: true });
+    document.addEventListener('touchstart', handler, { once: true });
+    document.addEventListener('keydown', handler, { once: true });
+  }
+
+  /**
+   * 播放音频(自动停止之前的音频,并支持自定义重复次数)
+   * @param {string} src - 音频文件路径
+   * @param {object} options
+   * @param {number} options.repeatCount - 播放次数(默认使用全局 defaultRepeatCount),设为 1 则只播放一次
+   * @param {boolean} options.loop - 是否无限循环(与 repeatCount 二选一,若同时设置,优先使用 repeatCount)
+   * @param {boolean} options.clearPrevious - 是否停止之前的音频,默认 true
+   * @returns {HTMLAudioElement} 返回 Audio 实例,以便外部控制
+   */
+  play(src, options = {}) {
+    const {
+      repeatCount = this.defaultRepeatCount,
+      loop = false,
+      clearPrevious = true,
+    } = options;
+
+    // 播放新音频前,先停止所有旧音频
+    if (clearPrevious) {
+      this.stopAll();
+    }
+
+    const audio = new Audio(src);
+    // 根据当前静音状态设置
+    audio.muted = this.isMuted;
+
+    // 禁用原生 loop,我们手动控制次数
+    audio.loop = false;
+
+    // 如果用户明确要求无限循环(且没有指定 repeatCount),则使用原生 loop
+    if (loop && !repeatCount) {
+      audio.loop = true;
+    }
+
+    // 计算目标播放次数(至少1次)
+    const targetCount = Math.max(1, repeatCount || 1);
+    let currentCount = 0;
+
+    // 定义 ended 事件处理器(用于重复播放)
+    const onEnded = () => {
+      currentCount++;
+      if (currentCount < targetCount) {
+        // 重新播放
+        audio.play().catch((err) => console.warn('重播失败:', err));
+      } else {
+        // 播放完成,从实例数组中移除
+        const idx = this.audioInstances.findIndex((item) => item.audio === audio);
+        if (idx > -1) {
+          this.audioInstances.splice(idx, 1);
+        }
+        audio.onended = null; // 清理事件
+      }
+    };
+    audio.addEventListener('ended', onEnded);
+
+    // 存储音频实例及元数据(用于后续管理)
+    this.audioInstances.push({
+      audio,
+      currentCount,
+      targetCount,
+      onEnded,
+    });
+
+    // 播放前先尝试恢复 AudioContext(绕过浏览器自动播放限制)
+    this._resumeAudioContext();
+
+    // 开始播放
+    audio.play().catch((err) => {
+      // 被浏览器策略拦截时,保存到待播放队列,等下次用户交互时重试
+      console.warn('音频播放失败(自动播放策略):', err);
+      if (err.name === 'NotAllowedError') {
+        this._pendingPlaybacks.push(() => {
+          audio.play().catch(() => {});
+        });
+      }
+    });
+
+    return audio;
+  }
+
+  /**
+   * 解除全局静音(必须由用户手势触发)
+   */
+  unmute() {
+    if (!this.isMuted) return;
+    this.isMuted = false;
+    this.audioInstances.forEach((item) => {
+      item.audio.muted = false;
+    });
+    sessionStorage.setItem('audioUnlocked', 'true');
+    this.hasUnlockedBefore = true;
+
+    // 解锁后重试被拦截的播放
+    if (this._pendingPlaybacks.length) {
+      const tasks = [...this._pendingPlaybacks];
+      this._pendingPlaybacks = [];
+      tasks.forEach((fn) => fn());
+    }
+
+    console.log('🔊 音频已解除静音');
+  }
+
+  /**
+   * 重新静音
+   */
+  mute() {
+    if (this.isMuted) return;
+    this.isMuted = true;
+    this.audioInstances.forEach((item) => {
+      item.audio.muted = true;
+    });
+    sessionStorage.removeItem('audioUnlocked');
+    this.hasUnlockedBefore = false;
+    console.log('🔇 音频已静音');
+  }
+
+  /**
+   * 获取当前状态(用于UI)
+   */
+  getStatus() {
+    return {
+      isMuted: this.isMuted,
+      hasUnlockedBefore: this.hasUnlockedBefore,
+    };
+  }
+
+  /**
+   * 彻底销毁所有音频(页面卸载时调用)
+   */
+  destroyAll() {
+    this.stopAll();
+  }
+}
+
+// 导出单例
+export default new AudioManager();

+ 2 - 1
src/utils/dict/warehouse.js

@@ -131,7 +131,8 @@ export const businessStatus = [
   { code: 2, label: '故障' },
   { code: 3, label: '维修' },
   { code: 4, label: '保养' },
-  { code: 5, label: '巡点检' }
+  { code: 5, label: '巡点检' },
+  { code: 6, label: '检修' },
 ];
 
 // 生命周期

+ 326 - 52
src/views/equipmentOperationMonitoring/index.vue

@@ -110,7 +110,7 @@
               </div>
 
               <!-- 更新时间 -->
-              <div class="update-time">更新时间:{{ updateTime }}</div>
+              <div class="update-time">更新时间:{{ updateTime }} </div>
 
               <!-- 卡片视图 -->
               <div
@@ -124,7 +124,9 @@
                 v-loading="loading"
                 v-infinite-scroll="loadMore"
                 :infinite-scroll-distance="50"
-                :infinite-scroll-disabled="loadingMore || deviceData.length >= total"
+                :infinite-scroll-disabled="
+                  loadingMore || deviceData.length >= total
+                "
                 :infinite-scroll-immediate="false"
               >
                 <el-row :gutter="10">
@@ -143,6 +145,50 @@
                       }"
                       @click="details(item)"
                     >
+                      <!-- 告警闪灯 -->
+                      <div
+                        v-if="item.alarmLogStatusDTO?.alarmId"
+                        class="alarm-badge"
+                        :class="{
+                          'alarm-yellow': item.alarmLogStatusDTO?.alarmId == 1,
+                          'alarm-orange': item.alarmLogStatusDTO?.alarmId == 2,
+                          'alarm-red':
+                            item.alarmLogStatusDTO?.alarmId == 3 ||
+                            item.alarmLogStatusDTO?.alarmId == 5 ||
+                            item.alarmLogStatusDTO?.alarmId == 4
+                        }"
+                      >
+                        <span class="alarm-text">
+                          <div
+                            v-if="
+                              item.alarmLogStatusDTO &&
+                              item.alarmLogStatusDTO?.deviceData
+                            "
+                          >
+                            <div
+                              v-for="(item, index) in JSON.parse(
+                                item.alarmLogStatusDTO?.deviceData
+                              ).filter((val) =>
+                                evalFn(
+                                  val.value + val.operator + val.thresholdValue
+                                )
+                              )"
+                              :key="index"
+                            >
+                              点位:{{ item.attributeName }} 差值:{{
+                                parseFloat(
+                                  (item.value - item.thresholdValue).toFixed(3)
+                                )
+                              }}
+                            </div>
+                          </div>
+                        </span>
+                        <img
+                          class="alarm-icon"
+                          :src="getAlarmSrc(item.alarmLogStatusDTO?.alarmId)"
+                          alt="alarm"
+                        />
+                      </div>
                       <div class="card-header">
                         <div>{{item.postName|}}</div>
                         <div class="card-header-value">
@@ -154,19 +200,57 @@
                           </div>
                           <div class="card-actions">
                             <el-tag
-                              :type="getStatusType(item.status, 1)"
+                              v-if="item.maintenanceSummary.patrol"
+                              type="warning"
                               size="small"
                               effect="dark"
                               class="status-tag"
                             >
-                              {{
-                                businessStatus.filter(
-                                  (row) => row.code == item.status
-                                )[0]?.label
-                              }}
+                              巡点检
                             </el-tag>
-                          </div></div
-                        >
+                            <el-tag
+                              v-if="item.maintenanceSummary.maintain"
+                              type="warning"
+                              size="small"
+                              effect="dark"
+                              class="status-tag"
+                            >
+                              保养
+                            </el-tag>
+                            <el-tag
+                              v-if="item.maintenanceSummary.overhaul"
+                              type="warning"
+                              size="small"
+                              effect="dark"
+                              class="status-tag"
+                            >
+                              检修
+                            </el-tag>
+                            <el-tag
+                              v-if="item.maintenanceSummary.repair"
+                              type="danger"
+                              size="small"
+                              effect="dark"
+                              class="status-tag"
+                            >
+                              维修
+                            </el-tag>
+                            <el-tag
+                              v-if="
+                                !item.maintenanceSummary.repair &&
+                                !item.maintenanceSummary.overhaul &&
+                                !item.maintenanceSummary.maintain &&
+                                !item.maintenanceSummary.patrol
+                              "
+                              type="success"
+                              size="small"
+                              effect="dark"
+                              class="status-tag"
+                            >
+                              空闲
+                            </el-tag>
+                          </div>
+                        </div>
                       </div>
                       <div class="card-body">
                         <el-tag
@@ -220,6 +304,7 @@
         </ele-split-layout>
       </el-card>
     </div>
+    <GlobalAudioUnlockButton></GlobalAudioUnlockButton>
   </vue-fullscreen>
 </template>
 
@@ -233,9 +318,16 @@
   import { businessStatus } from '@/utils/dict/warehouse';
   import DeptSelect from '@/components/CommomSelect/dept-selectNew.vue';
   import { component } from 'vue-fullscreen';
+  import audioManager from '@/utils/audioManager.js';
+
+  import GlobalAudioUnlockButton from '@/components/GlobalAudioUnlockButton.vue';
   export default {
     mixins: [dictMixins, tableColumnsMixin],
-    components: { DeptSelect, VueFullscreen: component },
+    components: {
+      DeptSelect,
+      VueFullscreen: component,
+      GlobalAudioUnlockButton
+    },
     data() {
       return {
         // 搜索表单
@@ -259,6 +351,7 @@
           children: 'children',
           label: 'name'
         },
+        src: '',
         // 分页参数
         pageNum: 1,
         pageSize: 10,
@@ -270,7 +363,9 @@
         categoryLevelId: '',
         rootCategoryLevelId: '',
         loadingMore: false,
-        loading: false
+        loading: false,
+        audioInstance: null,
+        pollingTimer: null
       };
     },
     computed: {},
@@ -312,6 +407,20 @@
           parentIdField: 'parentId'
         });
       });
+      // 3分钟轮询
+      this.pollingTimer = setInterval(() => {
+        this.pollDeviceData();
+      }, 3 * 60 * 1000);
+    },
+    beforeDestroy() {
+      if (this.pollingTimer) {
+        clearInterval(this.pollingTimer);
+        this.pollingTimer = null;
+      }
+      if (this.audioInstance) {
+        this.audioInstance.pause();
+        this.audioInstance = null;
+      }
     },
     methods: {
       activeTabChange() {
@@ -335,7 +444,23 @@
           this.deviceData = [];
         }
       },
-      // 加载设备数据
+      getAlarmLevelText(level) {
+        const textMap = {
+          1: '轻微告警',
+          2: '中等告警',
+          3: '严重告警',
+          4: '紧急告警',
+          5: '致命告警'
+        };
+        return textMap[level] || '';
+      },
+      getAlarmSrc(level) {
+        if (level == 1) return require('@/assets/y.gif');
+        if (level == 2) return require('@/assets/g.gif');
+        if (level == 3 || level == 4 || level == 5)
+          return require('@/assets/r.gif');
+        return '';
+      },
       loadDeviceData(isLoadMore = false) {
         if (this.loadingMore) return;
         this.loadingMore = true;
@@ -354,48 +479,51 @@
           areaId: this.areaId,
           keyWord: this.keyWord,
           postId: this.postId
-        }).then((res) => {
-          this.loadingMore = false;
-          this.loading = false;
-          this.updateTime = dayjs().format('YYYY-M-D HH:mm:ss');
-          const list = res.list.map((item) => {
-            let iotList = [];
-            if (item.iotPointDataList) {
-              item.iotPointDataList.forEach((element) => {
-                let data = item.iotModel.properties.find(
-                  (iotModel) => iotModel.identifier == element.identifier
-                );
-                if (data) {
-                  iotList.push({
-                    ...element,
-                    dataType: data.dataType
-                  });
-                }
-              });
-            }
+        })
+          .then((res) => {
+            this.loadingMore = false;
+            this.loading = false;
+            this.updateTime = dayjs().format('YYYY-M-D HH:mm:ss');
+            const list = res.list.map((item) => {
+              let iotList = [];
+              if (item.iotPointDataList) {
+                item.iotPointDataList.forEach((element) => {
+                  let data = item.iotModel.properties.find(
+                    (iotModel) => iotModel.identifier == element.identifier
+                  );
+                  if (data) {
+                    iotList.push({
+                      ...element,
+                      dataType: data.dataType
+                    });
+                  }
+                });
+              }
 
-            item['iotList'] = item.iotDashboardPoint.length
-              ? iotList.filter((iotListItem) =>
-                  item.iotDashboardPoint.find(
-                    (Point) =>
-                      Point.identifier == iotListItem.identifier &&
-                      Point.checked1
+              item['iotList'] = item.iotDashboardPoint.length
+                ? iotList.filter((iotListItem) =>
+                    item.iotDashboardPoint.find(
+                      (Point) =>
+                        Point.identifier == iotListItem.identifier &&
+                        Point.checked1
+                    )
                   )
-                )
-              : iotList.filter((iotListItem, index) => index < 4);
-            return item;
+                : iotList.filter((iotListItem, index) => index < 4);
+              return item;
+            });
+            if (isLoadMore) {
+              this.deviceData = this.deviceData.concat(list);
+            } else {
+              this.deviceData = list;
+            }
+            this.total = res.count;
+            this.playAlarmSound();
+            console.log(res);
+          })
+          .catch(() => {
+            this.loadingMore = false;
+            this.loading = false;
           });
-          if (isLoadMore) {
-            this.deviceData = this.deviceData.concat(list);
-          } else {
-            this.deviceData = list;
-          }
-          this.total = res.count;
-          console.log(res);
-        }).catch(() => {
-          this.loadingMore = false;
-          this.loading = false;
-        });
       },
       // 加载更多
       loadMore() {
@@ -447,12 +575,96 @@
         };
         return textMap[status] || status;
       },
+      playAlarmSound() {
+        const data = this.deviceData;
+        const hasHigh = data.some((item) =>
+          [3, 4, 5].includes(item.alarmLogStatusDTO?.alarmId)
+        );
+        const hasMedium = data.some(
+          (item) => item.alarmLogStatusDTO?.alarmId == 2
+        );
+        const hasLow = data.some(
+          (item) => item.alarmLogStatusDTO?.alarmId == 1
+        );
+
+        let src = '';
+        if (hasHigh) {
+          src = require('@/assets/r.mp3');
+        } else if (hasMedium) {
+          src = require('@/assets/g.mp3');
+        } else if (hasLow) {
+          src = require('@/assets/y.mp3');
+        }
+
+        console.log(src, 'src');
+        if (src) {
+          console.log(audioManager, 'audioManager');
+          audioManager.play(src, { loop: false });
+        }
+      },
+      // 3分钟轮询请求
+      pollDeviceData() {
+        const size = this.deviceData.length;
+        if (!size) return;
+        querySubstanceRunningMonitor({
+          pageNum: 1,
+          size: size,
+          categoryLevelId: this.categoryLevelId,
+          rootCategoryLevelId: this.rootCategoryLevelId,
+          areaId: this.areaId,
+          keyWord: this.keyWord,
+          postId: this.postId
+        })
+          .then((res) => {
+            const list = res.list.map((item) => {
+              let iotList = [];
+              if (item.iotPointDataList) {
+                item.iotPointDataList.forEach((element) => {
+                  let data = item.iotModel.properties.find(
+                    (iotModel) => iotModel.identifier == element.identifier
+                  );
+                  if (data) {
+                    iotList.push({
+                      ...element,
+                      dataType: data.dataType
+                    });
+                  }
+                });
+              }
+              item['iotList'] = item.iotDashboardPoint.length
+                ? iotList.filter((iotListItem) =>
+                    item.iotDashboardPoint.find(
+                      (Point) =>
+                        Point.identifier == iotListItem.identifier &&
+                        Point.checked1
+                    )
+                  )
+                : iotList.filter((iotListItem, index) => index < 4);
+              return item;
+            });
+            this.deviceData = list;
+            this.total = res.count;
+            this.playAlarmSound();
+          })
+          .catch(() => {});
+      },
 
       // 搜索
       handleSearch() {
         this.pageNum = 1;
         this.loadDeviceData();
       },
+      evalFn(val) {
+        return eval(val);
+      },
+      getDeviceData(data) {
+        console.log(data, 'data');
+        if (data) {
+          return JSON.parse(data);
+        } else {
+          return [];
+        }
+      },
       // 重置
       handleReset() {
         this.keyWord = '';
@@ -791,6 +1003,41 @@
           transition: all 0.3s;
           box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4),
             inset 0 1px 0 rgba(255, 255, 255, 0.05);
+          position: relative;
+
+          .alarm-badge {
+            position: absolute;
+            top: 5px;
+            right: 70px;
+            display: flex;
+            align-items: center;
+            gap: 4px;
+            z-index: 2;
+            //animation: alarm-pulse 1.5s infinite;
+
+            .alarm-text {
+              font-size: 12px;
+              font-weight: 500;
+            }
+
+            .alarm-icon {
+              width: 30px;
+              height: 30px;
+            }
+
+            &.alarm-yellow {
+              color: #f0a030;
+              text-shadow: 0 0 8px #f0a030;
+            }
+            &.alarm-orange {
+              color: #e67e22;
+              text-shadow: 0 0 8px #e67e22;
+            }
+            &.alarm-red {
+              color: #ff4d4f;
+              text-shadow: 0 0 8px #ff4d4f;
+            }
+          }
 
           &:hover {
             box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5),
@@ -995,6 +1242,24 @@
     }
   }
 
+  @keyframes alarm-pulse {
+    0%,
+    100% {
+      transform: scale(1);
+    }
+    50% {
+      transform: scale(1.15);
+    }
+  }
+  @keyframes alarm-pulse {
+    0%,
+    100% {
+      transform: scale(1);
+    }
+    50% {
+      transform: scale(1.15);
+    }
+  }
   @keyframes bellshake {
     0%,
     100% {
@@ -1014,6 +1279,15 @@
       transform: rotate(10deg);
     }
   }
+  @keyframes blink {
+    0%,
+    100% {
+      opacity: 1;
+    }
+    50% {
+      opacity: 0.3;
+    }
+  }
   .fullscreen-btn {
     position: absolute;
     right: 15px;

+ 38 - 1
src/views/ledgerAssets/accountingLedger/components/list.vue

@@ -81,6 +81,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
         <el-button
           size="small"
           type="danger"
@@ -173,7 +194,7 @@
   } from '@/utils/dict/warehouse';
 
   import EquipmentSearch from '@/views/ledgerAssets/equipment/components/equipment-search.vue';
-  import { getAssetList, getNetworkCount, batchDel } from '@/api/ledgerAssets';
+  import { getAssetList, getNetworkCount, batchDel, batchStop, batchRun } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   import axios from 'axios';
   import { API_BASE_URL } from '@/config/setting';
@@ -389,6 +410,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -490,6 +520,13 @@
           this.checkRadioData = [];
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
       handlDelete() {
         if (this.checkRadioData.length == 0) {
           this.$message.warning('请至少选择一条数据');

+ 40 - 1
src/views/ledgerAssets/boat/components/boat-list.vue

@@ -80,6 +80,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -128,7 +149,9 @@
   import {
     getBoatList,
     downloadCategory,
-    getAssetList
+    getAssetList,
+    batchStop,
+    batchRun
   } from '@/api/ledgerAssets';
   // import { downloadAction } from '@/api/flowable/manage';
   import dictMixins from '@/mixins/dictMixins';
@@ -329,6 +352,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -411,6 +443,13 @@
           this.checkRadioData = [];
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
       add() {
         this.$router.push({
           path: '/ledgerAssets/boat/edit'

+ 41 - 8
src/views/ledgerAssets/equipment/components/equipment-list.vue

@@ -81,6 +81,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
         <el-button
           size="small"
           type="danger"
@@ -99,13 +120,6 @@
           v-if="$hasPermission('main:substance:import')"
           >导入</el-button
         >
-        <!-- <el-button
-          size="small"
-          @click="moveTo(checkRadioData, 'move')"
-          :disabled="checkRadioData.length == 0"
-          class="ele-btn-icon"
-          >移动到</el-button
-        > -->
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }" v-if="!$route.query.isDrawer">
@@ -183,7 +197,9 @@
     getAssetList,
     downloadAsset,
     getNetworkCount,
-    batchDel
+    batchDel,
+    batchStop,
+    batchRun
   } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   import axios from 'axios';
@@ -411,6 +427,16 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
+
           {
             prop: 'pathName',
             label: '位置',
@@ -512,6 +538,13 @@
           this.checkRadioData = [];
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
       handlDelete() {
         if (this.checkRadioData.length == 0) {
           this.$message.warning('请至少选择一条数据');

+ 59 - 1
src/views/ledgerAssets/material/components/material-list.vue

@@ -17,6 +17,8 @@
       full-height="calc(100vh - 115px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"
+      @select="selectChange"
+      @select-all="changeSelectAll"
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
@@ -59,6 +61,27 @@
         >
           设置使用单位
         </el-button> -->
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -100,7 +123,9 @@
   import {
     getBoatList,
     downloadCategory,
-    getAssetList
+    getAssetList,
+    batchStop,
+    batchRun
   } from '@/api/ledgerAssets';
   import batchSetDialog from '@/views/ledgerAssets/equipment/components/batchSetDialog.vue';
   import DialogMoveto from '@/views/ledgerAssets/equipment/components/DialogMoveTo.vue';
@@ -122,6 +147,7 @@
         businessStatus,
         assetLevel: [],
         isConsumer: false,
+        checkRadioData: [],
         // 表格列配置
         columns: [
           {
@@ -295,6 +321,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -408,6 +443,29 @@
           rootCategoryLevelId: this.rootId
         };
         downloadCategory(params, '原料台账导出数据');
+      },
+      // 全选
+      changeSelectAll(arr) {
+        console.log(arr);
+        if (arr.length != 0) {
+          this.checkRadioData = arr;
+        } else {
+          this.checkRadioData = [];
+        }
+      },
+      selectChange(selection, row) {
+        if (selection.length != 0) {
+          this.checkRadioData = selection;
+        } else {
+          this.checkRadioData = [];
+        }
+      },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
       }
     },
     watch: {

+ 40 - 1
src/views/ledgerAssets/meter/components/equipment-list.vue

@@ -77,6 +77,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -128,7 +149,9 @@
     getAssetList,
     downloadAsset,
     getNetworkCount,
-    batchDel
+    batchDel,
+    batchStop,
+    batchRun
   } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   import axios from 'axios';
@@ -347,6 +370,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -470,6 +502,13 @@
             .catch(() => {});
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
 
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {

+ 38 - 1
src/views/ledgerAssets/mould/components/mould-list.vue

@@ -78,6 +78,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -146,7 +167,7 @@
   } from '@/utils/dict/warehouse';
   import MouldSearch from '@/views/ledgerAssets/equipment/components/equipment-search.vue';
 
-  import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
+  import { getAssetList, downloadAsset, batchStop, batchRun } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   import axios from 'axios';
   import {
@@ -354,6 +375,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -436,6 +466,13 @@
           this.checkRadioData = [];
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
       // 获取资产级别下拉
       async getAssetLevelOptions() {
         let { data } = await getByCode('asset_level');

+ 38 - 1
src/views/ledgerAssets/office/components/data-list.vue

@@ -79,6 +79,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -144,7 +165,7 @@
   } from '@/utils/dict/warehouse';
   import UserSearch from '@/views/ledgerAssets/equipment/components/equipment-search.vue';
 
-  import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
+  import { getAssetList, downloadAsset, batchStop, batchRun } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   import axios from 'axios';
   import {
@@ -353,6 +374,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -415,6 +445,13 @@
           this.checkRadioData = [];
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
       // 获取资产级别下拉
       async getAssetLevelOptions() {
         let { data } = await getByCode('asset_level');

+ 38 - 1
src/views/ledgerAssets/sparepart/components/sparepart-list.vue

@@ -70,6 +70,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -135,7 +156,7 @@
   } from '@/utils/dict/warehouse';
   import SparepartSearch from '@/views/ledgerAssets/equipment/components/equipment-search.vue';
 
-  import { getAssetList, importCategorySparePart } from '@/api/ledgerAssets';
+  import { getAssetList, importCategorySparePart, batchStop, batchRun } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   import axios from 'axios';
   import {
@@ -339,6 +360,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -420,6 +450,13 @@
           this.checkRadioData = [];
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
       suuccessUpload() {
         this.isLoading = false;
       },

+ 38 - 1
src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue

@@ -79,6 +79,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
 
       <!-- 编码列 -->
@@ -132,7 +153,7 @@
   } from '@/utils/dict/warehouse';
   import TurnovercarSearch from '@/views/ledgerAssets/equipment/components/equipment-search.vue';
 
-  import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
+  import { getAssetList, downloadAsset, batchStop, batchRun } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   // import { downloadAction } from '@/api/flowable/manage';
   import axios from 'axios';
@@ -333,6 +354,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -415,6 +445,13 @@
           this.checkRadioData = [];
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
       // 获取资产级别下拉
       async getAssetLevelOptions() {
         let { data } = await getByCode('asset_level');

+ 40 - 1
src/views/ledgerAssets/turnoverDisks/components/equipment-list.vue

@@ -78,6 +78,27 @@
         >
           设置使用单位
         </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-s-tools"
+          class="ele-btn-icon"
+          type="danger"
+          @click="setStatus(1)"
+          v-if="$hasPermission('main:substance:stop')"
+        >
+          批量停机
+        </el-button>
+        <el-button
+          size="small"
+          :disabled="checkRadioData.length == 0"
+          icon="el-icon-setting"
+          class="ele-btn-icon"
+          @click="setStatus(2)"
+          v-if="$hasPermission('main:substance:run')"
+        >
+          批量运行
+        </el-button>
       </template>
       <!-- 编码列 -->
       <template v-slot:code="{ row }">
@@ -124,7 +145,9 @@
     getAssetList,
     downloadAsset,
     getNetworkCount,
-    batchDel
+    batchDel,
+    batchStop,
+    batchRun
   } from '@/api/ledgerAssets';
   import dictMixins from '@/mixins/dictMixins';
   import axios from 'axios';
@@ -327,6 +350,15 @@
               }
             }
           },
+          {
+            prop: 'runStatus',
+            label: '运行状态',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (_row) => {
+              return _row.runStatus == 5 ? '停机' : '运行';
+            }
+          },
           {
             prop: 'pathName',
             label: '位置',
@@ -439,6 +471,13 @@
             .catch(() => {});
         }
       },
+      setStatus(type) {
+        let api = type == 1 ? batchStop : batchRun;
+        api(this.checkRadioData.map((item) => item.id)).then((res) => {
+          this.$message.success('操作成功');
+          this.sucesstion(true);
+        });
+      },
 
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {

+ 1136 - 931
src/views/maintenance/components/programRulesDialog.vue

@@ -1,25 +1,56 @@
 <template>
-  <ele-modal width="80%" :visible="visible" v-if="visible" append-to-body custom-class="ele-dialog-form"
-    :title="dialogTitle" :close-on-click-modal="false" :before-close="close" :maxable="true">
+  <ele-modal
+    width="80%"
+    :visible="visible"
+    v-if="visible"
+    append-to-body
+    custom-class="ele-dialog-form"
+    :title="dialogTitle"
+    :close-on-click-modal="false"
+    :before-close="close"
+    :maxable="true"
+  >
     <header-title title="基本信息"></header-title>
-    <el-form ref="addFormRef" :model="addForm" :rules="addFormRules" label-width="120px">
+    <el-form
+      ref="addFormRef"
+      :model="addForm"
+      :rules="addFormRules"
+      label-width="120px"
+    >
       <el-row>
         <el-col :span="8">
           <el-form-item label="计划配置单号" prop="code">
-            <el-input v-model="addForm.code" size="small" placeholder="自动带出" disabled></el-input>
+            <el-input
+              v-model="addForm.code"
+              size="small"
+              placeholder="自动带出"
+              disabled
+            ></el-input>
           </el-form-item>
         </el-col>
 
         <el-col :span="8">
           <el-form-item label="计划配置名称" prop="name">
-            <el-input :disabled="dialogTitle === '派单'" v-model="addForm.name" size="small" placeholder="请输入"></el-input>
+            <el-input
+              :disabled="dialogTitle === '派单'"
+              v-model="addForm.name"
+              size="small"
+              placeholder="请输入"
+            ></el-input>
           </el-form-item>
         </el-col>
 
         <el-col :span="8">
           <el-form-item label="自动派单" prop="autoOrder">
-            <el-select :disabled="dialogTitle === '派单' || dialogTitle.includes('量具送检')
-              " v-model="addForm.autoOrder" size="small" style="width: 100%" @change="autoOrderChange">
+            <el-select
+              :disabled="
+                dialogTitle === '派单' || dialogTitle.includes('量具送检')
+              "
+              v-model="addForm.autoOrder"
+              size="small"
+              style="width: 100%"
+              @change="autoOrderChange"
+            >
               <el-option :value="1" label="是"></el-option>
               <el-option :value="0" label="否"></el-option>
             </el-select>
@@ -29,8 +60,13 @@
         <el-col :span="8">
           <el-form-item label="计划完成时长" prop="duration">
             <div style="display: flex">
-              <el-input type="number"  v-model="addForm.duration" size="small"
-                placeholder="请输入" @input="formDataDurationTime">
+              <el-input
+                type="number"
+                v-model="addForm.duration"
+                size="small"
+                placeholder="请输入"
+                @input="formDataDurationTime"
+              >
                 <template #suffix>分钟</template>
               </el-input>
             </div>
@@ -39,14 +75,27 @@
 
         <el-col :span="8" v-if="!dialogTitle.includes('量具送检')">
           <el-form-item label="类型" prop="executeUserType">
-            <el-select v-model="addForm.executeUserType" :disabled="isBindPlan" size="small" @change="typeChange" style="width: 100%">
+            <el-select
+              v-model="addForm.executeUserType"
+              :disabled="isBindPlan"
+              size="small"
+              @change="typeChange"
+              style="width: 100%"
+            >
               <el-option :value="1" label="班组"></el-option>
               <el-option :value="0" label="个人"></el-option>
             </el-select>
           </el-form-item>
         </el-col>
 
-        <el-col :span="8" v-if="dispatchStatus && addForm.executeUserType == 1 && !dialogTitle.includes('量具送检')">
+        <el-col
+          :span="8"
+          v-if="
+            dispatchStatus &&
+            addForm.executeUserType == 1 &&
+            !dialogTitle.includes('量具送检')
+          "
+        >
           <el-form-item label="班组" prop="teamId">
             <el-select
               v-model="addForm.teamId"
@@ -65,12 +114,30 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="8" v-if="dispatchStatus && addForm.executeUserType == 0 && !dialogTitle.includes('量具送检')">
+        <el-col
+          :span="8"
+          v-if="
+            dispatchStatus &&
+            addForm.executeUserType == 0 &&
+            !dialogTitle.includes('量具送检')
+          "
+        >
           <el-form-item label="部门" prop="groupId">
-            <deptSelect v-model="addForm.groupId" @changeGroup="searchDeptNodeClick" :disabled="isBindPlan" />
+            <deptSelect
+              v-model="addForm.groupId"
+              @changeGroup="searchDeptNodeClick"
+              :disabled="isBindPlan"
+            />
           </el-form-item>
         </el-col>
-        <el-col :span="8" v-if="dispatchStatus && addForm.executeUserType == 0 && !dialogTitle.includes('量具送检')">
+        <el-col
+          :span="8"
+          v-if="
+            dispatchStatus &&
+            addForm.executeUserType == 0 &&
+            !dialogTitle.includes('量具送检')
+          "
+        >
           <!-- <el-form-item label="负责人" prop="executorId">
             <el-select v-model="addForm.executorId" size="small" style="width: 100%" :disabled="isBindPlan" multiple
               filterable>
@@ -98,50 +165,85 @@
         </el-col>
         <el-col :span="8" v-if="!dialogTitle.includes('量具送检')">
           <el-form-item label="审核人" prop="approvalUserId">
-            <el-select :disabled="dialogTitle === '派单'" v-model="addForm.approvalUserId" size="small" clearable
-              style="width: 100%" filterable>
-              <el-option v-for="item in uerList" :key="item.id" :value="item.id" :label="item.name"></el-option>
+            <el-select
+              :disabled="dialogTitle === '派单'"
+              v-model="addForm.approvalUserId"
+              size="small"
+              clearable
+              style="width: 100%"
+              filterable
+            >
+              <el-option
+                v-for="item in uerList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              ></el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="紧急程度" prop="urgent">
-            <DictSelection dictName="紧急程度" clearable v-model="addForm.urgent" :disabled="dialogTitle === '派单'">
+            <DictSelection
+              dictName="紧急程度"
+              clearable
+              v-model="addForm.urgent"
+              :disabled="dialogTitle === '派单'"
+            >
             </DictSelection>
           </el-form-item>
         </el-col>
-        <!-- <el-col :span="8">
-          <el-form-item label="状态" prop="status">
-            <el-switch
-              v-model="addForm.status"
-              active-text="开"
-              inactive-text="关"
-              :active-value="1"
-              :inactive-value="0"
-            />
-          </el-form-item>
-        </el-col> -->
+
         <el-col :span="24">
           <el-form-item label="备注" prop="remark">
-            <el-input type="textarea" resize="none" v-model="addForm.remark" :rows="2" placeholder="请详细说明" size="small"
-              :disabled="dialogTitle === '派单'"></el-input>
+            <el-input
+              type="textarea"
+              resize="none"
+              v-model="addForm.remark"
+              :rows="2"
+              placeholder="请详细说明"
+              size="small"
+              :disabled="dialogTitle === '派单'"
+            ></el-input>
           </el-form-item>
         </el-col>
       </el-row>
 
-      <el-button v-if="dialogTitle.includes('新增')" type="primary" size="small" style="margin-bottom: 10px"
-        @click="handleAddTab">添加规则</el-button>
-
-      <el-tabs v-model="tabsValue" type="card" :closable="dialogTitle !== '派单'" @tab-click="handleTab"
-        @tab-remove="removeTab">
-        <el-tab-pane v-for="(item, ruleIdListIndex) in ruleIdList" :key="item.ruleId" :label="item.name"
-          :name="item.ruleId">
+      <el-button
+        v-if="dialogTitle.includes('新增')"
+        type="primary"
+        size="small"
+        style="margin-bottom: 10px"
+        @click="handleAddTab"
+        >添加规则</el-button
+      >
+
+      <el-tabs
+        v-model="tabsValue"
+        type="card"
+        :closable="dialogTitle !== '派单'"
+        @tab-click="handleTab"
+        @tab-remove="removeTab"
+      >
+        <el-tab-pane
+          v-for="(item, ruleIdListIndex) in ruleIdList"
+          :key="item.ruleId"
+          :label="item.name"
+          :name="item.ruleId"
+        >
           <div class="el-tab_box">
             <div class="equipmentList_box">
               <header-title title="设备列表">
                 <div v-if="dialogTitle !== '派单'">
-                  <el-button size="small" icon="el-icon-plus" class="ele-btn-icon" type="primary"
-                    :disables="hasCategoryId" @click="handleAdd(ruleIdList, ruleIdListIndex)">新增</el-button>
+                  <el-button
+                    size="small"
+                    icon="el-icon-plus"
+                    class="ele-btn-icon"
+                    type="primary"
+                    :disables="hasCategoryId"
+                    @click="handleAdd(ruleIdList, ruleIdListIndex)"
+                    >新增</el-button
+                  >
                 </div>
               </header-title>
               <el-table :data="item.equipmentList" border>
@@ -168,9 +270,17 @@
                     </template>
                   </template>
                 </el-table-column>
-                <el-table-column v-if="dialogTitle !== '派单'" label="操作" width="100">
+                <el-table-column
+                  v-if="dialogTitle !== '派单'"
+                  label="操作"
+                  width="100"
+                >
                   <template slot-scope="scope">
-                    <el-button type="text" @click="deleteEquipment(scope.$index)">删除</el-button>
+                    <el-button
+                      type="text"
+                      @click="deleteEquipment(scope.$index)"
+                      >删除</el-button
+                    >
                   </template>
                 </el-table-column>
               </el-table>
@@ -178,8 +288,14 @@
             <div class="ruleMatters_box">
               <header-title title="规则事项">
                 <div v-if="dialogTitle !== '派单'">
-                  <el-button size="small" icon="el-icon-plus" class="ele-btn-icon" type="primary"
-                    @click="addPostscript">新增</el-button>
+                  <el-button
+                    size="small"
+                    icon="el-icon-plus"
+                    class="ele-btn-icon"
+                    type="primary"
+                    @click="addPostscript"
+                    >新增</el-button
+                  >
                 </div>
               </header-title>
               <el-table :data="item.ruleItems" border>
@@ -188,20 +304,34 @@
                     <span>{{ scope.$index + 1 }}</span>
                   </template>
                 </el-table-column>
-                <el-table-column label="零部件编码" prop="categoryCode" width="100">
+                <el-table-column
+                  label="零部件编码"
+                  prop="categoryCode"
+                  width="100"
+                >
                   <template slot-scope="scope">
                     <div v-if="scope.row.isNew">
-                      <el-input v-model="scope.row.categoryCode" placeholder="请输入零部件编码"></el-input>
+                      <el-input
+                        v-model="scope.row.categoryCode"
+                        placeholder="请输入零部件编码"
+                      ></el-input>
                     </div>
                     <div v-else>
                       <span>{{ scope.row.categoryCode }}</span>
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column label="零部件名称" prop="categoryName" width="100">
+                <el-table-column
+                  label="零部件名称"
+                  prop="categoryName"
+                  width="100"
+                >
                   <template slot-scope="scope">
                     <div v-if="scope.row.isNew">
-                      <el-input v-model="scope.row.categoryName" placeholder="请输入零部件名称"></el-input>
+                      <el-input
+                        v-model="scope.row.categoryName"
+                        placeholder="请输入零部件名称"
+                      ></el-input>
                     </div>
                     <div v-else>
                       <span>{{ scope.row.categoryName }}</span>
@@ -211,7 +341,10 @@
                 <el-table-column label="事项" prop="name" width="100">
                   <template slot-scope="scope">
                     <div v-if="scope.row.isNew">
-                      <el-input v-model="scope.row.name" placeholder="请输入内容"></el-input>
+                      <el-input
+                        v-model="scope.row.name"
+                        placeholder="请输入内容"
+                      ></el-input>
                     </div>
                     <div v-else>
                       <span>{{ scope.row.name }}</span>
@@ -221,7 +354,10 @@
                 <el-table-column label="内容" prop="content" width="200">
                   <template slot-scope="scope">
                     <div v-if="scope.row.isNew">
-                      <el-input v-model="scope.row.content" placeholder="请输入内容"></el-input>
+                      <el-input
+                        v-model="scope.row.content"
+                        placeholder="请输入内容"
+                      ></el-input>
                     </div>
                     <div v-else>
                       <span>{{ scope.row.content }}</span>
@@ -230,22 +366,33 @@
                 </el-table-column>
                 <el-table-column label="操作指导" prop="operationGuide">
                   <template slot-scope="scope">
-                    <div class="operationGuide_box" @click="
-                      openOperationGuideDialogDialog(
-                        scope.row.operationGuide,
-                        scope.$index
-                      )
-                      ">
+                    <div
+                      class="operationGuide_box"
+                      @click="
+                        openOperationGuideDialogDialog(
+                          scope.row.operationGuide,
+                          scope.$index
+                        )
+                      "
+                    >
                       <div class="left_content">
                         <template v-if="scope.row.operationGuide">
-                          <div v-for="(item, index) in scope.row.operationGuide
-                            .toolList" :key="item.id">{{ index + 1 }}.{{ item.name }}</div>
+                          <div
+                            v-for="(item, index) in scope.row.operationGuide
+                              .toolList"
+                            :key="item.id"
+                            >{{ index + 1 }}.{{ item.name }}</div
+                          >
                         </template>
                       </div>
                       <div class="right_content">
                         <template v-if="scope.row.operationGuide">
-                          <div v-for="(item, index) in scope.row.operationGuide
-                            .procedureList" :key="item.id">{{ index + 1 }}.{{ item.content }}</div>
+                          <div
+                            v-for="(item, index) in scope.row.operationGuide
+                              .procedureList"
+                            :key="item.id"
+                            >{{ index + 1 }}.{{ item.content }}</div
+                          >
                         </template>
                       </div>
                     </div>
@@ -254,16 +401,25 @@
                 <el-table-column label="标准" prop="norm" width="100">
                   <template slot-scope="scope">
                     <div v-if="scope.row.isNew">
-                      <el-input v-model="scope.row.norm" placeholder="请输入内容"></el-input>
+                      <el-input
+                        v-model="scope.row.norm"
+                        placeholder="请输入内容"
+                      ></el-input>
                     </div>
                     <div v-else>
                       <span>{{ scope.row.norm }}</span>
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column v-if="dialogTitle !== '派单'" label="操作" width="100">
+                <el-table-column
+                  v-if="dialogTitle !== '派单'"
+                  label="操作"
+                  width="100"
+                >
                   <template slot-scope="scope">
-                    <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
+                    <el-button type="text" @click="deleteItem(scope.$index)"
+                      >删除</el-button
+                    >
                   </template>
                 </el-table-column>
               </el-table>
@@ -275,7 +431,8 @@
     <template v-slot:footer>
       <el-button @click="visible = false">取消</el-button>
       <el-button type="primary" @click="save">
-        {{ dialogTitle === '派单' ? '派单' : '保存' }}</el-button>
+        {{ dialogTitle === '派单' ? '派单' : '保存' }}</el-button
+      >
     </template>
     <!-- 新增设备 -->
     <MaterialAdd ref="productRefs" @chooseEquipment="chooseEquipment">
@@ -283,12 +440,30 @@
     <!--  -->
     <operation-guideDialog ref="operationGuideDialog" @save="saveEdit" />
     <!-- 添加规则 -->
-    <ele-modal width="800px" :visible="addDialog" :append-to-body="true" title="规则配置" :close-on-click-modal="true"
-      @update:visible="closeAdd" :maxable="true">
-      <el-select v-model="ruleObj.ruleId" size="small" style="width: 100%" @change="handleRuleNameChange"
-        :disabled="isBindPlan" filterable>
-        <el-option v-for="item in ruleNameList" :key="item.id" :value="item.id" :label="item.code + '-' + item.name"
-          @click.native="ruleChange(item)"></el-option>
+    <ele-modal
+      width="800px"
+      :visible="addDialog"
+      :append-to-body="true"
+      title="规则配置"
+      :close-on-click-modal="true"
+      @update:visible="closeAdd"
+      :maxable="true"
+    >
+      <el-select
+        v-model="ruleObj.ruleId"
+        size="small"
+        style="width: 100%"
+        @change="handleRuleNameChange"
+        :disabled="isBindPlan"
+        filterable
+      >
+        <el-option
+          v-for="item in ruleNameList"
+          :key="item.id"
+          :value="item.id"
+          :label="item.code + '-' + item.name"
+          @click.native="ruleChange(item)"
+        ></el-option>
       </el-select>
       <template v-slot:footer>
         <el-button @click="addDialog = false">取消</el-button>
@@ -299,953 +474,983 @@
 </template>
 
 <script>
-import { getDetail, getCode } from '@/api/ruleManagement/matter';
-import {
-  getRule,
-  getCategory,
-  getAssetList,
-  getInfoById
-} from '@/api/ruleManagement/plan';
-import { saveOrUpdate, getteampage } from '@/api/maintenance/patrol_maintenance';
-import { getUserPage } from '@/api/system/organization';
-import { getTreeByType } from '@/api/classifyManage';
-import MaterialAdd from './MaterialAdd.vue';
-import OperationGuideDialog from './operationGuideDialog.vue';
-import deptSelect from '@/components/CommomSelect/dept-select.vue';
-import { pageList } from '@/api/technology/version/version.js';
-import { getById } from '@/api/maintenance/patrol_maintenance';
-import { getFile } from '@/api/system/file';
-import { deepClone } from 'ele-admin/lib/utils/core';
-
-export default {
-  components: {
-    MaterialAdd,
-    deptSelect,
-    OperationGuideDialog
-  },
-  props: {
-    dialogTitle: {
-      type: String,
-      default: () => {
-        return '新增巡检点计划配置';
+  import { getDetail, getCode } from '@/api/ruleManagement/matter';
+  import {
+    getRule,
+    getCategory,
+    getAssetList,
+    getInfoById
+  } from '@/api/ruleManagement/plan';
+  import {
+    saveOrUpdate,
+    getteampage
+  } from '@/api/maintenance/patrol_maintenance';
+  import { getUserPage } from '@/api/system/organization';
+  import { getTreeByType } from '@/api/classifyManage';
+  import MaterialAdd from './MaterialAdd.vue';
+  import OperationGuideDialog from './operationGuideDialog.vue';
+  import deptSelect from '@/components/CommomSelect/dept-select.vue';
+  import { pageList } from '@/api/technology/version/version.js';
+  import { getById } from '@/api/maintenance/patrol_maintenance';
+  import { getFile } from '@/api/system/file';
+  import { deepClone } from 'ele-admin/lib/utils/core';
+
+  export default {
+    components: {
+      MaterialAdd,
+      deptSelect,
+      OperationGuideDialog
+    },
+    props: {
+      dialogTitle: {
+        type: String,
+        default: () => {
+          return '新增巡检点计划配置';
+        }
       }
-    }
-    // visible: {
-    //   type: Boolean,
-    //   default: false
-    // }
-  },
-  data() {
-    const defaultForm = {
-      id: null,
-      code: '',
-      name: '',
-      modelType: '',
-      brandNum: '',
-      specification: '',
-      measuringUnit: '',
-      type: 0,
-      bomList: []
-    };
-    return {
-      visible: false,
-      ruleIndex: 0, // 规则index
-      ruleId: '',
-      formLabel: '',
-      isBindPlan: false,
-      ruleObj: {
-        ruleId: '',
-        name: '',
+      // visible: {
+      //   type: Boolean,
+      //   default: false
+      // }
+    },
+    data() {
+      const defaultForm = {
+        id: null,
         code: '',
-        equipmentList: []
-      },
-      ruleIdList: [],
-      addForm: {
-        id: '',
-        code: '', // 计划配置单号
-        name: '', // 计划配置名称
-        autoOrder: 1, // 自动派单
-        ruleId: '', // 规则id
-        ruleName: '', // 规则名称
-        duration: null, // 计划完成时长
-        categoryId: '', // 设备类别id
-        approvalUserId: '', // 审核人id
-        groupId: '', // 巡点检部门code
-        executorId: [], // 巡点检人员id
-        executorPhone: '',
-        status: 1, // 状态
-        remark: '', // 备注
-        urgent: '1',
-        executeIdList: [],
-        executeUsers: [
-          // {
-          //   groupId: 0,
-          //   groupName: '',
-          //   teamId: 0,
-          //   teamName: '',
-          //   userId: 0,
-          //   userName: ''
-          // }
-        ],
-        teamId: '',
+        name: '',
+        modelType: '',
+        brandNum: '',
+        specification: '',
+        measuringUnit: '',
         type: 0,
-        executeUserType: 0,
-      },
-      ruleNameList: [], // 规则列表
-      uerList: [], // 审核人列表
-      executorList: [], // 业务人员列表
-      defaultForm,
-      // 表单数据
-      form: {
-        ...defaultForm
-      },
-
-      versionList: [],
-
-      // 表单验证规则
-      addFormRules: {
-        name: [
-          { required: true, message: '请输入计划配置名称', trigger: 'blur' }
-        ],
-        autoOrder: [
-          { required: true, message: '请选择是否自动派单', trigger: 'change' }
-        ],
-        ruleId: [
-          { required: true, message: '请选择规则名称', trigger: 'change' }
-        ],
-        duration: [
-          { required: true, message: '请输入计划完成时长', trigger: 'blur' }
-        ],
-        categoryLevelId: [
-          { required: true, message: '请选择设备分类', trigger: 'change' }
-        ],
-        categoryId: [
-          { required: true, message: '请选择设备类别', trigger: 'change' }
-        ],
-        groupId: [
-          { required: true, message: '请选择巡点检部门', trigger: 'change' }
-        ],
-        executorId: [
-          { required: true, message: '请选择巡点检人员', trigger: 'change' }
-        ],
-        executeIdList: [
-          { required: true, message: '请选择人员', trigger: 'change' }
-        ],
-        urgent: [
-          { required: true, message: '请选择紧急程度', trigger: 'change' }
-        ],
-        teamId: [
-          { required: true, message: '请选择班组', trigger: 'change' }
-        ],
-      },
-
-      columns: [
-        {
-          type: 'index',
-          width: 55,
-          align: 'center'
+        bomList: []
+      };
+      return {
+        visible: false,
+        ruleIndex: 0, // 规则index
+        ruleId: '',
+        formLabel: '',
+        isBindPlan: false,
+        ruleObj: {
+          ruleId: '',
+          name: '',
+          code: '',
+          equipmentList: []
         },
-        {
-          label: '子项编号',
-          prop: 'subCode',
-          action: 'subCode'
+        ruleIdList: [],
+        addForm: {
+          id: '',
+          code: '', // 计划配置单号
+          name: '', // 计划配置名称
+          autoOrder: 1, // 自动派单
+          ruleId: '', // 规则id
+          ruleName: '', // 规则名称
+          duration: null, // 计划完成时长
+          categoryId: '', // 设备类别id
+          approvalUserId: '', // 审核人id
+          groupId: '', // 巡点检部门code
+          executorId: [], // 巡点检人员id
+          executorPhone: '',
+          status: 1, // 状态
+          remark: '', // 备注
+          urgent: '1',
+          executeIdList: [],
+          executeUsers: [
+            // {
+            //   groupId: 0,
+            //   groupName: '',
+            //   teamId: 0,
+            //   teamName: '',
+            //   userId: 0,
+            //   userName: ''
+            // }
+          ],
+          teamId: '',
+          type: 0,
+          executeUserType: 0
         },
-        {
-          label: '物料名称',
-          prop: 'categoryName',
-          action: 'categoryName'
+        ruleNameList: [], // 规则列表
+        uerList: [], // 审核人列表
+        executorList: [], // 业务人员列表
+        defaultForm,
+        // 表单数据
+        form: {
+          ...defaultForm
         },
 
-        {
-          label: '是否回收料',
-          prop: 'isReworkBom',
-          action: 'isReworkBom',
-          slot: 'isReworkBom',
-          width: 95
+        versionList: [],
+
+        // 表单验证规则
+        addFormRules: {
+          name: [
+            { required: true, message: '请输入计划配置名称', trigger: 'blur' }
+          ],
+          autoOrder: [
+            { required: true, message: '请选择是否自动派单', trigger: 'change' }
+          ],
+          ruleId: [
+            { required: true, message: '请选择规则名称', trigger: 'change' }
+          ],
+          duration: [
+            { required: true, message: '请输入计划完成时长', trigger: 'blur' }
+          ],
+          categoryLevelId: [
+            { required: true, message: '请选择设备分类', trigger: 'change' }
+          ],
+          categoryId: [
+            { required: true, message: '请选择设备类别', trigger: 'change' }
+          ],
+          groupId: [
+            { required: true, message: '请选择部门', trigger: 'change' }
+          ],
+          executorId: [
+            { required: true, message: '请选择人员', trigger: 'change' }
+          ],
+          executeIdList: [
+            { required: true, message: '请选择人员', trigger: 'change' }
+          ],
+          urgent: [
+            { required: true, message: '请选择紧急程度', trigger: 'change' }
+          ],
+          teamId: [{ required: true, message: '请选择班组', trigger: 'change' }]
         },
 
-        {
-          label: '物料编码',
-          prop: 'categoryCode'
-        },
-        {
-          label: '牌号',
-          prop: 'brandNum'
-        },
-        {
-          label: '型号',
-          prop: 'modelType'
-        },
-        {
-          label: '数量',
-          prop: 'count'
-        },
-        {
-          label: '计量单位',
-          prop: 'unit'
-        },
+        columns: [
+          {
+            type: 'index',
+            width: 55,
+            align: 'center'
+          },
+          {
+            label: '子项编号',
+            prop: 'subCode',
+            action: 'subCode'
+          },
+          {
+            label: '物料名称',
+            prop: 'categoryName',
+            action: 'categoryName'
+          },
 
-        {
-          label: '附件',
-          slot: 'bomArtFiles',
-          action: 'bomArtFiles',
-          minWidth: 100
-        },
+          {
+            label: '是否回收料',
+            prop: 'isReworkBom',
+            action: 'isReworkBom',
+            slot: 'isReworkBom',
+            width: 95
+          },
 
-        {
-          label: '单位',
-          prop: 'weightUnit'
-        },
+          {
+            label: '物料编码',
+            prop: 'categoryCode'
+          },
+          {
+            label: '牌号',
+            prop: 'brandNum'
+          },
+          {
+            label: '型号',
+            prop: 'modelType'
+          },
+          {
+            label: '数量',
+            prop: 'count'
+          },
+          {
+            label: '计量单位',
+            prop: 'unit'
+          },
 
-        {
-          label: '备注',
-          prop: 'remark'
-        }
-      ],
+          {
+            label: '附件',
+            slot: 'bomArtFiles',
+            action: 'bomArtFiles',
+            minWidth: 100
+          },
 
-      statusList: [
-        { label: '草稿', value: -1 },
-        { label: '失效', value: 0 },
-        { label: '生效', value: 1 }
-      ],
+          {
+            label: '单位',
+            prop: 'weightUnit'
+          },
 
-      // 提交状态
-      loading: false,
+          {
+            label: '备注',
+            prop: 'remark'
+          }
+        ],
+
+        statusList: [
+          { label: '草稿', value: -1 },
+          { label: '失效', value: 0 },
+          { label: '生效', value: 1 }
+        ],
 
-      categoryId: null,
+        // 提交状态
+        loading: false,
 
-      current: null,
+        categoryId: null,
 
-      materialShow: false,
+        current: null,
 
-      tabsList: [],
-      tableData: [],
+        materialShow: false,
 
-      taskId: null,
+        tabsList: [],
+        tableData: [],
 
-      addDialog: false,
-      tabsValue: null,
+        taskId: null,
 
-      hasCategoryId: false,
-      getByIdData: {},
-      teamAllList: [],
-      model: ''
-    };
-  },
-  computed: {
-    // 是否开启响应式布局
-    styleResponsive() {
-      return this.$store.state.theme.styleResponsive;
+        addDialog: false,
+        tabsValue: null,
+
+        hasCategoryId: false,
+        getByIdData: {},
+        teamAllList: [],
+        model: ''
+      };
     },
-    dispatchStatus() {
-      return ((this.addForm.autoOrder && (this.model == 'add' || this.model == 'edit')) || (((!this.addForm.autoOrder && this.addForm.planStatus == 0) || (this.addForm.autoOrder && this.addForm.planStatus == 4)) && this.model == 'dispatch'))
-    }
-  },
-  watch: {
-    visible(val) {
-      if (val) {
-        // 获取审核人列表数据
-        this.getUserList();
-        // 获取规则名称
-        this._getRuleNameList();
-        // 获取所有班组
-        this.getAllTeamList();
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      },
+      dispatchStatus() {
+        return (
+          (this.addForm.autoOrder &&
+            (this.model == 'add' || this.model == 'edit')) ||
+          (((!this.addForm.autoOrder && this.addForm.planStatus == 0) ||
+            (this.addForm.autoOrder && this.addForm.planStatus == 4)) &&
+            this.model == 'dispatch')
+        );
       }
-    }
-  },
-  methods: {
-    close() {
-      this.visible = false;
     },
-    // 初始化
-    async init(type, row, tips) {
-      console.log(row);
-      console.log(tips);
-      console.log(type);
-      this.model = type;
-      this.visible = true;
-      if (row) {
-        this.getInfo(row.id, tips);
-      } else {
-        //  获取计划配置单号
-        this.getOrderCode(tips);
-        this.addForm = {
-          code: '', // 计划配置单号
-          name: '', // 计划配置名称
-          autoOrder: 1, // 自动派单
-          ruleId: '', // 规则id
-          ruleName: '', // 规则名称
-          duration: null, // 计划完成时长
-          categoryId: '', // 设备类别id
-          approvalUserId: '', // 审核人id
-          groupId: '', // 巡点检部门code
-          executorId: [], // 巡点检人员id
-          executorPhone: '',
-          status: 1, // 状态
-          remark: '', // 备注
-          urgent: '1',
-          type: 0,
-          teamId: '',
-          executeIdList: [], // 负责人id
-          executeUserType: 0, // 执行人类型 0:部门 1:班组 0:个人
-          executeUsers: [
-          // {
-          //   groupId: 0,
-          //   groupName: '',
-          //   teamId: 0,
-          //   teamName: '',
-          //   userId: 0,
-          //   userName: ''
-          // }
-        ],
-        };
-        this.ruleIdList = [];
-        this.isBindPlan = false;
-        this.planRuleEquiList = [];
-        //   this.matterRulesList = [];
+    watch: {
+      visible(val) {
+        if (val) {
+          // 获取审核人列表数据
+          this.getUserList();
+          // 获取规则名称
+          this._getRuleNameList();
+          // 获取所有班组
+          this.getAllTeamList();
+        }
       }
-      this.formLabel = this.dialogTitle.includes('巡点检')
-        ? '巡点检'
-        : this.dialogTitle.includes('保养')
+    },
+    methods: {
+      close() {
+        this.visible = false;
+      },
+      // 初始化
+      async init(type, row, tips) {
+        console.log(row);
+        console.log(tips);
+        console.log(type);
+        this.model = type;
+        this.visible = true;
+        if (row) {
+          this.getInfo(row.id, tips);
+        } else {
+          //  获取计划配置单号
+          this.getOrderCode(tips);
+          this.addForm = {
+            code: '', // 计划配置单号
+            name: '', // 计划配置名称
+            autoOrder: 1, // 自动派单
+            ruleId: '', // 规则id
+            ruleName: '', // 规则名称
+            duration: null, // 计划完成时长
+            categoryId: '', // 设备类别id
+            approvalUserId: '', // 审核人id
+            groupId: '', // 巡点检部门code
+            executorId: [], // 巡点检人员id
+            executorPhone: '',
+            status: 1, // 状态
+            remark: '', // 备注
+            urgent: '1',
+            type: 0,
+            teamId: '',
+            executeIdList: [], // 负责人id
+            executeUserType: 0, // 执行人类型 0:部门 1:班组 0:个人
+            executeUsers: [
+              // {
+              //   groupId: 0,
+              //   groupName: '',
+              //   teamId: 0,
+              //   teamName: '',
+              //   userId: 0,
+              //   userName: ''
+              // }
+            ]
+          };
+          this.ruleIdList = [];
+          this.isBindPlan = false;
+          this.planRuleEquiList = [];
+          //   this.matterRulesList = [];
+        }
+        this.formLabel = this.dialogTitle.includes('巡点检')
+          ? '巡点检'
+          : this.dialogTitle.includes('保养')
           ? '保养'
           : this.dialogTitle.includes('量具送检')
-            ? '量具送检'
-            : this.dialogTitle.includes('运行记录')
-              ? '运行记录'
-              : '盘点';
-      const typeOptions = {
-        巡点检: 1,
-        保养: 2,
-        维修: 3,
-        计划性维修: 4,
-        量具送检: 5,
-        运行记录: 6
-      };
-      this.$set(this.addForm, 'type', typeOptions[this.formLabel]);
-
-      // const planRuleTypeObj = {
-      //   巡点检: 'PATROL',
-      //   保养: 'MAINTAIN',
-      //   量具送检: '',
-      //   盘点: 'INVENTORY'
-      // };
-      // this.addForm.planType = planRuleTypeObj[this.formLabel];
-    },
-    // 负责人变更 同步执行人列表
-    executeIdListChange() {
-      this.addForm.executeUsers = this.addForm.executeIdList.map((userId) => {
-        const user = this.executorList.find((u) => u.id === userId);
-        return {
-          userId: user.id,
-          userName: user.name,
-
-          groupId: user.groupId,
-          groupName: user.groupName
+          ? '量具送检'
+          : this.dialogTitle.includes('运行记录')
+          ? '运行记录'
+          : this.dialogTitle.includes('检修')
+          ? '检修'
+          : '盘点';
+        const typeOptions = {
+          巡点检: 1,
+          保养: 2,
+          维修: 3,
+          计划性维修: 4,
+          量具送检: 5,
+          运行记录: 6,
+          检修: 7
         };
-      });
-      console.log('this.addForm.executeUsers', this.addForm.executeUsers);
-    },
-    async getAllTeamList() {
-      const { list } = await getteampage({
-        pageNum: 1,
-        size: -1
-      });
-      console.log('teamAllList 班组', list);
-      this.teamAllList = list;
-    },
-    teamChange(v) {
-      console.log('teamChange', v);
-      this.$set(this.addForm, 'teamId', v);
-      // 当前班组
-      const currentTeam = this.teamAllList.find(
-        (item) => item.id === this.addForm.teamId
-      );
-      if (currentTeam) {
-        // 同步执行人
-        this.addForm.executeUsers = [
-          {
-            teamId: currentTeam.id,
-            teamName: currentTeam.name
-          }
-        ];
-      }
-    },
-    autoOrderChange(val) {
-      if (val == 0) {
-        this.addForm.executorId = [];
-        this.addForm.groupId = '';
-        this.addForm.executeIdList = '';
-      }
-    },
-    ruleChange(item) {
-      this.ruleObj.name = item.name;
-      this.ruleObj.code = item.code;
-    },
-    save() {
-      console.log(this.addForm, 888);
-      console.log(this.ruleIdList);
-      if (this.ruleIdList && this.ruleIdList.length > 0) {
-        this.$refs.addFormRef.validate(async (valid) => {
-          // console.log(valid);
-          if (valid) {
-            const planDeviceList = this.ruleIdList.map((ruleItem) => {
-              return ruleItem.equipmentList.map((item) => {
+        this.$set(this.addForm, 'type', typeOptions[this.formLabel]);
+
+        // const planRuleTypeObj = {
+        //   巡点检: 'PATROL',
+        //   保养: 'MAINTAIN',
+        //   量具送检: '',
+        //   盘点: 'INVENTORY'
+        // };
+        // this.addForm.planType = planRuleTypeObj[this.formLabel];
+      },
+      // 负责人变更 同步执行人列表
+      executeIdListChange() {
+        this.addForm.executeUsers = this.addForm.executeIdList.map((userId) => {
+          const user = this.executorList.find((u) => u.id === userId);
+          return {
+            userId: user.id,
+            userName: user.name,
+
+            groupId: user.groupId,
+            groupName: user.groupName
+          };
+        });
+        console.log('this.addForm.executeUsers', this.addForm.executeUsers);
+      },
+      async getAllTeamList() {
+        const { list } = await getteampage({
+          pageNum: 1,
+          size: -1
+        });
+        console.log('teamAllList 班组', list);
+        this.teamAllList = list;
+      },
+      teamChange(v) {
+        console.log('teamChange', v);
+        this.$set(this.addForm, 'teamId', v);
+        // 当前班组
+        const currentTeam = this.teamAllList.find(
+          (item) => item.id === this.addForm.teamId
+        );
+        if (currentTeam) {
+          // 同步执行人
+          this.addForm.executeUsers = [
+            {
+              teamId: currentTeam.id,
+              teamName: currentTeam.name
+            }
+          ];
+        }
+      },
+      autoOrderChange(val) {
+        if (val == 0) {
+          this.addForm.executorId = [];
+          this.addForm.groupId = '';
+          this.addForm.executeIdList = '';
+        }
+      },
+      ruleChange(item) {
+        this.ruleObj.name = item.name;
+        this.ruleObj.code = item.code;
+      },
+      save() {
+        console.log(this.addForm, 888);
+        console.log(this.ruleIdList);
+        if (this.ruleIdList && this.ruleIdList.length > 0) {
+          this.$refs.addFormRef.validate(async (valid) => {
+            // console.log(valid);
+            if (valid) {
+              const planDeviceList = this.ruleIdList.map((ruleItem) => {
+                return ruleItem.equipmentList.map((item) => {
+                  return {
+                    // equiCode: item.code,
+                    // equiName: item.name,
+                    deviceId: item.id,
+                    codeNumber: item.codeNumber,
+                    // equiModel: item.modelType,
+                    equiLocation: item.position[0] && item.position[0].pathName,
+                    equiLocationCode:
+                      item.position[0] && item.position[0].pathIds,
+                    workItems: ruleItem.ruleItems ? ruleItem.ruleItems : []
+                    // categoryId: item.category.categoryLevelId,
+                    // categoryName: item.category.categoryLevelName
+                    // sparePart: ruleItem.sparePart ? obj.sparePart : []
+                  };
+                });
+              });
+              let boolen = planDeviceList.every((item) => item.length > 0);
+              console.log(planDeviceList);
+              if (!boolen) {
+                this.$message.error('请添加设备!');
+                return false;
+              }
+              let sendMsg = this.ruleIdList.map((item, index) => {
                 return {
-                  // equiCode: item.code,
-                  // equiName: item.name,
-                  deviceId: item.id,
-                  codeNumber: item.codeNumber,
-                  // equiModel: item.modelType,
-                  equiLocation: item.position[0] && item.position[0].pathName,
-                  equiLocationCode:
-                    item.position[0] && item.position[0].pathIds,
-                  workItems: ruleItem.ruleItems ? ruleItem.ruleItems : []
-                  // categoryId: item.category.categoryLevelId,
-                  // categoryName: item.category.categoryLevelName
-                  // sparePart: ruleItem.sparePart ? obj.sparePart : []
+                  ...this.addForm,
+                  autoOrder:
+                    this.model == 'dispatch' ? 1 : this.addForm.autoOrder,
+                  ruleId: item.ruleId,
+                  categoryId: item.categoryId,
+                  planDeviceList: planDeviceList[index],
+                  executorId: this.addForm.executorId
+                    ? this.addForm.executorId.join(',')
+                    : ''
                 };
               });
-            });
-            let boolen = planDeviceList.every((item) => item.length > 0);
-            console.log(planDeviceList);
-            if (!boolen) {
-              this.$message.error('请添加设备!');
-              return false;
-            }
-            let sendMsg = this.ruleIdList.map((item, index) => {
-              return {
-                ...this.addForm,
-                autoOrder: this.model == 'dispatch' ? 1 : this.addForm.autoOrder,
-                ruleId: item.ruleId,
-                categoryId: item.categoryId,
-                planDeviceList: planDeviceList[index],
-                executorId: this.addForm.executorId
-                  ? this.addForm.executorId.join(',')
-                  : ''
-              };
-            });
-            let type = '';
-            if (this.dialogTitle === '派单') {
-              type = '派单';
-            } else {
-              type = this.dialogTitle.includes('新增') ? '新增' : '编辑';
-            }
-            // return
-            try {
-              let res = await saveOrUpdate(sendMsg);
-              if (res) {
-                this.$message.success(type + '成功!');
-                this.$emit('done');
-                this.visible = false;
+              let type = '';
+              if (this.dialogTitle === '派单') {
+                type = '派单';
+              } else {
+                type = this.dialogTitle.includes('新增') ? '新增' : '编辑';
+              }
+              // return
+              try {
+                let res = await saveOrUpdate(sendMsg);
+                if (res) {
+                  this.$message.success(type + '成功!');
+                  this.$emit('done');
+                  this.visible = false;
+                }
+              } catch (error) {
+                this.$message.error(type + '失败!');
               }
-            } catch (error) {
-              this.$message.error(type + '失败!');
             }
+          });
+        } else {
+          this.$message.error('请添加规则!');
+        }
+      },
+      // 保存操作指导数据
+      saveEdit(data, index) {
+        console.log(this.matterRulesList);
+        console.log(data);
+        console.log(index);
+        this.$set(
+          this.ruleIdList[this.ruleIndex].ruleItems[index],
+          'operationGuide',
+          data
+        );
+      },
+      /* 打开操作手册编辑款 */
+      openOperationGuideDialogDialog(row, index) {
+        if (this.dialogTitle !== '派单') {
+          this.$refs.operationGuideDialog.open(row, index);
+        }
+      },
+      deleteEquipment(index) {
+        this.ruleIdList[this.ruleIndex].equipmentList.splice(index, 1);
+      },
+      deleteItem(index) {
+        if (this.ruleIdList[this.ruleIndex].ruleItems.length > 1) {
+          this.ruleIdList[this.ruleIndex].ruleItems.splice(index, 1);
+        } else {
+          this.$message.error('至少要有一个规则事项!');
+        }
+      },
+      addPostscript() {
+        console.log(
+          'this.matterRulesList---------------',
+          this.matterRulesList
+        );
+        this.ruleIdList[this.ruleIndex].ruleItems.push({
+          sort: null,
+          name: '',
+          content: '',
+          norm: '',
+          isNew: true,
+          operationGuide: {
+            procedureList: [],
+            toolList: []
           }
         });
-      } else {
-        this.$message.error('请添加规则!');
-      }
-    },
-    // 保存操作指导数据
-    saveEdit(data, index) {
-      console.log(this.matterRulesList);
-      console.log(data);
-      console.log(index);
-      this.$set(
-        this.ruleIdList[this.ruleIndex].ruleItems[index],
-        'operationGuide',
-        data
-      );
-    },
-    /* 打开操作手册编辑款 */
-    openOperationGuideDialogDialog(row, index) {
-      if (this.dialogTitle !== '派单') {
-        this.$refs.operationGuideDialog.open(row, index);
-      }
-    },
-    deleteEquipment(index) {
-      this.ruleIdList[this.ruleIndex].equipmentList.splice(index, 1);
-    },
-    deleteItem(index) {
-      if (this.ruleIdList[this.ruleIndex].ruleItems.length > 1) {
-        this.ruleIdList[this.ruleIndex].ruleItems.splice(index, 1);
-      } else {
-        this.$message.error('至少要有一个规则事项!');
-      }
-    },
-    addPostscript() {
-      console.log(
-        'this.matterRulesList---------------',
-        this.matterRulesList
-      );
-      this.ruleIdList[this.ruleIndex].ruleItems.push({
-        sort: null,
-        name: '',
-        content: '',
-        norm: '',
-        isNew: true,
-        operationGuide: {
-          procedureList: [],
-          toolList: []
-        }
-      });
-    },
-    async getInfo(id, tips) {
-      console.log(id);
-      try {
-        const res = await getById(id);
-        console.log('res----------', res);
-        const data = res.data;
-        // if (this.dialogTitle === '派单') {
-        //   this.addForm.autoOrder = 1;
-        // }
-        this.isBindPlan = res.isBindPlan;
-        // this.categoryEquipment(res.categoryLevelId);
-        this.ruleIdList = [
-          {
-            id: res.data.id,
-            ruleId: res.data.ruleId,
-            name: res.data.name,
-            code: res.data.code,
-            categoryId: res.data.categoryId,
-            equipmentList: res.data.planDeviceList.map((item) => {
-              return {
-                name: item.substance.name,
-                position: item.substance.position,
-                id: item.substance.id,
-                fixCode: item.substance.fixCode,
-                codeNumber: item.substance.codeNumber
-                // category: {
-                //   categoryLevelId: item.categoryId,
-                //   categoryLevelName: item.categoryName
-                // }
-              };
-            }),
-            ruleItems: res.data.planDeviceList[0].workItems
+      },
+      async getInfo(id, tips) {
+        console.log(id);
+        try {
+          const res = await getById(id);
+          console.log('res----------', res);
+          const data = res.data;
+          // if (this.dialogTitle === '派单') {
+          //   this.addForm.autoOrder = 1;
+          // }
+          this.isBindPlan = res.isBindPlan;
+          // this.categoryEquipment(res.categoryLevelId);
+          this.ruleIdList = [
+            {
+              id: res.data.id,
+              ruleId: res.data.ruleId,
+              name: res.data.name,
+              code: res.data.code,
+              categoryId: res.data.categoryId,
+              equipmentList: res.data.planDeviceList.map((item) => {
+                return {
+                  name: item.substance.name,
+                  position: item.substance.position,
+                  id: item.substance.id,
+                  fixCode: item.substance.fixCode,
+                  codeNumber: item.substance.codeNumber
+                  // category: {
+                  //   categoryLevelId: item.categoryId,
+                  //   categoryLevelName: item.categoryName
+                  // }
+                };
+              }),
+              ruleItems: res.data.planDeviceList[0].workItems
+            }
+          ];
+          console.log(this.ruleIdList);
+
+          // 处理回显数据
+          if (data.executeUserType === 0) {
+            // 个人
+            data.executeIdList = data.executeUsers?.map((item) => item.userId);
+
+            let groupIds = data.executeUsers
+              ?.map((i) => i.groupId)
+              .filter((i) => i);
+            groupIds = Array.from(new Set(groupIds));
+
+            if (groupIds.includes('1')) {
+              // 包含全部部门,置空
+              data.groupId = '1';
+            } else {
+              data.groupId = data.executeUsers?.[0]?.groupId || '1';
+            }
+
+            groupIds.map((item) => {
+              this.searchDeptNodeClick(item);
+            });
+          } else {
+            // 班组
+            data.teamId = data.executeUsers?.[0]?.teamId || '';
           }
-        ];
-        console.log(this.ruleIdList);
 
-        // 处理回显数据
-        if (data.executeUserType === 0) {
-          // 个人
-          data.executeIdList = data.executeUsers?.map(
-            (item) => item.userId
-          );
+          this.tabsValue = this.ruleIdList[0].ruleId;
 
-          let groupIds = data.executeUsers?.map((i) => i.groupId)
-            .filter((i) => i);
-          groupIds = Array.from(new Set(groupIds));
+          // this.addForm = res.data;
+          // this.addForm.id = res.data.planId;
+          this.$set(this, 'addForm', data);
+          this.$set(this.addForm, 'id', data.planId);
 
-          if (groupIds.includes('1')) {
-            // 包含全部部门,置空
-            data.groupId = '1';
-          } else {
-            data.groupId = data.executeUsers?.[0]?.groupId || '1';
+          // this._getMatterRulesDetails(res.ruleId);
+          this.$set(this.addForm, 'code', res.data.code);
+          this.$set(this.addForm, 'urgent', JSON.stringify(res.data.urgent));
+          this.$set(
+            this.addForm,
+            'executorId',
+            res.data?.executorId?.split(',').filter((i) => i)
+          );
+          this.$set(this.addForm, 'imageUrl', {});
+          // console.log(this.rootData);
+          if (res.data.groupId) {
+            this.getUserList({ groupId: res.data.groupId });
           }
-
-          groupIds.map((item) => {
-            this.searchDeptNodeClick(item);
-          });
+          console.log('addForm~~~~', this.addForm);
+          // const rep = await getTreeByType(0);
+          // console.log('sasas', res);
+          // const ids = this.findTopLevelAncestorId(
+          //   rep.data,
+          //   res.categoryLevelId
+          // );
+          // this.rootId = ids;
+          // //   await this._getEquipmentList(res.categoryLevelId, this.isBindPlan);
+          // let keys = [];
+          // res.deviceInfo.map((item) => {
+          //   keys.push(item.substanceId);
+          // });
+          // this.$nextTick(() => {
+          //   this.$refs.equiListTree.setCheckedKeys(keys);
+          // });
+          // this.clickedTreeNode = true;
+        } catch (error) {
+          console.log(error);
+        }
+      },
+      typeChange(v) {
+        console.log('typeChange', v, this.addForm.executeIdList);
+        // this.addForm.groupId = '';
+        // this.addForm.executeIdList = [];
+        // this.addForm.teamId = '';
+        // this.addForm.executeUsers = [];
+        this.$set(this.addForm, 'executeUsers', []);
+        if (v == 0) {
+          this.$set(this.addForm, 'groupId', '');
+          this.$set(this.addForm, 'executeIdList', []);
         } else {
-          // 班组
-          data.teamId = data.executeUsers?.[0]?.teamId || '';
+          this.$set(this.addForm, 'teamId', '');
         }
-
-        this.tabsValue = this.ruleIdList[0].ruleId;
-
-        // this.addForm = res.data;
-        // this.addForm.id = res.data.planId;
-        this.$set(this, 'addForm', data);
-        this.$set(this.addForm, 'id', data.planId);
-
-        // this._getMatterRulesDetails(res.ruleId);
-        this.$set(this.addForm, 'code', res.data.code);
-        this.$set(this.addForm, 'urgent', JSON.stringify(res.data.urgent));
-        this.$set(this.addForm, 'executorId', res.data?.executorId?.split(',').filter((i) => i));
-        this.$set(this.addForm, 'imageUrl', {});
-        // console.log(this.rootData);
-        if(res.data.groupId){
-          this.getUserList({ groupId: res.data.groupId });
-
+        this.$forceUpdate();
+      },
+      // 获取设备分类数据
+      async categoryEquipment(id) {
+        const params = { categoryLevelId: id, pageNum: 1, size: -1 };
+        console.log('params==', params);
+        const data = await getCategory(params);
+        console.log(data);
+        this.equipmentList = data.list;
+      },
+      // 选择设备
+      chooseEquipment(data, index, categoryId) {
+        this.$set(
+          this.ruleIdList[index],
+          'equipmentList',
+          this.ruleIdList[index].equipmentList.concat(data)
+        );
+        this.$set(this.ruleIdList[index], 'categoryId', categoryId);
+        console.log(this.ruleIdList);
+      },
+      // 获取计划配置单号
+      async getOrderCode(tips) {
+        if (tips.includes('巡点检')) {
+          const data = await getCode('patrolconfig_code');
+          this.$set(this.addForm, 'code', data);
         }
-        console.log('addForm~~~~', this.addForm);
-        // const rep = await getTreeByType(0);
-        // console.log('sasas', res);
-        // const ids = this.findTopLevelAncestorId(
-        //   rep.data,
-        //   res.categoryLevelId
-        // );
-        // this.rootId = ids;
-        // //   await this._getEquipmentList(res.categoryLevelId, this.isBindPlan);
-        // let keys = [];
-        // res.deviceInfo.map((item) => {
-        //   keys.push(item.substanceId);
-        // });
-        // this.$nextTick(() => {
-        //   this.$refs.equiListTree.setCheckedKeys(keys);
-        // });
-        // this.clickedTreeNode = true;
-      } catch (error) {
-        console.log(error);
-      }
-    },
-    typeChange(v) {
-      console.log('typeChange', v, this.addForm.executeIdList);
-      // this.addForm.groupId = '';
-      // this.addForm.executeIdList = [];
-      // this.addForm.teamId = '';
-      // this.addForm.executeUsers = [];
-      this.$set(this.addForm, 'executeUsers', []);
-      if(v == 0) {
-        this.$set(this.addForm, 'groupId', '');
-        this.$set(this.addForm, 'executeIdList', []);
-      } else {
-        this.$set(this.addForm, 'teamId', '');
-      }
-      this.$forceUpdate();
-    },
-    // 获取设备分类数据
-    async categoryEquipment(id) {
-      const params = { categoryLevelId: id, pageNum: 1, size: -1 };
-      console.log('params==', params);
-      const data = await getCategory(params);
-      console.log(data);
-      this.equipmentList = data.list;
-    },
-    // 选择设备
-    chooseEquipment(data, index, categoryId) {
-      this.$set(
-        this.ruleIdList[index],
-        'equipmentList',
-        this.ruleIdList[index].equipmentList.concat(data)
-      );
-      this.$set(this.ruleIdList[index], 'categoryId', categoryId);
-      console.log(this.ruleIdList);
-    },
-    // 获取计划配置单号
-    async getOrderCode(tips) {
-      if (tips.includes('巡点检')) {
-        const data = await getCode('patrolconfig_code');
-        this.$set(this.addForm, 'code', data);
-      }
-      if (tips.includes('保养')) {
-        const code = await getCode('maintainconfig_code');
-        this.$set(this.addForm, 'code', code);
-      }
-      if (tips.includes('量具送检')) {
-        const code = await getCode('quantity_code');
-        this.$set(this.addForm, 'code', code);
-      }
-      if (tips.includes('运行记录')) {
-        const code = await getCode('runRecord_code');
-        this.$set(this.addForm, 'code', code);
-      }
-    },
-    //选择部门(搜索)
-    searchDeptNodeClick(info, data) {
-      if (info) {
-        // 根据部门获取人员
-        this.addForm.groupName = data.name;
-        const params = { groupId: info };
-        this.getUserList(params);
-      } else {
-        this.addForm.groupId = null;
-      }
-    },
-    // 过滤计划完成时长
-    formDataDurationTime(value) {
-      if (value > 0) {
-        this.addForm.duration = value.replace(/^[0]+/, '');
-      } else {
-        this.addForm.duration = 0;
-      }
-    },
-    // 获取审核人列表、巡点检人员
-    async getUserList(params) {
-      try {
-        let data = { pageNum: 1, size: -1 };
-        // 如果传了参数就是获取巡点检人员数据
-        if (params) {
-          data = Object.assign(data, params);
+        if (tips.includes('保养')) {
+          const code = await getCode('maintainconfig_code');
+          this.$set(this.addForm, 'code', code);
         }
-        const res = await getUserPage(data);
-        console.log('res------------', res);
-        if (params) {
-          this.executorList = res.list;
+        if (tips.includes('量具送检')) {
+          const code = await getCode('quantity_code');
+          this.$set(this.addForm, 'code', code);
+        }
+        if (tips.includes('运行记录')) {
+          const code = await getCode('runRecord_code');
+          this.$set(this.addForm, 'code', code);
+        }
+        if (tips.includes('检修')) {
+          const code = await getCode('servicePlan_code');
+          this.$set(this.addForm, 'code', code);
+        }
+      },
+      //选择部门(搜索)
+      searchDeptNodeClick(info, data) {
+        if (info) {
+          // 根据部门获取人员
+          this.addForm.groupName = data.name;
+          const params = { groupId: info };
+          this.getUserList(params);
         } else {
-          this.uerList = res.list;
+          this.addForm.groupId = null;
         }
-      } catch (error) { }
-    },
-    // 获取规则名列表
-    async _getRuleNameList() {
-      if (
-        this.dialogTitle === '新增保养计划配置' ||
-        this.dialogTitle === '编辑保养计划配置'
-      ) {
-        const res = await getRule({
-          status: 1,
-          type: 2,
-          pageNum: 1,
-          size: -1
-        });
-        if (res.list) {
-          this.ruleNameList = res.list || [];
+      },
+      // 过滤计划完成时长
+      formDataDurationTime(value) {
+        if (value > 0) {
+          this.addForm.duration = value.replace(/^[0]+/, '');
+        } else {
+          this.addForm.duration = 0;
         }
-      }
-      if (
-        this.dialogTitle === '新增巡点检计划配置' ||
-        this.dialogTitle === '编辑巡点检计划配置'
-      ) {
-        const res = await getRule({
-          status: 1,
-          type: 1,
-          pageNum: 1,
-          size: -1
-        });
-        if (res.list) {
-          this.ruleNameList = res.list || [];
+      },
+      // 获取审核人列表、巡点检人员
+      async getUserList(params) {
+        try {
+          let data = { pageNum: 1, size: -1 };
+          // 如果传了参数就是获取巡点检人员数据
+          if (params) {
+            data = Object.assign(data, params);
+          }
+          const res = await getUserPage(data);
+          console.log('res------------', res);
+          if (params) {
+            this.executorList = res.list;
+          } else {
+            this.uerList = res.list;
+          }
+        } catch (error) {}
+      },
+      // 获取规则名列表
+      async _getRuleNameList() {
+        if (
+          this.dialogTitle === '新增保养计划配置' ||
+          this.dialogTitle === '编辑保养计划配置'
+        ) {
+          const res = await getRule({
+            status: 1,
+            type: 2,
+            pageNum: 1,
+            size: -1
+          });
+          if (res.list) {
+            this.ruleNameList = res.list || [];
+          }
         }
-      }
-      if (
-        this.dialogTitle === '新增量具送检计划配置' ||
-        this.dialogTitle === '编辑量具送检计划配置'
-      ) {
-        const res = await getRule({
-          status: 1,
-          type: 5,
-          pageNum: 1,
-          size: -1
-        });
-        if (res.list) {
-          this.ruleNameList = res.list || [];
+        if (
+          this.dialogTitle === '新增巡点检计划配置' ||
+          this.dialogTitle === '编辑巡点检计划配置'
+        ) {
+          const res = await getRule({
+            status: 1,
+            type: 1,
+            pageNum: 1,
+            size: -1
+          });
+          if (res.list) {
+            this.ruleNameList = res.list || [];
+          }
         }
-      }
-      if (
-        this.dialogTitle === '新增运行记录配置' ||
-        this.dialogTitle === '编辑运行记录配置'
-      ) {
-        const res = await getRule({
-          status: 1,
-          type: 6,
-          pageNum: 1,
-          size: -1
-        });
-        if (res.list) {
-          this.ruleNameList = res.list || [];
+        if (
+          this.dialogTitle === '新增量具送检计划配置' ||
+          this.dialogTitle === '编辑量具送检计划配置'
+        ) {
+          const res = await getRule({
+            status: 1,
+            type: 5,
+            pageNum: 1,
+            size: -1
+          });
+          if (res.list) {
+            this.ruleNameList = res.list || [];
+          }
         }
-      }
-    },
-    downloadFile(file) {
-      getFile({ objectName: file.storePath }, file.name);
-    },
+        if (
+          this.dialogTitle === '新增运行记录配置' ||
+          this.dialogTitle === '编辑运行记录配置'
+        ) {
+          const res = await getRule({
+            status: 1,
+            type: 6,
+            pageNum: 1,
+            size: -1
+          });
+          if (res.list) {
+            this.ruleNameList = res.list || [];
+          }
+        }
+        if (
+          this.dialogTitle === '新增检修计划配置' ||
+          this.dialogTitle === '编辑检修计划配置'
+        ) {
+          const res = await getRule({
+            status: 1,
+            type: 7,
+            pageNum: 1,
+            size: -1
+          });
+          if (res.list) {
+            this.ruleNameList = res.list || [];
+          }
+        }
+      },
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      },
 
-    openEdit(index) {
-      this.current = this.form.bomList[index];
-      console.log(this.current);
-      this.materialShow = true;
-    },
+      openEdit(index) {
+        this.current = this.form.bomList[index];
+        console.log(this.current);
+        this.materialShow = true;
+      },
 
-    /* 表格数据源 */
-    datasource({ page, limit, where }) {
-      return [];
-    },
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        return [];
+      },
 
-    async getVersionList() {
-      const res = await pageList({
-        pageNum: 1,
-        size: 100
-      });
+      async getVersionList() {
+        const res = await pageList({
+          pageNum: 1,
+          size: 100
+        });
 
-      this.versionList = res.list;
-    },
+        this.versionList = res.list;
+      },
 
-    handleAdd(ruleIdList, ruleIdListIndex) {
-      this.$refs.productRefs.open(ruleIdList, ruleIdListIndex);
-    },
+      handleAdd(ruleIdList, ruleIdListIndex) {
+        this.$refs.productRefs.open(ruleIdList, ruleIdListIndex);
+      },
 
-    // /* 更新visible */
-    // updateVisible(value) {
-    //   this.$emit('update:visible', value);
-    // },
+      // /* 更新visible */
+      // updateVisible(value) {
+      //   this.$emit('update:visible', value);
+      // },
 
-    handleAddTab() {
-      this.tableData = this.tabsList;
-      this.addDialog = true;
-    },
+      handleAddTab() {
+        this.tableData = this.tabsList;
+        this.addDialog = true;
+      },
 
-    handleTab(e) {
-      this.ruleIndex = e.index;
-      // this.ruleIdList[e.index].ruleItems = this._getMatterRulesDetails(this.ruleId)
-    },
+      handleTab(e) {
+        this.ruleIndex = e.index;
+        // this.ruleIdList[e.index].ruleItems = this._getMatterRulesDetails(this.ruleId)
+      },
 
-    removeTab(targetName) {
-      this.$confirm('是否删除当前工序?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      })
-        .then(() => {
-          this.ruleIdList.forEach((e, index) => {
-            if (e.ruleId == targetName) {
-              this.ruleIdList.splice(index, 1);
-              this.$nextTick(() => {
-                if (this.ruleIdList.length == 1) {
-                  this.tabsValue = this.ruleIdList[0].ruleId;
-                }
-              });
-            }
-          });
+      removeTab(targetName) {
+        this.$confirm('是否删除当前工序?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
         })
-        .catch(() => { });
-    },
+          .then(() => {
+            this.ruleIdList.forEach((e, index) => {
+              if (e.ruleId == targetName) {
+                this.ruleIdList.splice(index, 1);
+                this.$nextTick(() => {
+                  if (this.ruleIdList.length == 1) {
+                    this.tabsValue = this.ruleIdList[0].ruleId;
+                  }
+                });
+              }
+            });
+          })
+          .catch(() => {});
+      },
 
-    /*关闭选择参数*/
-    closeAdd() {
-      this.addDialog = false;
-    },
-    // 规则名称下拉触发
-    handleRuleNameChange(val) {
-      this.ruleId = val;
-      console.log('勾选的规则----', val);
-      this.getRulesDetails(val);
-    },
-    async getRulesDetails(val) {
-      const res = await getDetail(val);
-      this.hasCategoryId = res?.categoryId;
-      this.getByIdData = res;
-      console.log(res, 'sssssssssssssssssssssss')
-    },
-    // 封装 - 获取规则下面的详情数据及事项
-    async _getMatterRulesDetails(val) {
-      const res = await getDetail(val);
-      return res.ruleItems;
-    },
-    async addRule() {
-
-      let boolen = this.ruleIdList.every((item) => {
-        return this.ruleId != item.ruleId;
-      });
-      if (boolen) {
-        this.ruleObj.ruleItems = await this._getMatterRulesDetails(
-          this.ruleId
-        );
+      /*关闭选择参数*/
+      closeAdd() {
+        this.addDialog = false;
+      },
+      // 规则名称下拉触发
+      handleRuleNameChange(val) {
+        this.ruleId = val;
+        console.log('勾选的规则----', val);
+        this.getRulesDetails(val);
+      },
+      async getRulesDetails(val) {
+        const res = await getDetail(val);
+        this.hasCategoryId = res?.categoryId;
+        this.getByIdData = res;
+        console.log(res, 'sssssssssssssssssssssss');
+      },
+      // 封装 - 获取规则下面的详情数据及事项
+      async _getMatterRulesDetails(val) {
+        const res = await getDetail(val);
+        return res.ruleItems;
+      },
+      async addRule() {
+        let boolen = this.ruleIdList.every((item) => {
+          return this.ruleId != item.ruleId;
+        });
+        if (boolen) {
+          this.ruleObj.ruleItems = await this._getMatterRulesDetails(
+            this.ruleId
+          );
 
-        for (let i = 0; i < this.ruleObj.ruleItems.length; i++) {
-          const id = this.getByIdData?.categoryId;
-          const name = this.getByIdData?.categoryName;
+          for (let i = 0; i < this.ruleObj.ruleItems.length; i++) {
+            const id = this.getByIdData?.categoryId;
+            const name = this.getByIdData?.categoryName;
 
-          this.ruleObj.ruleItems[i].categoryId = id;
-          this.ruleObj.ruleItems[i].categoryName = name;
+            this.ruleObj.ruleItems[i].categoryId = id;
+            this.ruleObj.ruleItems[i].categoryName = name;
 
-          this.ruleObj.ruleItems[i].isNew = true;
-        }
+            this.ruleObj.ruleItems[i].isNew = true;
+          }
 
-        this.ruleIdList.push(deepClone(this.ruleObj));
+          this.ruleIdList.push(deepClone(this.ruleObj));
 
-        console.log('this.ruleIdList--------', this.ruleIdList);
+          console.log('this.ruleIdList--------', this.ruleIdList);
 
-        this.addDialog = false;
-        this.$nextTick(() => {
-          if (this.ruleIdList.length == 1) {
-            this.tabsValue = this.ruleIdList[0].ruleId;
-          }
-        });
-      } else {
-        this.$message.error('请误重复添加规则');
+          this.addDialog = false;
+          this.$nextTick(() => {
+            if (this.ruleIdList.length == 1) {
+              this.tabsValue = this.ruleIdList[0].ruleId;
+            }
+          });
+        } else {
+          this.$message.error('请误重复添加规则');
+        }
+      },
+      onClose() {
+        console.log('关闭窗口');
+        this.visible = false;
       }
-    },
-    onClose() {
-      console.log('关闭窗口');
-      this.visible = false;
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-::v-deep .el-row {
-  display: flex;
-  flex-wrap: wrap;
-}
-
-::v-deep .el-tab_box {
-  display: flex;
-  margin-top: 10px;
-  height: 300px;
-  width: 100%;
-
-  .equipmentList_box {
-    flex: 1;
-    height: 100%;
-    margin-right: 10px;
+  ::v-deep .el-row {
     display: flex;
-    flex-direction: column;
-
-    .divider {
-      flex: 0 0 50px;
+    flex-wrap: wrap;
+  }
 
-      .title {
-        height: 35px;
+  ::v-deep .el-tab_box {
+    display: flex;
+    margin-top: 10px;
+    height: 300px;
+    width: 100%;
+
+    .equipmentList_box {
+      flex: 1;
+      height: 100%;
+      margin-right: 10px;
+      display: flex;
+      flex-direction: column;
+
+      .divider {
+        flex: 0 0 50px;
+
+        .title {
+          height: 35px;
+        }
       }
-    }
 
-    .el-table {
-      overflow: auto;
+      .el-table {
+        overflow: auto;
+      }
     }
-  }
 
-  .ruleMatters_box {
-    flex: 3;
-    height: 100%;
-    display: flex;
-    flex-direction: column;
-    overflow: hidden;
+    .ruleMatters_box {
+      flex: 3;
+      height: 100%;
+      display: flex;
+      flex-direction: column;
+      overflow: hidden;
 
-    .divider {
-      flex: 0 0 50px;
+      .divider {
+        flex: 0 0 50px;
 
-      .title {
-        height: 35px;
+        .title {
+          height: 35px;
+        }
       }
-    }
 
-    .el-table {
-      overflow: auto;
-
-      .operationGuide_box {
-        width: 100%;
-        height: 50px;
-        display: flex;
-        overflow: hidden;
-        cursor: pointer;
-
-        .left_content {
-          flex: 0 0 200px;
-          padding: 10px;
-          box-sizing: border-box;
-          border: 1px solid #c0c4cc;
-          border-radius: 10px;
-          margin-right: 10px;
-          overflow-y: auto;
-        }
+      .el-table {
+        overflow: auto;
+
+        .operationGuide_box {
+          width: 100%;
+          height: 50px;
+          display: flex;
+          overflow: hidden;
+          cursor: pointer;
+
+          .left_content {
+            flex: 0 0 200px;
+            padding: 10px;
+            box-sizing: border-box;
+            border: 1px solid #c0c4cc;
+            border-radius: 10px;
+            margin-right: 10px;
+            overflow-y: auto;
+          }
 
-        .right_content {
-          flex: 1;
-          padding: 10px;
-          box-sizing: border-box;
-          border: 1px solid #c0c4cc;
-          border-radius: 10px;
-          overflow-y: auto;
+          .right_content {
+            flex: 1;
+            padding: 10px;
+            box-sizing: border-box;
+            border: 1px solid #c0c4cc;
+            border-radius: 10px;
+            overflow-y: auto;
+          }
         }
       }
-    }
 
-    .el-table::before {
-      display: none;
+      .el-table::before {
+        display: none;
+      }
     }
   }
-}
 </style>

+ 7 - 7
src/views/maintenance/patrol/workOrder/index.vue

@@ -1,11 +1,11 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
-      <el-tabs v-model="activeTab" @tab-click="handleTabClick" style="margin-bottom: 10px">
+      <el-tabs v-model="activeTab" @tab-click="handleTabClick" style="margin-bottom: 10px" v-if="$store.state.user.info.clientEnvironmentId == 10">
         <el-tab-pane label="全部" name=""></el-tab-pane>
-        <el-tab-pane label="场站5" name="2008729845612720129"></el-tab-pane>
-        <el-tab-pane label="场站6" name="2008729929536548865"></el-tab-pane>
-        <el-tab-pane label="场站7" name="2008730320160468994"></el-tab-pane>
+        <el-tab-pane label="5号站" name="2008729845612720129"></el-tab-pane>
+        <el-tab-pane label="6号站" name="2008729929536548865"></el-tab-pane>
+        <el-tab-pane label="7号站" name="2008730320160468994"></el-tab-pane>
       </el-tabs>
       <work-search @search="reload"> </work-search>
       <!-- 数据表格 -->
@@ -300,7 +300,7 @@
           type: 1
         };
         if (this.activeTab) {
-          params.executeGroupId = this.activeTab;
+          params.teamId = this.activeTab;
         }
         return getWorkOrderPage(params);
       },
@@ -317,10 +317,10 @@
       },
       /* 刷新表格 */
       reload(where) {
-        this.$refs.table.reload({ page: 1, where: { ...where, executeGroupId: this.activeTab || undefined } });
+        this.$refs.table.reload({ page: 1, where: { ...where, teamId: this.activeTab || undefined } });
       },
       handleTabClick() {
-        this.$refs.table.reload({ page: 1, where: { executeGroupId: this.activeTab || undefined } });
+        this.$refs.table.reload({ page: 1, where: { teamId: this.activeTab || undefined } });
       },
       startExecuting(row) {
         startExecuting({ id: row.id }).then((res) => {

+ 70 - 0
src/views/maintenance/service/index.vue

@@ -0,0 +1,70 @@
+<template>
+  <div class="patrol">
+    <div class="ele-body">
+      <el-card shadow="never">
+        <div class="switch">
+          <div class="switch_left">
+            <ul>
+              <li
+                v-for="item in tabOptions"
+                :key="item.key"
+                :class="{ active: activeComp == item.key }"
+                @click="activeComp = item.key"
+              >
+                {{ item.name }}
+              </li>
+            </ul>
+          </div>
+        </div>
+        <div class="main">
+          <div v-if="activeComp == 'plan'">
+            <plan />
+          </div>
+          <div v-else>
+            <workOrder />
+          </div>
+        </div>
+      </el-card>
+    </div>
+  </div>
+</template>
+<script>
+  import plan from './plan';
+  import workOrder from './workOrder';
+  export default {
+    components: { plan, workOrder },
+    data() {
+      return {
+        activeComp: 'plan',
+        tabOptions: [
+          { key: 'plan', name: '计划' },
+          { key: 'workOrder', name: '工单' }
+        ]
+      };
+    },
+    mounted() {
+      switch (this.$route.query.title) {
+        case '计划':
+          this.activeComp = 'plan';
+          break;
+        case '工单':
+          this.activeComp = 'workOrder';
+          break;
+        default:
+          break;
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  ::v-deep .el-card__body {
+    padding-top: 0;
+    padding-left: 0;
+  }
+  .main {
+    padding-left: 17px;
+    .plan {
+      padding-top: 15px;
+    }
+  }
+</style>

+ 187 - 0
src/views/maintenance/service/plan/components/plan-search.vue

@@ -0,0 +1,187 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="100px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="计划单号:">
+          <el-input clearable v-model="where.planCode" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="计划性质:">
+          <el-select
+            clearable
+            filterable
+            v-model="where.cycleType"
+            class="w100"
+          >
+            <el-option label="手动" :value="0"></el-option>
+            <el-option label="自动" :value="1"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="计划名称:">
+          <el-input clearable v-model="where.planName" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="设备分类:">
+          <equipmentSelect v-model="where.categoryLevelId" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="计划规则:">
+          <el-input clearable v-model="where.ruleName" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="生成时间:">
+          <el-date-picker
+            v-model="where.time"
+            type="daterange"
+            align="right"
+            unlink-panels
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            :picker-options="pickerOptions"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="状态:">
+          <el-select
+            clearable
+            filterable
+            v-model="where.planStatus"
+            class="w100"
+          >
+            <el-option label="待派单" :value="0"></el-option>
+            <el-option label="已派单" :value="1"></el-option>
+            <el-option label="执行中" :value="2"></el-option>
+            <el-option label="已完成" :value="3"></el-option>
+            <el-option label="已撤回" :value="4"></el-option>
+            <el-option label="已驳回" :value="4"></el-option>
+          </el-select>
+        </el-form-item>
+        <!-- <el-form-item label="组织机构:">
+          <auth-selection v-model="where.deptIds" style="width: 100%"></auth-selection>
+        </el-form-item> -->
+
+      </el-col>
+    </el-row>
+    <el-row :gutter="15">
+      <el-col class="ele-form-actions">
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          class="ele-btn-icon"
+          @click="search"
+          size="small"
+        >
+          查询
+        </el-button>
+        <el-button
+          @click="reset"
+          icon="el-icon-refresh-left"
+          size="small"
+          type="primary"
+        >重置</el-button
+        >
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  import equipmentSelect from '@/components/CommomSelect/equipment-select.vue';
+  export default {
+    components: { equipmentSelect },
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        planName: '',
+        planCode: '',
+        fixCode: '',
+        time: [],
+        ruleName: '',
+        categoryLevelId: ''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere },
+        treeData: [],
+        pickerOptions: {
+          shortcuts: [
+            {
+              text: '最近一周',
+              onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+                picker.$emit('pick', [start, end]);
+              }
+            },
+            {
+              text: '最近一个月',
+              onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+                picker.$emit('pick', [start, end]);
+              }
+            },
+            {
+              text: '最近三个月',
+              onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+                picker.$emit('pick', [start, end]);
+              }
+            }
+          ]
+        }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created() {},
+    methods: {
+      /* 搜索 */
+      search() {
+        const parmas = this.where;
+        if (parmas.time?.length) {
+          parmas.startTime = parmas.time[0];
+          parmas.endTime = parmas.time[1];
+        }
+        delete parmas.time;
+        this.$emit('search', parmas);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .ele-form-actions {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+  }
+  ::v-deep {
+    .el-range-editor--medium.el-input__inner {
+      width: 100%;
+    }
+  }
+</style>

+ 732 - 0
src/views/maintenance/service/plan/details.vue

@@ -0,0 +1,732 @@
+<template>
+  <!-- 巡点检计划审批 -->
+  <div class="page" v-loading="pageLoading">
+    <el-form label-width="130px">
+      <div class="content-detail">
+        <div class="basic-details">
+          <HeaderTitle title="基本信息" size="16px">
+            <el-button
+              type="primary"
+              @click="
+                $router.push({
+                  path: '/maintenance/patrol',
+                  query: { title: '计划' }
+                })
+              "
+              >返回</el-button
+            >
+          </HeaderTitle>
+          <el-row>
+            <el-col :span="24">
+              <el-col :span="12">
+                <el-form-item label="计划单号">
+                  <span> {{ infoData.code }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="来源计划配置单号">
+                  <span> {{ infoData.planConfigCode }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="名称">
+                  <span> {{ infoData.name }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="指定执行人">
+                  <span v-if="infoData.executor && infoData.executor.length">
+                    {{ infoData.executor.map((i) => `${i.groupName}-${i.name}`).join(',') }}
+                  </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="计划完成时长">
+                  <span v-if="infoData.duration >= 0"
+                    >{{ infoData.duration }}分钟</span
+                  >
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="周期">
+                  <span v-if="infoData.ruleInfo">
+                    {{ infoData.ruleInfo.cycleValue
+                    }}{{
+                      getDictValue('巡点检周期', infoData.ruleInfo.cycleType)
+                    }}
+                  </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="设备分类">
+                  <span> {{ infoData.categoryLevelName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="规则名称">
+                  <span>
+                    {{ infoData.ruleInfo && infoData.ruleInfo.name }}
+                  </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="创建部门">
+                  <span> {{ infoData.createUserGroupName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="创建人">
+                  <span> {{ infoData.createUserName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="创建时间">
+                  <span> {{ infoData.createTime }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="备注">
+                  <span> {{ infoData.remark }} </span>
+                </el-form-item>
+              </el-col>
+            </el-col>
+            <!-- <el-col :span="12">
+              <img :src="infoData.imageUrl" alt="" />
+            </el-col> -->
+          </el-row>
+        </div>
+        <!-- 备品备件 -->
+        <div v-if="sparePartsList.length > 0" class="maintain_spareParts_info">
+          <HeaderTitle title="备品备件" size="16px"></HeaderTitle>
+          <div
+            class="maintain_spareParts_info_content"
+            v-for="(item, index) in sparePartsList"
+          >
+            <div class="title">
+              <span>工单号:{{ item.workOrderId }}</span>
+            </div>
+            <el-table :data="item.infoList" border>
+              <el-table-column label="序号" width="50">
+                <template slot-scope="scope">
+                  <span>{{ scope.$index + 1 }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="备件物品编码"
+                prop="code"
+              ></el-table-column>
+              <el-table-column label="备件名称" prop="name"></el-table-column>
+              <el-table-column
+                label="所属分类"
+                prop="typeName"
+              ></el-table-column>
+              <el-table-column label="型号" prop="model"></el-table-column>
+              <el-table-column label="使用数量" prop="num"></el-table-column>
+            </el-table>
+          </div>
+        </div>
+        <!-- 巡点检、保养设备 -->
+        <div class="maintain_equipment_info">
+          <HeaderTitle title="设备" size="16px"></HeaderTitle>
+          <div class="maintain_equipment_info_content">
+            <div
+              class="equipment_item"
+              v-for="item in infoData.planDeviceList"
+              :key="item.id"
+            >
+              <div class="equipment_info" v-if="item.substance">
+                <div class="item_info">
+                  <span class="item_label">设备编码</span>
+                  <span class="item_value">{{ item.substance.code }}</span>
+                </div>
+                <div class="item_info">
+                  <span class="item_label">设备名称</span>
+                  <span class="item_value">{{ item.substance.name }}</span>
+                </div>
+                <div class="item_info">
+                  <span class="item_label">设备型号</span>
+                  <span class="item_value">{{ item.substance.model }}</span>
+                </div>
+                <div class="item_info">
+                  <span class="item_label">设备位置</span>
+                  <span class="item_value">{{
+                    item.substance.positionNames
+                  }}</span>
+                </div>
+              </div>
+              <p>操作事项</p>
+              <div class="ruleMatters_box">
+                <el-table :data="item.workItems" border>
+                  <el-table-column label="序号" width="50">
+                    <template slot-scope="scope">
+                      <span>{{ scope.$index + 1 }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="零部件编码"
+                    prop="categoryCode"
+                    width="100"
+                  >
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.categoryCode }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="零部件名称"
+                    prop="categoryName"
+                    width="100"
+                  >
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.categoryName }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="事项" prop="name" width="100">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.name }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="内容" prop="content" width="300">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.content }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="操作指导" prop="operationGuide">
+                    <template slot-scope="scope">
+                      <div class="operationGuide_box">
+                        <div class="left_content">
+                          <template v-if="scope.row.operationGuide">
+                            <div
+                              v-for="(item, index) in scope.row.operationGuide
+                                .toolList"
+                              :key="item.id"
+                              >{{ index + 1 }}.{{ item.name }}</div
+                            >
+                          </template>
+                        </div>
+                        <div class="line"></div>
+                        <div class="right_content">
+                          <template v-if="scope.row.operationGuide">
+                            <div
+                              v-for="(item, index) in scope.row.operationGuide
+                                .procedureList"
+                              :key="item.id"
+                              >{{ index + 1 }}.{{ item.content }}</div
+                            >
+                          </template>
+                        </div>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="标准" prop="norm" width="100">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.norm }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                </el-table>
+              </div>
+             
+            </div>
+          </div>
+        </div>
+      
+        <div class="btnbox" v-if="$route.query.isshow">
+          <el-button class="confirm-btn" type="danger" plain @click="reject"
+            >驳回</el-button
+          >
+          <el-button class="confirm-btn" type="success" plain @click="pass"
+            >通过</el-button
+          >
+          <!-- <el-button class="cancel-btn">关闭</el-button> -->
+        </div>
+        <div class="textbox" v-if="showtext" ref="rejectContent">
+          <el-input
+            type="textarea"
+            placeholder="请输入驳回原因"
+            v-model="cause"
+            maxlength="30"
+            rows="5"
+            show-word-limit
+          >
+          </el-input>
+          <div class="textbtnbox">
+            <el-button size="small" round @click="cancelreject">取消</el-button>
+            <el-button size="small" round @click="surereject">提交</el-button>
+          </div>
+        </div>
+      </div>
+    </el-form>
+  </div>
+</template>
+
+<script>
+  // import { getDetail, sendAudit } from '@/api/stockManagement/stocking'
+  // import { useDictLabel, patrolMatterStatus } from '@/utils/dict/index'
+  import { getById, getSpareParts } from '@/api/maintenance/patrol_maintenance';
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    mixins: [dictMixins],
+    data() {
+      return {
+        num: 1,
+        dialogVisible: false,
+        baseInfo: {},
+        pageLoading: false,
+        typeValue: null,
+        contract_type: [],
+        status: [
+          {
+            value: true,
+            label: '失效'
+          },
+          {
+            value: false,
+            label: '生效'
+          }
+        ],
+        ruleItem: [],
+        cause: '',
+        showtext: false,
+        infoData: {},
+        sparePartsList: []
+      };
+    },
+    async created() {
+      this.requestDict('巡点检周期');
+      this.getInfo();
+      this.getSparePartsList();
+    },
+    methods: {
+      // getStatus: useDictLabel(patrolMatterStatus),
+      delete() {},
+      // 点击切换事件
+      tab(index) {
+        this.num = index;
+      },
+      // 表格数据
+      async getInfo() {
+        this.pageLoading = true;
+        const res = await getById(this.$route.query.id).catch(() => {
+          this.pageLoading = false;
+        });
+        if (res?.data) {
+          this.infoData = res.data;
+        }
+        this.pageLoading = false;
+      },
+      // 通过工单查询备品备件
+      getSparePartsList() {
+        getSpareParts(this.$route.query.id).then((data) => {
+          console.log(data);
+          this.sparePartsList = data.map((item) => {
+            item.infoList = item.content.infoList.map((innerItem) => {
+              return {
+                sparePartsId: innerItem.sparePartsId,
+                ...JSON.parse(innerItem.sparePartsList)
+              };
+            });
+            return {
+              ...item
+            };
+          });
+          console.log(this.sparePartsList);
+        });
+      },
+      //通过按钮事件
+      pass() {
+        let params = {
+          id: this.$route.query.id,
+          checked: true,
+          myHandleId: this.$route.query.dbid,
+          cause: '',
+          type: 2,
+          handleType: 0
+        };
+        sendAudit(params).then((res) => {
+          if (res.success) {
+            this.$message.success('审批通过!');
+            this.$router.back();
+          }
+        });
+      },
+      //驳回按钮事件
+      reject() {
+        this.showtext = true;
+        let bodyscrollHeight = document.body.scrollHeight;
+        this.$nextTick(() => {
+          document.documentElement.scrollTop = bodyscrollHeight;
+        });
+      },
+      cancelreject() {
+        this.showtext = false;
+        this.cause = '';
+      },
+      surereject() {
+        if (!this.cause) {
+          this.$message.info('请填写驳回原因!');
+        } else {
+          let params = {
+            id: this.$route.query.id,
+            checked: false,
+            myHandleId: this.$route.query.dbid,
+            cause: this.cause,
+            type: 2,
+            handleType: 0
+          };
+          sendAudit(params).then((res) => {
+            if (res.success) {
+              this.$message.success('驳回成功!');
+              this.$router.back();
+            }
+          });
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  // @import '@/assets/css/oaa.scss';
+  .page {
+    padding: 10px;
+  }
+  .page-title {
+    background: #fff;
+    font-size: 18px;
+    padding: 6px 20px;
+    font-weight: 500;
+    .page-title-div {
+      margin: 5px 0;
+      height: 30px;
+      line-height: 30px;
+      border-bottom: 1px solid #eaeefb;
+      .title-div-no {
+        margin-left: 10px;
+        font-weight: 400;
+        color: #909090;
+        font-size: 14px;
+      }
+    }
+  }
+  .page-data {
+    padding-top: 10px;
+  }
+  .content-detail {
+    background: #fff;
+    padding: 20px;
+  }
+  .flows {
+    .flow-left {
+      width: 156px;
+      height: 70px;
+      border: 1px dashed #ccc;
+      padding: 10px;
+    }
+    .row {
+      margin-top: 13px;
+    }
+  }
+  .basic-details-title {
+    margin-bottom: 12px;
+    margin-top: 20px;
+    border-bottom: 1px solid #1890ff;
+    padding-bottom: 8px;
+    display: flex;
+    justify-content: space-between;
+  }
+  .basic-details-title .border-span {
+    height: 18px;
+    font-size: 16px;
+    border-left: 4px solid #1890ff;
+    padding-left: 8px;
+
+    font-weight: 500;
+  }
+  .heade-right {
+    // float: right;
+    .heade-right-content {
+      margin-right: 12px;
+      font-size: 14px;
+      display: inline-block;
+      .content-key {
+        color: #3e3e3e;
+        margin-right: 12px;
+        font-weight: 500;
+      }
+      .content-value {
+        color: #000;
+      }
+    }
+  }
+  .list-title {
+    font-size: 14px;
+    color: #3e3e3e;
+    margin: 10px 0px;
+  }
+  .goods {
+    background: #a30014;
+    border: 1px solid #a30014;
+  }
+  .details-title {
+    display: inline-block;
+    color: #6e6e6e;
+    font-size: 14px;
+    font-weight: bold;
+    margin-right: 13px;
+    width: 70px;
+    text-align: right;
+  }
+  .details-con {
+    color: #3e3e3e;
+    font-size: 14px;
+  }
+  .detailed-tab {
+    margin-left: 10px;
+    margin-top: 10px;
+  }
+  ::v-deep .el-form-item--medium .el-form-item__label {
+    color: #6e6e6e;
+    font-size: 14px;
+    font-weight: bold;
+  }
+  .warehouse {
+    display: block;
+    border-bottom: 1px solid #eaeefb;
+    padding: 10px 0;
+  }
+  .box-card {
+    .store-box {
+      width: 80%;
+      .store-box-span {
+        display: inline-block;
+        font-size: 14px;
+        height: 50px;
+        width: 50px;
+        text-align: center;
+        line-height: 50px;
+        color: #fff;
+        margin: 2px;
+      }
+    }
+  }
+  .vacant {
+    background: #3196fb;
+  }
+  .inUse {
+    background: #157a2c;
+  }
+  .invalid {
+    background: #cccccc;
+  }
+  .full {
+    background: #cc3300;
+  }
+
+  .maintain_equipment_info {
+    .maintain_equipment_info_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      > span {
+        display: inline-block;
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
+      }
+    }
+    .maintain_equipment_info_content {
+      padding: 0 30px;
+      .equipment_item {
+        border: 1px solid #ccc;
+        font-size: 14px;
+        padding: 15px;
+        margin-bottom: 30px;
+        .equipment_info {
+          display: flex;
+          flex-wrap: wrap;
+          border: 1px solid #ddd;
+          .item_info {
+            width: 33.33%;
+            height: 24px;
+            line-height: 24px;
+            display: flex;
+            .item_label {
+              width: 90px;
+              text-align: center;
+              background-color: #f2f2f2;
+              font-weight: 700;
+            }
+            .item_value {
+              border-bottom: 1px solid #f2f2f2;
+              flex: 1;
+              padding-left: 5px;
+            }
+            &:last-child {
+              width: 100%;
+              .item_value {
+                border: 0;
+              }
+            }
+          }
+        }
+        > p {
+          margin-top: 20px;
+          color: #797979;
+        }
+        .matter_info {
+          ::v-deep .el-table {
+            th.el-table__cell {
+              background-color: #f2f2f2;
+              padding: 0;
+            }
+            td.el-table__cell {
+              padding: 0;
+            }
+          }
+        }
+        .ruleMatters_box {
+          flex: 3;
+          height: 100%;
+          display: flex;
+          flex-direction: column;
+          .divider {
+            flex: 0 0 50px;
+            .title {
+              height: 35px;
+            }
+          }
+          .el-table {
+            overflow: auto;
+            .operationGuide_box {
+              width: 100%;
+              display: flex;
+              position: relative;
+              .left_content {
+                flex: 0 0 300px;
+                padding: 10px;
+                margin-right: 10px;
+                overflow-y: auto;
+              }
+              .line {
+                position: absolute;
+                top: -10px;
+                left: 300px;
+                bottom: -10px;
+                height: 110%;
+                width: 1px;
+                background-color: #ededed;
+              }
+              .right_content {
+                flex: 1;
+                padding: 10px;
+                overflow-y: auto;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+
+  .maintain_spareParts_info {
+    margin-bottom: 20px;
+    .maintain_spareParts_info_content {
+      .title {
+        padding: 20px 0;
+        font-size: 16px;
+      }
+    }
+  }
+  .examine_info {
+    margin-bottom: 30px;
+    .examine_info_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      > span {
+        display: inline-block;
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
+      }
+    }
+    .item_row {
+      display: flex;
+      flex-wrap: wrap;
+      font-size: 14px;
+      padding: 0 15px;
+      box-sizing: border-box;
+      .item_info {
+        width: 33.33%;
+        height: 24px;
+        line-height: 24px;
+        display: flex;
+        &.border_right {
+          border-right: 1px solid #f2f2f2;
+        }
+        &.border_top {
+          border-top: 1px solid #f2f2f2;
+        }
+        &.reason {
+          width: 100%;
+        }
+        .item_label {
+          width: 90px;
+          text-align: center;
+          background-color: #f2f2f2;
+          font-weight: 700;
+        }
+        .item_value {
+          border-bottom: 1px solid #f2f2f2;
+          flex: 1;
+          padding-left: 5px;
+        }
+      }
+    }
+  }
+  .execute_info {
+    .execute_info_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      > span {
+        display: inline-block;
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
+      }
+    }
+    ::v-deep .el-table th.el-table__cell {
+      background-color: #f2f2f2;
+    }
+    ::v-deep .el-table .el-table__cell {
+      padding: 5px 0;
+    }
+  }
+  .btnbox {
+    display: flex;
+    justify-content: center;
+    margin-top: 10px;
+  }
+  ::v-deep .el-button {
+    padding: 10px 20px;
+    margin-right: 10px;
+  }
+  .textbox {
+    margin-top: 10px;
+  }
+  .textbtnbox {
+    margin-top: 10px;
+    display: flex;
+    justify-content: center;
+  }
+</style>

+ 260 - 0
src/views/maintenance/service/plan/index.vue

@@ -0,0 +1,260 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <plan-search @search="reload"> </plan-search>
+      <!-- 数据表格 -->
+      <!-- :default-sort="{ prop: 'createTime', order: 'descending' }" -->
+      <ele-pro-table
+        ref="table"
+        :pageSizes="tablePageSizes"
+        :columns="columns"
+        :datasource="datasource"
+        cache-key="systemRoleTable"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:toolbar>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="openAdd('add', '新增检修计划配置')"
+          >
+            新建临时计划
+          </el-button>
+        </template>
+
+        <template v-slot:planCode="{ row }">
+          <el-link type="primary" :underline="false" @click="goDetail(row)">
+            {{ row.planCode }}
+          </el-link>
+        </template>
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            v-if="row.planStatus == 4 || row.planStatus == 0"
+            icon="el-icon-edit"
+            @click="openAdd('edit', '编辑检修计划配置', row)"
+          >
+            编辑
+          </el-link>
+          <el-link
+            v-if="row.planStatus == 4 || row.planStatus == 0"
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openAdd('dispatch', '派单', row)"
+          >
+            派单
+          </el-link>
+          <el-link
+            v-if="
+              row.planStatus != 2 &&
+              row.planStatus != 3 &&
+              row.planStatus != 4 &&
+              row.planStatus != 0
+            "
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="handleWithdraw(row)"
+          >
+            撤回
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+
+    <programRulesDialog
+      ref="programRulesDialog"
+      :visible.sync="addProgramRulesDialog"
+      :dialogTitle="dialogTitle"
+      :isBindPlan="isBindPlan"
+      @done="reload"
+    />
+  </div>
+</template>
+
+<script>
+  import ProgramRulesDialog from '../../components/programRulesDialog.vue';
+  import { getPage, revocation } from '@/api/maintenance/patrol_maintenance';
+  import PlanSearch from './components/plan-search.vue';
+  
+  export default {
+    components: {
+      ProgramRulesDialog,PlanSearch
+    },
+    data() {
+      return {
+        addProgramRulesDialog: false,
+        isBindPlan: false,
+        dialogTitle: '',
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            columnKey: 'planCode',
+            slot: 'planCode',
+            prop: 'planCode',
+            label: '计划单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'planName',
+            label: '计划名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'ruleName',
+            label: '计划规则',
+            align: 'center',
+            showOverflowTooltip: true,
+            slot: 'enable',
+            minWidth: 200
+          },
+          {
+            prop: 'categoryLevelName',
+            label: '设备分类',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'isSyncBill',
+            label: '自动派单',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter(item) {
+              return item.isSyncBill == 1 ? '是' : '否';
+            }
+          },
+          {
+            prop: 'planStatus',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter(item) {
+              return {
+                0: '待派单',
+                1: '已派单',
+                2: '执行中',
+                3: '已完成',
+                4: '已撤回',
+                5: '已驳回'
+              }[item.planStatus];
+            }
+          },
+          {
+            prop: 'approvalUserName',
+            label: '审批人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'createTime',
+            label: '生成时间',
+            align: 'center',
+            // sortable: true,
+            showOverflowTooltip: true,
+            minWidth: 150,
+            formatter: (_row, _column, cellValue) => {
+              return this.$util.toDateString(cellValue);
+            }
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 230,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        // 加载状态
+        loading: false,
+        pageType: 'add',
+        isBindPlan: false
+      };
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getPage({ pageNum: page, size: limit, ...where, planType: 7 });
+      },
+      async changeEnable(row) {
+        const res = await putRoles(row);
+        if (res.code == 0) {
+          this.$message({
+            type: 'success',
+            message: '修改成功',
+            customClass: 'ele-message-border'
+          });
+          this.reload();
+        }
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.addProgramRulesDialog = false;
+        this.$refs.table.reload({ page: 1, where });
+      },
+      handleWithdraw(row) {
+        // 撤回
+        this.$confirm(`确认撤回?`, '提示').then(async () => {
+          revocation(row.id)
+            .then(() => {
+              this.$message.success('撤回成功!');
+              this.reload();
+            })
+            .catch((err) => {
+              this.$message.success(err.message || '撤回失败!');
+            });
+        });
+      },
+
+      openAdd(type, dialogTitle, row) {
+        // this.$refs.addPatrolPlanDialogRef.open(dialogTitle, row);
+        this.isBindPlan = false;
+        this.addProgramRulesDialog = true;
+        this.dialogTitle = dialogTitle;
+        this.$nextTick(() => {
+          this.$refs.programRulesDialog.init(type, row, '检修');
+        });
+      },
+      goDetail({ id }) {
+        this.$router.push({
+          path: '/maintenance/service/plan/details',
+          query: {
+            id
+          }
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 169 - 0
src/views/maintenance/service/workOrder/components/work-search.vue

@@ -0,0 +1,169 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="100px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="工单单号:">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="检修人员:">
+          <el-input
+            clearable
+            v-model="where.executeUserName"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="计划单号:">
+          <el-input clearable v-model="where.planCode" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="状态:">
+          <el-select
+            style="width: 100%"
+            clearable
+            filterable
+            v-model="where.orderStatus"
+          >
+            <el-option label="待接收" :value="0"></el-option>
+            <el-option label="已接收" :value="1"></el-option>
+            <el-option label="执行中" :value="2"></el-option>
+            <el-option label="已完成" :value="3"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="检修名称:">
+          <el-input clearable v-model="where.planName" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="规则名称:">
+          <el-select
+            v-model="where.ruleId"
+            size="small"
+            clearable
+            style="width: 100%"
+            filterable
+          >
+            <el-option
+              v-for="item in ruleNameList"
+              :key="item.id"
+              :value="item.id"
+              :label="item.name"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+    
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="检修部门:">
+          <deptSelect v-model="where.groupId" @changeGroup="changeGroup" />
+        </el-form-item>
+      
+      </el-col>
+    </el-row>
+    <el-row :gutter="15">
+      <el-col class="ele-form-actions">
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          class="ele-btn-icon"
+          @click="search"
+          size="small"
+        >
+          查询
+        </el-button>
+        <el-button
+          @click="reset"
+          icon="el-icon-refresh-left"
+          size="small"
+          type="primary"
+          >重置</el-button
+        >
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  import { getRule } from '@/api/ruleManagement/plan';
+  import equipmentSelect from '@/components/CommomSelect/equipment-select.vue';
+  import deptSelect from '@/components/CommomSelect/dept-select.vue';
+  import personSelect from '@/components/CommomSelect/person-select.vue';
+  export default {
+    components: { equipmentSelect, deptSelect, personSelect },
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        executeUserName: '',
+        planCode: '',
+        code: '',
+        orderStatus: '',
+        groupId: '',
+        categoryLevelId: '',
+        planName: ''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere },
+        treeData: [],
+        ruleNameList: []
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created() {
+      this.getRuleNameList();
+    },
+    methods: {
+      /* 部门选择 */
+      changeGroup(id, data) {
+        if (id) {
+          this.where.groupId = id;
+          this.where.executeGroupName = data.name;
+        } else {
+          this.where.groupId = '';
+          this.where.executeGroupName = '';
+        }
+      },
+      /* 搜索 */
+      search() {
+        console.log(this.where);
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      },
+      // 获取规则名列表(设备保养)
+      async getRuleNameList() {
+        const res = await getRule({
+          status: 1,
+          type: 7,
+          pageNum: 1,
+          size: -1
+        });
+        if (res.list) {
+          this.ruleNameList = res.list || [];
+        }
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .ele-form-actions {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+  }
+</style>

+ 708 - 0
src/views/maintenance/service/workOrder/details.vue

@@ -0,0 +1,708 @@
+<template>
+  <div class="page" v-loading="pageLoading">
+    <el-form label-width="130px">
+      <div class="content-detail" v-show="num == 1">
+        <div class="basic-details">
+          <HeaderTitle title="基本信息" size="16px">
+            <el-button
+              type="primary"
+              @click="
+                $router.push({
+                  path: '/maintenance/patrol',
+                  query: { title: '工单' }
+                })
+              "
+            >
+              返回</el-button
+            >
+          </HeaderTitle>
+          <el-row>
+            <el-col :span="24">
+              <el-col :span="8">
+                <el-form-item label="计划单号">
+                  <span> {{ infoData.planCode }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="来源计划配置单号">
+                  <span> {{ infoData.planConfigCode }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="名称">
+                  <span> {{ infoData.planName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="指定执行人">
+                  <span v-if="infoData.executeUsers">
+                    <span v-if="executeUserType == 1">
+                      {{
+                        infoData.executeUsers
+                          .map((i) => {
+                            return `${i.teamName}`;
+                          })
+                          .join(',')
+                      }}
+                    </span>
+                    <span v-else>
+                      {{
+                        infoData.executeUsers
+                          .map((i) => {
+                            return `${i.groupName}-${i.userName}`;
+                          })
+                          .join(',')
+                      }}
+                    </span>
+                  </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="实际执行人">
+                  <span v-if="infoData.executeUserName">
+                    {{ infoData.executeGroupName }}-{{
+                      infoData.executeUserName
+                    }}
+                  </span>
+                </el-form-item>
+              </el-col>
+
+              <el-col :span="8">
+                <el-form-item label="计划完成时长">
+                  <span v-if="infoData.duration >= 0"
+                    >{{ infoData.duration }}分钟</span
+                  >
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="周期">
+                  <span v-if="infoData.ruleInfo">
+                    {{ infoData.ruleInfo.cycleValue
+                    }}{{
+                      getDictValue('巡点检周期', infoData.ruleInfo.cycleType)
+                    }}
+                  </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="设备分类">
+                  <span> {{ infoData.categoryLevelName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="规则名称">
+                  <span>
+                    {{ infoData.ruleName }}
+                  </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="创建部门">
+                  <span> {{ infoData.createGroupName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="创建人">
+                  <span> {{ infoData.createUserName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="创建时间">
+                  <span> {{ infoData.createTime }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="实际开始时间">
+                  <span> {{ infoData.acceptTime }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="实际完成时间">
+                  <span> {{ infoData.finishTime }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="8">
+                <el-form-item label="报工时间">
+                  <span> {{ infoData.reportTime }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="备注">
+                  <span> {{ infoData.remark }} </span>
+                </el-form-item>
+              </el-col>
+            </el-col>
+          </el-row>
+        </div>
+
+        <!-- 巡点检、保养设备 -->
+        <div class="maintain_equipment_info">
+          <HeaderTitle title="设备" size="16px"></HeaderTitle>
+          <div class="maintain_equipment_info_content">
+            <div
+              class="equipment_item"
+              v-for="item in infoData.deviceList"
+              :key="item.id"
+            >
+              <div class="equipment_info" v-if="item.substance">
+                <div class="item_info">
+                  <span class="item_label">设备编码</span>
+                  <span class="item_value">{{ item.substance.code }}</span>
+                </div>
+                <div class="item_info">
+                  <span class="item_label">设备名称</span>
+                  <span class="item_value">{{ item.substance.name }}</span>
+                </div>
+                <div class="item_info">
+                  <span class="item_label">设备型号</span>
+                  <span class="item_value">{{ item.substance.model }}</span>
+                </div>
+                <div class="item_info">
+                  <span class="item_label">设备位置</span>
+                  <span class="item_value">{{
+                    item.substance.positionNames
+                  }}</span>
+                </div>
+                <div class="item_info">
+                  <span class="item_label">设备编号</span>
+                  <span class="item_value">{{
+                    item.substance.codeNumber
+                  }}</span>
+                </div>
+                <div class="item_info" style="display: none"> </div>
+              </div>
+              <p>操作事项</p>
+              <div class="ruleMatters_box">
+                <el-table :data="item.workItems" border>
+                  <el-table-column label="序号" width="50">
+                    <template slot-scope="scope">
+                      <span>{{ scope.$index + 1 }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="零部件编码"
+                    prop="categoryCode"
+                    width="100"
+                  >
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.categoryCode }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="零部件名称"
+                    prop="categoryName"
+                    width="100"
+                  >
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.categoryName }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="事项" prop="name" width="100">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.name }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="内容" prop="content" width="300">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.content }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="操作指导" prop="operationGuide">
+                    <template slot-scope="scope">
+                      <div class="operationGuide_box">
+                        <div class="left_content">
+                          <template v-if="scope.row.operationGuide">
+                            <div
+                              v-for="(item, index) in scope.row.operationGuide
+                                .toolList"
+                              :key="item.id"
+                              >{{ index + 1 }}.{{ item.name }}</div
+                            >
+                          </template>
+                        </div>
+                        <div class="line"></div>
+                        <div class="right_content">
+                          <template v-if="scope.row.operationGuide">
+                            <div
+                              v-for="(item, index) in scope.row.operationGuide
+                                .procedureList"
+                              :key="item.id"
+                              >{{ index + 1 }}.{{ item.content }}</div
+                            >
+                          </template>
+                        </div>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="标准" prop="norm" width="100">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.norm }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="状态" prop="status" width="100">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ options[scope.row.status] }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column
+                    label="现场照片"
+                    prop="photoList"
+                    width="300"
+                  >
+                    <template slot-scope="scope">
+                      <div>
+                        <el-image
+                          v-for="imgItem in scope.row.photoList"
+                          :key="imgItem"
+                          style="width: 100px; height: 100px"
+                          :src="imgItem"
+                          :preview-src-list="scope.row.photoList"
+                        >
+                        </el-image>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="结果" prop="result" width="200">
+                  </el-table-column>
+                </el-table>
+              </div>
+   
+            </div>
+    
+          </div>
+        </div>
+        <HeaderTitle title="备品备件申请单" size="16px"></HeaderTitle>
+        <editd :id="infoData.id" />
+
+       
+      </div>
+    </el-form>
+  </div>
+</template>
+
+<script>
+  import dictMixins from '@/mixins/dictMixins';
+  import { getWordOrderDetail } from '@/api/maintenance/patrol_maintenance';
+  import editd from '@/views/sparePartsApply/components/editd';
+
+  export default {
+    components: {
+      editd
+    },
+    mixins: [dictMixins],
+    data() {
+      return {
+        options: {
+          0: '未定义',
+          1: '正常',
+          '-1': '异常'
+        },
+        num: 1,
+        infoData: {},
+        dialogVisible: false,
+        data: {},
+        repairNotes: {},
+        pageLoading: false,
+        typeValue: null,
+        contract_type: [],
+        status: [
+          {
+            value: true,
+            label: '失效'
+          },
+          {
+            value: false,
+            label: '生效'
+          }
+        ],
+        ruleItem: [],
+        cause: '',
+        showtext: false,
+        from: null,
+        executeUserType: ''
+      };
+    },
+    created() {
+      this.requestDict('巡点检周期');
+      this.executeUserType = this.$route.query.executeUserType;
+      this.getInfo();
+    },
+    methods: {
+      // getStatus: useDictLabel(patrolMatterStatus),
+      delete() {},
+      // 点击切换事件
+      tab(index) {
+        this.num = index;
+      },
+      goBack() {
+        window.sessionStorage.setItem('patrolTabType', 'work');
+        if (this.form) {
+          this.$router.push({
+            path: '/workspace/workOrder',
+            query: { activeName: 'polling' }
+          });
+        } else {
+          this.$router.go(-1);
+        }
+      },
+      // 表格数据
+      getInfo() {
+        this.pageLoading = true;
+        getWordOrderDetail(this.$route.query.id)
+          .then((data) => {
+            data.deviceList.forEach((item) => {
+              item.workItems.forEach((val) => {
+                val.photoList.map((url) => {
+                  return window.location.origin + url;
+                });
+              });
+            });
+            this.infoData = data;
+
+            this.pageLoading = false;
+          })
+          .catch(() => {
+            this.pageLoading = false;
+          });
+      },
+
+      //驳回按钮事件
+      reject() {
+        this.showtext = true;
+      },
+      cancelreject() {
+        this.showtext = false;
+        this.cause = '';
+      },
+
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  // @import '@/assets/css/oaa.scss';
+  .page {
+    padding: 10px;
+  }
+  .page-title {
+    background: #fff;
+    font-size: 18px;
+    padding: 6px 20px;
+    font-weight: 500;
+    .page-title-div {
+      margin: 5px 0;
+      height: 30px;
+      line-height: 30px;
+      border-bottom: 1px solid #eaeefb;
+      .title-div-no {
+        margin-left: 10px;
+        font-weight: 400;
+        color: #909090;
+        font-size: 14px;
+      }
+    }
+  }
+  .page-data {
+    padding-top: 10px;
+  }
+  .content-detail {
+    background: #fff;
+    padding: 20px;
+  }
+  .flows {
+    .flow-left {
+      width: 156px;
+      height: 70px;
+      border: 1px dashed #ccc;
+      padding: 10px;
+    }
+    .row {
+      margin-top: 13px;
+    }
+  }
+  .basic-details-title {
+    margin-bottom: 12px;
+    margin-top: 20px;
+    border-bottom: 1px solid #1890ff;
+    padding-bottom: 8px;
+    display: flex;
+    justify-content: space-between;
+  }
+  .basic-details-title .border-span {
+    height: 18px;
+    font-size: 16px;
+    border-left: 4px solid #1890ff;
+    padding-left: 8px;
+
+    font-weight: 500;
+  }
+  .heade-right {
+    // float: right;
+    .heade-right-content {
+      margin-right: 12px;
+      font-size: 14px;
+      display: inline-block;
+      .content-key {
+        color: #3e3e3e;
+        margin-right: 12px;
+        font-weight: 500;
+      }
+      .content-value {
+        color: #000;
+      }
+    }
+  }
+  .list-title {
+    font-size: 14px;
+    color: #3e3e3e;
+    margin: 10px 0px;
+  }
+  .goods {
+    background: #a30014;
+    border: 1px solid #a30014;
+  }
+  .details-title {
+    display: inline-block;
+    color: #6e6e6e;
+    font-size: 14px;
+    font-weight: bold;
+    margin-right: 13px;
+    width: 70px;
+    text-align: right;
+  }
+  .details-con {
+    color: #3e3e3e;
+    font-size: 14px;
+  }
+  .detailed-tab {
+    margin-left: 10px;
+    margin-top: 10px;
+  }
+  ::v-deep .el-form-item--medium .el-form-item__label {
+    color: #6e6e6e;
+    font-size: 14px;
+    font-weight: bold;
+  }
+  .warehouse {
+    display: block;
+    border-bottom: 1px solid #eaeefb;
+    padding: 10px 0;
+  }
+  .box-card {
+    .store-box {
+      width: 80%;
+      .store-box-span {
+        display: inline-block;
+        font-size: 14px;
+        height: 50px;
+        width: 50px;
+        text-align: center;
+        line-height: 50px;
+        color: #fff;
+        margin: 2px;
+      }
+    }
+  }
+  .vacant {
+    background: #3196fb;
+  }
+  .inUse {
+    background: #157a2c;
+  }
+  .invalid {
+    background: #cccccc;
+  }
+  .full {
+    background: #cc3300;
+  }
+
+  .maintain_equipment_info {
+    .maintain_equipment_info_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      > span {
+        display: inline-block;
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
+      }
+    }
+    .maintain_equipment_info_content {
+      padding: 0 30px;
+      .equipment_item {
+        border: 1px solid #ccc;
+        font-size: 14px;
+        padding: 15px;
+        margin-bottom: 30px;
+        .equipment_info {
+          display: flex;
+          flex-wrap: wrap;
+          border: 1px solid #ddd;
+          .item_info {
+            width: 33.33%;
+            height: 24px;
+            line-height: 24px;
+            display: flex;
+            .item_label {
+              width: 90px;
+              text-align: center;
+              background-color: #f2f2f2;
+              font-weight: 700;
+            }
+            .item_value {
+              border-bottom: 1px solid #f2f2f2;
+              flex: 1;
+              padding-left: 5px;
+            }
+            &:last-child {
+              width: 100%;
+              .item_value {
+                border: 0;
+              }
+            }
+          }
+        }
+        > p {
+          margin-top: 20px;
+          color: #797979;
+        }
+        .matter_info {
+          ::v-deep .el-table {
+            th.el-table__cell {
+              background-color: #f2f2f2;
+              padding: 0;
+            }
+            td.el-table__cell {
+              padding: 0;
+            }
+          }
+        }
+        .ruleMatters_box {
+          flex: 3;
+          height: 100%;
+          display: flex;
+          flex-direction: column;
+          .divider {
+            flex: 0 0 50px;
+            .title {
+              height: 35px;
+            }
+          }
+          .el-table {
+            overflow: auto;
+            .operationGuide_box {
+              width: 100%;
+              display: flex;
+              position: relative;
+              .left_content {
+                flex: 0 0 300px;
+                padding: 10px;
+                margin-right: 10px;
+                overflow-y: auto;
+              }
+              .line {
+                position: absolute;
+                top: -10px;
+                left: 300px;
+                bottom: -10px;
+                height: 110%;
+                width: 1px;
+                background-color: #ededed;
+              }
+              .right_content {
+                flex: 1;
+                padding: 10px;
+                overflow-y: auto;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  .execute_info {
+    margin: 30px 0;
+    .execute_info_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      display: flex;
+      justify-content: space-between;
+      > span:first-child {
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
+      }
+    }
+    .execute_row {
+      padding: 0 30px;
+      .column {
+        display: flex;
+        font-size: 14px;
+        margin-bottom: 20px;
+        .label {
+          // width: 110px;
+          text-align: center;
+          font-weight: 700;
+        }
+      }
+    }
+  }
+  .repair_notes {
+    .repair_notes_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      > span {
+        display: inline-block;
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
+      }
+    }
+    .repair_notes_equipment_item {
+      padding: 0 20px;
+      .equipment_item_tilte {
+        background-color: #f7f7f7;
+        height: 36px;
+        line-height: 36px;
+        .label {
+          font-weight: 700;
+        }
+      }
+      .main_info {
+        font-size: 14px;
+        margin-top: 15px;
+        > div {
+          margin-bottom: 10px;
+        }
+      }
+    }
+  }
+  .btnbox {
+    display: flex;
+    justify-content: center;
+  }
+  ::v-deep .el-button {
+    padding: 10px 20px;
+    margin-right: 10px;
+  }
+  .textbtnbox {
+    margin-top: 10px;
+    display: flex;
+    justify-content: center;
+  }
+</style>

+ 384 - 0
src/views/maintenance/service/workOrder/index.vue

@@ -0,0 +1,384 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <el-tabs
+        v-model="activeTab"
+        @tab-click="handleTabClick"
+        style="margin-bottom: 10px"
+        v-if="$store.state.user.info.clientEnvironmentId == 10"
+      >
+        <el-tab-pane label="全部" name=""></el-tab-pane>
+        <el-tab-pane label="5号站" name="2008369768909287426"></el-tab-pane>
+        <el-tab-pane label="6号站" name="2008369839033856001"></el-tab-pane>
+        <el-tab-pane label="7号站" name="2008369897779277826"></el-tab-pane>
+      </el-tabs>
+      <work-search @search="reload"> </work-search>
+      <!-- 数据表格 -->
+      <!-- :default-sort="{ prop: 'createTime', order: 'descending' }" -->
+      <ele-pro-table
+        ref="table"
+        :pageSizes="tablePageSizes"
+        :columns="columns"
+        :datasource="datasource"
+        cache-key="patrolOrderTable"
+      >
+        <template v-slot:code="{ row }">
+          <el-link type="primary" @click="goDetail(row)">
+            {{ row.code }}
+          </el-link>
+        </template>
+        <!-- 操作列 -->
+        <template v-slot:action="{ row }">
+          <jimureportBrowse
+            :businessId="row.id"
+            businessCode="eampatrolinspectionprint"
+            v-if="row.orderStatus == 3"
+            style="width: 80px; display: inline-block"
+          ></jimureportBrowse>
+          <el-link
+            v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
+            type="primary"
+            :underline="false"
+            icon="el-icon-truck"
+            @click="addSpareItems(row)"
+          >
+            申请备品备件
+          </el-link>
+          <el-link
+            v-if="
+              row.orderStatus !== 3 &&
+              row.orderStatus !== 4 &&
+              row.orderStatus !== 0
+            "
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="toSigningUpWork(row)"
+          >
+            报工
+          </el-link>
+          <el-link
+            v-if="row.orderStatus == 3"
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="hazardManagementOpen(row)"
+          >
+            查看隐患
+          </el-link>
+          <el-link
+            v-if="row.orderStatus == 0"
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="startExecuting(row)"
+          >
+            接收
+          </el-link>
+          <el-link
+            v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="toRedeploy(row)"
+          >
+            转派
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+    <!-- 转派弹窗 -->
+    <redeployOther ref="redeployOtherRef" @refresh="reload" />
+    <!-- 报工弹框 -->
+    <signingUpWork ref="signingUpWorkRef" @refresh="reload" />
+    <edit @refresh="reload" ref="edit" />
+    <hazardManagement
+      ref="hazardManagementRef"
+      :sourceType="1"
+    ></hazardManagement>
+  </div>
+</template>
+
+<script>
+  import edit from '@/views/sparePartsApply/components/edit';
+  import WorkSearch from './components/work-search.vue';
+  import redeployOther from '@/views/maintenance/components/redeployOther.vue';
+  import signingUpWork from '@/views/maintenance/components/signingUpWork.vue';
+  import {
+    getWorkOrderPage,
+    getWordOrderDetail
+  } from '@/api/maintenance/patrol_maintenance';
+  import jimureportBrowse from '@/components/jimureport/browseModal.vue';
+  import { startExecuting } from '@/api/maintenance/repair';
+  import dictMixins from '@/mixins/dictMixins';
+  import hazardManagement from '@/views/maintenance/hazardManagement/index.vue';
+  import { getToken } from '@/utils/token-util';
+  export default {
+    components: {
+      WorkSearch,
+      redeployOther,
+      signingUpWork,
+      jimureportBrowse,
+      edit,
+      hazardManagement
+    },
+    mixins: [dictMixins],
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            columnKey: 'code',
+            slot: 'code',
+            prop: 'code',
+            label: '工单单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'planCode',
+            label: '计划单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'planName',
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'executeGroupName',
+            label: '部门',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: (row) => {
+              if (row.executeGroupName) {
+                return row.executeGroupName;
+              }
+              if (row.executeUserType == 0) {
+                return row.executeUsers.map((i) => i.groupName).join(',');
+              }
+              return '';
+            }
+          },
+          {
+            prop: 'executeUserName',
+            label: '人员',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              if (row.executeUserName) {
+                return row.executeUserName;
+              }
+              if (row.executeUserType == 0) {
+                return row.executeUsers.map((i) => i.userName).join(',');
+              }
+              return '';
+            }
+          },
+          {
+            prop: 'executeUsers',
+            label: '班组',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (row) => {
+              if (row.executeUserType == 1) {
+                return row.executeUsers.map((i) => i.teamName).join(',');
+              }
+              return '';
+            }
+          },
+          {
+            prop: 'ruleName',
+            label: '规则名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'createTime',
+            label: '工单生成时间',
+            align: 'center',
+            // sortable: true,
+            showOverflowTooltip: true,
+            width: 170
+          },
+          {
+            prop: 'acceptTime',
+            label: '开工时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'finishTime',
+            label: '报工时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            columnKey: 'orderHour',
+            label: '实际工时(分钟)',
+            align: 'center',
+            resizable: false,
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: (row) => {
+              if (row.finishTime && row.acceptTime) {
+                return parseInt(
+                  (new Date(row.finishTime).getTime() -
+                    new Date(row.acceptTime).getTime()) /
+                    60000
+                );
+              }
+            }
+          },
+          {
+            prop: 'orderStatus',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return {
+                0: '待接收',
+                1: '已接收',
+                2: '执行中',
+                3: '已完成'
+              }[row.orderStatus];
+            }
+          },
+          {
+            prop: 'acceptanceStatus',
+            label: '执行结果',
+            align: 'center',
+            showOverflowTooltip: true,
+            // formatter(row) {
+            //   return { 0: '缺陷', 1: '正常' }[row.isAbnormal];
+            // }
+            formatter(row) {
+              return { 0: '异常', 1: '正常', 2: '异常', 3: '待检' }[
+                row.isAbnormal
+              ];
+            }
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 240,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        // 加载状态
+        loading: false,
+        activeTab: '',
+        pageType: 'add',
+        dialogTitle: '',
+        isBindPlan: false
+      };
+    },
+    created() {
+      this.requestDict('巡点检工单状态');
+    },
+    computed: {},
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        const params = {
+          pageNum: page,
+          size: limit,
+          ...where,
+          type: 7
+        };
+        if (this.activeTab && this.activeTab != 0) {
+          params.postId = this.activeTab;
+        }
+        return getWorkOrderPage(params);
+      },
+      async changeEnable(row) {
+        const res = await putRoles(row);
+        if (res.code == 0) {
+          this.$message({
+            type: 'success',
+            message: '修改成功',
+            customClass: 'ele-message-border'
+          });
+          this.reload();
+        }
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({
+          page: 1,
+          where: {
+            ...where,
+            postId: this.activeTab == 0 ? '' : this.activeTab
+          }
+        });
+      },
+      handleTabClick() {
+        this.$refs.table.reload({
+          page: 1,
+          where: { postId: this.activeTab == 0 ? '' : this.activeTab }
+        });
+      },
+      startExecuting(row) {
+        startExecuting({ id: row.id }).then((res) => {
+          this.reload();
+        });
+      },
+      hazardManagementOpen(row) {
+        this.$refs.hazardManagementRef.open(row);
+      },
+      // 添加备品备件
+      async addSpareItems(row) {
+        let data = await getWordOrderDetail(row.id);
+        data.deviceList = data.deviceList.map((item) => {
+          return item.substance;
+        });
+
+        this.$refs.edit.open(data, 'add');
+      },
+      goDetail({ id, executeUserType }) {
+        this.$router.push({
+          path: '/maintenance/service/workOrder/details',
+          query: {
+            id,
+            executeUserType
+          }
+        });
+      },
+      // 转派
+      toRedeploy(row) {
+        this.$refs.redeployOtherRef.open(row);
+      },
+      // 报工
+      toSigningUpWork(row) {
+        this.$refs.signingUpWorkRef.open(row);
+      },
+      handleExport(row) {
+        const url = `http://192.168.120.128:8085/jmreport/view/1060046036862939136?token=${getToken()}&id=${
+          row.id
+        }`;
+        window.open(url, '_blank');
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped></style>

+ 46 - 97
src/views/warning/warningMessage/components/message-search.vue

@@ -1,113 +1,62 @@
-<!-- 搜索表单 -->
 <template>
-  <el-form
-    label-width="100px"
-    class="ele-form-search"
-    @keyup.enter.native="search"
-    @submit.native.prevent
-  >
-    <el-row :gutter="15">
-      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
-        <el-form-item label="告警级别:" prop="level">
-          <el-select filterable v-model="where.level" size="small">
-            <el-option label="轻微" :value="1"></el-option>
-            <el-option label="中等" :value="2"></el-option>
-            <el-option label="严重" :value="3"></el-option>
-            <el-option label="紧急" :value="4"></el-option>
-            <el-option label="致命" :value="5"></el-option>
-          </el-select>
-        </el-form-item>
-      </el-col>
-
-      <!-- <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
-        <el-form-item label="告警时间:" label-width="80px">
-          <el-date-picker
-            v-model="time"
-            style="width: 100%"
-            type="daterange"
-            range-separator="至"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            :default-time="['00:00:00', '23:59:59']"
-          >
-          </el-date-picker>
-        </el-form-item>
-      </el-col> -->
-      <!-- <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
-        <el-form-item label="组织机构:">
-          <auth-selection v-model="where.deptIds" style="width: 100%"></auth-selection>
-        </el-form-item>
-      </el-col> -->
-      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 5 }">
-        <div class="ele-form-actions">
-          <el-button
-            type="primary"
-            icon="el-icon-search"
-            class="ele-btn-icon"
-            @click="search"
-            size="small"
-          >
-            查询
-          </el-button>
-          <el-button
-            @click="reset"
-            icon="el-icon-refresh-left"
-            size="small"
-            type="primary"
-            >重置
-          </el-button>
-        </div>
-      </el-col>
-    </el-row>
-  </el-form>
+  <seek-page
+    :seekList="seekList"
+    :formLength="4"
+    @search="search"
+    @reset="reset"
+  />
 </template>
 
 <script>
-  import equipmentSelect from '@/components/CommomSelect/equipment-select.vue';
-
   export default {
-    components: { equipmentSelect },
     data() {
-      // 默认表单数据
-      const defaultWhere = {
-        level: ''
-      };
       return {
-        // 表单数据
-        where: { ...defaultWhere },
-        time: []
+        seekList: [
+          {
+            label: '告警级别',
+            value: 'level',
+            type: 'select',
+            placeholder: '请选择',
+            selectList: [
+              { label: '轻微', value: 1 },
+              { label: '中等', value: 2 },
+              { label: '严重', value: 3 },
+              { label: '紧急', value: 4 },
+              { label: '致命', value: 5 }
+            ]
+          },
+          // {
+          //   label: '告警名称',
+          //   value: 'keyWord',
+          //   type: 'input',
+          //   placeholder: '请输入'
+          // },
+          {
+            label: '设备名称',
+            value: 'deviceName',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '状态',
+            value: 'handleStatus',
+            type: 'select',
+            placeholder: '请选择',
+            selectList: [
+              { label: '未处理', value: '0' },
+              { label: '已处理', value: '2' }
+            ]
+          }
+        ]
       };
     },
-    computed: {
-      // 是否开启响应式布局
-      styleResponsive() {
-        return this.$store.state.theme.styleResponsive;
-      }
-    },
-    created() {},
     methods: {
-      /* 搜索 */
-      search() {
-        if (this.time.length) {
-          this.where.startTime = this.time[0];
-          this.where.endTime = this.time[1];
-        }
-        this.$emit('search', this.where);
+      search(where) {
+        this.$emit('search', where);
       },
-      /*  重置 */
       reset() {
-        this.time = [];
-        this.where = { ...this.defaultWhere };
-        this.search();
+        this.$emit('search', {});
       }
     }
   };
 </script>
-<style lang="scss" scoped>
-  .ele-form-actions {
-    display: flex;
-    align-items: center;
-    justify-content: flex-end;
-  }
-</style>

+ 15 - 9
src/views/warning/warningMessage/index.vue

@@ -65,12 +65,7 @@
       append-to-body
     >
       <el-table :data="triggerList" border style="width: 100%">
-        <el-table-column
-          type="index"
-          label="序号"
-          width="55"
-          align="center"
-        />
+        <el-table-column type="index" label="序号" width="55" align="center" />
         <el-table-column
           prop="description"
           label="告警描述"
@@ -94,10 +89,17 @@
           <template slot-scope="{ row }">
             <div v-if="row._deviceData && row._deviceData.length">
               <div
-                v-for="(item, index) in row._deviceData"
+                v-for="(item, index) in row._deviceData.filter((val) =>
+                  evalFn(val.value + val.operator + val.thresholdValue)
+                )"
                 :key="index"
               >
-                告警值:{{ item.attributeName }} {{ item.value }}
+                点位:{{ item.attributeName }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                告警值:{{ item.thresholdValue }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                当前值: {{ item.value }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                差值:{{
+                  parseFloat((item.value - item.thresholdValue).toFixed(3))
+                }}
               </div>
             </div>
             <span v-else>-</span>
@@ -111,7 +113,7 @@
 <script>
   import MessageSearch from './components/message-search.vue';
   import processDialog from './components/processDialog.vue';
-  import { alarmlogsheetPage,getDetail } from '@/api/warning/index.js';
+  import { alarmlogsheetPage, getDetail } from '@/api/warning/index.js';
 
   import dictMixins from '@/mixins/dictMixins';
   export default {
@@ -289,6 +291,10 @@
       openEdit(row, type) {
         this.$refs.processDialogRef.open(row, type);
       },
+      evalFn(val) {
+        console.log(val,'val')
+        return eval(val);
+      },
       triggerCount(row) {
         getDetail(row.id).then((res) => {
           let list = Array.isArray(res) ? res : [];

+ 46 - 87
src/views/warning/warningSetting/components/setting-search.vue

@@ -1,103 +1,62 @@
-<!-- 搜索表单 -->
 <template>
-  <el-form
-    label-width="100px"
-    class="ele-form-search"
-    @keyup.enter.native="search"
-    @submit.native.prevent
-  >
-    <el-row :gutter="15">
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="告警级别:" prop="level">
-          <el-select filterable v-model="where.level" size="small">
-            <el-option label="轻微" :value="1"></el-option>
-            <el-option label="中等" :value="2"></el-option>
-            <el-option label="严重" :value="3"></el-option>
-            <el-option label="紧急" :value="4"></el-option>
-            <el-option label="致命" :value="5"></el-option>
-          </el-select>
-        </el-form-item>
-      </el-col>
-      <!-- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="告警名称:" prop="name">
-          <el-input filterable v-model="where.name" size="small"> </el-input>
-        </el-form-item>
-      </el-col> -->
-      <!-- <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="组织机构:">
-          <auth-selection
-            v-model="where.deptIds"
-            style="width: 100%"
-          ></auth-selection>
-        </el-form-item>
-      </el-col> -->
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <div class="ele-form-actions">
-          <el-button
-            type="primary"
-            icon="el-icon-search"
-            class="ele-btn-icon"
-            @click="search"
-            size="small"
-          >
-            查询
-          </el-button>
-          <el-button
-            @click="reset"
-            icon="el-icon-refresh-left"
-            size="small"
-            type="primary"
-            >重置</el-button
-          >
-        </div>
-      </el-col>
-    </el-row>
-  </el-form>
+  <seek-page
+    :seekList="seekList"
+    :formLength="4"
+    @search="search"
+    @reset="reset"
+  />
 </template>
 
 <script>
-  import equipmentSelect from '@/components/CommomSelect/equipment-select.vue';
   export default {
-    components: { equipmentSelect },
     data() {
-      // 默认表单数据
-      const defaultWhere = {
-        name: '',
-        ruleName: '',
-        code: '',
-        groupId: '',
-        status: '',
-        categoryLevelId: ''
-      };
       return {
-        // 表单数据
-        where: { ...defaultWhere }
+        seekList: [
+          {
+            label: '告警级别',
+            value: 'level',
+            type: 'select',
+            placeholder: '请选择',
+            selectList: [
+              { label: '轻微', value: 1 },
+              { label: '中等', value: 2 },
+              { label: '严重', value: 3 },
+              { label: '紧急', value: 4 },
+              { label: '致命', value: 5 }
+            ]
+          },
+          {
+            label: '告警名称',
+            value: 'keyWord',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '设备名称',
+            value: 'deviceName',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '状态',
+            value: 'status',
+            type: 'select',
+            placeholder: '请选择',
+            selectList: [
+              { label: '启用', value: 1 },
+              { label: '停用', value: '0' }
+            ]
+          }
+        ]
       };
     },
-    computed: {
-      // 是否开启响应式布局
-      styleResponsive() {
-        return this.$store.state.theme.styleResponsive;
-      }
-    },
-    created() {},
     methods: {
-      /* 搜索 */
-      search() {
-        this.$emit('search', this.where);
+      search(where) {
+        this.$emit('search', where);
       },
-      /*  重置 */
       reset() {
-        this.where = { ...this.defaultWhere };
-        this.search();
+        this.$emit('search', {});
       }
     }
   };
 </script>
-<style lang="scss" scoped>
-  .ele-form-actions {
-    display: flex;
-    align-items: center;
-    justify-content: flex-end;
-  }
-</style>

+ 8 - 0
src/views/warning/warningSetting/index.vue

@@ -141,6 +141,14 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
+          {
+            prop: 'deviceName',
+            label: '设备名称',
+            slot: 'deviceName',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
           {
             prop: 'level',
             label: '告警级别',

+ 2 - 2
vue.config.js

@@ -40,8 +40,8 @@ module.exports = {
         // target: 'http://192.168.1.139:18086', // 粟
         // target: 'http://192.168.1.132:18086', // 徐
         // target: 'http://192.168.1.125:18086', //本
-        // target: 'http://192.168.1.116:18086', // 赵沙金
-        target: 'http://192.168.1.251:18086', // 测试环境
+        // target: 'http://192.168.1.251:18086', // 赵沙金
+        target: 'http://114.116.248.196:86/api/', // 测试环境
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''