<template>
|
<div class='app'>
|
<a-tabs default-active-key='1' style='background-color: white;text-align: center' @change='tabChange'>
|
<a-tab-pane key='1' tab='周报'>
|
<a-card :bordered='false'>
|
<!-- 查询区域 -->
|
<div class='table-page-search-wrapper'>
|
<a-form :form="form" layout='inline'>
|
<a-row :gutter='24' type="flex" justify="center" align="top">
|
<a-col :md='16' :sm='16'>
|
<a-form-item label='时间区间'>
|
<a-range-picker
|
style='width: 100%'
|
v-model='queryParam.dateRange'
|
format='YYYY-MM-DD'
|
:placeholder="['开始时间', '结束时间']"
|
@change='onDateChange'>
|
</a-range-picker>
|
</a-form-item>
|
</a-col>
|
|
</a-row>
|
|
<a-row :gutter='24' type="flex" justify="center" align="top">
|
<a-col :md='16' :sm='16'>
|
<a-form-item label='选择部门'>
|
<j-select-depart v-model="queryParam.sysOrgCode" :trigger-change="true" customReturnField="orgCode" :multi="true"></j-select-depart>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
|
<a-row :gutter='24' type="flex" justify="center" align="top">
|
<a-col :md='16' :sm='16'>
|
<a-form-item label='选择项目'>
|
<j-select-multi-project v-model='queryParam.xm' />
|
</a-form-item>
|
</a-col>
|
</a-row>
|
|
<a-row :gutter='24' type="flex" justify="center" align="top">
|
<a-col :md='16' :sm='16'>
|
<a-form-item label='选择用户'>
|
<j-select-user-by-dep v-model='queryParam.user' :multi='true' />
|
</a-form-item>
|
</a-col>
|
</a-row>
|
|
|
<a-row :gutter='24' type="flex" justify="center" align="top">
|
<a-col :md='16' :sm='16'>
|
<a-form-item label='导出明细' style="text-align: left">
|
<a-radio-group v-model='queryParam.detailFlag' >
|
<a-radio :value='0'>
|
否
|
</a-radio>
|
<a-radio :value='1'>
|
是
|
</a-radio>
|
</a-radio-group>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
|
<a-row :gutter='24' type="flex" justify="center" align="top">
|
<a-col :md='16' :sm='16' >
|
<span style='float: right;overflow: hidden;' class='table-page-search-submitButtons'>
|
<a-button type='primary' @click='searchQuery' :loading="loading" icon='export'>导出</a-button>
|
<a-button type='primary' @click='searchReset' icon='reload' style='margin-left: 8px'>重置</a-button>
|
</span>
|
</a-col>
|
</a-row>
|
|
</a-form>
|
</div>
|
</a-card>
|
</a-tab-pane>
|
<a-tab-pane key='2' tab='绩效' force-render>
|
<a-card :bordered='false'>
|
<!-- 查询区域 -->
|
<div class='table-page-search-wrapper'>
|
<a-form :form="form2" layout='inline'>
|
<a-row :gutter='24' type="flex" justify="center" align="top">
|
<a-col :md='16' :sm='16'>
|
<a-form-item label='选择年份'>
|
<a-month-picker v-model='queryParam2.year' style='width: 100%' placeholder="选择年份" @change="onMonthChange" />
|
</a-form-item>
|
</a-col>
|
|
<a-col :md='16' :sm='16' style="text-align: left">
|
<a-form-item label='选择季度'>
|
<a-radio-group v-model='queryParam2.quarter' @change='onQuarterChange'>
|
<a-radio :value='0'>
|
全年
|
</a-radio>
|
<a-radio :value='1'>
|
一季度
|
</a-radio>
|
<a-radio :value='2'>
|
二季度
|
</a-radio>
|
<a-radio :value='3'>
|
三季度
|
</a-radio>
|
<a-radio :value='4'>
|
四季度
|
</a-radio>
|
</a-radio-group>
|
</a-form-item>
|
</a-col>
|
|
</a-row>
|
|
<a-row :gutter='24' type="flex" justify="center" align="top">
|
<a-col :md='16' :sm='16'>
|
<a-form-item label='选择部门'>
|
<j-select-depart v-model="queryParam2.sysOrgCode" :trigger-change="true" customReturnField="orgCode" :multi="true"></j-select-depart>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
|
|
|
<a-row :gutter='24' type="flex" justify="center" align="top">
|
<a-col :md='16' :sm='16'>
|
<a-form-item label='选择用户'>
|
<j-select-user-by-dep v-model='queryParam2.user' :multi='true' />
|
</a-form-item>
|
</a-col>
|
</a-row>
|
|
<a-row :gutter='24' type="flex" justify="center" align="top">
|
<a-col :md='16' :sm='16' >
|
<span style='float: right;overflow: hidden;' class='table-page-search-submitButtons'>
|
<a-button type='primary' @click='searchQuery2' :loading="loading" icon='export'>导出</a-button>
|
<a-button type='primary' @click='searchReset2' icon='reload' style='margin-left: 8px'>重置</a-button>
|
</span>
|
</a-col>
|
</a-row>
|
|
</a-form>
|
</div>
|
</a-card>
|
</a-tab-pane>
|
|
</a-tabs>
|
</div>
|
</template>
|
|
<script>
|
import get from 'lodash.get'
|
import JSelectMultiProject from '@comp/jeecgbiz/JSelectMultiProject'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import { getLastWeek, getWeek } from '@/utils/util'
|
import moment from 'moment'
|
import { getAction } from '@api/manage'
|
export default {
|
name: 'RightExportWeekly',
|
components:{JSelectMultiProject},
|
mixins: [JeecgListMixin],
|
data(){
|
return{
|
loading:false,
|
queryParam:{
|
detailFlag:0
|
},
|
queryParam2:{},
|
//默认查询全年
|
queryQuarter:2,
|
form: this.$form.createForm(this),
|
form2: this.$form.createForm(this),
|
disableMixinCreated:true,
|
url: {
|
exportUrl: "/wek/record/exportWeekly",
|
exportEvaluateUrl: "/wek/evaluate/exportEvaluate",
|
}
|
}
|
},
|
created() {
|
//默认查询上周数据
|
let lastWeek = getLastWeek(1)
|
this.initQuery(lastWeek.start, lastWeek.end)
|
let week = getWeek()
|
let quarter = moment().quarter()
|
|
this.queryParam2.year = week.yearNo +"-01"
|
this.queryParam2.quarter = quarter
|
|
},
|
methods:{
|
onQuarterChange(e){
|
let quarter = e.target.value
|
this.queryParam2.quarter = quarter
|
console.info(quarter)
|
console.info(this.queryParam2.quarter)
|
this.$forceUpdate()
|
},
|
onDateChange: function(value, dateString) {
|
this.queryParam.ksrq = dateString[0]
|
this.queryParam.jsrq = dateString[1]
|
this.$forceUpdate()
|
},
|
searchReset() {
|
this.queryParam = {
|
detailFlag:0
|
}
|
let lastWeek = getLastWeek(1)
|
this.initQuery(lastWeek.start, lastWeek.end)
|
},
|
searchReset2() {
|
this.queryParam2 = {}
|
let week = getWeek()
|
this.queryParam2.year = week.yearNo +"-01"
|
let quarter = moment().quarter()
|
this.queryParam2.quarter = quarter
|
this.$forceUpdate()
|
},
|
|
|
initQuery(start, end) {
|
this.queryParam.ksrq = start
|
this.queryParam.jsrq = end
|
this.queryParam.dateRange = [
|
moment(start, this.dateFormat),
|
moment(end, this.dateFormat)
|
]
|
this.$forceUpdate()
|
},
|
searchQuery(){
|
|
let params = Object.assign({}, this.queryParam)
|
if(params.dateRange){
|
delete params.dateRange; //范围参数不传递后台
|
}
|
this.loading = true
|
let that = this
|
getAction(this.url.exportUrl,params).then((res) => {
|
console.info(res)
|
if (res.success) {
|
const size = get(res, 'result.size') || 0;
|
this.openNotification("success",'查询到'+size+'条数据,正在导出文件!')
|
this.down(res.result.filePath)
|
}else {
|
this.openNotification("error",res.message)
|
}
|
}).finally(() => {
|
setTimeout(function() {
|
that.loading = false
|
},1000)
|
|
})
|
|
},
|
searchQuery2(){
|
|
let params = Object.assign({}, this.queryParam2)
|
if(params.year){
|
params.year = params.year.slice(0,4)
|
}
|
this.loading = true
|
let that = this
|
getAction(this.url.exportEvaluateUrl,params).then((res) => {
|
console.info(res)
|
if (res.success) {
|
const size = get(res, 'result.size') || 0;
|
this.openNotification("success",'查询到'+size+'条数据,正在导出文件!')
|
this.down(res.result.filePath)
|
}else {
|
this.openNotification("error",res.message + "")
|
}
|
}).finally(() => {
|
setTimeout(function() {
|
that.loading = false
|
},1000)
|
|
})
|
|
},
|
//提示
|
openNotification(type,message) {
|
this.$notification[type]({
|
message: '提示',
|
description:
|
message,
|
duration: 5,
|
});
|
},
|
|
down(url){
|
this.downloadFile(url +"?time="+ new Date().getTime())
|
},
|
tabChange(){
|
|
},
|
onMonthChange(date, dateString) {
|
console.log(date, dateString);
|
this.queryParam2.year = dateString
|
this.$forceUpdate()
|
},
|
}
|
}
|
</script>
|
|
<style lang='less' scoped>
|
|
.app{
|
width: 100%;
|
height: 100%;
|
background: white;
|
min-height: calc(100vh - 140px);
|
}
|
|
</style>
|