SysPositionList.vue 6.0 KB

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