jiangping
2025-03-18 1b0cf0db5c82ea8308d2f338973a91555787c34d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<template>
  <TableLayout :permissions="['business:holidays:query']">
    <!-- 搜索表单 -->
    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
      <el-form-item label="日期" prop="holiday">
        <el-date-picker v-model="searchForm.holiday" value-format="yyyy-MM-dd" placeholder="请输入日期" @change="search"/>
      </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>
      <ul class="toolbar" v-permissions="['business:holidays:create']">
        <li><el-button type="primary" @click="$refs.operaHolidaysWindow.open('新建节假日')" icon="el-icon-plus" v-permissions="['business:holidays:create']">新建</el-button></li>
      </ul>
      <el-table
        v-loading="isWorking.search"
        :data="tableData.list"
        stripe
        border
      >
        <el-table-column prop="holiday" label="节假日日期" min-width="100px" align="center"></el-table-column>
        <el-table-column
          v-if="containPermissions(['business:holidays:update', 'business:holidays:delete'])"
          label="操作"
          min-width="120"
          fixed="right"
          align="center"
        >
          <template slot-scope="{row}">
            <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:holidays:delete']">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination
        @size-change="handleSizeChange"
        @current-change="handlePageChange"
        :pagination="tableData.pagination"
      >
      </pagination>
    </template>
    <!-- 新建/修改 -->
    <OperaHolidaysWindow ref="operaHolidaysWindow" @success="handlePageChange"/>
  </TableLayout>
</template>
 
<script>
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaHolidaysWindow from '@/components/business/OperaHolidaysWindow'
export default {
  name: 'Holidays',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaHolidaysWindow },
  data () {
    return {
      // 搜索
      searchForm: {
        id: '',
        createDate: '',
        creator: '',
        editDate: '',
        editor: '',
        isdeleted: '',
        info: '',
        holiday: ''
      }
    }
  },
  created () {
    this.config({
      module: '节假日配置表',
      api: '/business/holidays',
      'field.id': 'id',
      'field.main': 'id'
    })
    this.search()
  }
}
</script>