SysPositionList.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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 @click="openModal" placeholder="请点击选择部门" v-model="departNames" readOnly>
  26. <a-icon slot="prefix" type="cluster" title="部门选择控件" />
  27. <a-icon v-if="queryParam.deptId!=null&&queryParam.deptId!=''" slot="suffix" type="close-circle"
  28. @click="handleEmpty" title="清空" />
  29. </a-input>
  30. </a-form-item>
  31. </a-col>
  32. </template>
  33. <a-col :md="6" :sm="8">
  34. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  35. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  36. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  37. <a @click="handleToggleSearch" style="margin-left: 8px">
  38. {{ toggleSearchStatus ? '收起' : '展开' }}
  39. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  40. </a>
  41. </span>
  42. </a-col>
  43. </a-row>
  44. </a-form>
  45. </div>
  46. <!-- 操作按钮区域 -->
  47. <div class="table-operator">
  48. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  49. <a-button type="primary" icon="download" @click="handleExportXls('职位信息')">导出</a-button>
  50. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  51. <a-button type="primary" icon="import">导入</a-button>
  52. </a-upload>
  53. <a-dropdown v-if="selectedRowKeys.length > 0">
  54. <a-menu slot="overlay">
  55. <a-menu-item key="1" @click="batchDel">
  56. <a-icon type="delete"/>
  57. 删除
  58. </a-menu-item>
  59. </a-menu>
  60. <a-button style="margin-left: 8px"> 批量操作
  61. <a-icon type="down"/>
  62. </a-button>
  63. </a-dropdown>
  64. </div>
  65. <!-- table区域-begin -->
  66. <div>
  67. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  68. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  69. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  70. </div>
  71. <a-table
  72. ref="table"
  73. size="middle"
  74. bordered
  75. rowKey="id"
  76. :columns="columns"
  77. :dataSource="dataSource"
  78. :pagination="ipagination"
  79. :loading="loading"
  80. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  81. @change="handleTableChange">
  82. <span slot="action" slot-scope="text, record">
  83. <a @click="handleEdit(record)">编辑</a>
  84. <a-divider type="vertical"/>
  85. <a-dropdown>
  86. <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
  87. <a-menu slot="overlay">
  88. <a-menu-item>
  89. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  90. <a>删除</a>
  91. </a-popconfirm>
  92. </a-menu-item>
  93. </a-menu>
  94. </a-dropdown>
  95. </span>
  96. </a-table>
  97. </div>
  98. <!-- table区域-end -->
  99. <!-- 表单区域 -->
  100. <sysPosition-modal ref="modalForm" @ok="modalFormOk"></sysPosition-modal>
  101. <depart-window ref="departWindow" @ok="modalFormOks"></depart-window>
  102. </a-card>
  103. </template>
  104. <script>
  105. import SysPositionModal from './modules/SysPositionModal'
  106. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  107. import JDictSelectTag from '@/components/dict/JDictSelectTag'
  108. import departWindow from './modules/DepartWindow'
  109. import JTreeSelect from '@/components/jeecg/JTreeSelect'
  110. export default {
  111. name: 'SysPositionList',
  112. mixins: [JeecgListMixin],
  113. components: {
  114. SysPositionModal,
  115. JDictSelectTag,
  116. JTreeSelect,
  117. departWindow
  118. },
  119. data() {
  120. return {
  121. description: '职位表管理页面',
  122. departNames:null,
  123. queryParam:{
  124. deptId:null,
  125. },
  126. // 表头
  127. columns: [
  128. {
  129. title: '#',
  130. dataIndex: '',
  131. key: 'rowIndex',
  132. width: 60,
  133. align: 'center',
  134. customRender: function (t, r, index) {
  135. return parseInt(index) + 1
  136. }
  137. },
  138. {
  139. title: '职位编码',
  140. align: 'center',
  141. dataIndex: 'code'
  142. },
  143. {
  144. title: '职位名称',
  145. align: 'center',
  146. dataIndex: 'name'
  147. },
  148. // {
  149. // title: '职级',
  150. // align: 'center',
  151. // dataIndex: 'postRank_dictText'
  152. // },
  153. {
  154. title: '一级部门',
  155. align: 'center',
  156. dataIndex: 'deptName1'
  157. },
  158. {
  159. title: '二级部门',
  160. align: 'center',
  161. dataIndex: 'deptName2'
  162. },
  163. {
  164. title: '三级部门',
  165. align: 'center',
  166. dataIndex: 'deptName3'
  167. },
  168. // {
  169. // title: '公司id',
  170. // align: 'center',
  171. // dataIndex: 'companyId'
  172. // },
  173. {
  174. title: '操作',
  175. dataIndex: 'action',
  176. align: 'center',
  177. scopedSlots: { customRender: 'action' },
  178. }
  179. ],
  180. url: {
  181. list: '/sys/position/lists',
  182. delete: '/sys/position/delete',
  183. deleteBatch: '/sys/position/deleteBatch',
  184. exportXlsUrl: '/sys/position/exportXls',
  185. importExcelUrl: 'sys/position/importExcel',
  186. },
  187. }
  188. },
  189. computed: {
  190. importExcelUrl: function () {
  191. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  192. }
  193. },
  194. methods: {
  195. modalFormOks(formData) {
  196. if (formData.departIdList != null && formData.departIdList.length > 0) {
  197. for (let i = 0; i < formData.departIdList.length; i++) {
  198. this.queryParam.deptId=formData.departIdList[i].key;
  199. this.departNames =formData.departIdList[i].title;
  200. }
  201. }
  202. },
  203. openModal(){
  204. var ls=[];
  205. ls.push(this.queryParam.deptId);
  206. this.$refs.departWindow.add(ls, {});
  207. },
  208. handleEmpty(){
  209. this.queryParam.deptId=null;
  210. this.departNames=null;
  211. },
  212. },
  213. }
  214. </script>
  215. <style scoped>
  216. @import '~@assets/less/common.less'
  217. </style>