| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <template>
- <div>
- <!-- 头部展示 -->
- <!-- <div class="headWrap">
- <div class="left">
- <div class="headItem">
- <p>本月请假:<span>12345</span></p>
- </div>
- </div>
- <div class="right">
- </div>
- </div> -->
- <!-- 搜索标题 -->
- <el-form :inline="true"
- class="searchForm"
- v-model.trim="searchForm">
- <el-form-item>
- <el-date-picker style="width: 400px;"
- v-model.trim="courseDate"
- type="daterange"
- value-format="yyyy-MM-dd"
- @change="searchCourseDate"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button @click="search"
- type="danger">搜索</el-button>
- <el-button @click="onReSet"
- type="primary">重置</el-button>
- </el-form-item>
- </el-form>
- <!-- 列表 -->
- <div class="tableWrap">
- <el-table :data='tableList'
- :header-cell-style="{background:'#EDEEF0',color:'#444'}">
- <el-table-column align='center'
- prop="createTime"
- label="请假发起时间">
- <template slot-scope="scope">
- <div>
- {{ scope.row.createTime |dateForMinFormat}}
- </div>
- </template>
- </el-table-column>
- <el-table-column align='center'
- label="请假时间">
- <template slot-scope="scope">
- {{ scope.row.startTime |dateForMinFormat}} - {{ scope.row.endTime |dateForMinFormat}}
- </template>
- </el-table-column>
- <el-table-column align='center'
- prop="remark"
- label="请假说明">
- </el-table-column>
- </el-table>
- <pagination :total="pageInfo.total"
- :page.sync="pageInfo.page"
- :limit.sync="pageInfo.limit"
- :page-sizes="pageInfo.page_size"
- @pagination="getList" />
- </div>
- </div>
- </template>
- <script>
- import { teacherLeaveRecordQuery } from '@/api/teacherManager'
- import pagination from '@/components/Pagination/index'
- import store from '@/store'
- import { attendance } from '@/utils/searchArray'
- export default {
- name: 'leaveRecord',
- components: {
- pagination
- },
- data () {
- return {
- attendance: attendance,
- courseDate: null,
- searchForm: {
- startTime: null,
- endTime: null,
- status: 'PASS'
- },
- tableList: [],
- tableList: [],
- organId: null,
- teacherId: this.$route.query.teacherId,
- pageInfo: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 1, // 总条数
- page_size: [10, 20, 40, 50] // 选择限制显示条数
- }
- }
- },
- mounted () {
- this.getList()
- },
- activated () {
- this.teacherId = this.$route.query.teacherId
- this.getList()
- },
- methods: {
- search () {
- this.pageInfo.page = 1
- this.getList()
- },
- getList () {
- let params = this.searchForm
- params.rows = this.pageInfo.limit
- params.page = this.pageInfo.page,
- params.teacherId = this.teacherId
- teacherLeaveRecordQuery(params).then(res => {
- if (res.code == 200) {
- this.tableList = res.data.rows
- this.pageInfo.total = res.data.total
- }
- })
- },
- searchCourseDate (value) {
- if (value) {
- this.searchForm.startTime = value[0]
- this.searchForm.endTime = value[1]
- } else {
- this.searchForm.startTime = null
- this.searchForm.endTime = null
- }
- },
- onReSet () {
- this.courseDate = null
- this.searchForm = {
- startTime: null,
- endTime: null,
- }
- }
- }
- }
- </script>
- <style lang="scss">
- </style>
|