ysh 2 jaren geleden
bovenliggende
commit
27a7be0392

+ 56 - 6
src/views/system/schedulingInformation/BdClockinMonthList.vue

@@ -40,6 +40,7 @@
          
           <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>
               <a-button type="primary" @click="syMonthReport" icon="reload" style="margin-left: 8px">同步至U8</a-button>
               <a-button type="primary" icon="download" style="margin-left: 8px" @click="handleExportXls('考勤月报')">导出</a-button>
             </span>
@@ -58,7 +59,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="username" :columns="columns"
         :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         @change="handleTableChange" :scroll="{ x: 1200, y: 700 }">
 
@@ -93,7 +94,8 @@
   import JDictSelectTag from '@/components/dict/JDictSelectTag'
   import moment from 'moment';
   import 'moment/locale/zh-cn';
-
+  import {monthReport} from '@/api/api';
+  
   export default {
     name: 'ViewClockInList',
     mixins: [JeecgListMixin],
@@ -106,23 +108,24 @@
         moment,
         oldCloseDate:'',//原始关账日期
         closeDate:'',//关账日期
+        monthTime:'',
         description: '考勤月报',
         // 表头
         columns: [
           {
             title: '日期',
             align: 'center',
-            dataIndex: 'monthTime'
+            dataIndex: 'monthdate'
           },
           {
             title: '人员姓名',
             align: 'center',
-            dataIndex: 'personName'
+            dataIndex: 'realname'
           },
           {
             title: '工号',
             align: 'center',
-            dataIndex: 'personId'
+            dataIndex: 'username'
           },
           {
             title: '考勤天数',
@@ -169,13 +172,60 @@
           syMonthReport: '/viewClockIn/viewClockIn/syMonthReport'
         },
       }
+    }, 
+    created() {    //实例被创建时候执行
+        let yy = new Date().getFullYear();
+        let mm = new Date().getMonth()+1;
+        // let dd = new Date().getDate();
+        this.monthTime = yy+"-"+mm;
     },
     computed: {
       importExcelUrl: function() {
         return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
-      }
+      },
     },
     methods: {
+      
+      monthReport() {
+        
+        let ids = "";
+        var conText = ";"
+        let sqp1 = this.getQueryParams();
+        if(sqp1['monthTime'] == 'undefined' || sqp1['monthTime'] == null || sqp1['monthTime'] == ''){
+          this.$message.warning('请选择生成月报日期!');
+          return false;
+        }
+        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;
+        }
+        // console.log(ids);
+        that.$confirm({
+           title: "确认操作",
+           content: conText,
+           onOk: function () {
+             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.message);
+               }
+             });
+           }
+        });
+      
+      
+      },
+      
       showModal() {
         let that = this;
         getAction(this.url.getCloseDate, {}).then((res) => {

+ 41 - 25
src/views/system/schedulingInformation/ViewClockInList.vue

@@ -77,11 +77,10 @@
 
         </a-row>
 
-        <a-row :gutter="24">
+        <!-- <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-input placeholder="请输入生成月报日期" v-model="queryParam.nowDate"></a-input> -->
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="8">
@@ -90,7 +89,7 @@
             </span>
           </a-col>
 
-        </a-row>
+        </a-row> -->
       </a-form>
     </div>
 
@@ -193,12 +192,12 @@
           }, */
           {
             title: '日期',
-            align: 'center',
+            align: 'center',sorter: true,
             dataIndex: 'viewDate', fixed: 'left', width: 100
           },
           {
             title: '人员',
-            align: 'center',
+            align: 'center',sorter: true,
             dataIndex: 'realname', fixed: 'left', width: 100
           },
           // {
@@ -213,7 +212,7 @@
           // },
           {
             title: '班次',
-            align: 'center',
+            align: 'center',sorter: true,
             fixed: 'left', width: 160,
             scopedSlots: {
               customRender: 'realShiftTime'
@@ -226,13 +225,13 @@
           // },
           {
             title: '一级部门',
-            align: 'center',
+            align: 'center',sorter: true,
             dataIndex: 'oneDept'
           },
           {
             title: '二级部门',
-            align: 'center',
-            dataIndex: 'twoDept'
+            align: 'center',sorter: true,
+            dataIndex: 'lastDept'
           },
           // {
           //   title: '三级部门',
@@ -241,7 +240,7 @@
           // },
           {
             title: '最早',
-            align: 'center',
+            align: 'center',sorter: true,
             dataIndex: 'gotoTime',
             scopedSlots: {
               customRender: 'customTime'
@@ -249,7 +248,7 @@
           },
           {
             title: '最晚',
-            align: 'center',
+            align: 'center',sorter: true,
             dataIndex: 'closingTime',
             scopedSlots: {
               customRender: 'customTime'
@@ -257,7 +256,7 @@
           },
           {
             title: '上班1',
-            align: "center",
+            align: "center",sorter: true,
             dataIndex: 'oneTime',
             scopedSlots: {
               customRender: 'customTime'
@@ -265,14 +264,14 @@
           },
           {
             title: '下班1',
-            align: "center",
+            align: "center",sorter: true,
             dataIndex: 'twoTime',
             scopedSlots: {
               customRender: 'customTime'
             }
           },{
             title: '上班2',
-            align: "center",
+            align: "center",sorter: true,
             dataIndex: 'threeTime',
             scopedSlots: {
               customRender: 'customTime'
@@ -280,7 +279,7 @@
           },
           {
             title: '下班2',
-            align: "center",
+            align: "center",sorter: true,
             dataIndex: 'fourTime',
             scopedSlots: {
               customRender: 'customTime'
@@ -288,11 +287,11 @@
           },
           {
             title: '打卡次数',
-            align: 'center',
+            align: 'center',sorter: true,
             dataIndex: 'attendanceCount', width: 100
           }, {
             title: '考勤状态',
-            align: 'center', width: 100,
+            align: 'center', width: 100,sorter: true,
             scopedSlots: {
               customRender: 'latetimeState'
             }
@@ -333,37 +332,37 @@
           },*/
           {
             title: '加班开始时间',width: 150,
-            align: 'center',
+            align: 'center',sorter: true,
             dataIndex: 'durationBeginDate'
           },
           {
             title: '加班结束时间',width: 150,
-            align: 'center',
+            align: 'center',sorter: true,
             dataIndex: 'durationEndDate'
           },
           {
             title: '加班事由',
-            align: 'center',
+            align: 'center',sorter: true,
             dataIndex: 'demo'
           },
           {
             title: '加班时长',
-            align: 'center',width: 100,
+            align: 'center',width: 100,sorter: true,
             dataIndex: 'duration'
           },
           {
             title: '请假开始时间',
-            align: 'center',width: 160,
+            align: 'center',width: 160,sorter: true,
             dataIndex: 'holidayStartDate'
           },
           {
             title: '请假结束时间',
-            align: 'center',width: 160,
+            align: 'center',width: 160,sorter: true,
             dataIndex: 'holidayEndDate'
           },
           {
             title: '请假类型',
-            align: 'center',width: 100,
+            align: 'center',width: 100,sorter: true,
             dataIndex: 'holidayType'
           }
           // ,
@@ -375,7 +374,7 @@
           // }
         ],
         url: {
-          list: '/viewClockIn/viewClockIn/list',
+          list: '/viewClockIn/viewClockIn/list1',
           shift: "/shift/shift/lists",
           exportXlsUrl: '/viewClockIn/viewClockIn/exportXlsDay',
         },
@@ -390,6 +389,22 @@
         this.queryShift();
     },
     methods: {
+      //筛选需要重写handleTableChange
+      handleTableChange(pagination, filters, sorter) {
+        //分页、排序、筛选变化时触发
+        //TODO 筛选
+        if (Object.keys(sorter).length > 0) {
+          this.isorter.column = sorter.field;
+          this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+        }else{
+          this.isorter.column = 'viewDate';
+          this.isorter.order = "ascend" == "desc"
+        }
+        //这种筛选方式只支持单选
+        //this.filters.status = filters.status[0];
+        this.ipagination = pagination;
+        this.loadData();
+      },
       modalFormOks(formData) {
         if (formData.departIdList != null && formData.departIdList.length > 0) {
           for (let i = 0; i < formData.departIdList.length; i++) {
@@ -406,6 +421,7 @@
       },
       handleEmpty(){
         this.queryParam.departIds=null;
+        this.queryParam.departNames=null;
         this.departNames=null;
       },
       onDateChange: function (value, dateString) {

+ 70 - 21
src/views/system/schedulingInformation/ViewClockUserInfo.vue

@@ -32,14 +32,14 @@
          <!-- 123-->
          <a-menu slot="overlay">
            <a-menu-item v-has="'viewClockUserInfo:fuxin'">
-             <a-popconfirm title="确定对所选记录付薪吗?" @confirm="() => handleInfo('1')">
-               <a>付薪</a>
-             </a-popconfirm>
+             <!-- <a-popconfirm title="确定对所选记录付薪吗?" @confirm="() => handleInfo('1')"> -->
+               <a @click="showModal3('top','1',null)">付薪</a>
+             <!-- </a-popconfirm> -->
            </a-menu-item>
            <a-menu-item v-has="'viewClockUserInfo:tiaoxiu'">
-             <a-popconfirm title="确定对所选记录累计调休吗?" @confirm="() => handleInfo('2')">
-               <a>累计调休</a>
-             </a-popconfirm>
+             <!-- <a-popconfirm title="确定对所选记录累计调休吗?" @confirm="() => handleInfo('2')"> -->
+               <a @click="showModal3('top','2',null)">累计调休</a>
+             <!-- </a-popconfirm> -->
            </a-menu-item>
            <a-menu-item v-has="'viewClockUserInfo:hulue'">
              <a-popconfirm title="确定对所选记录忽略吗?" @confirm="() => handleInfo('3')">
@@ -118,14 +118,14 @@
             </a>
             <a-menu slot="overlay">
               <a-menu-item v-has="'viewClockUserInfo:fuxin'">
-                <a-popconfirm title="确定付薪吗?" @confirm="() => fuXinInfo('2','1',record)">
-                  <a>付薪</a>
-                </a-popconfirm>
+                <!-- <a-popconfirm title="确定付薪吗?" @confirm="() => fuXinInfo('2','1',record)"> -->
+                  <a @click="showModal3('right','1',record)">付薪</a>
+                <!-- </a-popconfirm> -->
               </a-menu-item>
               <a-menu-item v-has="'viewClockUserInfo:tiaoxiu'">
-                <a-popconfirm title="确定累计调休吗?" @confirm="() => fuXinInfo('2','2',record)">
-                  <a>累计调休</a>
-                </a-popconfirm>
+                <!-- <a-popconfirm title="确定累计调休吗?" @confirm="() => fuXinInfo('2','2',record)"> -->
+                  <a @click="showModal3('right','2',record)">累计调休</a>
+                <!-- </a-popconfirm> -->
               </a-menu-item>
               <a-menu-item v-has="'viewClockUserInfo:hulue'">
                 <a-popconfirm title="确定忽略吗?" @confirm="() => fuXinInfo('2','3',record)">
@@ -159,14 +159,14 @@
                  </a>
                  <a-menu slot="overlay">
                    <a-menu-item v-has="'viewClockUserInfo:fuxin'">
-                     <a-popconfirm title="确定付薪吗?" @confirm="() => fuXinInfo('1','1',record)">
-                       <a>付薪</a>
-                     </a-popconfirm>
+                     <!-- <a-popconfirm title="确定付薪吗?" @confirm="() => fuXinInfo('1','1',record)"> -->
+                       <a @click="showModal3('in','1',record)">付薪</a>
+                     <!-- </a-popconfirm> -->
                    </a-menu-item>
                    <a-menu-item v-has="'viewClockUserInfo:tiaoxiu'">
-                     <a-popconfirm title="确定累计调休吗?" @confirm="() => fuXinInfo('1','2',record)">
-                       <a>累计调休</a>
-                     </a-popconfirm>
+                     <!-- <a-popconfirm title="确定累计调休吗?" @confirm="() => fuXinInfo('1','2',record)"> -->
+                       <a @click="showModal3('in','2',record)">累计调休</a>
+                     <!-- </a-popconfirm> -->
                    </a-menu-item>
                    <a-menu-item v-has="'viewClockUserInfo:hulue'">
                      <a-popconfirm title="确定忽略吗?" @confirm="() => fuXinInfo('1','3',record)">
@@ -188,6 +188,18 @@
         >
           <a-input placeholder="请填写忽略原因" v-model="errorText"></a-input>
     </a-modal>
+    
+    <a-modal style="z-index:999"
+          title="请选择倍数"
+          :visible="visibleShowModal3"
+          :confirm-loading="confirmLoading"
+          @ok="handleOk3"
+          @cancel="handleCancel3"
+        >
+        <j-dict-select-tag style="width:100%;" v-model="multiple"  placeholder="请选择倍数"
+            dictCode="multiple" />
+           
+    </a-modal>
   </a-card>
 </template>
 
@@ -224,7 +236,12 @@
         durationEndDate:'',//加班结束时间
         duration:'',//加班时长
         demo:'',//加班事由
-        modal2Visible: false,
+        modal2Visible: false,//加班信息详情
+        visibleShowModal3:false,//薪资倍数选择框
+        multiple:1,//薪资倍数选择框倍数
+        area:'',//点击倍数弹框的区域 top/right/in
+        recordPar:'',//弹框参数
+        stPar:null,//1付薪,2调休
         moment,
         description: '员工考勤信息',
         userName:'',//标题员工姓名
@@ -430,7 +447,7 @@
             }
           }
 
-          putAction(this.url.handleInfo, {viewDate:ids,st:st,username:username}).then((res) => {
+          putAction(this.url.handleInfo, {multiple:this.multiple,viewDate:ids,st:st,username:username}).then((res) => {
             if (res.success) {
               that.$message.success("操作成功");
               that.loadData();
@@ -439,6 +456,7 @@
               that.loadData();
             }
           }).finally(() => {
+            that.multiple = 1;
             that.selectedRowKeys = [];
           })
         },
@@ -459,6 +477,16 @@
           this.errorSt = record.errorState;
           this.errorText = record.errorText;
           this.visible = true;
+        }, 
+        showModal3(area,st,record) {//薪资倍数选择框
+          if(area == 'top' && this.selectedRowKeys.length < 1){
+            this.$message.warning("请选择一条含有加班信息的数据");
+            return;
+          }
+          this.stPar = st;
+          this.area = area;
+          this.recordPar = record;
+          this.visibleShowModal3 = true;
         },
         handleOk(e) {
           if(this.errorSt == 0){
@@ -484,6 +512,25 @@
             this.visible = false;
           })
         },
+        handleOk3(e) {
+          this.modal2Visible = false;
+          this.visibleShowModal3 = false;
+          if(this.area == 'top'){
+             this.handleInfo(this.stPar);
+          }
+          if(this.area == 'right'){
+            this.fuXinInfo('2',this.stPar,this.recordPar);
+          }
+          if(this.area == 'in'){
+            this.fuXinInfo('1',this.stPar,this.recordPar);
+            
+          }      
+        },
+        handleCancel3(e) {
+          this.multiple = 1;
+          this.visibleShowModal3 = false;
+          
+        },
         handleCancel(e) {
           console.log('Clicked cancel button');
           this.visible = false;
@@ -714,11 +761,13 @@
             userId = record.userId;
           }
           let that = this;
-          fuXinInfo({viewDate:record.viewDate,viewDate1:record.beginDate,userId:userId,pkId:record.id,st:st,w:w}).then((res) => {
+          fuXinInfo({multiple:this.multiple,viewDate:record.viewDate,viewDate1:record.beginDate,userId:userId,pkId:record.id,st:st,w:w}).then((res) => {
             if (res.success) {
+               that.multiple = 1;
               that.$message.success("已成功设置");
               that.loadData();
             } else {
+              that.multiple = 1;
               that.$message.warning(res.message);
               that.loadData();
             }