From 585fb0bbd4a7bc7f8f333ecba7c5fecd2ee5cbc2 Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期四, 28 三月 2024 09:46:44 +0800
Subject: [PATCH] Merge branch 'master' of http://117.34.109.166:18448/r/vue_mdc_430 into develop

---
 src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue |   90 ++++++++++++++++++++++++++++++++++++---------
 1 files changed, 72 insertions(+), 18 deletions(-)

diff --git a/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue b/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue
index f8ee888..9f9fd47 100644
--- a/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue
+++ b/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue
@@ -3,10 +3,10 @@
     <!-- 鏌ヨ鍖哄煙 -->
     <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
-        <a-row :gutter="24">
+        <a-row :gutter="24" style="width: 100%;">
           <a-col :md="7" :sm="7">
             <a-form-item label="鏃堕棿">
-              <a-range-picker @change="dateParamChange" v-model="dates"  format="YYYY-MM-DD HH:mm:ss"/>
+              <a-range-picker @change="dateParamChange" v-model="dates"  format="YYYYMMDD"/>
             </a-form-item>
           </a-col>
           <a-col :md="5" :sm="5">
@@ -46,6 +46,8 @@
       <!--<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
       <!--&lt;!&ndash;<a-button type="primary" icon="import">瀵煎叆</a-button>&ndash;&gt;-->
       <!--</a-upload>-->
+      <a-button type="primary" icon="printer" v-print="'#DeviceList'" v-has="'overtimeManagement:print'">鎵撳嵃</a-button>
+
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel">
@@ -79,6 +81,9 @@
         </span>
         <span slot="model" slot-scope="text" style="font-weight: bold">
           <j-ellipsis :value="text" :length="8"/>
+        </span>
+        <span slot="duration" slot-scope="text">
+          {{text|getFormattedTime}}
         </span>
       </a-table>
     </div>
@@ -145,12 +150,24 @@
         queryParamPeople:{},
         dataStartsoucre:[],
         scrollY:465,
+        /* 鍒嗛〉鍙傛暟 */
+        ipagination:{
+          current: 1,
+          pageSize: 30,
+          pageSizeOptions: ['30', '50', '100'],
+          showTotal: (total, range) => {
+            return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�"
+          },
+          showQuickJumper: true,
+          showSizeChanger: true,
+          total: 0
+        },
         columns: [
           {
             title: '璁惧缂栧彿',
             align: 'center',
             dataIndex: 'equipmentId',
-            width:150
+            width:180
           },
           {
             title: '璁惧鍚嶇О',
@@ -163,25 +180,25 @@
           {
             title: '鏃ユ湡',
             align: 'center',
-            dataIndex: 'effectiveDate',
-            width:150
+            dataIndex: 'theDate',
+            width:180
             // scopedSlots:{customRender:'startTime'},
             // customRender:(text,row,index) => {
             //   return moment(text).format("YYYY-MM-DD HH:mm:ss")
             // }
           },
-          {
-            title: '鐝寮�濮嬫椂闂�',
-            align: 'center',
-            dataIndex: 'startDate',
-            width:150
-          },
-          {
-            title: '鐝缁撴潫鏃堕棿',
-            align: 'center',
-            dataIndex: 'endDate',
-            width:150
-          },
+          // {
+          //   title: '鐝寮�濮嬫椂闂�',
+          //   align: 'center',
+          //   dataIndex: 'startDate',
+          //   width:150
+          // },
+          // {
+          //   title: '鐝缁撴潫鏃堕棿',
+          //   align: 'center',
+          //   dataIndex: 'endDate',
+          //   width:150
+          // },
           {
             title: '鍔犵彮寮�濮嬫椂闂�',
             align: 'center',
@@ -195,10 +212,17 @@
             width:150
           },
           {
+            title: '鍔犵彮鏃堕暱',
+            align: 'center',
+            dataIndex: 'duration',
+            scopedSlots: {customRender: 'duration'},
+            width:200
+          },
+          {
             title: '澶囨敞',
             align: 'center',
             dataIndex: 'remark',
-            width:150
+            width:210
           },
           {
             title: '鎿嶄綔',
@@ -257,6 +281,36 @@
         return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
       },
     },
+    filters:{
+      /**
+       * 鏍煎紡鍖栨椂闂�
+       * @param seconds 绉掓暟
+       * @returns '' 鏍煎紡鍖栧悗鏃堕棿瀛楃涓�
+       */
+      getFormattedTime(seconds) {
+        var hours = Math.floor(seconds / 3600)
+        var minutes = Math.floor((seconds % 3600) / 60)
+        var secs = seconds % 60
+
+        if (hours === 0) {
+          if (minutes === 0) {
+            return secs === 0 ? 0 : `${secs}绉抈
+          } else {
+            if (secs === 0) {
+              return `${minutes}鍒哷
+            }
+            return `${minutes}鍒� ${secs}绉抈
+          }
+        } else {
+          if (minutes === 0 && secs === 0) {
+            return `${hours}灏忔椂`
+          } else if (minutes !== 0 && secs === 0) {
+            return `${hours}灏忔椂 ${minutes}鍒哷
+          }
+        }
+        return `${hours}灏忔椂 ${minutes}鍒� ${secs}绉抈
+      }
+    },
     methods: {
       importTemplate(fileName){
         var a = document.createElement("a");

--
Gitblit v1.9.3