From fb1e6ab905adea16f680d4eb5ead8d0d517777d9 Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期五, 13 十二月 2024 15:09:26 +0800
Subject: [PATCH] 新增OEE页面

---
 src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue                       |  294 ++++++++++++++++++++++++++++++++++++
 src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseList.vue           |   17 -
 src/views/mdc/base/OEEAnalysis.vue                                               |   82 ++++++++++
 src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseList.vue |   17 -
 src/views/mdc/base/modules/PartsMatchingManagement/PartsMatchingList.vue         |   11 
 5 files changed, 395 insertions(+), 26 deletions(-)

diff --git a/src/views/mdc/base/OEEAnalysis.vue b/src/views/mdc/base/OEEAnalysis.vue
new file mode 100644
index 0000000..28654a1
--- /dev/null
+++ b/src/views/mdc/base/OEEAnalysis.vue
@@ -0,0 +1,82 @@
+<template>
+  <div style="width: 100%; height: 100%;">
+    <a-card :bordered="false">
+      <a-row type="flex" :gutter="16">
+        <a-col :md="5">
+          <a-tabs :activeKey="activeKey" @change="tabChange">
+            <a-tab-pane key="1" tab="杞﹂棿灞傜骇" force-render>
+              <base-tree @getCurrSelected="changeSelectionNode"></base-tree>
+            </a-tab-pane>
+            <a-tab-pane v-if="isDepartType == 0" key="2" tab="閮ㄩ棬灞傜骇">,
+              <depart-tree @getCurrSelectedDD="changeSelectionNodedd"></depart-tree>
+            </a-tab-pane>
+          </a-tabs>
+        </a-col>
+        <a-col :md="19">
+          <OEEAnalysisList :nodePeople='selectPeople' :nodeTree='selectEquipment' :Type="selectTypeTree"/>
+        </a-col>
+      </a-row>
+    </a-card>
+  </div>
+
+</template>
+
+<script>
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import BaseTree from '../common/BaseTree'
+  import OEEAnalysisList from './modules/OEEAnalysis/OEEAnalysisList'
+  import DepartTree from './modules/DepartList/DepartListTree/DepartTree'
+  import { mapActions } from 'vuex'
+
+  export default {
+    name: 'OEEAnalysis',
+    components: {
+      BaseTree,
+      DepartTree,
+      OEEAnalysisList
+    },
+    data() {
+      return {
+        activeKey: '1',
+        selectEquipmentId: '',
+        selectEquipment: {},
+        selectPeople: {},
+        selectTypeTree: '',
+        isDepartType: ''
+      }
+    },
+    created() {
+      this.queryTreeData()
+    },
+    methods: {
+      ...mapActions(['QueryDepartTree']),
+      queryTreeData() {
+        this.QueryDepartTree().then(res => {
+          if (res.success) {
+            this.isDepartType = res.result[0].value
+          } else {
+            // this.$message.warn(res.message)
+            this.$notification.warning({
+              message: '娑堟伅',
+              description: res.message
+            })
+          }
+        }).finally(() => {
+        })
+      },
+      tabChange(val) {
+        this.activeKey = val
+        this.selectTypeTree = val
+      },
+      changeSelectionNode(val) {
+        this.selectEquipment = val
+        this.selectTypeTree = '1'
+      },
+      changeSelectionNodedd(val) {
+        this.selectPeople = val
+        this.selectTypeTree = '2'
+      }
+    }
+
+  }
+</script>
\ No newline at end of file
diff --git a/src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseList.vue b/src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseList.vue
index 9fdef5c..c2b1236 100644
--- a/src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseList.vue
+++ b/src/views/mdc/base/modules/MdcPlanCloseManagement/MdcPlanCloseList.vue
@@ -6,7 +6,7 @@
         <a-row :gutter="24">
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="璁惧缂栧彿">
-              <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId" allowClear/>
+              <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId"/>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -21,10 +21,10 @@
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+            <a-space>
               <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
-            </span>
+              <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>
+            </a-space>
           </a-col>
         </a-row>
       </a-form>
@@ -34,7 +34,7 @@
     <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button>
