evaluationIntention.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <!-- 自我评价和求职意向 -->
  2. <template>
  3. <view class="evaluate-intention">
  4. <!-- 导航栏 -->
  5. <u-navbar class="evaluate-intention-bar" back-text="" title="">
  6. <view class="evaluate-intention-bar-right" slot="right" @click="jumpPage('/pages/myResume/myResume')">跳过</view>
  7. </u-navbar>
  8. <view class="evaluate-intention-explain">
  9. <view>继续完善加分项</view>
  10. <view>据平台数据显示,完善后,被HR查看几率更高</view>
  11. </view>
  12. <!-- tab页 -->
  13. <view class="evaluate-intention-tabs">
  14. <view
  15. class="evaluate-intention-tabs-item"
  16. v-for="(item, index) in list"
  17. :key="index"
  18. :class="{'evaluate-intention-tabs-active': tabCur === index}"
  19. @click="tabCur = index"
  20. >
  21. {{ item.name }}
  22. </view>
  23. </view>
  24. <!-- 工作意向 -->
  25. <view class="evaluate-intention-intention" v-if="tabCur === 0">
  26. <u-form
  27. :model="intentionForm"
  28. ref="intentionForm"
  29. label-position="top"
  30. >
  31. <u-form-item label="工作城市" prop="cityName" required>
  32. <u-input v-model="intentionForm.workCity" type="select" @click="workCityClick" placeholder="请选择工作城市"/>
  33. <!-- <u-select v-model="cityShow" :list="cityList" @confirm="cityConfirm"></u-select> -->
  34. <city-select-unlimited v-if="cityShow" v-model="cityShow" :default-region="defaultRegion" @city-change="cityConfirm"/>
  35. </u-form-item>
  36. <!-- <u-form-item label="期望职位" prop="position" required>
  37. <u-input v-model="intentionForm.position" type="select" @click="positionShow = true" placeholder="请选择期望职位"/>
  38. <u-select v-model="positionShow" :list="positionList" @confirm="positionConfirm"></u-select>
  39. </u-form-item>
  40. <u-form-item label="期望行业" prop="industry" required>
  41. <u-input v-model="intentionForm.industry" type="select" @click="industryShow = true" placeholder="请选择期望行业"/>
  42. <u-select v-model="industryShow" :list="industryList" @confirm="industryConfirm"></u-select>
  43. </u-form-item> -->
  44. <u-form-item label="最低薪资要求(k)" prop="expectedLowestSalary" required>
  45. <u-input v-model="intentionForm.expectedLowestSalary" type="select" @click="lowestsalaryShow = true" placeholder="请选择薪资要求"/>
  46. <u-select v-model="lowestsalaryShow" :list="salaryList" @confirm="salaryLowestConfirm" :default-value="[Number(intentionForm.expectedLowestSalary) - 1]"></u-select>
  47. </u-form-item>
  48. <u-form-item label="最高薪资要求(k)" prop="expectedHighestSalary" required>
  49. <u-input v-model="intentionForm.expectedHighestSalary" type="select" @click="highestSalaryShow = true" placeholder="请选择薪资要求"/>
  50. <u-select v-model="highestSalaryShow" :list="salaryList" @confirm="salaryHighestConfirm" :default-value="[Number(intentionForm.expectedHighestSalary) - 1]"></u-select>
  51. </u-form-item>
  52. </u-form>
  53. <view class="evaluate-intention-intention-submit">
  54. <u-button type="primary" class="btn" @click="submitIntention">开始找工作</u-button>
  55. </view>
  56. <view class="evaluate-intention-intention-explain">去完善项目经历,让更多HR看到你</view>
  57. </view>
  58. <!-- 自我评价 -->
  59. <view class="evaluate-intention-evaluate" v-else-if="tabCur === 1">
  60. <u-form
  61. :model="evaluateForm"
  62. ref="evaluateForm"
  63. label-position="top"
  64. >
  65. <u-form-item label="自我评价">
  66. <u-input
  67. v-model="evaluateForm.content"
  68. type="textarea"
  69. :border="true"
  70. :height="150"
  71. :auto-height="true"
  72. />
  73. </u-form-item>
  74. </u-form>
  75. <view class="evaluate-intention-evaluate-submit">
  76. <u-button type="primary" class="btn" @click="submitEvaluation">提交</u-button>
  77. </view>
  78. </view>
  79. <u-toast ref="uToast" />
  80. </view>
  81. </template>
  82. <script>
  83. import { industry } from './industry.js';
  84. import citySelectUnlimited from '../../uview-ui/components/u-city-select-unlimited/u-city-select-unlimited.vue'
  85. export default {
  86. components: {
  87. citySelectUnlimited
  88. },
  89. data() {
  90. return {
  91. list: [
  92. {
  93. name: '期望薪资'
  94. },
  95. {
  96. name: '自我评价'
  97. }
  98. ],
  99. tabCur: 0,
  100. intentionForm: {
  101. provinceName: '',
  102. provinceId: '',
  103. cityName: '',
  104. cityId: '',
  105. areaName : '',
  106. areaId: '',
  107. // position: '',
  108. // positionId: '',
  109. // industry: '',
  110. // industryId: '',
  111. expectedLowestSalary: '',
  112. expectedHighestSalary: '',
  113. workCity: ''
  114. },
  115. defaultRegion: [],
  116. intentionRules: {
  117. cityName: [
  118. {
  119. required: true,
  120. message: '请选择您的工作城市',
  121. trigger: ['change','blur']
  122. }
  123. ],
  124. // position: [
  125. // {
  126. // required: true,
  127. // message: '请选择您的期望职位',
  128. // trigger: ['change', 'blur']
  129. // }
  130. // ],
  131. // industry: [
  132. // {
  133. // required: true,
  134. // message: '请选择您的期望行业',
  135. // trigger: ['change', 'blur']
  136. // }
  137. // ],
  138. expectedLowestSalary: [
  139. {
  140. required: true,
  141. message: '请选择您的最低薪资要求',
  142. trigger: ['change', 'blur']
  143. }
  144. ],
  145. expectedHighestSalary: [
  146. {
  147. required: true,
  148. message: '请选择您的最高薪资要求',
  149. trigger: ['change', 'blur']
  150. },
  151. {
  152. validator: (rule, value, callback) => {
  153. return Number(value) >= Number(this.intentionForm.expectedLowestSalary);
  154. },
  155. message: '最高薪资要求不能小于最低薪资要求',
  156. trigger: ['change', 'blur']
  157. }
  158. ]
  159. },
  160. // 城市下拉显示
  161. cityShow: false,
  162. // 职位下拉显示
  163. positionShow: false,
  164. // 职位列表
  165. positionList: [
  166. {
  167. value: 1,
  168. label: '保安'
  169. },
  170. {
  171. value: 2,
  172. label: '服务员'
  173. },
  174. {
  175. value: 3,
  176. label: '消防员'
  177. }
  178. ],
  179. // 行业下拉显示
  180. industryShow: false,
  181. // 行业列表
  182. industryList: industry,
  183. // 薪资下拉显示
  184. highestSalaryShow: false,
  185. lowestsalaryShow: false,
  186. // 薪资列表
  187. salaryList: [],
  188. // 自我评价
  189. evaluateForm: {
  190. content: ''
  191. }
  192. }
  193. },
  194. onLoad(page) {
  195. this.getMemberinfo()
  196. if (page.tabCur) {
  197. this.tabCur = Number(page.tabCur)
  198. }
  199. // 设置薪资范围
  200. let numList = []
  201. for(let i = 1; i < 51; i++) {
  202. const obj = {
  203. value: String(i),
  204. label: String(i)
  205. }
  206. numList.push(obj)
  207. }
  208. this.salaryList = numList
  209. },
  210. // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
  211. onReady() {
  212. if (this.tabCur === 0) {
  213. this.$refs.intentionForm.setRules(this.intentionRules);
  214. }
  215. },
  216. methods: {
  217. /**
  218. * 获取用户基本信息
  219. */
  220. getMemberinfo(){
  221. this.$u.api.getmemberinfo().then(res => {
  222. if (res.code === 200){
  223. const data = res.data;
  224. this.evaluateForm.content = data.selfAssessment
  225. // this.intentionForm.position = res.data.expectedPost
  226. // this.intentionForm.industry = res.data.expectedIndustry
  227. this.intentionForm.expectedLowestSalary = data.expectedLowestSalary ? String(data.expectedLowestSalary) : ''
  228. this.intentionForm.expectedHighestSalary = data.expectedHighestSalary ? String(data.expectedHighestSalary) : ''
  229. if (data.provinceName) {
  230. this.intentionForm.workCity = data.provinceName + '-' + data.cityName + '-' + data.areaName
  231. }
  232. this.intentionForm.provinceId = data.provinceId
  233. this.intentionForm.provinceName = data.provinceName
  234. this.intentionForm.cityId = data.cityId
  235. this.intentionForm.cityName = data.cityName
  236. this.intentionForm.areaId = data.areaId
  237. this.intentionForm.areaName = data.areaName
  238. } else {
  239. this.$refs.uToast.show({
  240. title: res.msg,
  241. type: 'error'
  242. })
  243. }
  244. }).catch(err => {
  245. this.$refs.uToast.show({
  246. title: err.msg,
  247. type: 'error'
  248. })
  249. })
  250. },
  251. /**
  252. * 城市下拉
  253. * @param { Object } item
  254. */
  255. cityConfirm(item) {
  256. this.intentionForm.provinceName = item.province.label;
  257. this.intentionForm.provinceId = item.province.value;
  258. this.intentionForm.cityName = item.city.label;
  259. this.intentionForm.cityId = item.city.value;
  260. this.intentionForm.areaName = item.area.label;
  261. this.intentionForm.areaId = item.area.value;
  262. this.intentionForm.workCity = item.province.label + '-' + item.city.label + '-' + item.area.label
  263. },
  264. /**
  265. * 职位下拉
  266. * @param {Object} item
  267. */
  268. positionConfirm(item) {
  269. this.intentionForm.position = item[0].label
  270. this.intentionForm.positionId = item[0].value
  271. },
  272. /**
  273. * 行业下拉
  274. * @param {Object} item
  275. */
  276. industryConfirm(item) {
  277. this.intentionForm.industry = item[0].label
  278. this.intentionForm.industryId = item[0].value
  279. },
  280. /**
  281. * 最低薪资下拉
  282. * @param {Object} item
  283. */
  284. salaryLowestConfirm(item) {
  285. this.intentionForm.expectedLowestSalary = item[0].label
  286. },
  287. /**
  288. * 最高薪资下拉
  289. * @param {Object} item
  290. */
  291. salaryHighestConfirm(item) {
  292. this.intentionForm.expectedHighestSalary = item[0].label
  293. },
  294. /**
  295. * 跳转到指定页面
  296. */
  297. jumpPage(url) {
  298. this.$u.route(url)
  299. },
  300. /**
  301. * 提交求职意向
  302. */
  303. submitIntention() {
  304. this.$refs.intentionForm.validate(valid => {
  305. if (valid) {
  306. const form = {
  307. ...this.intentionForm
  308. }
  309. uni.showLoading({
  310. title: '数据提交中,请等待'
  311. })
  312. this.$u.api.resume.submitJobIntention({
  313. provinceName: form.provinceName,
  314. provinceId: form.provinceId,
  315. cityName: form.cityName,
  316. cityId: form.cityId,
  317. areaName : form.areaName ,
  318. areaId: form.areaId,
  319. expectedLowestSalary: form.expectedLowestSalary,
  320. expectedHighestSalary: form.expectedHighestSalary
  321. }).then(res => {
  322. if (res.code === 200) {
  323. this.$refs.uToast.show({
  324. title: '更新成功',
  325. type: 'success'
  326. })
  327. setTimeout(() => {
  328. uni.hideLoading()
  329. this.jumpPage('/pages/myResume/myResume');
  330. }, 300)
  331. } else {
  332. uni.hideLoading();
  333. this.$refs.uToast.show({
  334. title: res.msg,
  335. type: 'error'
  336. })
  337. }
  338. }).catch(() => {
  339. uni.hideLoading();
  340. this.$refs.uToast.show({
  341. title: '系统异常',
  342. type: 'error'
  343. })
  344. })
  345. }
  346. })
  347. },
  348. /**
  349. * 提交自我评价
  350. */
  351. submitEvaluation() {
  352. if (this.evaluateForm.content) {
  353. uni.showLoading({
  354. title: '数据提交中,请等待'
  355. })
  356. this.$u.api.resume.submitSelfAssessment({
  357. selfAssessment: this.evaluateForm.content
  358. }).then(res => {
  359. if (res.code === 200) {
  360. this.$refs.uToast.show({
  361. title: '更新成功',
  362. type: 'success'
  363. })
  364. setTimeout(() => {
  365. uni.hideLoading()
  366. this.jumpPage('/pages/myResume/myResume');
  367. }, 300)
  368. } else {
  369. uni.hideLoading();
  370. this.$refs.uToast.show({
  371. title: res.msg,
  372. type: 'error'
  373. })
  374. }
  375. }).catch(() => {
  376. uni.hideLoading();
  377. this.$refs.uToast.show({
  378. title: '系统异常',
  379. type: 'error'
  380. })
  381. })
  382. } else {
  383. uni.hideLoading()
  384. this.$refs.uToast.show({
  385. title: '请输入自我评价',
  386. type: 'warning'
  387. })
  388. }
  389. },
  390. /**
  391. * 城市下拉
  392. */
  393. workCityClick() {
  394. this.defaultRegion = [this.intentionForm.provinceName, this.intentionForm.cityName, this.intentionForm.areaName ]
  395. this.cityShow = true;
  396. }
  397. }
  398. }
  399. </script>
  400. <style lang="scss" scoped>
  401. @import './evaluationIntention.scss'
  402. </style>