StatutoryLeaveList.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="假期名称">
  9. <a-input placeholder="请输入假期名称" v-model="queryParam.name"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <a-form-item label="日薪资倍数">
  14. <a-input placeholder="请输入日薪资倍数" v-model="queryParam.sum"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  19. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  20. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  21. <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
  22. {{ toggleSearchStatus ? '收起' : '展开' }}
  23. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  24. </a> -->
  25. </span>
  26. </a-col>
  27. </a-row>
  28. </a-form>
  29. </div>
  30. <!-- 操作按钮区域 -->
  31. <div class="table-operator">
  32. <a-button @click="handleAdd" type="primary" icon="plus" v-has="'leave:add'">新增</a-button>
  33. <a-button type="primary" icon="download" @click="handleExportXls('法定假期')">导出</a-button>
  34. <!--<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  35. <a-button type="primary" icon="import">导入</a-button>
  36. </a-upload> -->
  37. <a-dropdown v-if="selectedRowKeys.length > 0">
  38. <a-menu slot="overlay" v-has="'leave:deletes'">
  39. <a-menu-item key="1" @click="batchDel">
  40. <a-icon type="delete" />删除
  41. </a-menu-item>
  42. </a-menu>
  43. <a-button style="margin-left: 8px"> 批量操作
  44. <a-icon type="down" />
  45. </a-button>
  46. </a-dropdown>
  47. </div>
  48. <!-- table区域-begin -->
  49. <div>
  50. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  51. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
  52. style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  53. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  54. </div>
  55. <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
  56. :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" @change="handleTableChange"
  57. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
  58. <span slot="action" slot-scope="text, record">
  59. <a @click="handleEdit(record)" v-has="'leave:edit'">编辑</a>
  60. <a-divider type="vertical" />
  61. <a-dropdown>
  62. <a class="ant-dropdown-link">更多
  63. <a-icon type="down" />
  64. </a>
  65. <a-menu slot="overlay" v-has="'leave:delete'">
  66. <a-menu-item>
  67. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  68. <a>删除</a>
  69. </a-popconfirm>
  70. </a-menu-item>
  71. </a-menu>
  72. </a-dropdown>
  73. </span>
  74. </a-table>
  75. </div>
  76. <!-- table区域-end -->
  77. <!-- 表单区域 -->
  78. <statutoryLeave-modal ref="modalForm" @ok="modalFormOk"></statutoryLeave-modal>
  79. </a-card>
  80. </template>
  81. <script>
  82. import '@/assets/less/TableExpand.less'
  83. import StatutoryLeaveModal from './modules/StatutoryLeaveModal'
  84. import {
  85. JeecgListMixin
  86. } from '@/mixins/JeecgListMixin'
  87. import moment from "moment"
  88. export default {
  89. name: "StatutoryLeaveList",
  90. mixins: [JeecgListMixin],
  91. components: {
  92. StatutoryLeaveModal
  93. },
  94. data() {
  95. return {
  96. description: '法定假期管理页面',
  97. // 表头
  98. columns: [
  99. // {
  100. // title: '#',
  101. // dataIndex: '',
  102. // key:'rowIndex',
  103. // width:60,
  104. // align:"center",
  105. // customRender:function (t,r,index) {
  106. // return parseInt(index)+1;
  107. // }
  108. // },
  109. {
  110. title: '假期名称',
  111. align: "center",
  112. dataIndex: 'name'
  113. },
  114. {
  115. title: '类型',
  116. align: "center",
  117. dataIndex: 'type',
  118. },
  119. {
  120. title: '是否法节',
  121. align: "center",
  122. dataIndex: 'isF',
  123. },
  124. {
  125. title: '假期时间',
  126. align: "center",
  127. dataIndex: 'startDate',
  128. customRender: function(t, r, index) {
  129. return moment(t).format('YYYY-MM-DD');
  130. }
  131. },
  132. /* {
  133. title: '假期结束时间',
  134. align: "center",
  135. dataIndex: 'endDate',
  136. customRender: function(t, r, index) {
  137. return moment(t).format('YYYY-MM-DD');
  138. }
  139. }, */
  140. {
  141. title: '日薪资倍数',
  142. align: "center",
  143. dataIndex: 'sum'
  144. },
  145. {
  146. title: '操作',
  147. dataIndex: 'action',
  148. align: "center",
  149. scopedSlots: {
  150. customRender: 'action'
  151. },
  152. }
  153. ],
  154. url: {
  155. list: "/statutoryleave/statutoryLeave/list",
  156. delete: "/statutoryleave/statutoryLeave/delete",
  157. deleteBatch: "/statutoryleave/statutoryLeave/deleteBatch",
  158. exportXlsUrl: "statutoryleave/statutoryLeave/exportXls",
  159. importExcelUrl: "statutoryleave/statutoryLeave/importExcel",
  160. },
  161. }
  162. },
  163. computed: {
  164. importExcelUrl: function() {
  165. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  166. }
  167. },
  168. methods: {
  169. }
  170. }
  171. </script>
  172. <style scoped>
  173. @import '~@assets/less/common.less';
  174. </style>