招聘网页
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

intention.vue 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. <template>
  2. <div>
  3. <template v-if="state">
  4. <a-form layout="vertical" class="resume-form">
  5. <a-tabs v-model:activeKey="activeKey" style="width: 100%" type="card">
  6. <a-tab-pane :key="1" tab="意向地区">
  7. <a-row :gutter="20">
  8. <a-col span="24">
  9. <a-form-item label="意向地区">
  10. <a-jilian :dict="2009" @saveCascader="areaSave" placeholder="请选择意向地区"
  11. :cascader_content="addOtherForm.area"></a-jilian>
  12. </a-form-item>
  13. </a-col>
  14. <a-col span="24">
  15. <a-flex justify="flex-end">
  16. <a-space>
  17. <a-button @click="resetForm('area')" size="large">取消</a-button>
  18. <a-button type="primary" @click="sumbitAreaForm" size="large">保存</a-button>
  19. </a-space>
  20. </a-flex>
  21. </a-col>
  22. </a-row>
  23. </a-tab-pane>
  24. <a-tab-pane :key="2" tab="意向职位" force-render>
  25. <a-row :gutter="20">
  26. <a-col span="24">
  27. <a-form-item label="意向职位">
  28. <a-jilian :dict="2004" @saveCascader="positionSave" placeholder="请选择意向职位"
  29. :cascader_content="addOtherForm.position"></a-jilian>
  30. </a-form-item>
  31. </a-col>
  32. <a-col span="24">
  33. <a-flex justify="flex-end">
  34. <a-space>
  35. <a-button @click="resetForm('position')" size="large">取消</a-button>
  36. <a-button type="primary" @click="sumbitPositionForm" size="large">保存</a-button>
  37. </a-space>
  38. </a-flex>
  39. </a-col>
  40. </a-row>
  41. </a-tab-pane>
  42. <a-tab-pane :key="3" tab="其他意向">
  43. <a-row :gutter="20">
  44. <a-col span="12">
  45. <a-form-item label="其他职位">
  46. <a-input v-model:value="basicForm.other_positions" placeholder="请输入其他职位"
  47. size="large" />
  48. </a-form-item>
  49. </a-col>
  50. <a-col span="12">
  51. <a-form-item label="求职类型">
  52. <a-xuanze :dict="2019" placeholder="请选择求职类型" @saveSelect="saveJobType"
  53. :select_content="basicForm.job_type"></a-xuanze>
  54. </a-form-item>
  55. </a-col>
  56. <a-col span="12">
  57. <a-form-item label="人才类型">
  58. <a-xuanze :dict="2020" placeholder="请选择人才类型" @saveSelect="saveTalentType"
  59. :select_content="basicForm.talent_type"></a-xuanze>
  60. </a-form-item>
  61. </a-col>
  62. <a-col span="12">
  63. <a-form-item label="工作经验" name="work_experience">
  64. <a-xuanze :dict="2021" placeholder="请选择求工作经验" @saveSelect="saveWorkExperience"
  65. :select_content="basicForm.work_experience"></a-xuanze>
  66. </a-form-item>
  67. </a-col>
  68. <a-col span="12">
  69. <a-form-item label="月薪要求范围">
  70. <a-xuanze :dict="2005" placeholder="请选择月薪要求范围" @saveSelect="saveSalaryRange"
  71. :select_content="basicForm.salary_range"></a-xuanze>
  72. </a-form-item>
  73. </a-col>
  74. <a-col span="12">
  75. <a-form-item label="可到职日期">
  76. <a-xuanze :dict="2013" placeholder="请选择可到职日期" @saveSelect="saveAvailableDate"
  77. :select_content="basicForm.available_date"></a-xuanze>
  78. </a-form-item>
  79. </a-col>
  80. <a-col span="12">
  81. <a-form-item label="职称要求">
  82. <a-xuanze :dict="2014" placeholder="请选择职称要求" @saveSelect="saveTitleRequirement"
  83. :select_content="basicForm.title_requirement"></a-xuanze>
  84. </a-form-item>
  85. </a-col>
  86. <a-col span="12">
  87. <a-form-item label="技能认证">
  88. <a-xuanze :dict="2015" placeholder="请选择技能认证" @saveSelect="saveSkillCertification"
  89. :select_content="basicForm.skill_certification"></a-xuanze>
  90. </a-form-item>
  91. </a-col>
  92. <a-col span="12">
  93. <a-form-item label="食宿要求">
  94. <a-xuanze :dict="2016" placeholder="请选择食宿要求"
  95. @saveSelect="saveAccommodationRequirement"
  96. :select_content="basicForm.accommodation_requirement"></a-xuanze>
  97. </a-form-item>
  98. </a-col>
  99. <a-col span="12">
  100. <a-form-item label="节假日休息情况">
  101. <a-xuanze :dict="2017" placeholder="请选择节假日休息情况" @saveSelect="saveHolidayRest"
  102. :select_content="basicForm.holiday_rest"></a-xuanze>
  103. </a-form-item>
  104. </a-col>
  105. <a-col span="24">
  106. <a-flex justify="flex-end">
  107. <a-space>
  108. <a-button @click="resetForm('basic')" size="large">取消</a-button>
  109. <a-button type="primary" @click="sumbitBasicForm" size="large">保存</a-button>
  110. </a-space>
  111. </a-flex>
  112. </a-col>
  113. </a-row>
  114. </a-tab-pane>
  115. </a-tabs>
  116. </a-form>
  117. </template>
  118. <template v-else>
  119. <template v-if="positionList.length > 0">
  120. <a-typography>
  121. <a-typography-title :level="5">
  122. 意向职位
  123. </a-typography-title>
  124. </a-typography>
  125. <a-typography-paragraph>
  126. <a-space direction="vertical">
  127. <template v-for="(item,index) in positionList">
  128. <div>
  129. {{item.level1_txt}}/{{item.level2_txt}}
  130. <a-divider type="vertical" />
  131. <a-button size="small" type="text" @click="toPositionEdit(item)">
  132. <EditOutlined />
  133. </a-button>
  134. <a-divider type="vertical" />
  135. <a-popconfirm title="是否删除该意向职位" @confirm="delPosition(item.id)">
  136. <a-button size="small" type="text">
  137. <DeleteOutlined />
  138. </a-button>
  139. </a-popconfirm>
  140. </div>
  141. </template>
  142. </a-space>
  143. </a-typography-paragraph>
  144. </template>
  145. <template v-if="areaList.length > 0">
  146. <a-typography>
  147. <a-typography-title :level="5">
  148. 意向地区
  149. </a-typography-title>
  150. </a-typography>
  151. <a-typography-paragraph>
  152. <a-space direction="vertical">
  153. <template v-for="(item,index) in areaList">
  154. <div>
  155. {{item.level1_txt}}
  156. <span v-if="item.level2_txt">/</span>
  157. {{item.level2_txt}}
  158. <span v-if="item.level3_txt">/</span>
  159. {{item.level3_txt}}
  160. <span v-if="item.level4_txt">/</span>
  161. {{item.level4_txt}}
  162. <a-divider type="vertical" />
  163. <a-button size="small" type="text" @click="toEdit(item)">
  164. <EditOutlined />
  165. </a-button>
  166. <a-divider type="vertical" />
  167. <a-popconfirm title="是否删除该意向地区" @confirm="delArea(item.id)">
  168. <a-button size="small" type="text">
  169. <DeleteOutlined />
  170. </a-button>
  171. </a-popconfirm>
  172. </div>
  173. </template>
  174. </a-space>
  175. </a-typography-paragraph>
  176. </template>
  177. <template v-if="basic">
  178. <a-typography>
  179. <a-typography-title :level="5">
  180. 其他意向
  181. </a-typography-title>
  182. </a-typography>
  183. <a-typography-paragraph>
  184. <div>{{basic.job_type_txt}}职位</div>
  185. <div>
  186. {{basic.talent_type_txt}}
  187. <a-divider type="vertical" />
  188. {{basic.holiday_rest_txt}}
  189. <a-divider type="vertical" />
  190. {{basic.salary_range_txt}}
  191. <a-divider type="vertical" />
  192. <a-button size="small" type="text" @click="toBasicEdit">
  193. <EditOutlined />
  194. </a-button>
  195. <a-divider type="vertical" />
  196. <a-popconfirm title="是否删除其他意向" @confirm="delBasic(basic.id)">
  197. <a-button size="small" type="text">
  198. <DeleteOutlined />
  199. </a-button>
  200. </a-popconfirm>
  201. </div>
  202. </a-typography-paragraph>
  203. </template>
  204. </template>
  205. </div>
  206. </template>
  207. <script setup lang="ts">
  208. import { ref, onMounted, computed, defineProps, watch, defineEmits, createVNode } from 'vue';
  209. import { PostJobapplicantAdddesirearea, PostJobapplicantDeldesirearea, PostJobapplicantUpdatedesirearea, PostJobapplicantListdesirearea, PostJobapplicantDesireareadetail, PostJobapplicantAdddesireindustry, PostJobapplicantDeldesireindustry, PostJobapplicantUpdatedesireindustry, PostJobapplicantListdesireindustry, PostJobapplicantDesireindustrydetail, PostJobapplicantAdddesirebase, PostJobapplicantDeldesirebase, PostJobapplicantUpdatedesirebase, PostJobapplicantDesirebasedetail } from '@/apis/models';
  210. import { intersectionAlike } from '@/utils/dataHelper';
  211. import { warnToast, successToast } from '@/utils/toastHelper';
  212. import { dataAreaForm, dataPositionForm, dataBasicForm, otherDataForm, reset } from '@/components/jobseeker/resume/intention/data.ts';
  213. import { EditOutlined, FileSearchOutlined, RedoOutlined, DeleteOutlined } from '@ant-design/icons-vue';
  214. import { useCommon } from '@/hooks/useCommon';
  215. let { store, dayjs, commomParams, richOption, ExclamationCircleOutlined, Modal } = useCommon();
  216. const dayjsRef = ref(dayjs);
  217. let props = defineProps(['form_state']);
  218. const emit = defineEmits();
  219. let state = ref<Boolean>(false)
  220. let basic = ref<Object>(null)
  221. let positionList = ref<Object[]>([])
  222. let areaList = ref<Object[]>([])
  223. let activeKey = ref<Number>(1)
  224. let areaForm = ref<JobseekerIntentionType.JobseekerIntentionAreaFormType>(dataAreaForm)
  225. let positionForm = ref<JobseekerIntentionType.JobseekerIntentionPositionFormType>(dataPositionForm)
  226. let basicForm = ref<JobseekerIntentionType.JobseekerIntentionBasicFormType>(dataBasicForm)
  227. let addOtherForm = ref<JobseekerIntentionType.OtherFormType>(otherDataForm)
  228. onMounted(() => {
  229. getBasic()
  230. getPosition()
  231. getArea()
  232. })
  233. const getBasic = () => {
  234. PostJobapplicantDesirebasedetail().then(res => {
  235. basic.value = res.data
  236. basicForm.value = intersectionAlike(basicForm.value, res.data)
  237. console.log(basicForm.value)
  238. basicForm.value.id = res.data.id;
  239. })
  240. }
  241. const getArea = () => {
  242. PostJobapplicantListdesirearea().then(res => {
  243. areaList.value = res.data.jobapplicantareas
  244. areaForm.value = intersectionAlike(areaForm.value, res.data)
  245. })
  246. }
  247. const getPosition = () => {
  248. PostJobapplicantListdesireindustry().then(res => {
  249. positionList.value = res.data.jobapplicantpositions
  250. positionForm.value = intersectionAlike(positionForm.value, res.data)
  251. })
  252. }
  253. // 意向地区
  254. const areaSave = (data) => {
  255. for (let i = 0; i < 4; i++) {
  256. areaForm.value[`level${i + 1}`] = data.arr1[i] || 0;
  257. }
  258. }
  259. // 保存意向地区
  260. const sumbitAreaForm = () => {
  261. if (areaForm.value.id) {
  262. PostJobapplicantUpdatedesirearea(areaForm.value).then(res => {
  263. successToast('保存成功');
  264. getArea();
  265. resetForm('area')
  266. }).catch(err => {
  267. })
  268. } else {
  269. PostJobapplicantAdddesirearea(areaForm.value).then(res => {
  270. successToast('保存成功');
  271. getArea();
  272. resetForm('area')
  273. }).catch(err => {
  274. })
  275. }
  276. }
  277. const toEdit = (item : Object) => {
  278. areaForm.value.id = item.id;
  279. getDetail(areaForm.value.id)
  280. emit("editEdit")
  281. }
  282. // 详情
  283. const getDetail = (val) => {
  284. PostJobapplicantDesireareadetail({ id: val }).then(res => {
  285. areaForm.value = intersectionAlike(areaForm.value, res.data)
  286. areaForm.value.id = res.data.id;
  287. for (var i = 1; i <= 4; i++) {
  288. if (res.data['level' + i]) {
  289. addOtherForm.value.area.push(res.data['level' + i]);
  290. }
  291. }
  292. })
  293. }
  294. const delArea = (id : number) => {
  295. commomParams.value.delParam = { id: id };
  296. PostJobapplicantDeldesirearea(commomParams.value.delParam).then(res => {
  297. successToast('删除成功');
  298. areaList.value = [];
  299. getArea();
  300. })
  301. }
  302. // 意向求职
  303. const positionSave = (data) => {
  304. for (let i = 0; i < 2; i++) {
  305. positionForm.value[`level${i + 1}`] = data.arr1[i] || 0;
  306. }
  307. console.log(positionForm.value)
  308. }
  309. const sumbitPositionForm = () => {
  310. if (positionForm.value.id) {
  311. PostJobapplicantUpdatedesireindustry(positionForm.value).then(res => {
  312. successToast('保存成功');
  313. getPosition();
  314. resetForm('position')
  315. }).catch(err => {
  316. })
  317. } else {
  318. PostJobapplicantAdddesireindustry(positionForm.value).then(res => {
  319. successToast('保存成功');
  320. getPosition();
  321. resetForm('position')
  322. }).catch(err => {
  323. })
  324. }
  325. }
  326. const toPositionEdit = (item : Object) => {
  327. positionForm.value.id = item.id;
  328. getPositionDetail(positionForm.value.id)
  329. activeKey.value = 2
  330. emit("editEdit")
  331. }
  332. // 详情
  333. const getPositionDetail = (val) => {
  334. PostJobapplicantDesireindustrydetail({ id: val }).then(res => {
  335. positionForm.value = intersectionAlike(positionForm.value, res.data)
  336. positionForm.value.id = res.data.id;
  337. for (var i = 1; i <= 2; i++) {
  338. if (res.data['level' + i]) {
  339. addOtherForm.value.position.push(res.data['level' + i]);
  340. }
  341. }
  342. })
  343. }
  344. const delPosition = (id : number) => {
  345. commomParams.value.delParam = { id: id };
  346. PostJobapplicantDeldesireindustry(commomParams.value.delParam).then(res => {
  347. successToast('删除成功');
  348. positionList.value = [];
  349. getPosition();
  350. })
  351. }
  352. // 求职类型
  353. const saveJobType = (data) => {
  354. basicForm.value.job_type = data.val.key;
  355. }
  356. // 人才类型
  357. const saveTalentType = (data) => {
  358. basicForm.value.talent_type = data.val.key;
  359. }
  360. // 工作经验
  361. const saveWorkExperience = (data) => {
  362. basicForm.value.work_experience = data.val.key;
  363. }
  364. // 月薪要求范围
  365. const saveSalaryRange = (data) => {
  366. basicForm.value.salary_range = data.val.key;
  367. }
  368. // 可到职日期
  369. const saveAvailableDate = (data) => {
  370. basicForm.value.available_date = data.val.key;
  371. }
  372. // 职称要求
  373. const saveTitleRequirement = (data) => {
  374. basicForm.value.title_requirement = data.val.key;
  375. }
  376. // 技能认证
  377. const saveSkillCertification = (data) => {
  378. basicForm.value.skill_certification = data.val.key;
  379. }
  380. // 食宿要求
  381. const saveAccommodationRequirement = (data) => {
  382. basicForm.value.accommodation_requirement = data.val.key;
  383. }
  384. // 节假日休息情况
  385. const saveHolidayRest = (data) => {
  386. basicForm.value.holiday_rest = data.val.key;
  387. }
  388. const sumbitBasicForm = () => {
  389. if (basicForm.value.id) {
  390. PostJobapplicantUpdatedesirebase(basicForm.value).then(res => {
  391. successToast('保存成功');
  392. getBasic();
  393. resetForm('basic')
  394. }).catch(err => {
  395. })
  396. } else {
  397. PostJobapplicantAdddesirebase(basicForm.value).then(res => {
  398. successToast('保存成功');
  399. getBasic();
  400. resetForm('basic')
  401. }).catch(err => {
  402. })
  403. }
  404. }
  405. const toBasicEdit = (item : Object) => {
  406. getBasic()
  407. activeKey.value = 3
  408. emit("editEdit")
  409. }
  410. const delBasic = (id : number) => {
  411. commomParams.value.delParam = { id: id };
  412. PostJobapplicantDeldesirebase(commomParams.value.delParam).then(res => {
  413. successToast('删除成功');
  414. basic.value = null;
  415. getBasic();
  416. })
  417. }
  418. const resetForm = (val) => {
  419. if (val == 'area') {
  420. areaForm.value = reset().dataAreaForm as JobseekerIntentionType.JobseekerIntentionAreaFormType;
  421. }
  422. if (val == 'position') {
  423. positionForm.value = reset().dataPositionForm as JobseekerIntentionType.JobseekerIntentionPositionFormType;
  424. }
  425. if (val == 'basic') {
  426. basicForm.value = reset().dataBasicForm as JobseekerIntentionType.JobseekerIntentionBasicFormType;
  427. }
  428. addOtherForm.value = reset().otherDataForm as JobseekerIntentionType.OtherFormType;
  429. state.value = false;
  430. emit("quitEdit")
  431. }
  432. watch(() => [props.form_state], (newVal) => {
  433. state.value = newVal[0];
  434. getBasic();
  435. getPosition();
  436. getArea();
  437. })
  438. </script>
  439. <style>
  440. </style>