-      <a-button type="primary" icon="download" @click="importTemplate('璁″垝鍋滄満妯℃澘')">瀵煎叆妯℃澘</a-button>
+      <a-button type="primary" icon="download" @click="importTemplate('璁″垝鍋滄満绠$悊')">瀵煎叆妯℃澘</a-button>
       <a-button type="primary" icon="download" @click="handleExportXls('璁″垝鍋滄満绠$悊')">瀵煎嚭</a-button>
       <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
                 @change="handleImportExcel">
@@ -58,7 +58,6 @@
     <!-- table鍖哄煙-begin -->
     <div id="DeviceList" style="flex: 1;overflow: hidden">
       <a-table
-        id="planClose"
         ref="table"
         size="middle"
         :scroll="{x:'max-content',y:scrollY}"
@@ -188,8 +187,6 @@
           exportXlsUrl: '/mdc/mdcPlanClose/exportXls',
           importExcelUrl: 'mdc/mdcPlanClose/importExcel'
         },
-        dictOptions: {},
-        superFieldList: []
       }
     },
     watch: {
@@ -236,8 +233,8 @@
       },
       importTemplate(fileName) {
         var a = document.createElement('a')
-        a.href = '/static/璁″垝鍋滄満绠$悊.xls'
-        a.download = '璁″垝鍋滄満绠$悊.xls'
+        a.href = `/static/${fileName}.xls`
+        a.download = `${fileName}.xls`
         a.style.display = 'none'
         document.body.appendChild(a)
         a.click()
diff --git a/src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseList.vue b/src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseList.vue
index 0626f74..8c0c42e 100644
--- a/src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseList.vue
+++ b/src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseList.vue
@@ -6,7 +6,7 @@
         <a-row :gutter="24">
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="璁惧缂栧彿">
-              <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId" allowClear/>
+              <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId"/>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -21,10 +21,10 @@
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+            <a-space>
               <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
-            </span>
+              <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>
+            </a-space>
           </a-col>
         </a-row>
       </a-form>
@@ -34,7 +34,7 @@
     <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button>
-      <a-button type="primary" icon="download" @click="importTemplate('闈炶鍒掑仠鏈烘ā鏉�')">瀵煎叆妯℃澘</a-button>
+      <a-button type="primary" icon="download" @click="importTemplate('闈炶鍒掑仠鏈虹鐞�')">瀵煎叆妯℃澘</a-button>
       <a-button type="primary" icon="download" @click="handleExportXls('闈炶鍒掑仠鏈虹鐞�')">瀵煎嚭</a-button>
       <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
                 @change="handleImportExcel">
@@ -58,7 +58,6 @@
     <!-- table鍖哄煙-begin -->
     <div id="DeviceList" style="flex: 1;overflow: hidden">
       <a-table
-        id="planClose"
         ref="table"
         size="middle"
         :scroll="{x:'max-content',y:scrollY}"
@@ -188,8 +187,6 @@
           exportXlsUrl: '/mdc/mdcPlanClose/exportXls',
           importExcelUrl: 'mdc/mdcPlanClose/importExcel'
         },
