From 7a1652cf61e65a2dd2ad1b52c4b383207f3a6956 Mon Sep 17 00:00:00 2001
From: zhuzhuanzhuan
Date: 星期五, 01 九月 2023 14:03:00 +0800
Subject: [PATCH] 加班管理

---
 src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModalList.vue |  234 ++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 179 insertions(+), 55 deletions(-)

diff --git a/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModalList.vue b/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModalList.vue
index 86d898c..94d1786 100644
--- a/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModalList.vue
+++ b/src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModalList.vue
@@ -7,42 +7,11 @@
       <div class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="searchQuery">
           <a-row :gutter="24">
-            <a-col :md="6" :sm="6"  v-if="isDepartType == 0">
-              <a-form-item label="閮ㄩ棬" v-if="isDepartType == 0">
-                <!--<a-select v-model="queryParam.sectionPid" placeholder="璇烽�夋嫨閮ㄩ棬" :options="sectionPData" @change="initGroupOptions" />-->
-                <a-tree-select
-                  v-model="value"
-                  style="width: 100%"
-                  :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
-                  :tree-data="treeData"
-                  placeholder="璇烽�夋嫨閮ㄩ棬"
-                  tree-default-expand-all
-                >
-                  <!--<span v-if="key === '0-0-1'" slot="title" slot-scope="{ key, value }" style="color: #08c">-->
-                  <!--Child Node1 {{ value }}-->
-                  <!--</span>-->
-                </a-tree-select>
-              </a-form-item>
-            </a-col>
-
-            <a-col :md="6" :sm="6">
-              <a-form-item label="杞﹂棿" >
-                <!--<a-select v-model="queryParam.sectionId" placeholder="璇烽�夋嫨鍥㈤槦" :options="sectionData"/>-->
-                <a-tree-select
-                  v-model="valueProduct"
-                  style="width: 100%"
-                  :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
-                  :tree-data="sectionData"
-                  placeholder="璇烽�夋嫨杞﹂棿"
-                  tree-default-expand-all
-                >
-                  <!--<span v-if="key === '0-0-1'" slot="title" slot-scope="{ key, value }" style="color: #08c">-->
-                  <!--Child Node1 {{ value }}-->
-                  <!--</span>-->
-                </a-tree-select>
-              </a-form-item>
-            </a-col>
-
+           <a-col :md="8" :sm="8">
+             <a-form-item label="鏃堕棿">
+               <a-range-picker @change="dateParamChange" format="YYYYMMDD" v-model="dates"/>
+             </a-form-item>
+           </a-col>
             <a-col :md="6" :sm="6">
               <a-form-item label="璁惧缂栫爜">
                 <a-input placeholder="璇疯緭鍏ヨ澶囩紪鐮佹绱�" v-model="queryParam.equipmentId"></a-input>
@@ -68,6 +37,11 @@
                  :dataSource="dataSource" :pagination="ipagination" :loading="loading"
                  :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
                  @change="handleTableChange">
+                    <span slot="isDaySpan" slot-scope="text, record">
+           <span v-if="text == 'true'">鏄�</span>
+           <span v-if="text == 'false'">鍚�</span>
+         </span>
+
         </a-table>
       </div>
       <!-- table鍖哄煙-end -->
@@ -77,6 +51,7 @@
 
 <script>
   import {mapActions} from 'vuex'
+  import { filterObj } from '@/utils/util';
   import {
     ajaxGetSelectItems
   } from '@/api/api'
@@ -98,7 +73,7 @@
 
   export default {
     name: 'DeviceCalendarListModel',
-    mixins: [JeecgListMixin],
+    // mixins: [JeecgListMixin],
     components: {
       JDictSelectTag,
       JEllipsis,
@@ -113,7 +88,43 @@
       }
     },
     data() {
-      return {
+      return{
+        /* 鏌ヨ鏉′欢-璇蜂笉瑕佸湪queryParam涓0鏄庨潪瀛楃涓插�肩殑灞炴�� */
+        queryParam: {},
+        /* 鏁版嵁婧� */
+        dataSource:[],
+        /* 鍒嗛〉鍙傛暟 */
+        ipagination:{
+          current: 1,
+          pageSize: 10,
+          pageSizeOptions: ['10', '20', '30'],
+          showTotal: (total, range) => {
+            return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�"
+          },
+          showQuickJumper: true,
+          showSizeChanger: true,
+          total: 0
+        },
+        /* 鎺掑簭鍙傛暟 */
+        isorter:{
+          column: 'createTime',
+          order: 'desc',
+        },
+        /* 绛涢�夊弬鏁� */
+        filters: {},
+        /* table鍔犺浇鐘舵�� */
+        loading:false,
+        /* table閫変腑keys*/
+        selectedRowKeys: [],
+        /* table閫変腑records*/
+        selectionRows: [],
+        /* 鏌ヨ鎶樺彔 */
+        toggleSearchStatus:false,
+        /* 楂樼骇鏌ヨ鏉′欢鐢熸晥鐘舵�� */
+        superQueryFlag:false,
+        /* 楂樼骇鏌ヨ鏉′欢 */
+        superQueryParams: '',
+        dates:[],
         isDepartType:'',
         /*readOnly:true,*/
         title:'',
@@ -132,11 +143,15 @@
             customRender: function (t, r, index) {
               return parseInt(index) + 1;
             }
-          },{
-
-            title: '璁惧缂栫爜',
+          }, {
+            title: '鏃ユ湡',
             align: 'center',
-            dataIndex: 'equipmentId',
+            dataIndex: 'effectiveDate',
+          },
+          {
+            title: '璁惧缂栧彿',
+            align: 'center',
+            dataIndex: 'equipmentId'
           },
           {
             title: '璁惧鍚嶇О',
@@ -144,20 +159,46 @@
             dataIndex: 'equipmentName',
           },
           {
-            title: '椹卞姩绫诲瀷',
+            title: '鐝埗',
             align: 'center',
-            dataIndex: 'driveType'
+            dataIndex: 'shiftName'
           },
           {
-            title: '鏁版帶绯荤粺',
+            title: '鐝',
             align: 'center',
-            dataIndex: 'controlSystem'
+            dataIndex: 'shiftSubName'
           },
+          {
+            title: '寮�濮嬫椂闂�',
+            align: 'center',
+            dataIndex: 'startDate'
+          },
+          {
+            title: '缁撴潫鏃堕棿',
+            align: 'center',
+            dataIndex: 'endDate'
+          },
+          {
+            title: '鏄惁璺ㄥぉ',
+            align: 'center',
+            dataIndex: 'isDaySpan',
+            scopedSlots: { customRender: 'isDaySpan' }
+          },
+          {
+            title: '寮�濮嬩紤鎭椂闂�',
+            align: 'center',
+            dataIndex: 'sleepStartDate'
+          },
+          {
+            title: '缁撴潫浼戞伅鏃堕棿',
+            align: 'center',
+            dataIndex: 'sleepEndDate'
+          }
         ],
         sectionPData: [],
         sectionData: [],
         url: {
-          list: '/mdc/mdcEquipment/findEquipmentList',
+          list: '/mdc/mdcDeviceCalendar/list',
           loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
           loadProductionOptions:'/mdc/mdcProduction/loadProductionTreeOptions'
         },
@@ -165,8 +206,12 @@
         valueProduct:undefined
       }
     },
