ysh 3 anni fa
parent
commit
09c8436a2b

+ 40 - 46
src/views/system/schedulingInformation/BdClockinMonthList.vue

@@ -25,25 +25,13 @@
           <a-col :md="6" :sm="8">
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <a-button type="primary" @click="syMonthReport" icon="reload" style="margin-left: 8px">同步至U8</a-button>
 
             </span>
           </a-col>
 
         </a-row>
 
-        <!-- <a-row :gutter="24">
-          <a-col :md="6" :sm="8">
-            <a-form-item label="生成月报日期">
-              <a-month-picker format="YYYY-MM" placeholder="请输入生成月报日期" v-model="queryParam.nowDate" />
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="8">
-            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-              <a-button type="primary" @click="monthReport" icon="reload" style="margin-left: 8px">生成当月考勤月报</a-button>
-            </span>
-          </a-col>
-        </a-row> -->
       </a-form>
     </div>
 
@@ -73,10 +61,8 @@
   import {
     JeecgListMixin
   } from '@/mixins/JeecgListMixin'
+  import {getAction, postAction, deleteAction,putAction} from '@/api/manage'
   import JDictSelectTag from '@/components/dict/JDictSelectTag'
-  import {
-    monthReport
-  } from '@/api/api'
   import moment from 'moment';
   import 'moment/locale/zh-cn';
 
@@ -91,16 +77,7 @@
         moment,
         description: '考勤月报',
         // 表头
-        columns: [{
-            title: '行号',
-            dataIndex: '',
-            key: 'rowIndex',
-            width: 60,
-            align: 'center',
-            customRender: function(t, r, index) {
-              return parseInt(index) + 1
-            }
-          },
+        columns: [
           {
             title: '日期',
             align: 'center',
@@ -117,14 +94,14 @@
             dataIndex: 'personId'
           },
           {
-            title: '本月迟到分钟数',
+            title: '考勤天数',
             align: 'center',
-            dataIndex: 'latetimeS'
+            dataIndex: 'workDay'
           },
           {
-            title: '本月早退分钟数',
+            title: '实际考勤天数',
             align: 'center',
-            dataIndex: 'latetimeX'
+            dataIndex: 'workDayReal'
           },
           {
             title: '本月加班时长',
@@ -132,13 +109,19 @@
             dataIndex: 'duration'
           },
           {
-            title: '本月请假时长',
+            title: '事假时长(时)',
             align: 'center',
-            dataIndex: 'holidayTime'
+            dataIndex: 'holidayTimeSj'
+          },
+          {
+            title: '病假时长(天)',
+            align: 'center',
+            dataIndex: 'holidayTimeBj'
           }
         ],
         url: {
-          list: '/viewClockIn/bdClockinMonth/list'
+          list: '/viewClockIn/bdClockinMonth/list',
+          syMonthReport: '/viewClockIn/viewClockIn/syMonthReport'
         },
       }
     },
@@ -152,26 +135,37 @@
             console.log(date, dateString);
             // this.value = "2021-01-01"
       },
-      monthReport() {
+      syMonthReport() {
+        let ids = "";
+        var conText = "";
         let sqp1 = this.getQueryParams();
-        if(sqp1['nowDate'] == 'undefined' || sqp1['nowDate'] == null || sqp1['nowDate'] == ''){
-          this.$message.warning('请选择生成月报日期!');
+        if(sqp1['monthTime'] == 'undefined' || sqp1['monthTime'] == null || sqp1['monthTime'] == ''){
+          this.$message.warning('请选择同步月份!');
           return false;
         }
-        let nowDate = moment(sqp1['nowDate']).format('YYYY-MM');
+        let nowDate = moment(sqp1['monthTime']).format('YYYY-MM');
         let that = this;
+        
+        for (var a = 0; a < this.selectedRowKeys.length; a++) {
+          ids += this.selectedRowKeys[a] + ",";
+        }
+        if(ids == ""){
+          conText = "是否同步所有员工" + nowDate + "月报?";
+        }else{
+          conText = "是否同步所选员工" + nowDate + "月报? 所选数量:" + this.selectedRowKeys.length;
+        }
+        
         that.$confirm({
-           title: "确认操作",
-           content: "是否生成" + nowDate + "月报?",
+           title: conText,
+           content: "同步后不可修改,请确认操作!",
            onOk: function () {
-             monthReport({nowDate:nowDate}).then((res) => {
-               if (res) {
-                 that.$message.success("已成功生成"+nowDate+"考勤月报");
-                 that.loadData();
-               } else {
-                 that.$message.warning(res);
+             putAction(that.url.syMonthReport, {viewDate:nowDate,ids:ids}).then((res) => {
+               if (res.success) {
+                 console.log(res.result);
                }
-             });
+             }).finally(() => {
+                   
+             })
            }
         });
        

+ 2 - 2
src/views/system/schedulingInformation/JiaoZhunModal.vue

@@ -131,11 +131,11 @@
             //时间格式化
             
             jiaozhun({shiftTimeS:this.startDate,shiftTimeX:this.endDate,viewDate:this.viewDate,username:this.username,setInfo:this.setInfo}).then((res) => {
-              if (res == 'true') {
+              if (res.success) {
                 that.$message.success("已成功校准");
                 that.loadData();
               } else {
-                that.$message.warning(res);
+                that.$message.warning(res.message);
                  that.$emit('ok');
               }
             });

+ 19 - 6
src/views/system/schedulingInformation/ViewClockInList.vue

@@ -89,7 +89,7 @@
     <!-- table区域-begin -->
     <div>
 
-      <a-table class="j-table-force-nowrap" ref="table" size="middle" bordered rowKey="id" :columns="columns"
+      <a-table class="j-table-force-nowrap" ref="table" size="middle" bordered rowKey="pkId" :columns="columns"
         :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         @change="handleTableChange" :scroll="{ x: 3000 }">
 
@@ -361,6 +361,8 @@
         
       },
       monthReport() {
+        let ids = "";
+        var conText = ";"
         let sqp1 = this.getQueryParams();
         if(sqp1['nowDate'] == 'undefined' || sqp1['nowDate'] == null || sqp1['nowDate'] == ''){
           this.$message.warning('请选择生成月报日期!');
@@ -368,21 +370,32 @@
         }
         let nowDate = moment(sqp1['nowDate']).format('YYYY-MM');
         let that = this;
+        
+        for (var a = 0; a < this.selectedRowKeys.length; a++) {
+          ids += this.selectedRowKeys[a] + ",";
+        }
+        if(ids == ""){
+          conText = "是否生成所有员工" + nowDate + "月报?";
+        }else{
+          conText = "是否生成所选员工" + nowDate + "月报? 所选数量:" + this.selectedRowKeys.length;
+        }
+        // console.log(ids);
         that.$confirm({
            title: "确认操作",
-           content: "是否生成" + nowDate + "月报?",
+           content: conText,
            onOk: function () {
-             monthReport({nowDate:nowDate}).then((res) => {
-               if (res == 'true') {
+             monthReport({nowDate:nowDate,userIds:ids}).then((res) => {
+               if (res.success) {
                  that.$message.success("已成功生成"+nowDate+"考勤月报");
+                 // that.$message.success("已成功生成"+nowDate+"考勤月报");
                  that.loadData();
                } else {
-                 that.$message.warning(res);
+                 that.$message.warning(res.message);
                }
              });
            }
         });
-       
+