| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:rooms:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="人å" prop="userId"> |
| | | <el-select |
| | | v-model="searchForm.userId" |
| | | clearable |
| | | filterable |
| | | placeholder="éæ©äººå" |
| | | > |
| | | <el-option |
| | | v-for="item in sysList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.department?`${item.department.name}-${item.realname}`:item.realname" |
| | | ></el-option> |
| | | <!-- :label="item.name" --> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="年份" prop="yearNum"> |
| | | <el-select |
| | | v-model="searchForm.yearNum" |
| | | clearable |
| | | placeholder="鿩年份" |
| | | > |
| | | <el-option |
| | | v-for="item in years" |
| | | :key="item" |
| | | :value="item" |
| | | :label="`${item}å¹´`" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | </section> |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <!-- v-permissions="['business:rooms:create', 'business:rooms:delete']" --> |
| | | <ul class="toolbar" > |
| | | <!-- v-permissions="['business:rooms:exportExcel']" --> |
| | | <li><el-button :loading="isWorking.export" @click="exportExcel">导åº</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | border |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <!-- <el-table-column prop="roomName" label="ä¼è®®å®¤" align="center" min-width="100px"></el-table-column> --> |
| | | <el-table-column prop="realname" label="å§å" align="center" min-width="100px"></el-table-column> |
| | | <el-table-column prop="januaryCount" label="䏿" align="center" min-width="120px"> |
| | | <template slot-scope="{row}"> |
| | | {{ `${row.januaryCount}H` }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="januaryCount" label="äºæ" align="center" min-width="120px"> |
| | | <template slot-scope="{row}"> |
| | | {{ `${row.februaryCount}H` }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="januaryCount" label="䏿" align="center" min-width="120px"> |
| | | <template slot-scope="{row}"> |
| | | {{ `${row.marchCount}H` }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="januaryCount" label="åæ" align="center" min-width="120px"> |
| | | <template slot-scope="{row}"> |
| | | {{ `${row.aprilCount}H` }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="januaryCount" label="äºæ" align="center" min-width="120px"> |
| | | <template slot-scope="{row}"> |
| | | {{ `${row.mayCount}H` }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="januaryCount" label="å
æ" align="center" min-width="120px"> |
| | | <template slot-scope="{row}"> |
| | | {{ `${row.juneCount}H` }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="januaryCount" label="䏿" align="center" min-width="120px"> |
| | | <template slot-scope="{row}"> |
| | | {{ `${row.julyCount}H` }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="januaryCount" label="å
«æ" align="center" min-width="120px"> |
| | | <template slot-scope="{row}"> |
| | | {{ `${row.augustCount}H` }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="januaryCount" label="乿" align="center" min-width="120px"> |
| | | <template slot-scope="{row}"> |
| | | {{ `${row.septemberCount}H` }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="januaryCount" label="åæ" align="center" min-width="120px"> |
| | | <template slot-scope="{row}"> |
| | | {{ `${row.octoberCount}H` }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="januaryCount" label="å䏿" align="center" min-width="120px"> |
| | | <template slot-scope="{row}"> |
| | | {{ `${row.novemberCount}H` }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="januaryCount" label="åäºæ" align="center" min-width="120px"> |
| | | <template slot-scope="{row}"> |
| | | {{ `${row.decemberCount}H` }} |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | ></pagination> |
| | | </template> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import { getUserStatistics, exportUserStatistics } from '@/api/meeting/bookings' |
| | | import { fetchList as userList } from '@/api/system/user' |
| | | |
| | | export default { |
| | | name: 'Rooms', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination }, |
| | | data () { |
| | | return { |
| | | years: [ |
| | | '2021', '2022', '2023' |
| | | ], |
| | | sysList: [], |
| | | // æç´¢ |
| | | searchForm: { |
| | | yearNum: '', |
| | | userId: '' |
| | | } |
| | | } |
| | | }, |
| | | |
| | | created () { |
| | | this.config({ |
| | | module: 'ä¼è®®å®¤ä¿¡æ¯è¡¨', |
| | | api: '/meeting/rooms', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | let tempYear = new Date().getFullYear() |
| | | this.searchForm.yearNum = tempYear |
| | | this.years = [tempYear-2, tempYear-1, tempYear] |
| | | |
| | | // findList({}) |
| | | // .then(res => { |
| | | // this.rooms = res |
| | | // }) |
| | | userList({ |
| | | page: 1, |
| | | capacity: 9999, |
| | | model: { realname: this.filterText }, |
| | | }) |
| | | .then(res => { |
| | | console.log('userList', res); |
| | | this.sysList = res.records |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | // 导åºExcel |
| | | exportExcel () { |
| | | this.__checkApi() |
| | | this.$dialog.exportConfirm('确认导åºåï¼') |
| | | .then(() => { |
| | | this.isWorking.export = true |
| | | exportUserStatistics({ |
| | | page: this.tableData.pagination.pageIndex, |
| | | capacity: 1000000, |
| | | model: this.searchForm, |
| | | sorts: this.tableData.sorts |
| | | }) |
| | | .then(response => { |
| | | this.download(response) |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.export = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | handlePageChange (pageIndex) { |
| | | this.__checkApi() |
| | | this.tableData.pagination.pageIndex = pageIndex || this.tableData.pagination.pageIndex |
| | | this.isWorking.search = true |
| | | getUserStatistics({ |
| | | page: this.tableData.pagination.pageIndex, |
| | | capacity: this.tableData.pagination.pageSize, |
| | | model: this.searchForm, |
| | | sorts: this.tableData.sorts |
| | | }) |
| | | .then(data => { |
| | | this.tableData.list = data.records |
| | | this.tableData.pagination.total = data.total |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.search = false |
| | | }) |
| | | }, |
| | | // selectMemberAction() { |
| | | // console.log('21212'); |
| | | // this.$refs.selectMember.open('éæ©ç®¡çå') |
| | | // }, |
| | | changeStatus(item) { |
| | | updateById({ |
| | | id: item.id, |
| | | status: item.status |
| | | }).then(res => { |
| | | this.search() |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | ::v-deep .el-input.is-disabled .el-input__inner { |
| | | background-color: #fff !important; |
| | | cursor: pointer; |
| | | } |
| | | </style> |