-    created() {
-      this.queryTreeData()
+    created(){
+      this.dates = [moment().subtract('days', 0), moment().subtract('days', 0)]
+      this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD')
+      this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD')
+      // this.queryTreeData()
+      this.loadData()
     },
     watch: {
       value(value) {
@@ -193,6 +238,79 @@
         }).finally(() =>{
         })
       },
+      getQueryParams() {
+        //鑾峰彇鏌ヨ鏉′欢
+        let sqp = {}
+        if(this.superQueryParams){
+          sqp['superQueryParams']=encodeURI(this.superQueryParams)
+          sqp['superQueryMatchType'] = this.superQueryMatchType
+        }
+        var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
+        param.field = this.getQueryField();
+        param.pageNo = this.ipagination.current;
+        param.pageSize = this.ipagination.pageSize;
+        //鑾峰彇鐢ㄦ埛瀹氬埗鐨勫弬鏁板睘鎬�
+        if (this.getCustomQueryParams) {
+          param = this.getCustomQueryParams(param);
+          if(!param){
+            return false;
+          }
+        }
+
+        return filterObj(param);
+      },
+      getQueryField() {
+        //TODO 瀛楁鏉冮檺鎺у埗
+        var str = "id,";
+        this.columns.forEach(function (value) {
+          str += "," + value.dataIndex;
+        });
+        return str;
+      },
+      loadData(arg) {
+        this.dataSource = [];
+        if(!this.url.list){
+          this.$message.error("璇疯缃畊rl.list灞炴��!")
+          return
+        }
+        //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭
+        if (arg === 1) {
+          this.ipagination.current = 1;
+        }
+
+        var params = this.getQueryParams();//鏌ヨ鏉′欢
+
+        if(!params){
+          return false;
+        }
+        params.startTime = this.queryParam.startTime;
+        params.endTime = this.queryParam.endTime;
+        params.orderByName = "ascend";
+        this.loading = true;
+        getAction(this.url.list, params).then((res) => {
+          if (res.success) {
+            // console.log(res)
+            //update-begin---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
+
+            this.dataSource = res.result.records||res.result;
+            if(res.result.total)
+            {
+              this.ipagination.total = res.result.total;
+            }else{
+              this.ipagination.total = 0;
+            }
+            //update-end---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
+          }else{
+            this.$message.warning(res.message)
+          }
+        }).finally(() => {
+          this.loading = false
+        })
+      },
+      dateParamChange(v1, v2) {
+        this.queryParam.startTime = v2[0]
+        this.queryParam.endTime = v2[1]
+      },
       onSelectChange(selectedRowKeys, selectionRows) {
         // this.SelectedList.push(selectedRowKeys);
         this.selectedRowKeys = selectedRowKeys;
@@ -211,13 +329,17 @@
         this.ipagination = pagination;
         this.loadData();
       },
+      onClearSelected() {
+        this.selectedRowKeys = [];
+        this.selectionRows = [];
+      },
       openPage() {
         this.visible = true
         this.onClearSelected()
         this.dataSource = [];
-        this.queryParam = {
-          status: this.status
-        };
+        // this.queryParam = {
+        //   status: this.status
+        // };
 
         this.loadData();
         this.initOptions();
@@ -273,9 +395,11 @@
         this.onClearSelected()
       },
       searchReset() {
-        this.queryParam = {
-          status: 1
-        };
+        // this.queryParam = {
+        //   status: 1
+        // };
+        this.dates = []
+        this.queryParam = {}
         this.loadData();
         this.onClearSelected()
       },

--
Gitblit v1.9.3