index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. <template>
  2. <div class="card-search">
  3. <a-form
  4. ref="formRef"
  5. name="advanced_search"
  6. class="ant-advanced-search-form"
  7. :model="searchParamsState"
  8. >
  9. <a-row :gutter="24">
  10. <a-col :span="6">
  11. <a-form-item label="姓名" :label-col="{ span: 8 }" name="name">
  12. <a-input v-model:value="searchParamsState.name" placeholder="" :allow-clear="true"/>
  13. </a-form-item>
  14. </a-col>
  15. <a-col :span="6">
  16. <a-form-item label="所属驿站" :label-col="{ span: 8 }" name="siteID">
  17. <a-select
  18. ref="select"
  19. v-model:value="searchParamsState.siteID"
  20. :options="siteList"
  21. :field-names="{ label: 'siteName', value: 'siteID' }"
  22. :allow-clear="true"
  23. @change="loadData"
  24. >
  25. </a-select>
  26. </a-form-item>
  27. </a-col>
  28. <a-col :span="6">
  29. <a-form-item label="就业状态" :label-col="{ span: 8 }" name="jobStatus">
  30. <a-select
  31. ref="select"
  32. v-model:value="searchParamsState.jobStatus"
  33. :options="jobStatusList"
  34. :field-names="{ label: 'name', value: 'value' }"
  35. :allow-clear="true"
  36. @change="loadData"
  37. >
  38. </a-select>
  39. </a-form-item>
  40. </a-col>
  41. <a-col :span="6" style="text-align: left">
  42. <a-button type="primary" html-type="submit" @click="onFinish">查询</a-button>
  43. <a-button
  44. style="margin: 0 8px"
  45. @click="
  46. () => {
  47. formRef.resetFields();
  48. loadData();
  49. }
  50. ">重置</a-button>
  51. <a style="font-size: 12px" @click="expand = !expand">
  52. <template v-if="expand">
  53. <UpOutlined />
  54. </template>
  55. <template v-else>
  56. <DownOutlined />
  57. </template>
  58. {{ expand ? '收缩' : '展开' }}
  59. </a>
  60. </a-col>
  61. </a-row>
  62. <a-row :gutter="24" v-show="expand">
  63. <a-col :span="6">
  64. <a-form-item label="性别" :label-col="{ span: 8 }" name="sexId">
  65. <a-select
  66. ref="select"
  67. v-model:value="searchParamsState.sexId"
  68. :options="sexTypeList"
  69. :field-names="{ label: 'name', value: 'value' }"
  70. :allow-clear="true"
  71. @change="loadData"
  72. >
  73. </a-select>
  74. </a-form-item>
  75. </a-col>
  76. <a-col :span="6">
  77. <a-form-item label="最高学历" :label-col="{ span: 8 }" name="educationId">
  78. <a-select
  79. ref="select"
  80. v-model:value="searchParamsState.educationTypeId"
  81. :options="educationTypeList"
  82. :field-names="{ label: 'name', value: 'value' }"
  83. :allow-clear="true"
  84. @change="loadData"
  85. >
  86. </a-select>
  87. </a-form-item>
  88. </a-col>
  89. <a-col :span="6">
  90. <a-form-item label="重点人员类别" :label-col="{ span: 8 }" name="emphasisTypeId">
  91. <a-select
  92. ref="select"
  93. v-model:value="searchParamsState.emphasisTypeId"
  94. :options="emphasisTypeList"
  95. :field-names="{ label: 'name', value: 'value' }"
  96. :allow-clear="true"
  97. @change="loadData"
  98. >
  99. </a-select>
  100. </a-form-item>
  101. </a-col>
  102. </a-row>
  103. <a-row :gutter="24" v-show="expand">
  104. <a-col :span="6">
  105. <a-form-item label="所属县区" :label-col="{span:8}" name="regionCode">
  106. <a-select
  107. ref="select"
  108. v-model:value="searchParamsState.regionCode"
  109. :options="regionList"
  110. :field-names="{ label: 'name', value: 'code' }"
  111. :allow-clear="true"
  112. @change="loadData"
  113. >
  114. </a-select>
  115. </a-form-item>
  116. </a-col>
  117. <a-col :span="6">
  118. <a-form-item label="登记时间" :label-col="{ span: 8 }">
  119. <a-range-picker v-model:value="createDate" :placeholder="['开始日期', '结束日期']" format="YYYY-MM-DD"
  120. @change="onCreateTimeChange"/>
  121. </a-form-item>
  122. </a-col>
  123. </a-row>
  124. <a-row class="edit-operation">
  125. <a-col :span="24" class="flex-space-between">
  126. <div>
  127. <!-- 表格字段筛选按钮 -->
  128. <ColumnsSetting :table-columns="originalColumns" :checked-table-columns="columns"
  129. @on-check="columnsCheckSub"></ColumnsSetting>
  130. </div>
  131. <div>
  132. <a-button type="primary" html-type="submit" @click='onAdd' functioncode="T01030102">新增</a-button>
  133. <BImportExcel functioncode="T01030105"
  134. :options="importOptions"
  135. @success="loadData"
  136. ></BImportExcel>
  137. <BExportExcel :title="'导出'" :filename="'求职人员信息'" v-show="false"
  138. :url="'jobUserService/jobUser/export'"
  139. :params="{...exportSearchParams, isExport: true, rows:10000,jobUserIDList:formState.selectedRowKeys.join(',')}"></BExportExcel>
  140. </div>
  141. </a-col>
  142. </a-row>
  143. </a-form>
  144. <div class="search-result-list">
  145. <a-table
  146. :columns="columns"
  147. :data-source="dataList"
  148. :scroll="{ x: '100%', y: 500 }"
  149. :pagination="pagination"
  150. :loading="formState.loading"
  151. :row-selection="{ selectedRowKeys: formState.selectedRowKeys, onChange: onSelectChange }"
  152. :row-key="(record) => record.jobUserID"
  153. bordered
  154. @change="handleTableChange">
  155. <template #bodyCell="{ column, text, record }">
  156. <template v-if="column.key === 'operation'">
  157. <div class="table-operation">
  158. <a-button type="link" size="small" functioncode="T01030106" @click='onVitae(record)'>个人简历</a-button>
  159. <a-button type="link" size="small" functioncode="T01030103" @click='onEdit(record)'>编辑</a-button>
  160. <a-button type="link" size="small" functioncode="T01030104" @click="onDel(record)">删除</a-button>
  161. </div>
  162. </template>
  163. </template>
  164. </a-table>
  165. </div>
  166. </div>
  167. </template>
  168. <script lang="ts">
  169. import {computed, createVNode, defineComponent, reactive, ref} from 'vue';
  170. import type {FormInstance, SelectProps, TableProps} from 'ant-design-vue';
  171. import {message, Modal} from "ant-design-vue";
  172. import {del, getList} from '@/api/jobUserManager/jobuser';
  173. import {getSysDictionaryList} from '@/api/system/dictionary';
  174. import {getPaginationTotalTitle} from '@/utils/common';
  175. import {useTabsViewStore} from "@/store/modules/tabsView";
  176. import {DownOutlined, ExclamationCircleOutlined, UpOutlined} from "@ant-design/icons-vue";
  177. import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
  178. import BImportExcel from "@/components/basic/excel/importExcel/importExcel.vue";
  179. import {getSiteList} from "@/api/baseSettings/siteInfo";
  180. import {get} from "@/api/common";
  181. import ColumnsSetting from "@/components/common/ColumnsSetting.vue";
  182. import type {ImportProps} from "@/components/basic/excel/importExcel/ImportProps";
  183. export default defineComponent({
  184. name: 'JobUserList',
  185. components: {ColumnsSetting, DownOutlined, UpOutlined, BExportExcel, BImportExcel},
  186. setup() {
  187. const modalRoleUserRef = ref();
  188. const expand = ref(false);
  189. const modalRoleEditRef = ref();
  190. const formRef = ref<FormInstance>();
  191. const searchParamsState = reactive({
  192. pageIndex: 1,
  193. pageSize: 20,
  194. name: null,
  195. siteId: null,
  196. jobStatus: null,
  197. sexId: null,
  198. educationTypeId: null,
  199. emphasisTypeId: null,
  200. siteID: "",
  201. startDate: "",
  202. endDate: "",
  203. regionCode: ""
  204. });
  205. // 导出Excel查询参数
  206. const exportSearchParams = computed(() => {
  207. let data = JSON.parse(JSON.stringify(searchParamsState));
  208. data.pageSize = formState.total;
  209. return data;
  210. })
  211. const formState = reactive({
  212. total: 0,
  213. selectedRowKeys: [],
  214. loading: false,
  215. });
  216. // 原始表格定义数据
  217. const originalColumns = [
  218. {
  219. title: '序号',
  220. align: 'center',
  221. width: 80,
  222. key: 'jobUserID',
  223. customRender: (item) =>
  224. `${searchParamsState.pageSize * (searchParamsState.pageIndex - 1) + item.index + 1}`,
  225. isDisabled: true
  226. },
  227. {title: '姓名', dataIndex: 'name', key: 'name', width: 100,align: "center"},
  228. {title: '性别', dataIndex: 'genderName', key: 'genderName', width: 80,align: "center"},
  229. {title: '联系电话', dataIndex: 'userMobile', key: 'userMobile', align: "center"},
  230. {title: '所属驿站', dataIndex: 'siteName', key: 'siteName', align: "center"},
  231. {title: '年龄', dataIndex: 'age', key: 'age', align: "center"},
  232. {title: '就业状态', dataIndex: 'jobStatusName', key: 'jobStatusName', align: "center"},
  233. {title: '重点人员类别', dataIndex: 'keyTypeName', key: 'keyTypeName', align: "center"},
  234. {title: '民族', dataIndex: 'nationName', key: 'nationName', width: 80, align: "center", isDefaultClose: true},
  235. {title: '最高学历', dataIndex: 'cultureName', key: 'cultureName', align: "center", isDefaultClose: true},
  236. {title: '地址', dataIndex: 'address', key: 'address', align: "center", isDefaultClose: true},
  237. {title: '操作', key: 'operation', width: 170, align: 'center', isDisabled: true},
  238. ];
  239. // 响应式表格定义
  240. const columns = ref<Array<any>>(originalColumns.filter(item => !item.isDefaultClose));
  241. const createDate = ref([]);
  242. const pagination = computed(() => ({
  243. total: formState.total,
  244. current: searchParamsState.pageIndex,
  245. pageSize: searchParamsState.pageSize,
  246. showSizeChanger: true,
  247. showTotal: (total) => getPaginationTotalTitle(total),
  248. }));
  249. const importOptions = ref<ImportProps>({
  250. title: '导入',
  251. url: '/jobUserService/jobUser/importJobUser',
  252. columns: [
  253. {cnName: '姓名', enName: 'name', width: 100},
  254. {cnName: '身份证号码', enName: 'identityNumber', width: 100},
  255. {cnName: '性别', enName: 'sexName', width: 100},
  256. {cnName: '重点人员类别', enName: 'keyPersonTypeName', width: 100},
  257. {cnName: '就业状态', enName: 'jobStatusName', width: 100},
  258. {cnName: '所属驿站', enName: 'siteName', width: 100},
  259. {cnName: '地址', enName: 'address', width: 100},
  260. {cnName: '联系电话', enName: 'userMobile', width: 100},
  261. {cnName: '联系人', enName: 'userName', width: 100},
  262. {cnName: '籍贯', enName: 'nativePlace', width: 100},
  263. {cnName: '社会保障卡号', enName: 'socialSecurityCard', width: 100},
  264. {cnName: '毕业院校', enName: 'finishSchool', width: 100},
  265. {cnName: '专业', enName: 'profession', width: 100},
  266. {cnName: '是否全日制', enName: 'isFullTimeName', width: 100},
  267. {cnName: '职业资格类别', enName: 'occupationalCategoryName', width: 100},
  268. {cnName: '职业资格等级', enName: 'occupationalLevelName', width: 100},
  269. {cnName: '民族', enName: 'nationName', width: 100},
  270. {cnName: '政治面貌', enName: 'politicsStatusName', width: 100},
  271. {cnName: '出生地', enName: 'birthPlace', width: 100},
  272. {cnName: '出生日期', enName: 'birthDayStr', width: 100},
  273. {cnName: '户口性质', enName: 'familyNatureName', width: 100},
  274. {cnName: '最高学历', enName: 'cultureRankName', width: 100},
  275. {cnName: '健康状况', enName: 'healthName', width: 100},
  276. {cnName: '婚姻状况', enName: 'bloodTypeName', width: 100},
  277. {cnName: '电子邮箱', enName: 'email', width: 100},
  278. {cnName: '身高(cm)', enName: 'height', width: 100},
  279. {cnName: '体重(kg)', enName: 'weight', width: 100},
  280. {cnName: '视力', enName: 'vision', width: 100},
  281. {cnName: '省份', enName: 'provinceName', width: 100},
  282. {cnName: '市/县', enName: 'regionName', width: 100},
  283. {cnName: '镇街', enName: 'streetName', width: 100},
  284. {cnName: '家庭住址', enName: 'familyAddress', width: 100},
  285. {cnName: '兴趣爱好', enName: 'hobby', width: 100},
  286. {cnName: '个人技能', enName: 'personalSkills', width: 100},
  287. ],
  288. template: {
  289. tempFileName: '求职人员导入模板.xlsx',
  290. url: '',
  291. params: null,
  292. },
  293. });
  294. const dataList = ref([]);
  295. const siteList = ref<any>([]);
  296. const jobStatusList = ref<SelectProps['options']>();
  297. const sexTypeList = ref<SelectProps['options']>();
  298. const educationTypeList = ref<SelectProps['options']>();
  299. const emphasisTypeList = ref<SelectProps['options']>();
  300. const regionList = ref<SelectProps['options']>();
  301. const onSelectChange = (selectedRowKeys: any) => {
  302. formState.selectedRowKeys = selectedRowKeys;
  303. };
  304. const handleTableChange: TableProps['onChange'] = (pag: {
  305. pageSize: number;
  306. current: number;
  307. }) => {
  308. searchParamsState.pageIndex = pag.current;
  309. searchParamsState.pageSize = pag.pageSize;
  310. loadData();
  311. };
  312. const onFinish = () => {
  313. loadData();
  314. };
  315. get('system/area/getCityList', {}).then(data => {
  316. regionList.value = data;
  317. });
  318. const loadData = async function () {
  319. formState.loading = true;
  320. getAllSites();
  321. const result: any = await getList(searchParamsState);
  322. dataList.value = result.list;
  323. //console.log(dataList.value);
  324. formState.total = result.total;
  325. formState.loading = false;
  326. // console.log("userParams",searchParamsState);
  327. };
  328. const getAllSites = () => {
  329. getSiteList({pageIndex:1,pageSize:9999}).then((result :any) => {
  330. siteList.value = result.list;
  331. })
  332. }
  333. const getJobStatusList = () => {
  334. getSysDictionaryList('jobStatus').then((data) => {
  335. jobStatusList.value = data;
  336. });
  337. };
  338. const getSexList = () => {
  339. getSysDictionaryList('Gender').then((data) => {
  340. sexTypeList.value = data;
  341. });
  342. };
  343. const getEducationList = () => {
  344. getSysDictionaryList('HighestDegree').then((data) => {
  345. educationTypeList.value = data;
  346. });
  347. };
  348. const getEmphasisTypeList = () => {
  349. getSysDictionaryList('KeyPersonType').then((data) => {
  350. emphasisTypeList.value = data;
  351. });
  352. };
  353. const tabsViewStore = useTabsViewStore();
  354. const onAdd = () => {
  355. tabsViewStore.addTabByPath('/jobusermgr/jobseeker/add', null);
  356. };
  357. const onEdit = (item: any) => {
  358. tabsViewStore.addTabByPath('/jobusermgr/jobseeker/edit', {id: item.jobUserID});
  359. };
  360. const onVitae = (item: any) => {
  361. tabsViewStore.addTabByPath('/jobusermgr/jobseeker/vitae', {id: item.jobUserID});
  362. };
  363. const onDel = (item: any) => {
  364. if (item) {
  365. formState.selectedRowKeys.push(item.jobUserID as never)
  366. }
  367. if (formState.selectedRowKeys.length <= 0) {
  368. message.warning('请选择需要删除的数据!');
  369. return false;
  370. }
  371. Modal.confirm({
  372. title: '确认删除?',
  373. icon: createVNode(ExclamationCircleOutlined),
  374. content: '',
  375. okText: '确认删除',
  376. okType: 'danger',
  377. okButtonProps: {},
  378. cancelText: '取消',
  379. onOk() {
  380. del(formState.selectedRowKeys).then(() => {
  381. loadData();
  382. });
  383. },
  384. onCancel() {
  385. },
  386. })
  387. }
  388. // 登记时间组件调整
  389. const onCreateTimeChange = (dateString) => {
  390. createDate.value = dateString;
  391. searchParamsState.startDate = dateString ? dateString[0].format("YYYY-MM-DD") : '';
  392. searchParamsState.endDate = dateString ? dateString[1].format("YYYY-MM-DD") : '';
  393. loadData();
  394. }
  395. // 字段展示列选择完毕
  396. function columnsCheckSub(columnsKeys: Array<string>) {
  397. // 从原始表格定义数据中过滤出已选择的字段
  398. columns.value = originalColumns.filter((item: any) => columnsKeys.includes(item.key));
  399. }
  400. return {
  401. modalRoleUserRef,
  402. modalRoleEditRef,
  403. formRef,
  404. loadData,
  405. onAdd,
  406. onDel,
  407. onEdit,
  408. searchParamsState,
  409. formState,
  410. columns,
  411. originalColumns,
  412. columnsCheckSub,
  413. pagination,
  414. importOptions,
  415. dataList,
  416. siteList,
  417. jobStatusList,
  418. sexTypeList,
  419. educationTypeList,
  420. emphasisTypeList,
  421. onSelectChange,
  422. handleTableChange,
  423. onFinish,
  424. getJobStatusList,
  425. getSexList,
  426. getEducationList,
  427. getEmphasisTypeList,
  428. onVitae,
  429. expand,
  430. exportSearchParams,
  431. regionList,
  432. createDate,
  433. onCreateTimeChange
  434. };
  435. },
  436. created() {
  437. this.loadData();
  438. this.getJobStatusList();
  439. this.getSexList();
  440. this.getEducationList();
  441. this.getEmphasisTypeList();
  442. },
  443. activated() {
  444. if (history.state.params?.reload) this.loadData();
  445. },
  446. });
  447. </script>
  448. <style lang="less" scoped></style>