evaluationIntention.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  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. <u-city-select 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. export default {
  85. data() {
  86. return {
  87. list: [
  88. {
  89. name: '期望薪资'
  90. },
  91. {
  92. name: '自我评价'
  93. }
  94. ],
  95. tabCur: 0,
  96. intentionForm: {
  97. provinceName: '',
  98. provinceId: '',
  99. cityName: '',
  100. cityId: '',
  101. areaName : '',
  102. areaId: '',
  103. // position: '',
  104. // positionId: '',
  105. // industry: '',
  106. // industryId: '',
  107. expectedLowestSalary: '',
  108. expectedHighestSalary: '',
  109. workCity: ''
  110. },
  111. defaultRegion: [],
  112. intentionRules: {
  113. cityName: [
  114. {
  115. required: true,
  116. message: '请选择您的工作城市',
  117. trigger: ['change','blur']
  118. }
  119. ],
  120. // position: [
  121. // {
  122. // required: true,
  123. // message: '请选择您的期望职位',
  124. // trigger: ['change', 'blur']
  125. // }
  126. // ],
  127. // industry: [
  128. // {
  129. // required: true,
  130. // message: '请选择您的期望行业',
  131. // trigger: ['change', 'blur']
  132. // }
  133. // ],
  134. expectedLowestSalary: [
  135. {
  136. required: true,
  137. message: '请选择您的最低薪资要求',
  138. trigger: ['change', 'blur']
  139. }
  140. ],
  141. expectedHighestSalary: [
  142. {
  143. required: true,
  144. message: '请选择您的最高薪资要求',
  145. trigger: ['change', 'blur']
  146. },
  147. {
  148. validator: (rule, value, callback) => {
  149. return Number(value) >= Number(this.intentionForm.expectedLowestSalary);
  150. },
  151. message: '最高薪资要求不能小于最低薪资要求',
  152. trigger: ['change', 'blur']
  153. }
  154. ]
  155. },
  156. // 城市下拉显示
  157. cityShow: false,
  158. // 职位下拉显示
  159. positionShow: false,
  160. // 职位列表
  161. positionList: [
  162. {
  163. value: 1,
  164. label: '保安'
  165. },
  166. {
  167. value: 2,
  168. label: '服务员'
  169. },
  170. {
  171. value: 3,
  172. label: '消防员'
  173. }
  174. ],
  175. // 行业下拉显示
  176. industryShow: false,
  177. // 行业列表
  178. industryList: industry,
  179. // 薪资下拉显示
  180. highestSalaryShow: false,
  181. lowestsalaryShow: false,
  182. // 薪资列表
  183. salaryList: [],
  184. // 自我评价
  185. evaluateForm: {
  186. content: ''
  187. }
  188. }
  189. },
  190. onLoad(page) {
  191. this.getMemberinfo()
  192. if (page.tabCur) {
  193. this.tabCur = Number(page.tabCur)
  194. }
  195. // 设置薪资范围
  196. let numList = []
  197. for(let i = 1; i < 51; i++) {
  198. const obj = {
  199. value: String(i),
  200. label: String(i)
  201. }
  202. numList.push(obj)
  203. }
  204. this.salaryList = numList
  205. },
  206. // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
  207. onReady() {
  208. if (this.tabCur === 0) {
  209. this.$refs.intentionForm.setRules(this.intentionRules);
  210. }
  211. },
  212. methods: {
  213. /**
  214. * 获取用户基本信息
  215. */
  216. getMemberinfo(){
  217. this.$u.api.getmemberinfo().then(res => {
  218. if (res.code === 200){
  219. const data = res.data;
  220. this.evaluateForm.content = data.selfAssessment
  221. // this.intentionForm.position = res.data.expectedPost
  222. // this.intentionForm.industry = res.data.expectedIndustry
  223. this.intentionForm.expectedLowestSalary = String(data.expectedLowestSalary)
  224. this.intentionForm.expectedHighestSalary = String(data.expectedHighestSalary)
  225. if (data.provinceName) {
  226. this.intentionForm.workCity = data.provinceName + '-' + data.cityName + '-' + data.areaName
  227. }
  228. this.intentionForm.provinceId = data.provinceId
  229. this.intentionForm.provinceName = data.provinceName
  230. this.intentionForm.cityId = data.cityId
  231. this.intentionForm.cityName = data.cityName
  232. this.intentionForm.areaId = data.areaId
  233. this.intentionForm.areaName = data.areaName
  234. } else {
  235. this.$refs.uToast.show({
  236. title: res.msg,
  237. type: 'error'
  238. })
  239. }
  240. }).catch(err => {
  241. this.$refs.uToast.show({
  242. title: err.msg,
  243. type: 'error'
  244. })
  245. })
  246. },
  247. /**
  248. * 城市下拉
  249. * @param { Object } item
  250. */
  251. cityConfirm(item) {
  252. this.intentionForm.provinceName = item.province.label;
  253. this.intentionForm.provinceId = item.province.value;
  254. this.intentionForm.cityName = item.city.label;
  255. this.intentionForm.cityId = item.city.value;
  256. this.intentionForm.areaName = item.area.label;
  257. this.intentionForm.areaId = item.area.value;
  258. this.intentionForm.workCity = item.province.label + '-' + item.city.label + '-' + item.area.label
  259. },
  260. /**
  261. * 职位下拉
  262. * @param {Object} item
  263. */
  264. positionConfirm(item) {
  265. this.intentionForm.position = item[0].label
  266. this.intentionForm.positionId = item[0].value
  267. },
  268. /**
  269. * 行业下拉
  270. * @param {Object} item
  271. */
  272. industryConfirm(item) {
  273. this.intentionForm.industry = item[0].label
  274. this.intentionForm.industryId = item[0].value
  275. },
  276. /**
  277. * 最低薪资下拉
  278. * @param {Object} item
  279. */
  280. salaryLowestConfirm(item) {
  281. this.intentionForm.expectedLowestSalary = item[0].label
  282. },
  283. /**
  284. * 最高薪资下拉
  285. * @param {Object} item
  286. */
  287. salaryHighestConfirm(item) {
  288. this.intentionForm.expectedHighestSalary = item[0].label
  289. },
  290. /**
  291. * 跳转到指定页面
  292. */
  293. jumpPage(url) {
  294. this.$u.route(url)
  295. },
  296. /**
  297. * 提交求职意向
  298. */
  299. submitIntention() {
  300. this.$refs.intentionForm.validate(valid => {
  301. if (valid) {
  302. const form = {
  303. ...this.intentionForm
  304. }
  305. uni.showLoading({
  306. title: '数据提交中,请等待'
  307. })
  308. this.$u.api.resume.submitJobIntention({
  309. provinceName: form.provinceName,
  310. provinceId: form.provinceId,
  311. cityName: form.cityName,
  312. cityId: form.cityId,
  313. areaName : form.areaName ,
  314. areaId: form.areaId,
  315. expectedLowestSalary: form.expectedLowestSalary,
  316. expectedHighestSalary: form.expectedHighestSalary
  317. }).then(res => {
  318. if (res.code === 200) {
  319. this.$refs.uToast.show({
  320. title: '更新成功',
  321. type: 'success'
  322. })
  323. setTimeout(() => {
  324. uni.hideLoading()
  325. this.jumpPage('/pages/myResume/myResume');
  326. }, 300)
  327. } else {
  328. uni.hideLoading();
  329. this.$refs.uToast.show({
  330. title: res.msg,
  331. type: 'error'
  332. })
  333. }
  334. }).catch(() => {
  335. uni.hideLoading();
  336. this.$refs.uToast.show({
  337. title: '系统异常',
  338. type: 'error'
  339. })
  340. })
  341. }
  342. })
  343. },
  344. /**
  345. * 提交自我评价
  346. */
  347. submitEvaluation() {
  348. if (this.evaluateForm.content) {
  349. uni.showLoading({
  350. title: '数据提交中,请等待'
  351. })
  352. this.$u.api.resume.submitSelfAssessment({
  353. selfAssessment: this.evaluateForm.content
  354. }).then(res => {
  355. if (res.code === 200) {
  356. this.$refs.uToast.show({
  357. title: '更新成功',
  358. type: 'success'
  359. })
  360. setTimeout(() => {
  361. uni.hideLoading()
  362. this.jumpPage('/pages/myResume/myResume');
  363. }, 300)
  364. } else {
  365. uni.hideLoading();
  366. this.$refs.uToast.show({
  367. title: res.msg,
  368. type: 'error'
  369. })
  370. }
  371. }).catch(() => {
  372. uni.hideLoading();
  373. this.$refs.uToast.show({
  374. title: '系统异常',
  375. type: 'error'
  376. })
  377. })
  378. } else {
  379. uni.hideLoading()
  380. this.$refs.uToast.show({
  381. title: '请输入自我评价',
  382. type: 'warning'
  383. })
  384. }
  385. },
  386. /**
  387. * 城市下拉
  388. */
  389. workCityClick() {
  390. this.defaultRegion = [this.intentionForm.provinceName, this.intentionForm.cityName, this.intentionForm.areaName ]
  391. this.cityShow = true;
  392. }
  393. }
  394. }
  395. </script>
  396. <style lang="scss" scoped>
  397. @import './evaluationIntention.scss'
  398. </style>