From adae7524c986a758dd61bc5d0c23f6b922e299c7 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期四, 25 一月 2024 17:06:35 +0800
Subject: [PATCH] 加班管理添加字段

---
 src/views/mdc/base/modules/mdcStandardProcessDuration/MdcStandardProcessDurationList.vue |   80 ++++++++++++++++++++++++++++++---------
 1 files changed, 61 insertions(+), 19 deletions(-)

diff --git a/src/views/mdc/base/modules/mdcStandardProcessDuration/MdcStandardProcessDurationList.vue b/src/views/mdc/base/modules/mdcStandardProcessDuration/MdcStandardProcessDurationList.vue
index 08aa784..8a6bdcf 100644
--- a/src/views/mdc/base/modules/mdcStandardProcessDuration/MdcStandardProcessDurationList.vue
+++ b/src/views/mdc/base/modules/mdcStandardProcessDuration/MdcStandardProcessDurationList.vue
@@ -1,5 +1,5 @@
 <template>
-  <a-card :bordered="false" class="device_list">
+  <div :bordered="false" class="device_list">
     <!-- 鏌ヨ鍖哄煙 -->
     <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
@@ -19,12 +19,18 @@
               <a-input placeholder="杈撳叆璁惧鍚嶇О鏌ヨ" v-model="queryParams.equipmentName"></a-input>
             </a-form-item>
           </a-col>
-          <a-col :md="2" :sm="3" :xs="3">
-            <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
-          </a-col>
           <a-col :md="2" :sm="2" :xs="2">
-            <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>
+            <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-col :md="2" :sm="3" :xs="3">-->
+            <!--<a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>-->
+          <!--</a-col>-->
+          <!--<a-col :md="2" :sm="2" :xs="2">-->
+            <!--<a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>-->
+          <!--</a-col>-->
           <!--<a-col :lg="2" :md="3" :sm="3" :xs="3">-->
             <!--<a-button type="primary" @click="exportExcel" icon="download">瀵煎嚭</a-button>-->
           <!--</a-col>-->
@@ -35,6 +41,7 @@
     <div class="table-operator" style="display: inline;">
       <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="handleExportXls('鏍囧噯鍔犲伐鏃堕棿')">瀵煎嚭</a-button>
       <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
       <a-button type="primary" icon="import">瀵煎叆</a-button>
@@ -53,9 +60,9 @@
     </div>
 
     <!-- table鍖哄煙-begin -->
-    <div id="DeviceList">
+    <div id="DeviceList" style="flex: 1;overflow: hidden">
       <a-table ref="table" bordered size="middle" rowKey="id" :columns="columns"
-               :scroll="{x:1000}" :dataSource="dataSource" :pagination="ipagination" :loading="loading"
+               :scroll="{x:'max-content',y:scrollY}" :dataSource="dataSource" :pagination="ipagination" :loading="loading"
                :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
                @change="handleTableChange">
         <span slot="action" slot-scope="text, record">
@@ -80,7 +87,7 @@
     <mdc-standard-process-duration-modal  ref="modalForm" @ok="modalFormOk"></mdc-standard-process-duration-modal>
     <mdc-standard-process-duration-edit   ref="modalFormedit" @ok="modalFormOk"></mdc-standard-process-duration-edit>
 
-  </a-card>
+  </div>
 </template>
 
 <script>
@@ -134,16 +141,19 @@
         queryParamEquip:{},
         queryParamPeople:{},
         dataStartsoucre:[],
+        scrollY:465,
         columns: [
           {
             title: '璁惧缂栧彿',
             align: 'center',
-            dataIndex: 'equipmentId'
+            dataIndex: 'equipmentId',
+            width:200
           },
           {
             title: '璁惧鍚嶇О',
             align: 'center',
             dataIndex: 'equipmentName',
+            width:200
             // defaultSortOrder:'descend',
             // sorter: (a, b) => {return a.equipmentName>b.equipmentName?1:-1}
           },
@@ -151,6 +161,7 @@
             title: '闆朵欢鍙�',
             align: 'center',
             dataIndex: 'partsCode',
+            width:150
             // scopedSlots:{customRender:'startTime'},
             // customRender:(text,row,index) => {
             //   return moment(text).format("YYYY-MM-DD HH:mm:ss")
@@ -159,28 +170,33 @@
           {
             title: '鎵规鍙�',
             align: 'center',
-            dataIndex: 'batchCode'
+            dataIndex: 'batchCode',
+            width:150
           },
           {
             title: '绋嬪簭鍙�',
             align: 'center',
-            dataIndex: 'sequenceNumber'
+            dataIndex: 'sequenceNumber',
+            width:150
           },
           {
             title: '鏃堕暱锛堝垎閽燂級',
             align: 'center',
-            dataIndex: 'duration'
+            dataIndex: 'duration',
+            width:150
           },
           {
             title: '澶囨敞',
             align: 'center',
-            dataIndex: 'remark'
+            dataIndex: 'remark',
+            width:250
           },
           {
             title: '鎿嶄綔',
             dataIndex: 'action',
             scopedSlots: {customRender: 'action'},
             align: "center",
+            fixed:'right',
             width: 150
           }
         ],
@@ -233,6 +249,15 @@
       },
     },
     methods: {
+      importTemplate(fileName){
+        var a = document.createElement("a");
+        a.href = "/static/鏍囧噯鍔犲伐鏃堕棿.xls";
+        a.download = "鏍囧噯鍔犲伐鏃堕棿.xls";
+        a.style.display = "none";
+        document.body.appendChild(a);
+        a.click();
+        a.remove();
+      },
       dateParamChange(v1, v2) {
         // console.log(v1,v2)
         this.queryParam.startTime = v2[0]
@@ -514,7 +539,7 @@
             //閲嶆柊璁$畻鍒嗛〉闂
             that.reCalculatePage(1)
             // that.$message.success(res.message);
-            that.$notification.warning({
+            that.$notification.success({
               message:'娑堟伅',
               description:res.message
             });
@@ -661,9 +686,25 @@
           exclude_inputs: true
         });
       },
+
+      /**
+       * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙�
+       */
+      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.typeTree = "1"
+    },
+    mounted(){
+      window.addEventListener('resize',this.handleWindowResize)
+      this.handleWindowResize()
+    },
+    beforeDestroy(){
+      window.removeEventListener('resize',this.handleWindowResize)
     }
   }
 </script>
@@ -671,34 +712,35 @@
 <style lang="less" scoped>
   @import '~@assets/less/common.less';
 
+  .device_list{
+    overflow: hidden;
+    display: flex;
+    flex-direction: column;
+  }
+
   @media screen and (min-width: 1920px){
     .device_list{
       height: 811px!important;
-      overflow: scroll;
     }
   }
   @media screen and (min-width: 1680px) and (max-width: 1920px){
     .device_list{
       height: 811px!important;
-      overflow: scroll;
     }
   }
   @media screen and (min-width: 1400px) and (max-width: 1680px){
     .device_list{
       height: 663px!important;
-      overflow: scroll;
     }
   }
   @media screen and (min-width: 1280px) and (max-width: 1400px){
     .device_list{
       height: 564px!important;
-      overflow: scroll;
     }
   }
   @media screen and (max-width: 1280px){
     .device_list{
       height: 564px!important;
-      overflow: scroll;
     }
   }
 </style>

--
Gitblit v1.9.3