招聘网页
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

demand.vue 8.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <template>
  2. <a-form :model="createForm" :label-col="{span: 6}" labelAlign="right">
  3. <a-row :gutter="20">
  4. <a-col span="12">
  5. <a-row>
  6. <a-col span="24">
  7. <a-form-item required label="工作经验">
  8. <a-xuanze :dict="2021" placeholder="请选择工作经验" @saveSelect="saveExperience"
  9. :select_content="createForm.experience"></a-xuanze>
  10. </a-form-item>
  11. </a-col>
  12. <a-col span="24">
  13. <a-form-item label="学历">
  14. <a-xuanze :dict="2006" placeholder="请选择学历" @saveSelect="saveSchoolDegree"
  15. :select_content="createForm.school_degree"></a-xuanze>
  16. </a-form-item>
  17. </a-col>
  18. <a-col span="24">
  19. <a-form-item label="含最高学历" name="degree_better">
  20. <a-radio-group v-model:value="createForm.degree_better" button-style="solid">
  21. <a-radio-button :value="1">是</a-radio-button>
  22. <a-radio-button :value="2">否</a-radio-button>
  23. </a-radio-group>
  24. </a-form-item>
  25. </a-col>
  26. <a-col span="24">
  27. <a-form-item required label="职称要求">
  28. <a-xuanze :dict="2006" placeholder="请选择职称要求" @saveSelect="saveProfelevel"
  29. :select_content="createForm.profelevel"></a-xuanze>
  30. </a-form-item>
  31. </a-col>
  32. <a-col span="24">
  33. <a-form-item required label="技能认证">
  34. <a-xuanze :dict="2015" placeholder="请选择技能认证" @saveSelect="saveCertification"
  35. :select_content="createForm.certification"></a-xuanze>
  36. </a-form-item>
  37. </a-col>
  38. <a-col span="24">
  39. <a-form-item label="语言要求">
  40. <a-xuanze :dict="2007" placeholder="请选择语言要求" @saveSelect="saveLanguage"
  41. :select_content="createForm.language"></a-xuanze>
  42. </a-form-item>
  43. </a-col>
  44. <a-col span="24">
  45. <a-form-item label="掌握程度">
  46. <a-xuanze :dict="2007" placeholder="请选择掌握程度" @saveSelect="saveLanguageDegree"
  47. :select_content="createForm.language_degree"></a-xuanze>
  48. </a-form-item>
  49. </a-col>
  50. <a-col span="24">
  51. <a-form-item label="性别要求" name="sex">
  52. <a-radio-group v-model:value="createForm.sex" button-style="solid">
  53. <a-radio-button :value="1">男</a-radio-button>
  54. <a-radio-button :value="2">女</a-radio-button>
  55. <a-radio-button :value="3">不限</a-radio-button>
  56. </a-radio-group>
  57. </a-form-item>
  58. </a-col>
  59. <a-col span="24">
  60. <a-form-item label="最小年龄" name="age_min">
  61. <a-input-number :min="0" type="number" v-model:value="createForm.age_min"
  62. placeholder="请输入最小年龄" style="width: 100%;" />
  63. </a-form-item>
  64. </a-col>
  65. <a-col span="24">
  66. <a-form-item label="最大年龄" name="age_max">
  67. <a-input-number :min="0" type="number" v-model:value="createForm.age_max"
  68. placeholder="请输入最大年龄" style="width: 100%;" />
  69. </a-form-item>
  70. </a-col>
  71. <a-col span="24">
  72. <a-form-item required label="婚姻状况" name="marital_status">
  73. <a-radio-group v-model:value="createForm.marital_status" button-style="solid">
  74. <a-radio-button :value="1">已婚</a-radio-button>
  75. <a-radio-button :value="2">未婚</a-radio-button>
  76. <a-radio-button :value="3">不限</a-radio-button>
  77. </a-radio-group>
  78. </a-form-item>
  79. </a-col>
  80. <a-col span="24">
  81. <a-form-item required label="专业" name="major">
  82. <a-input v-model:value="createForm.major" placeholder="请输入专业" />
  83. </a-form-item>
  84. </a-col>
  85. <a-col span="24">
  86. <a-form-item label="证书要求">
  87. <a-checkbox-group v-model:value="createForm.license">
  88. <a-row>
  89. <template v-for="(item, index) in licenseOption">
  90. <a-col span="8">
  91. <a-checkbox :value="item.id">{{item.name}}</a-checkbox>
  92. </a-col>
  93. </template>
  94. </a-row>
  95. </a-checkbox-group>
  96. </a-form-item>
  97. </a-col>
  98. <a-col span="24">
  99. <a-form-item label="籍贯要求" name="mandarin">
  100. <a-jilian :dict="2009" @saveCascader="compantJiguanSave" placeholder="请选择籍贯"
  101. :cascader_content="addOtherForm.company_jiguan_cascader"></a-jilian>
  102. </a-form-item>
  103. </a-col>
  104. <a-col span="24">
  105. <a-form-item label="所在地要求" name="mandarin">
  106. <a-jilian :dict="2009" @saveCascader="compantSuozaidiSave" placeholder="请选择所在地"
  107. :cascader_content="addOtherForm.company_suozaidi_cascader"></a-jilian>
  108. </a-form-item>
  109. </a-col>
  110. <a-col span="24">
  111. <a-form-item required label="保存">
  112. <a-button type="primary" block @click="sumbitForm">保存</a-button>
  113. </a-form-item>
  114. </a-col>
  115. </a-row>
  116. </a-col>
  117. </a-row>
  118. </a-form>
  119. </template>
  120. <script setup lang="ts">
  121. import { ref, onMounted, computed, watch, defineEmits, defineProps } from 'vue';
  122. import { GetDictTree, PostCompanyJobAdd, alreadyValue } from '@/apis/models';
  123. import { warnToast, successToast } from '@/utils/toastHelper';
  124. import { intersectionAlike } from '@/utils/dataHelper';
  125. const emit = defineEmits();
  126. const props = defineProps(['job_detail']);
  127. let licenseOption = ref<Object[]>([])
  128. let createForm : companyListType.addrFormType = ref({
  129. experience: 0,
  130. school_degree: 0,
  131. degree_better: 0,
  132. profelevel: 0,
  133. certification: 0,
  134. language: 0,
  135. language_degree: 0,
  136. sex: 3,
  137. age_min: 0,
  138. age_max: 0,
  139. marital_status: 3,
  140. major: '',
  141. license: [],
  142. household_province: 0,
  143. household_city: 0,
  144. location_province: 0,
  145. location_city: 0,
  146. location_town: 0,
  147. })
  148. let addOtherForm = ref<companyListType.addOtherFormType>({
  149. company_jiguan_cascader: [],
  150. company_suozaidi_cascader: [],
  151. })
  152. const job_id = ref<object>(null);
  153. watch(() => [props.job_detail], async (newVal : string[], oldVal) => {
  154. let res = await GetDictTree({ code: 2018 })
  155. licenseOption.value = res.data.dicts;
  156. if (newVal[0]) {
  157. job_id.value = newVal[0].id;
  158. createForm.value = intersectionAlike(createForm.value, newVal[0]);
  159. addOtherForm.value = {
  160. company_jiguan_cascader: [newVal[0].household_province, newVal[0].household_city],
  161. company_suozaidi_cascader: addToLocationArray(newVal[0])
  162. }
  163. sessionStorage.setItem("second", JSON.stringify(createForm.value))
  164. sessionStorage.setItem("secondOther", JSON.stringify(addOtherForm.value))
  165. addOtherForm.value = sessionStorage.getItem('secondOther') ? JSON.parse(sessionStorage.getItem('secondOther')) : addOtherForm.value
  166. createForm.value = sessionStorage.getItem('second') ? JSON.parse(sessionStorage.getItem('second')) : createForm.value
  167. }
  168. }, { immediate: true })
  169. const addToLocationArray = (data) => {
  170. let locationArray = [];
  171. if (data.location_province !== 0) {
  172. locationArray.push(data.location_province);
  173. }
  174. if (data.location_city !== 0) {
  175. locationArray.push(data.location_city);
  176. }
  177. if (data.location_town !== 0) {
  178. locationArray.push(data.location_town);
  179. }
  180. return locationArray;
  181. }
  182. onMounted(async () => {
  183. })
  184. // 工作经验
  185. const saveExperience = (data) => {
  186. createForm.value.experience = data.val.key;
  187. }
  188. // 学历要求
  189. const saveSchoolDegree = (data) => {
  190. createForm.value.school_degree = data.val.key;
  191. }
  192. // 职称要求
  193. const saveProfelevel = (data) => {
  194. createForm.value.profelevel = data.val.key;
  195. }
  196. // 技能认证
  197. const saveCertification = (data) => {
  198. createForm.value.certification = data.val.key;
  199. }
  200. // 语言要求
  201. const saveLanguage = (data) => {
  202. createForm.value.language = data.val.key;
  203. }
  204. // 掌握程度
  205. const saveLanguageDegree = (data) => {
  206. createForm.value.language_degree = data.val.key;;
  207. }
  208. // 选择籍贯
  209. const compantJiguanSave = (data) => {
  210. addOtherForm.value.company_jiguan_cascader = data.arr1;
  211. createForm.value.household_province = data.arr1[0] ? data.arr1[0] : 0;
  212. createForm.value.household_city = data.arr1[1] ? data.arr1[1] : 0;
  213. }
  214. // 选择所在地
  215. const compantSuozaidiSave = (data) => {
  216. addOtherForm.value.company_suozaidi_cascader = data.arr1;
  217. createForm.value.location_province = data.arr1[0] ? data.arr1[0] : 0;
  218. createForm.value.location_city = data.arr1[1] ? data.arr1[1] : 0;
  219. createForm.value.location_town = data.arr1[2] ? data.arr1[2] : 0;
  220. }
  221. const sumbitForm = () => {
  222. console.log(createForm.value)
  223. sessionStorage.setItem("second", JSON.stringify(createForm.value))
  224. sessionStorage.setItem("secondOther", JSON.stringify(addOtherForm.value))
  225. emit('saveSuccess', { key: "3" })
  226. }
  227. const resetForm = () => {
  228. addOtherForm.value = {
  229. company_jiguan_cascader: '',
  230. company_suozaidi_cascader: ''
  231. }
  232. createForm.value = {
  233. experience: 0,
  234. school_degree: 0,
  235. degree_better: 0,
  236. profelevel: 0,
  237. certification: 0,
  238. language: 0,
  239. language_degree: 0,
  240. sex: 3,
  241. age_min: 0,
  242. age_max: 0,
  243. marital_status: 3,
  244. major: '',
  245. license: [],
  246. household_province: 0,
  247. household_city: 0,
  248. location_province: 0,
  249. location_city: 0,
  250. location_town: 0,
  251. }
  252. }
  253. </script>
  254. <style>
  255. </style>