代码更新

This commit is contained in:
2022-10-20 21:14:06 +08:00
parent 910adcfd5b
commit 42e40b2f48
14 changed files with 363 additions and 40 deletions

View File

@@ -38,7 +38,18 @@
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-check"
size="mini"
@click="downdtl"
>
导出Excel
</el-button>
</crudOperation>
<!--表格渲染-->
<el-table
ref="table"
@@ -68,6 +79,8 @@ import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker'
import {download} from "@/api/data";
import {downloadFile} from "@/utils";
export default {
name: 'Performancemst',
@@ -106,6 +119,22 @@ export default {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
return true
},
downdtl() {
if (this.currentRow !== null) {
crud.downloadLoading = true
const data = {
'begin_time': this.crud.query.createTime[0],
'end_time': this.crud.query.createTime[1],
'assessor_id': this.crud.query.assessor_id
}
download('/api/performancemst/download', data).then(result => {
downloadFile(result, '工作量统计', 'xlsx')
crud.downloadLoading = false
}).catch(() => {
crud.downloadLoading = false
})
}
}
}
}