|
@@ -7,13 +7,7 @@
|
|
<a-row :gutter="24">
|
|
<a-row :gutter="24">
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
<a-form-item label="时间">
|
|
<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-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
@@ -77,7 +71,7 @@
|
|
<script>
|
|
<script>
|
|
|
|
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
- import { getAction } from '@/api/manage'
|
|
|
|
|
|
+ import { getAction,downFile} from '@/api/manage'
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
import AttendancelDetail from './modules/AttendancelDetail.vue'
|
|
import AttendancelDetail from './modules/AttendancelDetail.vue'
|
|
import OvertimeDetail from './modules/OvertimeDetail.vue'
|
|
import OvertimeDetail from './modules/OvertimeDetail.vue'
|
|
@@ -98,6 +92,7 @@
|
|
DateTime:[],
|
|
DateTime:[],
|
|
selectedRowKeys:[],
|
|
selectedRowKeys:[],
|
|
selectedRows:[],
|
|
selectedRows:[],
|
|
|
|
+ yearWithMonth:'',
|
|
// 表头
|
|
// 表头
|
|
columns: [
|
|
columns: [
|
|
{
|
|
{
|
|
@@ -127,7 +122,7 @@
|
|
{
|
|
{
|
|
title: '上传时间',
|
|
title: '上传时间',
|
|
align:"center",
|
|
align:"center",
|
|
- dataIndex: 'updateTime'
|
|
|
|
|
|
+ dataIndex: 'createTime'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '版本',
|
|
title: '版本',
|
|
@@ -152,11 +147,6 @@
|
|
this.getTableList()
|
|
this.getTableList()
|
|
},
|
|
},
|
|
methods: {
|
|
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(){
|
|
searchQuery(){
|
|
this.queryParam.pageNo =1
|
|
this.queryParam.pageNo =1
|
|
this.getTableList()
|
|
this.getTableList()
|
|
@@ -166,7 +156,9 @@
|
|
this.getTableList()
|
|
this.getTableList()
|
|
},
|
|
},
|
|
getTableList(){
|
|
getTableList(){
|
|
|
|
+ this.loading = true
|
|
getAction('/salary/salaryAttendance/list',this.queryParam).then(res=>{
|
|
getAction('/salary/salaryAttendance/list',this.queryParam).then(res=>{
|
|
|
|
+ this.loading = false
|
|
if(res.success){
|
|
if(res.success){
|
|
this.dataSource =res.result.records
|
|
this.dataSource =res.result.records
|
|
this.ipagination = {
|
|
this.ipagination = {
|
|
@@ -188,16 +180,39 @@
|
|
this.$refs.AttendancelDetail.getTableList(record.id)
|
|
this.$refs.AttendancelDetail.getTableList(record.id)
|
|
}else if(record.type=='加班表'){
|
|
}else if(record.type=='加班表'){
|
|
this.$refs.OvertimeDetail.visible = true
|
|
this.$refs.OvertimeDetail.visible = true
|
|
- this.$refs.OvertimeDetail.getTableList(record.id)
|
|
|
|
|
|
+ this.$refs.OvertimeDetail.detail(record.id)
|
|
}else if(record.type=='年休表'){
|
|
}else if(record.type=='年休表'){
|
|
this.$refs.AnnualLeave.visible = true
|
|
this.$refs.AnnualLeave.visible = true
|
|
- this.$refs.AnnualLeave.getTableList(record.id)
|
|
|
|
|
|
+ this.$refs.AnnualLeave.detail(record.id)
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
handleDownload(record){
|
|
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) {
|
|
onSelectChange(selectedRowKeys, selectionRows) {
|
|
this.selectedRowKeys = selectedRowKeys;
|
|
this.selectedRowKeys = selectedRowKeys;
|
|
this.selectedRows = selectionRows;
|
|
this.selectedRows = selectionRows;
|