Browse Source

考勤管理

jingbb 1 year ago
parent
commit
63d5efff30

+ 31 - 16
src/views/oa/salary_management/Attendance/attendanceManagement.vue

@@ -7,13 +7,7 @@
           <a-row :gutter="24">
             <a-col :xl="6" :lg="7" :md="8" :sm="24">
               <a-form-item label="时间">
-                <a-range-picker
-                  :placeholder="['开始月份', '结束月份']"
-                  format="YYYY-MM"
-                  valueFormat="YYYY-MM"
-                  :value="DateTime"
-                  @change="changeStartDate"/>
-                <!-- <a-range-picker v-model="DateTime"  style="width: 100%;" @change="changeStartDate" /> -->
+                <a-month-picker placeholder="请选择" :allowClear="false" v-model="yearWithMonth" @change="onChange" style="width:100% !important"/>
               </a-form-item>
             </a-col>
             <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -77,7 +71,7 @@
   <script>
   
     import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-    import { getAction } from '@/api/manage'
+    import { getAction,downFile} from '@/api/manage'
     import moment from 'moment'
     import AttendancelDetail from './modules/AttendancelDetail.vue'
     import OvertimeDetail from './modules/OvertimeDetail.vue'
@@ -98,6 +92,7 @@
           DateTime:[],
           selectedRowKeys:[],
           selectedRows:[],