-        dictOptions: {},
-        superFieldList: []
       }
     },
     watch: {
@@ -236,8 +233,8 @@
       },
       importTemplate(fileName) {
         var a = document.createElement('a')
-        a.href = '/static/闈炶鍒掑仠鏈虹鐞�.xls'
-        a.download = '闈炶鍒掑仠鏈虹鐞�.xls'
+        a.href = `/static/${fileName}.xls`
+        a.download = `${fileName}.xls`
         a.style.display = 'none'
         document.body.appendChild(a)
         a.click()
diff --git a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
new file mode 100644
index 0000000..5f19c98
--- /dev/null
+++ b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
@@ -0,0 +1,294 @@
+<template>
+  <div class="device_list">
+    <!-- 鏌ヨ鍖哄煙 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="璁惧缂栧彿">
+              <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId"/>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="鏃ユ湡">
+              <a-range-picker v-model="dates" style="width: 100%" @change="dateParamChange"></a-range-picker>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-space>
+              <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>
+            </a-space>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 鏌ヨ鍖哄煙-END -->
+
+    <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
+    <div class="table-operator">
+      <a-button type="primary" icon="download" @click="handleExportXls('OEE')">瀵煎嚭</a-button>
+    </div>
+
+    <!-- table鍖哄煙-begin -->
+    <div id="DeviceList" style="flex: 1;overflow: hidden">
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:'max-content',y:scrollY}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading">
+        <template slot="percent" slot-scope="text">
+          {{text+'%'}}
+        </template>
+      </a-table>
+    </div>
+  </div>
+</template>
+
+<script>
+  import moment from 'moment'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+
+  export default {
+    name: 'OEEAnalysisList',
+    mixins: [JeecgListMixin],
+    components: {},
+    props: { nodeTree: '', Type: '', nodePeople: '' },
+    data() {
+      return {
+        description: 'OEE椤甸潰',
+        disableMixinCreated: true,
+        /* 鍒嗛〉鍙傛暟 */
+        ipagination: {
+          current: 1,
+          pageSize: 30,
+          pageSizeOptions: ['30', '50', '100'],
+          showTotal: (total, range) => {
+            return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�'
+          },
+          showQuickJumper: true,
+          showSizeChanger: true,
+          total: 0
+        },
+        dates: [moment().subtract(1, 'day'), moment()],
+        queryParam: {},
+        // 琛ㄥご
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key: 'rowIndex',
+            width: 60,
+            align: 'center',
+            customRender: function(t, r, index) {
+              return parseInt(index) + 1
+            }
+          },
+          {
+            title: '璁惧缂栧彿',
+            align: 'center',
+            dataIndex: 'equipmentId',
+            width: 230
+          },
+          {
+            title: '鏃ユ湡',
+            align: 'center',
+            dataIndex: 'theDate',
+            width: 150
+          },
+          {
+            title: '鏃ュ巻宸ヤ綔鏃堕棿(min)',
+            align: 'center',
+            dataIndex: 'calendarLong',
+            width: 150
+          },
+          {
+            title: '璁″垝鍋滄満鏃堕棿(min)',
+            align: 'center',
+            dataIndex: 'planCloseLong',
+            width: 150
+          },
+          {
+            title: '璐熻嵎鏃堕棿(min)',
+            align: 'center',
+            dataIndex: 'loadLong',
+            width: 150
+          },
+          {
+            title: '闈炶鍒掑仠鏈烘椂闂�(min)',
+            align: 'center',
+            dataIndex: 'noplanCloseLong',
+            width: 150
+          },
+          {
+            title: '寮�鍔ㄦ椂闂�(min)',
+            align: 'center',
+            dataIndex: 'actuateLong',
+            width: 150
+          },
+          {
+            title: '鏃堕棿寮�鍔ㄧ巼',
+            align: 'center',
+            dataIndex: 'timeActuationRate',
+            width: 150,
+            scopedSlots: { customRender: 'percent' }
+          },
+          {
+            title: '鏈夋晥杩愯鏃堕棿(min)',
+            align: 'center',
+            dataIndex: 'effectiveRunLong',
+            width: 150
+          },
+          {
+            title: '鎬ц兘寮�鍔ㄧ巼',
+            align: 'center',
+            dataIndex: 'performanceRate',
+            width: 150,
+            scopedSlots: { customRender: 'percent' }
+          },
+          {
+            title: '鍔犲伐闆朵欢鏁伴噺',
+            align: 'center',
+            dataIndex: 'processCount',
+            width: 150
+          },
+          {
+            title: '鍚堟牸闆朵欢鏁伴噺',
+            align: 'center',
+            dataIndex: 'passCount',
+            width: 150
+          },
+          {
+            title: '涓�娆″悎鏍肩巼',
+            align: 'center',
+            dataIndex: 'passRate',
+            width: 150,
+            scopedSlots: { customRender: 'percent' }
+          },
+          {
+            title: 'OEE',
+            align: 'center',
+            dataIndex: 'oee',
+            width: 150,
+            scopedSlots: { customRender: 'percent' }
+          }
+        ],
+        scrollY: 465,
+        url: {
+          list: '/mdc/mdcOeeInfo/list',
+          exportXlsUrl: '/mdc/mdcOeeInfo/exportXls'
+        }
+      }
+    },
+    watch: {
+      Type(valmath) {
+        this.dataList = []
+        this.queryParam.typeTree = valmath
+        // console.log(this.queryParam.typeTree)
+      },
+      nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢
+        if (JSON.stringify(val) != '{}') {
+          if (val.equipmentId) {
+            this.queryParam.parentId = ''
+            this.queryParam.equipmentId = val.equipmentId
+          } else {
+            this.queryParam.parentId = val.key
+            this.queryParam.equipmentId = ''
+          }
+          this.searchQuery()
+        }
+      },
+      nodePeople(val) {
+        if (JSON.stringify(val) != '{}') {
+          if (val.equipmentId) {
+            this.queryParam.parentId = ''
+            this.queryParam.equipmentId = val.equipmentId
+          } else {
+            this.queryParam.parentId = val.key
+            this.queryParam.equipmentId = ''
+          }
+          this.searchQuery()
+        }
+      }
+    },
+    methods: {
+      dateParamChange(v1, v2) {
+        this.queryParam.startTime = v2[0]
+        this.queryParam.endTime = v2[1]
+        this.dates = [v1[0], v1[1]]
+      },
+      searchReset() {
+        this.dates = [moment().subtract(1, 'day'), moment()]
+        this.queryParam = {
+          startTime: this.dates[0].format('YYYY-MM-DD'),
+          endTime: this.dates[1].format('YYYY-MM-DD')
+        }
+        this.loadData(1)
+      },
+      /**
+       * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙�
+       */
+      handleWindowResize() {
+        const boxHeight = +window.getComputedStyle(document.getElementById('DeviceList')).height.slice(0, -2)
+        const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2)
+        this.scrollY = boxHeight - tableHeadHeight - 50
+      }
+    },
+    created() {
+      this.queryParam.startTime = this.dates[0].format('YYYY-MM-DD')
+      this.queryParam.endTime = this.dates[1].format('YYYY-MM-DD')
+      this.loadData()
+    },
+    mounted() {
+      window.addEventListener('resize', this.handleWindowResize)
+      this.handleWindowResize()
+    },
+    beforeDestroy() {
+      window.removeEventListener('resize', this.handleWindowResize)
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+
+  .device_list {
+    display: flex;
+    flex-direction: column;
+    overflow: hidden;
+  }
+
+  @media screen and (min-width: 1920px) {
+    .device_list {
+      height: 811px !important;
+    }
+  }
+
+  @media screen and (min-width: 1680px) and (max-width: 1920px) {
+    .device_list {
+      height: 811px !important;
+    }
+  }
+
+  @media screen and (min-width: 1400px) and (max-width: 1680px) {
+    .device_list {
+      height: 663px !important;
+    }
+  }
+
+  @media screen and (min-width: 1280px) and (max-width: 1400px) {
+    .device_list {
+      height: 564px !important;
+    }
+  }
+
+  @media screen and (max-width: 1280px) {
+    .device_list {
+      height: 564px !important;
+    }
+  }
+</style>
\ No newline at end of file
diff --git a/src/views/mdc/base/modules/PartsMatchingManagement/PartsMatchingList.vue b/src/views/mdc/base/modules/PartsMatchingManagement/PartsMatchingList.vue
index 0c0e4fc..39c9988 100644
--- a/src/views/mdc/base/modules/PartsMatchingManagement/PartsMatchingList.vue
+++ b/src/views/mdc/base/modules/PartsMatchingManagement/PartsMatchingList.vue
@@ -6,7 +6,7 @@
         <a-row :gutter="24">
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="璁惧缂栧彿">
-              <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId" allowClear/>
+              <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId"/>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -20,10 +20,10 @@
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+            <a-space>
               <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
-            </span>
+              <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>
+            </a-space>
           </a-col>
         </a-row>
       </a-form>
@@ -56,7 +56,6 @@
     <!-- table鍖哄煙-begin -->
     <div id="DeviceList" style="flex: 1;overflow: hidden">
       <a-table
-        id="planClose"
         ref="table"
         size="middle"
         :scroll="{x:'max-content',y:scrollY}"
@@ -196,7 +195,7 @@
           deleteBatch: '/mdc/mdcPartProcessInfo/deleteBatch',
           exportXlsUrl: '/mdc/mdcPartProcessInfo/exportXls',
           importExcelUrl: '/mdc/mdcPartProcessInfo/importExcel'
-        },
+        }
       }
     },
     watch: {

--
Gitblit v1.9.3