UserPrizeList.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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.realname"></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 @click="openModal" placeholder="请点击选择部门" v-model="departNames" readOnly >
  15. <a-icon slot="prefix" type="cluster" title="部门选择控件"/>
  16. <a-icon v-if="queryParam.deptId!=null&&queryParam.deptId!=''" slot="suffix" type="close-circle" @click="handleEmpty" title="清空"/>
  17. </a-input>
  18. </a-form-item>
  19. </a-col>
  20. <template v-if="toggleSearchStatus">
  21. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  22. <a-form-item label="类型">
  23. <j-dict-select-tag v-model="queryParam.type" placeholder="请选择类型"
  24. dictCode="work_type" />
  25. </a-form-item>
  26. </a-col>
  27. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  28. <a-form-item label="备注">
  29. <a-input placeholder="请输入备注" v-model="queryParam.demo"></a-input>
  30. </a-form-item>
  31. </a-col>
  32. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  33. <a-form-item label="日期">
  34. <a-date-picker valueFormat="YYYY-MM-DD HH:mm:ss" showTime format='YYYY-MM-DD'
  35. v-model="queryParam.date" />
  36. </a-form-item>
  37. </a-col>
  38. </template>
  39. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  40. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  41. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  42. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  43. <a @click="handleToggleSearch" style="margin-left: 8px">
  44. {{ toggleSearchStatus ? '收起' : '展开' }}
  45. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  46. </a>
  47. </span>
  48. </a-col>
  49. </a-row>
  50. </a-form>
  51. </div>
  52. <!-- 操作按钮区域 -->
  53. <div class="table-operator">
  54. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  55. <a-button type="primary" icon="download" @click="handleExportXls('员工奖惩')">导出</a-button>
  56. <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  57. <a-button type="primary" icon="import">导入</a-button>
  58. </a-upload> -->
  59. <a-dropdown v-if="selectedRowKeys.length > 0">
  60. <a-menu slot="overlay">
  61. <a-menu-item key="1" @click="batchDel">
  62. <a-icon type="delete" />删除
  63. </a-menu-item>
  64. </a-menu>
  65. <a-button style="margin-left: 8px"> 批量操作
  66. <a-icon type="down" />
  67. </a-button>
  68. </a-dropdown>
  69. </div>
  70. <!-- table区域-begin -->
  71. <div>
  72. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  73. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
  74. style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  75. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  76. </div>
  77. <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
  78. :pagination="ipagination" :loading="loading" class="j-table-force-nowrap"
  79. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange">
  80. <span slot="action" slot-scope="text, record">
  81. <a @click="handleEdit(record)">编辑</a>
  82. <a-divider type="vertical" />
  83. <a-dropdown>
  84. <a class="ant-dropdown-link">更多
  85. <a-icon type="down" />
  86. </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. <userPrize-modal ref="modalForm" @ok="modalFormOk"></userPrize-modal>
  101. <depart-window ref="departWindow" @ok="modalFormOks"></depart-window>
  102. </a-card>
  103. </template>
  104. <script>
  105. import '@/assets/less/TableExpand.less'
  106. import UserPrizeModal from './modules/UserPrizeModal'
  107. import departWindow from './modules/DepartWindow'
  108. import {
  109. JeecgListMixin
  110. } from '@/mixins/JeecgListMixin'
  111. import moment from "moment"
  112. export default {
  113. name: "UserPrizeList",
  114. mixins: [JeecgListMixin],
  115. components: {
  116. UserPrizeModal,
  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: 'realname'
  142. },
  143. {
  144. title: '一级部门',
  145. align: "center",
  146. dataIndex: 'deptName'
  147. },
  148. {
  149. title: '二级部门',
  150. align: "center",
  151. dataIndex: 'deptName1'
  152. },
  153. {
  154. title: '三级部门',
  155. align: "center",
  156. dataIndex: 'deptName2'
  157. },
  158. {
  159. title: '类型',
  160. align: "center",
  161. dataIndex: 'type_dictText',
  162. },
  163. {
  164. title: '备注',
  165. align: "center",
  166. dataIndex: 'demo',
  167. ellipsis: true,
  168. },
  169. {
  170. title: '日期',
  171. align: "center",
  172. dataIndex: 'date',
  173. customRender: function(t, r, index) {
  174. return moment(t).format('YYYY-MM-DD');
  175. }
  176. },
  177. {
  178. title: '操作员',
  179. align: "center",
  180. dataIndex: 'createBy_dictText'
  181. },
  182. {
  183. title: '操作',
  184. dataIndex: 'action',
  185. align: "center",
  186. scopedSlots: {
  187. customRender: 'action'
  188. },
  189. }
  190. ],
  191. url: {
  192. list: "/userPrize/userPrize/list",
  193. delete: "/userPrize/userPrize/delete",
  194. deleteBatch: "/userPrize/userPrize/deleteBatch",
  195. exportXlsUrl: "userPrize/userPrize/exportXls",
  196. importExcelUrl: "userPrize/userPrize/importExcel",
  197. },
  198. }
  199. },
  200. computed: {
  201. importExcelUrl: function() {
  202. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  203. }
  204. },
  205. methods: {
  206. modalFormOks(formData) {
  207. if (formData.departIdList != null && formData.departIdList.length > 0) {
  208. for (let i = 0; i < formData.departIdList.length; i++) {
  209. this.queryParam.deptId=formData.departIdList[i].key;
  210. this.departNames =formData.departIdList[i].title;
  211. }
  212. }
  213. },
  214. openModal(){
  215. var ls=[];
  216. ls.push(this.queryParam.deptId);
  217. this.$refs.departWindow.add(ls, {});
  218. },
  219. handleEmpty(){
  220. this.queryParam.deptId=null;
  221. this.departNames=null;
  222. },
  223. }
  224. }
  225. </script>
  226. <style scoped>
  227. @import '~@assets/less/common.less';
  228. </style>