+          yearWithMonth:'',
           // 表头
           columns: [
             {
@@ -127,7 +122,7 @@
             {
               title: '上传时间',
               align:"center",
-              dataIndex: 'updateTime'
+              dataIndex: 'createTime'
             },
             {
               title: '版本',
@@ -152,11 +147,6 @@
         this.getTableList()
       },
       methods: {
-        changeStartDate(data){
-            this.DateTime = data
-            this.queryParam.yearMonth_begin = data.length==2?moment(data[0]).format('YYYY-MM-DD'):''
-            this.queryParam.yearMonth_end = data.length==2?moment(data[1]).format('YYYY-MM-DD'):''
-        },
         searchQuery(){
           this.queryParam.pageNo =1
           this.getTableList()
@@ -166,7 +156,9 @@
           this.getTableList()
         },
         getTableList(){
+          this.loading = true
           getAction('/salary/salaryAttendance/list',this.queryParam).then(res=>{
+            this.loading = false
             if(res.success){
                 this.dataSource =res.result.records
                 this.ipagination = {
@@ -188,16 +180,39 @@
             this.$refs.AttendancelDetail.getTableList(record.id)         
           }else if(record.type=='加班表'){
             this.$refs.OvertimeDetail.visible = true
-            this.$refs.OvertimeDetail.getTableList(record.id)       
+            this.$refs.OvertimeDetail.detail(record.id)       
           }else if(record.type=='年休表'){
             this.$refs.AnnualLeave.visible = true
-            this.$refs.AnnualLeave.getTableList(record.id)       
+            this.$refs.AnnualLeave.detail(record.id)        
           }
             
         },
         handleDownload(record){
+          downFile('/salary/salaryAttendance/exportXls',{id:record.id,type:record.type}).then(data => {
+            if (!data) {
+              this.$message.warning('文件下载失败')
+              return
+            }
+            if (typeof window.navigator.msSaveBlob !== 'undefined') {
+                window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }),  record.type + '.xlsx')
+            } else {
+            let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
+            let link = document.createElement('a')
+            link.style.display = 'none'
+            link.href = url
+            link.setAttribute('download',  record.type+'.xlsx')
+            document.body.appendChild(link)
+            link.click()
+            document.body.removeChild(link) // 下载完成移除元素
+            window.URL.revokeObjectURL(url) // 释放掉blob对象
+        }
+      })
 
         },
+        onChange(data){
+          this.yearWithMonth = data
+          this.queryParam.yearWithMonth = this.yearWithMonth?moment(this.yearWithMonth).format('YYYY-MM'):''
+        },
         onSelectChange(selectedRowKeys, selectionRows) {
             this.selectedRowKeys = selectedRowKeys;
             this.selectedRows = selectionRows;

+ 31 - 157
src/views/oa/salary_management/Attendance/modules/AnnualLeave.vue

@@ -15,34 +15,17 @@
             <div class="table-page-search-wrapper">
                 <a-form-model layout="inline" ref="form" :model="formState" >
                     <a-row :gutter="24">
-                        <a-col :md="6" :sm="8">
+                        <a-col :md="8" :sm="8">
                             <a-form-model-item label="组织"  prop="name">
                                 <a-input  v-model="formState.orgName" />
                             </a-form-model-item>
                         </a-col>
-                        <a-col :md="6" :sm="8">
-                            <a-form-model-item label="考勤时间"  prop="totalNum">
-                                <a-input placeholder="" v-model="formState.DateTime" />
-                            </a-form-model-item>
-                        </a-col>
-                        <a-col :md="6" :sm="8">
-                            <a-form-model-item label="版本" >
-                                <a-input placeholder="请输入" v-model="formState.version"  />
-                            </a-form-model-item>
-                        </a-col>
-                        <a-col :md="6" :sm="8">
+                        <a-col :md="8" :sm="8">
                             <a-form-model-item label="姓名"  >
                                 <a-input placeholder="请输入" v-model="formState.name" />
                             </a-form-model-item>
                         </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :md="18" :sm="8"> 
-                            <a-form-model-item label="备注" >
-                                <a-input  placeholder="请输入" v-model="formState.remarks" />
-                            </a-form-model-item>
-                        </a-col>
-                        <a-col :md="6" :sm="8">
+                        <a-col :md="8" :sm="8">
                             <a-form-model-item label=""  >
                                 <a-button type="primary" icon="search" @click="searchSonList">查询</a-button>
                             </a-form-model-item>
@@ -54,7 +37,7 @@
                     :columns="columns"
                     :data-source="dataSource"
                     :loading="loading"
-                    :scroll="{x: 3500 ,y:300}"
+                    :scroll="{x: 1200 ,y:300}"
                     :pagination="false"
                 >
                 </a-table>
@@ -76,7 +59,7 @@
         data() {
           return {
               formState:{},
-              dataSource: [{}],
+              dataSource: [],
               visible:false,
               loading:false,
               columns: [
@@ -85,169 +68,51 @@
                     align: "center",
                     dataIndex: 'code',
                     ellipsis: true,
-                    width:'4%'
+                    width:'14%'
                 },
                 {
                     title: '姓名',
                     align: "center",
                     dataIndex: 'name',
                     ellipsis: true,
-                    width:'4%'
+                    width:'14%'
                 },
                 {
                     title: '组织',
                     align: "center",
                     dataIndex: 'orgName',
                     ellipsis: true,
-                    width:'4%'
+                    width:'14%'
                 },
                 {
                     title: '工资卡号',
                     align: "center",
                     dataIndex: 'cardNo',
                     ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '单双休',
-                    align: "center",
-                    dataIndex: 'restMode',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '工时/天',
-                    align: "center",
-                    dataIndex: 'workingHours',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '出勤天数',
-                    align: "center",
-                    dataIndex: 'attendanceDays',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '话费补贴',
-                    align: "center",
-                    dataIndex: 'phoneBill',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '午餐补贴',
-                    align: "center",
-                    dataIndex: 'lunch',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '住房补贴',
-                    align: "center",
-                    dataIndex: 'housingSubsidies',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '交通补贴',
-                    align: "center",
-                    dataIndex: 'transportation',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '全勤奖',
-                    align: "center",
-                    dataIndex: 'fullAttendance',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '养老保险',
-                    align: "center",
-                    dataIndex: 'endowmentInsurance',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '失业保险',
-                    align: "center",
-                    dataIndex: 'unemploymentInsurance',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '医疗保险',
-                    align: "center",
-                    dataIndex: 'medicalInsurance',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '公积金',
-                    align: "center",
-                    dataIndex: 'accumulationFund',
-                    ellipsis: true,
-                    width:'4%'
+                    width:'15%',
                 },
                 {
-                    title: '工资抵扣',
+                    title: '年假天数',
                     align: "center",
-                    dataIndex: 'deduction',
+                    dataIndex: 'annualLeave',
                     ellipsis: true,
-                    width:'4%'
+                    width:'14%'
                 },
                 {
-                    title: '迟到次数',
+                    title: '已请天数',
                     align: "center",
-                    dataIndex: 'latenessTimes',
+                    dataIndex: 'used',
                     ellipsis: true,
-                    width:'4%'
+                    width:'14%'
                 },
                 {
-                    title: '迟到扣费',
+                    title: '剩余天数',
                     align: "center",
-                    dataIndex: 'latenessCost',
+                    dataIndex: 'surplus',
                     ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '事假时间',
-                    align: "center",
-                    dataIndex: 'personalLeave',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '病假时间',
-                    align: "center",
-                    dataIndex: 'sickLeave',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '婚假时间',
-                    align: "center",
-                    dataIndex: 'marriageLeave',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '丧假时间',
-                    align: "center",
-                    dataIndex: 'funeralLeave',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '年假时间',
-                    align: "center",
-                    dataIndex: 'yearLeave',
-                    ellipsis: true,
-                    width:'4%'
+                    width:'14%'
                 },
+                
              ]
           }
         },
@@ -258,9 +123,18 @@
         methods: {
             handleCancel(){
                 this.visible = false
+                this.formState = {}
+                this.dataSource = []
             },
-            getTableList(id){
-                getAction('/salary/salaryAttendance/querySalaryAttendanceDetailByMainId',{id:id}).then(res=>{
+            detail(id){
+                this.formState = {}
+                this.formState.id = id
+                this.getTableList()
+            },
+            getTableList(){
+                this.loading = true
+                getAction('/salary/salaryAttendance/querySalaryAttendanceHolidayByMainId',this.formState).then(res=>{
+                    this.loading = false
                     if(res.success){
                         this.dataSource =res.result
                     }else{
@@ -269,7 +143,7 @@
                 })
             },
             searchSonList(){
-
+                this.getTableList()
             }
         }
     }

+ 6 - 21
src/views/oa/salary_management/Attendance/modules/AttendancelDetail.vue

@@ -15,34 +15,17 @@
             <div class="table-page-search-wrapper">
                 <a-form-model layout="inline" ref="form" :model="formState" >
                     <a-row :gutter="24">
-                        <a-col :md="6" :sm="8">
+                        <a-col :md="8" :sm="8">
                             <a-form-model-item label="组织"  prop="name">
                                 <a-input  v-model="formState.orgName" />
                             </a-form-model-item>
                         </a-col>
-                        <a-col :md="6" :sm="8">
-                            <a-form-model-item label="考勤时间"  prop="totalNum">
-                                <a-input placeholder="" v-model="formState.DateTime" />
-                            </a-form-model-item>
-                        </a-col>
-                        <a-col :md="6" :sm="8">
-                            <a-form-model-item label="版本" >
-                                <a-input placeholder="请输入" v-model="formState.version"  />
-                            </a-form-model-item>
-                        </a-col>
-                        <a-col :md="6" :sm="8">
+                        <a-col :md="8" :sm="8">
                             <a-form-model-item label="姓名"  >
                                 <a-input placeholder="请输入" v-model="formState.name" />
                             </a-form-model-item>
                         </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :md="18" :sm="8"> 
-                            <a-form-model-item label="备注" >
-                                <a-input  placeholder="请输入" v-model="formState.remarks" />
-                            </a-form-model-item>
-                        </a-col>
-                        <a-col :md="6" :sm="8">
+                        <a-col :md="8" :sm="8">
                             <a-form-model-item label=""  >
                                 <a-button type="primary" icon="search" @click="searchSonList">查询</a-button>
                             </a-form-model-item>
@@ -106,7 +89,7 @@
                     align: "center",
                     dataIndex: 'cardNo',
                     ellipsis: true,
-                    width:'4%'
+                    width:'5%'
                 },
                 {
                     title: '单双休',
@@ -260,7 +243,9 @@
                 this.visible = false
             },
             getTableList(id){
+                this.loading = true
                 getAction('/salary/salaryAttendance/querySalaryAttendanceDetailByMainId',{id:id}).then(res=>{
+                    this.loading = false
                     if(res.success){
                         this.dataSource =res.result
                     }else{

+ 43 - 100
src/views/oa/salary_management/Attendance/modules/OvertimeDetail.vue

@@ -15,34 +15,17 @@
             <div class="table-page-search-wrapper">
                 <a-form-model layout="inline" ref="form" :model="formState" >
                     <a-row :gutter="24">
-                        <a-col :md="6" :sm="8">
+                        <a-col :md="8" :sm="8">
                             <a-form-model-item label="组织"  prop="name">
                                 <a-input  v-model="formState.orgName" />
                             </a-form-model-item>
                         </a-col>
-                        <a-col :md="6" :sm="8">
-                            <a-form-model-item label="考勤时间"  prop="totalNum">
-                                <a-input placeholder="" v-model="formState.DateTime" />
-                            </a-form-model-item>
-                        </a-col>
-                        <a-col :md="6" :sm="8">
-                            <a-form-model-item label="版本" >
-                                <a-input placeholder="请输入" v-model="formState.version"  />
-                            </a-form-model-item>
-                        </a-col>
-                        <a-col :md="6" :sm="8">
+                        <a-col :md="8" :sm="8">
                             <a-form-model-item label="姓名"  >
                                 <a-input placeholder="请输入" v-model="formState.name" />
                             </a-form-model-item>
                         </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :md="18" :sm="8"> 
-                            <a-form-model-item label="备注" >
-                                <a-input  placeholder="请输入" v-model="formState.remarks" />
-                            </a-form-model-item>
-                        </a-col>
-                        <a-col :md="6" :sm="8">
+                        <a-col :md="8" :sm="8">
                             <a-form-model-item label=""  >
                                 <a-button type="primary" icon="search" @click="searchSonList">查询</a-button>
                             </a-form-model-item>
@@ -54,7 +37,7 @@
                     :columns="columns"
                     :data-source="dataSource"
                     :loading="loading"
-                    :scroll="{x: 3500 ,y:300}"
+                    :scroll="{x: 2500 ,y:300}"
                     :pagination="false"
                 >
                 </a-table>
@@ -106,145 +89,96 @@
                     align: "center",
                     dataIndex: 'cardNo',
                     ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '单双休',
-                    align: "center",
-                    dataIndex: 'restMode',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '工时/天',
-                    align: "center",
-                    dataIndex: 'workingHours',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '出勤天数',
-                    align: "center",
-                    dataIndex: 'attendanceDays',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '话费补贴',
-                    align: "center",
-                    dataIndex: 'phoneBill',
-                    ellipsis: true,
-                    width:'4%'
+                    width:'8%'
                 },
                 {
-                    title: '午餐补贴',
+                    title: '1月份',
                     align: "center",
-                    dataIndex: 'lunch',
+                    dataIndex: 'january',
                     ellipsis: true,
                     width:'4%'
                 },
                 {
-                    title: '住房补贴',
+                    title: '2月份',
                     align: "center",
-                    dataIndex: 'housingSubsidies',
+                    dataIndex: 'february',
                     ellipsis: true,
                     width:'4%'
                 },
                 {
-                    title: '交通补贴',
+                    title: '3月份',
                     align: "center",
-                    dataIndex: 'transportation',
+                    dataIndex: 'march',
                     ellipsis: true,
                     width:'4%'
                 },
                 {
-                    title: '全勤奖',
+                    title: '4月份',
                     align: "center",
-                    dataIndex: 'fullAttendance',
+                    dataIndex: 'april',
                     ellipsis: true,
                     width:'4%'
                 },
                 {
-                    title: '养老保险',
+                    title: '5月份',
                     align: "center",
-                    dataIndex: 'endowmentInsurance',
+                    dataIndex: 'may',
                     ellipsis: true,
                     width:'4%'
                 },
                 {
-                    title: '失业保险',
+                    title: '6月份',
                     align: "center",
-                    dataIndex: 'unemploymentInsurance',
+                    dataIndex: 'june',
                     ellipsis: true,
                     width:'4%'
                 },
                 {
-                    title: '医疗保险',
+                    title: '7月份',
                     align: "center",
-                    dataIndex: 'medicalInsurance',
+                    dataIndex: 'july',
                     ellipsis: true,
                     width:'4%'
                 },
                 {
-                    title: '公积金',
+                    title: '8月份',
                     align: "center",
-                    dataIndex: 'accumulationFund',
+                    dataIndex: 'august',
                     ellipsis: true,
                     width:'4%'
                 },
                 {
-                    title: '工资抵扣',
+                    title: '9月份',
                     align: "center",
-                    dataIndex: 'deduction',
+                    dataIndex: 'september',
                     ellipsis: true,
                     width:'4%'
                 },
                 {
-                    title: '迟到次数',
+                    title: '10月份',
                     align: "center",
-                    dataIndex: 'latenessTimes',
+                    dataIndex: 'october',
                     ellipsis: true,
                     width:'4%'
                 },
                 {
-                    title: '迟到扣费',
+                    title: '11月份',
                     align: "center",
-                    dataIndex: 'latenessCost',
+                    dataIndex: 'november',
                     ellipsis: true,
                     width:'4%'
                 },
                 {
-                    title: '事假时间',
+                    title: '12月份',
                     align: "center",
-                    dataIndex: 'personalLeave',
+                    dataIndex: 'december',
                     ellipsis: true,
                     width:'4%'
                 },
                 {
-                    title: '病假时间',
+                    title: '合计',
                     align: "center",
-                    dataIndex: 'sickLeave',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '婚假时间',
-                    align: "center",
-                    dataIndex: 'marriageLeave',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '丧假时间',
-                    align: "center",
-                    dataIndex: 'funeralLeave',
-                    ellipsis: true,
-                    width:'4%'
-                },
-                {
-                    title: '年假时间',
-                    align: "center",
-                    dataIndex: 'yearLeave',
+                    dataIndex: 'total',
                     ellipsis: true,
                     width:'4%'
                 },
@@ -258,9 +192,18 @@
         methods: {
             handleCancel(){
                 this.visible = false
+                this.formState ={}
+                this.dataSource =[]
             },
-            getTableList(id){
-                getAction('/salary/salaryAttendance/querySalaryAttendanceDetailByMainId',{id:id}).then(res=>{
+            detail(id){
+                this.formState = {}
+                this.formState.id=id
+                this.getTableList()
+            },
+            getTableList(){
+                this.loading = true
+                getAction('/salary/salaryAttendance/querySalaryAttendanceWorkOvertimeByMainId',this.formState).then(res=>{
+                    this.loading = false
                     if(res.success){
                         this.dataSource =res.result
                     }else{
@@ -269,7 +212,7 @@
                 })
             },
             searchSonList(){
-
+                this.getTableList()
             }
         }
     }

+ 9 - 3
src/views/oa/salary_management/Attendance/modules/uploadModal.vue

@@ -31,7 +31,7 @@
                         </a-col>
                         <a-col :md="24">
                             <a-form-model-item label="文件" >
-                                <a-upload name="file" :multiple="false"  action="/jeecg-boot/salary/salaryAttendance/importExcel" :before-upload="beforeUpload" @change="handleUploadChange" :data="{'yearWithMonth':formState.yearWithMonth,'type':formState.type}"  :headers="headers" >
+                                <a-upload name="file" :multiple="false"  action="/jeecg-boot/salary/salaryAttendance/importExcel" :before-upload="beforeUpload" @change="handleUploadChange" :data="{'yearWithMonth':formState.yearWithMonth,'type':formState.type}"  :headers="tokenHeader" >
                                     <a-button> <a-icon type="upload" /> 上  传 </a-button>
                                 </a-upload>
                             </a-form-model-item>
@@ -47,9 +47,11 @@
       import moment from 'moment'
       import pick from 'lodash.pick'
       import { FormTypes } from '@/utils/JEditableTableUtil'
+      import { JeecgListMixin } from '@/mixins/JeecgListMixin'
       import { putAction,getAction } from '@/api/manage'
       export default {
         name: 'uploadModal',
+        mixins: [JeecgListMixin],
         components: {
             moment,
         },
@@ -75,15 +77,19 @@
         methods: {
             handleCancel(){
                 this.visible = false
+                this.formState={
+                    type:'考勤表',
+                    yearWithMonth:moment().subtract(1, 'months')
+                }
             },
             handleOk(){
 
             },
             onChange(data){
-
+                debugger
             },
             beforeUpload(){
-                this.formState.yearWithMonth=moment(this.formState.yearMonth).format('YYYY-MM')
+                this.formState.yearWithMonth=moment(this.formState.yearWithMonth).format('YYYY-MM')
             },
             handleUploadChange({ file, fileList }){
                 if (file.status === 'done') {