index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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=""/>
  13. </a-form-item>
  14. </a-col>
  15. <a-col :span="6">
  16. <a-form-item label="企业名称" :label-col="{ span: 8 }" name="companyName">
  17. <a-input v-model:value="searchParamsState.companyName" placeholder=""/>
  18. </a-form-item>
  19. </a-col>
  20. <a-col :span="6">
  21. <a-form-item label="推荐类型" :label-col="{ span: 8 }" name="recommendType">
  22. <a-select
  23. ref="select"
  24. v-model:value="searchParamsState.recommendType"
  25. :options="recommendTypeList"
  26. :field-names="{ label: 'name', value: 'value' }"
  27. :allow-clear="true"
  28. @change="loadData"
  29. >
  30. </a-select>
  31. </a-form-item>
  32. </a-col>
  33. <a-col :span="6" style="text-align: left">
  34. <a-button type="primary" html-type="submit" @click="onFinish">查询</a-button>
  35. <a-button
  36. style="margin: 0 8px"
  37. @click="
  38. () => {
  39. formRef.resetFields();
  40. loadData();
  41. }
  42. "
  43. >重置
  44. </a-button>
  45. <a style="font-size: 12px" @click="expand = !expand">
  46. <template v-if="expand">
  47. <UpOutlined/>
  48. </template>
  49. <template v-else>
  50. <DownOutlined/>
  51. </template>
  52. {{ expand ? '收缩' : '展开' }}
  53. </a>
  54. </a-col>
  55. </a-row>
  56. <a-row :gutter="24" v-show="expand">
  57. <a-col :span="6">
  58. <a-form-item label="入职状态" :label-col="{ span: 8 }" name="educationId">
  59. <a-select
  60. ref="select"
  61. v-model:value="searchParamsState.entryState"
  62. :options="entryStateList"
  63. :field-names="{ label: 'name', value: 'value' }"
  64. :allow-clear="true"
  65. @change="loadData"
  66. >
  67. </a-select>
  68. </a-form-item>
  69. </a-col>
  70. <a-col :span="6">
  71. <a-form-item label="招聘岗位" :label-col="{ span: 8 }" name="zpProfessionName">
  72. <a-input v-model:value="searchParamsState.zpProfessionName" placeholder=""/>
  73. </a-form-item>
  74. </a-col>
  75. <a-col :span="6">
  76. <a-form-item label="求职岗位" :label-col="{ span: 8 }" name="qzProfessionName">
  77. <a-input v-model:value="searchParamsState.qzProfessionName" placeholder=""/>
  78. </a-form-item>
  79. </a-col>
  80. </a-row>
  81. <a-row :gutter="24" v-show="expand">
  82. <a-col :span="6">
  83. <a-form-item label="推送人" :label-col="{ span: 8 }" name="pushName">
  84. <a-input v-model:value="searchParamsState.pushName" placeholder=""/>
  85. </a-form-item>
  86. </a-col>
  87. <a-col :span="6">
  88. <a-form-item label="所属驿站" :label-col="{ span: 8 }" name="siteID">
  89. <a-select
  90. ref="select"
  91. v-model:value="searchParamsState.siteID"
  92. :options="siteList"
  93. :field-names="{ label: 'siteName', value: 'siteID' }"
  94. :allow-clear="true"
  95. @change="loadData"
  96. >
  97. </a-select>
  98. </a-form-item>
  99. </a-col>
  100. <a-col :span="6">
  101. <a-form-item label="所属县区" :label-col="{span:8}" name="regionCode">
  102. <a-select
  103. ref="select"
  104. v-model:value="searchParamsState.regionCode"
  105. :options="regionList"
  106. :field-names="{ label: 'name', value: 'code' }"
  107. :allow-clear="true"
  108. @change="loadData"
  109. >
  110. </a-select>
  111. </a-form-item>
  112. </a-col>
  113. <a-col :span="6">
  114. </a-col>
  115. </a-row>
  116. <a-row :gutter="24" v-show="expand">
  117. <a-col :span="6">
  118. <a-form-item label="登记时间" :label-col="{ span: 8 }" name="isAccomplish">
  119. <a-date-picker v-model:value="searchParamsState.startDate" picker="date" value-format="YYYY-MM-DD"
  120. style="width: 115px;"/>
  121. <label style="margin:10px;">-</label>
  122. <a-date-picker v-model:value="searchParamsState.endDate" picker="date" value-format="YYYY-MM-DD"
  123. style="width: 115px"/>
  124. </a-form-item>
  125. </a-col>
  126. </a-row>
  127. <a-row class="edit-operation">
  128. <a-col :span="24" style="text-align: right"></a-col>
  129. </a-row>
  130. </a-form>
  131. <div class="search-result-list">
  132. <a-table
  133. :columns="columns"
  134. :data-source="dataList"
  135. :scroll="{ x: '100%', y: 500 }"
  136. :pagination="pagination"
  137. :loading="formState.loading"
  138. :row-selection="{ selectedRowKeys: formState.selectedRowKeys, onChange: onSelectChange }"
  139. :row-key="(record) => record.recommendMgtID"
  140. bordered
  141. @change="handleTableChange"
  142. >
  143. <template #bodyCell="{ column, text, record }">
  144. <template v-if="column.key === 'operation'">
  145. <div class="table-operation">
  146. <a-button type="link" size="small" v-show="record.entryState!=1" functioncode="T01030203"
  147. @click='onSetEntryState(record.recommendMgtID, 1)'>已入职
  148. </a-button>
  149. <a-button type="link" size="small" v-show="record.entryState==1" functioncode="T01030203"
  150. @click='onSetEntryState(record.recommendMgtID, 0)'>已离职
  151. </a-button>
  152. </div>
  153. </template>
  154. </template>
  155. </a-table>
  156. </div>
  157. </div>
  158. </template>
  159. <script lang="ts">
  160. import {reactive, ref, computed, defineComponent} from 'vue';
  161. import type {FormInstance, TableColumnsType, TableProps, SelectProps} from 'ant-design-vue';
  162. import {getList, setEntryState} from '@/api/jobUserManager/recommendMgt';
  163. import {getSysDictionaryList} from '@/api/system/dictionary';
  164. import {getPaginationTotalTitle} from '@/utils/common';
  165. import dayjs from "dayjs";
  166. import {getSiteList} from "@/api/baseSettings/siteInfo";
  167. import {get} from "@/api/common";
  168. export default defineComponent({
  169. name: 'recommendMgtList',
  170. setup() {
  171. const expand = ref(false);
  172. const modalRoleUserRef = ref();
  173. const modalRoleEditRef = ref();
  174. const formRef = ref<FormInstance>();
  175. const searchParamsState = reactive({
  176. pageIndex: 1,
  177. pageSize: 20,
  178. post: '',
  179. name: '',
  180. companyName: '',
  181. recommendType: null,
  182. entryState: null,
  183. pushName: '',
  184. zpProfessionName: '',
  185. qzProfessionName: '',
  186. siteID: null,
  187. regionCode: null,
  188. startDate: null,
  189. endDate: null
  190. });
  191. const formState = reactive({
  192. total: 0,
  193. selectedRowKeys: [],
  194. loading: false,
  195. });
  196. const columns: TableColumnsType = [
  197. {
  198. title: '序号',
  199. align: 'center',
  200. width: 80,
  201. key: 'recommendMgtID',
  202. customRender: (item) =>
  203. `${searchParamsState.pageSize * (searchParamsState.pageIndex - 1) + item.index + 1}`,
  204. },
  205. {title: '求职者', dataIndex: 'name', key: 'name'},
  206. {title: '求职者电话', dataIndex: 'userMobile', key: 'userMobile'},
  207. {title: '求职岗位', dataIndex: 'qzProfessionName', key: 'qzProfessionName'},
  208. {title: '企业', dataIndex: 'companyName', key: 'companyName'},
  209. {title: '企业电话', dataIndex: 'companyMobile', key: 'companyMobile'},
  210. {title: '招聘岗位', dataIndex: 'zpProfessionName', key: 'zpProfessionName'},
  211. {title: '推荐类型', dataIndex: 'recommendTypeName', key: 'recommendTypeName'},
  212. {title: '入职状态', dataIndex: 'entryStateName', key: 'entryStateName'},
  213. {title: '推送人', dataIndex: 'pushName', key: 'pushName'},
  214. {
  215. title: '推送时间', dataIndex: 'createTime', key: 'createTime',
  216. customRender: ({record}) => dayjs(record.createTime).format('YYYY-MM-DD'),
  217. },
  218. {title: '操作', key: 'operation', width: 100, align: 'center'},
  219. ];
  220. const siteList = ref<Array<any>>([]);
  221. const regionList = ref<SelectProps['options']>();
  222. const pagination = computed(() => ({
  223. total: formState.total,
  224. current: searchParamsState.pageIndex,
  225. pageSize: searchParamsState.pageSize,
  226. showSizeChanger: true,
  227. showTotal: (total) => getPaginationTotalTitle(total),
  228. }));
  229. const dataList = ref([]);
  230. const recommendTypeList = ref<SelectProps['options']>();
  231. const entryStateList = ref<SelectProps['options']>();
  232. const onSelectChange = (selectedRowKeys: any) => {
  233. formState.selectedRowKeys = selectedRowKeys;
  234. };
  235. const handleTableChange: TableProps['onChange'] = (pag: {
  236. pageSize: number;
  237. current: number;
  238. }) => {
  239. searchParamsState.pageIndex = pag.current;
  240. searchParamsState.pageSize = pag.pageSize;
  241. loadData();
  242. };
  243. const onFinish = () => {
  244. loadData();
  245. };
  246. function getAllSites() {
  247. getSiteList({pageIndex: 1, pageSize: 9999}).then((result: any) => {
  248. siteList.value = result.list;
  249. })
  250. }
  251. function getAllRegion() {
  252. get('system/area/getCityList', {}).then(data => {
  253. regionList.value = data;
  254. });
  255. }
  256. const loadData = async function () {
  257. formState.loading = true;
  258. const result: any = await getList(searchParamsState);
  259. dataList.value = result.list;
  260. formState.total = result.total;
  261. formState.loading = false;
  262. };
  263. const onSetEntryState = async (recommendMgtID, entryState) => {
  264. setEntryState({recommendMgtID: recommendMgtID, entryState: entryState}).then(()=>{
  265. loadData();
  266. });
  267. }
  268. const getRecommendTypeList = () => {
  269. getSysDictionaryList('RecommendType').then((data) => {
  270. recommendTypeList.value = data;
  271. });
  272. };
  273. const getEntryStateList = () => {
  274. getSysDictionaryList('EntryState').then((data) => {
  275. entryStateList.value = data;
  276. });
  277. };
  278. return {
  279. modalRoleUserRef,
  280. modalRoleEditRef,
  281. formRef,
  282. loadData,
  283. searchParamsState,
  284. formState,
  285. columns,
  286. pagination,
  287. dataList,
  288. recommendTypeList,
  289. entryStateList,
  290. onSetEntryState,
  291. onSelectChange,
  292. handleTableChange,
  293. onFinish,
  294. getRecommendTypeList,
  295. getEntryStateList,
  296. expand,
  297. siteList,
  298. regionList,
  299. getAllSites,
  300. getAllRegion,
  301. };
  302. },
  303. created() {
  304. this.loadData();
  305. this.getRecommendTypeList();
  306. this.getEntryStateList();
  307. this.getAllSites();
  308. this.getAllRegion();
  309. },
  310. activated() {
  311. if (history.state.params?.reload) this.loadData();
  312. },
  313. });
  314. </script>
  315. <style lang="less" scoped></style>