From 2145108a5bf0c721fea728e0a4936cb7007a92a2 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期六, 06 一月 2024 15:31:41 +0800
Subject: [PATCH] mdc更新

---
 src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue |   90 ++++++++++++++++++++++++---------------------
 1 files changed, 48 insertions(+), 42 deletions(-)

diff --git a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
index a68adbb..4a0be14 100644
--- a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
+++ b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
@@ -7,6 +7,16 @@
           <a-form layout="inline" @keyup.enter.native="searchQuery">
             <a-row :gutter="24">
               <a-col :md="5" :sm="5" :xs="5">
+                <a-form-item label="椹卞姩绫诲瀷">
+                  <a-auto-complete
+                    v-model="queryParam.driveType"
+                    :data-source="driveTypeList"
+                    placeholder="璇烽�夋嫨椹卞姩绫诲瀷"
+                    :filter-option="filterOption"
+                  />
+                </a-form-item>
+              </a-col>
+              <a-col :md="5" :sm="5" :xs="5">
                 <a-form-item label="鏃堕棿">
                   <a-range-picker
                     :placeholder="['寮�濮嬫椂闂�', '缁撴潫鏃堕棿']"
@@ -17,31 +27,10 @@
                   />
                 </a-form-item>
               </a-col>
-              <!--<a-col :md="5" :sm="5" :xs="5">-->
-              <!--<a-form-item label="鐝埗">-->
-              <!--<a-select v-model="queryParam.shiftId" placeholder="璇烽�夋嫨鐝埗"-->
-              <!--@change="initShiftSubList" :allowClear="allowClear">-->
-              <!--<a-select-option v-for="(em,index) in shiftList" :key="index" :value="em.value">-->
-              <!--{{ em.label }}-->
-              <!--</a-select-option>-->
-              <!--</a-select>-->
-              <!--</a-form-item>-->
-              <!--</a-col>-->
-              <!--<a-col :md="5" :sm="5" :xs="5">-->
-              <!--<a-form-item label="鐝">-->
-              <!--<a-select v-model="queryParam.shiftSubId" placeholder="璇烽�夋嫨鐝" @change="initShiftSubListChange"-->
-              <!--:allowClear="allowClearSu">-->
-              <!--<a-select-option v-for="(em,index) in shiftSubList" :key="index" :value="em.value">-->
-              <!--{{ em.label }}-->
-              <!--</a-select-option>-->
-              <!--</a-select>-->
-              <!--</a-form-item>-->
-              <!--</a-col>-->
-
               <a-col :md="8" :sm="8" :xs="8">
                 <a-space>
                   <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
-                  <!--<a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>-->
+                  <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>
                   <a-button type="primary" @click="exportExcel" icon="download">瀵煎嚭</a-button>
                 </a-space>
               </a-col>
@@ -54,7 +43,7 @@
       <div class="container" id="EfficiencyShift" style="margin-top: 20px;">
         <div class="table2">
           <a-table :columns="columns" :dataSource="dataSource.records" :pagination="false" bordered
-                   :scroll="{ x: 3000, y: false }">
+                   :scroll="{ x: 3200, y: false }">
           </a-table>
         </div>
       </div>
@@ -66,7 +55,7 @@
           :default-current="1"
           :current=+queryParam.pageNo
           show-size-changer
-          :pageSizeOptions="['10','15','20','25']"
+          :pageSizeOptions="['20','30','40','50']"
           @change="handlePageNoChange"
           @showSizeChange="handlePageSizeChange"
         />
@@ -81,6 +70,7 @@
   import $ from 'jquery'
   import '@/components/table2excel/table2excel'
   import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api'
+  import api from '@api/mdc'
 
   export default {
     name: 'OEEAnalysisList',
@@ -95,7 +85,7 @@
         dates: [moment().subtract('month', 1), moment().subtract('month', 1)],
         identifying: [],
         queryParam: {
-          pageSize: 10,
+          pageSize: 20,
           pageNo: 1
         },
         queryParamEquip: {},
@@ -129,7 +119,7 @@
           {
             title: '璁惧鍚嶇О',
             align: 'center',
-            width: 150,
+            width: 200,
             dataIndex: 'equipmentName'
             // fixed: 'left'
           },
@@ -148,8 +138,9 @@
           {
             title: '鐝',
             align: 'center',
-            width: 80,
-            dataIndex: 'shift'
+            width: 100,
+            dataIndex: 'shift',
+            ellipsis: true,
           },
           {
             title: '姣忕彮灏忔椂',
@@ -249,7 +240,7 @@
             dataIndex: 'timeActuationRate',
             align: 'center',
             width: 110,
-            customRender: text => text != 0 ? text * 100 + '%' : 0
+            customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0
           },
           {
             title: '鍔犲伐闆朵欢鏁帮紙浠讹級',
@@ -268,7 +259,7 @@
             dataIndex: 'performanceRate',
             align: 'center',
             width: 110,
-            customRender: text => text != 0 ? text * 100 + '%' : 0
+            customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0
           },
           {
             title: '搴熷搧鏁�',
@@ -281,26 +272,28 @@
             dataIndex: 'passRate',
             align: 'center',
             width: 100,
-            customRender: text => text != 0 ? text * 100 + '%' : 0
+            customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0
           },
           {
             title: '璁惧缁煎悎鏁堢巼',
             dataIndex: 'overallEquipmentEfficiency',
             align: 'center',
             width: 120,
-            customRender: text => text != 0 ? text * 100 + '%' : 0
+            customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0
           }
         ],
-        dataSource: []
+        dataSource: [],
+        driveTypeList: []
       }
     },
     props: { nodeTree: '', Type: '', nodePeople: '' },
     created() {
-      this.initShiftList()
+      // this.initShiftList()
       this.queryParam.startTime = moment(this.dates[0]).format('YYYY-MM')
       this.queryParam.endTime = moment(this.dates[1]).format('YYYY-MM')
       this.queryParam.typeTree = '1'
       this.loadData()
+      this.getDriveTypeByApi()
     },
     watch: {
       Type(valmath) {
@@ -409,19 +402,21 @@
       },
 
       searchReset() {
-        this.typeTree = this.queryParam.typeTree
-        this.typeParent = this.queryParam.parentId
-        this.typeEquipment = this.queryParam.equipmentId
         this.queryParam = {
-          pageSize: 10,
+          pageSize: 20,
           pageNo: 1
         }
         this.dates = []
-        this.shiftSubList = []
-        this.queryParam.typeTree = this.typeTree
-        this.queryParam.parentId = this.typeParent
-        this.queryParam.equipmentId = this.typeEquipment
         this.loadData()
+      },
+
+      /**
+       * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷
+       */
+      getDriveTypeByApi() {
+        api.getDriveTypeApi().then((res) => {
+          this.driveTypeList = res.result.map(item => item.value)
+        })
       },
 
       loadData() {
@@ -450,6 +445,17 @@
       handlePageSizeChange(current, size) {
         this.queryParam.pageSize = size
         this.loadData()
+      },
+      /**
+       * 鑱旀兂杈撳叆妗嗙瓫閫夊姛鑳�
+       * @param input 杈撳叆鐨勫唴瀹�
+       * @param option 閰嶇疆
+       * @returns {boolean} 鍒ゆ柇鏄惁绛涢��
+       */
+      filterOption(input, option) {
+        return (
+          option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0
+        )
       }
     }
   }

--
Gitblit v1.9.3