Przeglądaj źródła

Merge branch 'test' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-mes into dengfei

695593266@qq.com 7 miesięcy temu
rodzic
commit
4197d60b8d

+ 111 - 0
src/views/produce/components/prenatalExamination/PlanRulesDialog.vue

@@ -0,0 +1,111 @@
+<template>
+  <ele-modal
+    :title="title"
+    :visible.sync="visible"
+    :close-on-click-modal="false"
+    @close="handleClose"
+    resizable
+    maxable
+    width="80%"
+    append-to-body
+  >
+    <div v-if="rulesInfo">
+      {{ JSON.stringify(planDevices) }}
+    </div>
+
+    <template v-slot:footer>
+      <div class="footer-box">
+        <div class="txt-tip">
+          共
+          <span class="active">
+            {{ rulesInfo ? rulesInfo.planDevices.length : 0 }}
+          </span>
+          条记录,当前位于第
+          <span class="active">{{ activeIndex + 1 }}</span
+          >条
+        </div>
+
+        <el-button
+          type="primary"
+          icon="el-icon-arrow-left"
+          size="mini"
+          :disabled="activeIndex === 0"
+          @click="activeIndex--"
+        >
+          上一页
+        </el-button>
+
+        <el-button
+          type="primary"
+          size="mini"
+          :disabled="activeIndex === rulesInfo.planDevices.length - 1"
+          @click="activeIndex++"
+        >
+          下一页
+          <i class="el-icon-arrow-right el-icon--right"></i>
+        </el-button>
+
+        <el-button @click="handleClose" size="mini">关 闭</el-button>
+      </div>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    mixins: [dictMixins],
+    data() {
+      return {
+        visible: false,
+        title: '巡点检',
+        // 规则信息
+        rulesInfo: null,
+        // 当前项
+        activeIndex: 0
+      };
+    },
+    computed: {
+      // 当前设备信息
+      planDevices() {
+        if (this.rulesInfo && this.rulesInfo.planDevices) {
+          return this.rulesInfo.planDevices[this.activeIndex];
+        }
+        return null;
+      }
+    },
+    methods: {
+      // 外部调用,打开弹窗
+      open(data, title = '') {
+        if (title) {
+          this.title = title;
+        }
+        this.rulesInfo = data;
+        console.log('this.rulesInfo', this.rulesInfo);
+        this.visible = true;
+      },
+      // 关闭时清理表单
+      handleClose() {
+        this.$nextTick(() => {
+          this.visible = false;
+        });
+      }
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  .txt-tip {
+    .active {
+      color: #409eff;
+      font-weight: bold;
+    }
+  }
+
+  .footer-box {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+    gap: 15px;
+  }
+</style>

+ 14 - 17
src/views/produce/components/prenatalExamination/index.vue

@@ -21,7 +21,9 @@
           @click="openMaintenancePlan(item)"
         >
           <div class="circle">{{ index + 1 }}</div>
-          <div class="desc">{{ item.ruleName || item.itemTaskName }}</div>
+          <div class="desc">{{
+            item.ruleName || item.itemTaskName || item.planConfigName
+          }}</div>
           <div class="methods">{{ item.recordRulesExecuteMethodName }}</div>
 
           <el-button
@@ -42,33 +44,32 @@
       <el-button @click="handleClose">取消</el-button>
     </template>
 
-    <programRulesDialog
-      ref="programRulesDialogRef"
-      :dialogTitle="dialogTitle"
-      @reload="getData"
-    />
-
     <releaseRulesDialog ref="releaseRulesDialogRef" @reload="getData" />
 
     <taskDialog ref="taskDialogRef" @reload="getData" />
+
+    <PlanRulesDialog ref="planRulesDialogRef"></PlanRulesDialog>
   </el-dialog>
 </template>
 
 <script>
   import releaseRulesDialog from './releaseRulesDialog.vue';
-  import programRulesDialog from './programRulesDialog.vue';
   import {
     getLastRuleRecords,
     getProduceTaskInstanceId
   } from '@/api/producetaskrulerecord/index.js';
   import taskDialog from './taskDialog.vue';
+  import PlanRulesDialog from './PlanRulesDialog.vue';
 
   export default {
-    components: { programRulesDialog, releaseRulesDialog, taskDialog },
+    components: {
+      releaseRulesDialog,
+      taskDialog,
+      PlanRulesDialog
+    },
     data() {
       return {
         dialogVisible: false,
-        dialogTitle: '设备保养计划',
         ruleRecordsList: [],
         // 工艺路线
         workOrderInfo: null,
@@ -153,13 +154,9 @@
         console.log('item', item);
 
         if (item.executeMethod == 1) {
-          // 设备保养计划相关逻辑
-          this.dialogTitle = '新增设备保养计划';
-          this.$refs.programRulesDialogRef.init(
-            item,
-            this.workOrderInfo,
-            this.produceTaskInfo
-          );
+          // 计划规则 巡点检
+          this.$refs.planRulesDialogRef.open(item);
+
         } else if (item.executeMethod == 2) {
           this.$refs.releaseRulesDialogRef.open(
             item,