evaluationIntention.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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="city" required>
  32. <u-input v-model="intentionForm.city" type="select" @click="cityShow = true" placeholder="请选择工作城市"/>
  33. <u-select v-model="cityShow" :list="cityList" @confirm="cityConfirm"></u-select>
  34. </u-form-item>
  35. <u-form-item label="期望职位" prop="position" required>
  36. <u-input v-model="intentionForm.position" type="select" @click="positionShow = true" placeholder="请选择期望职位"/>
  37. <u-select v-model="positionShow" :list="positionList" @confirm="positionConfirm"></u-select>
  38. </u-form-item>
  39. <u-form-item label="期望行业" prop="industry" required>
  40. <u-input v-model="intentionForm.industry" type="select" @click="industryShow = true" placeholder="请选择期望行业"/>
  41. <u-select v-model="industryShow" :list="industryList" @confirm="industryConfirm"></u-select>
  42. </u-form-item>
  43. <u-form-item label="薪资要求" prop="salary" required>
  44. <u-input v-model="intentionForm.salary" type="select" @click="salaryShow = true" placeholder="请选择薪资要求"/>
  45. <u-select v-model="salaryShow" :list="salaryList" @confirm="salaryConfirm"></u-select>
  46. </u-form-item>
  47. </u-form>
  48. <view class="evaluate-intention-intention-submit">
  49. <u-button type="primary" class="btn" @click="submitIntention">开始找工作</u-button>
  50. </view>
  51. <view class="evaluate-intention-intention-explain">去完善项目经历,让更多HR看到你</view>
  52. </view>
  53. <!-- 自我评价 -->
  54. <view class="evaluate-intention-evaluate" v-else-if="tabCur === 1">
  55. <u-form
  56. :model="evaluateForm"
  57. ref="evaluateForm"
  58. label-position="top"
  59. >
  60. <u-form-item label="自我评价">
  61. <u-input
  62. v-model="evaluateForm.content"
  63. type="textarea"
  64. :border="true"
  65. :height="150"
  66. :auto-height="true"
  67. />
  68. </u-form-item>
  69. </u-form>
  70. <view class="evaluate-intention-evaluate-submit">
  71. <u-button type="primary" class="btn" @click="submitEvaluation">提交</u-button>
  72. </view>
  73. </view>
  74. <u-toast ref="uToast" />
  75. </view>
  76. </template>
  77. <script>
  78. import { industry } from './industry.js';
  79. import { city } from './city.js'
  80. export default {
  81. data() {
  82. return {
  83. list: [
  84. {
  85. name: '求职意向'
  86. },
  87. {
  88. name: '自我评价'
  89. }
  90. ],
  91. tabCur: 0,
  92. intentionForm: {
  93. city: '',
  94. cityId: '',
  95. position: '',
  96. positionId: '',
  97. industry: '',
  98. industryId: '',
  99. salary: '',
  100. salaryId: ''
  101. },
  102. intentionRules: {
  103. city: [
  104. {
  105. required: true,
  106. message: '请选择您的工作城市',
  107. trigger: ['change','blur']
  108. }
  109. ],
  110. position: [
  111. {
  112. required: true,
  113. message: '请选择您的期望职位',
  114. trigger: ['change', 'blur']
  115. }
  116. ],
  117. industry: [
  118. {
  119. required: true,
  120. message: '请选择您的期望行业',
  121. trigger: ['change', 'blur']
  122. }
  123. ],
  124. salary: [
  125. {
  126. required: true,
  127. message: '请选择您的期望薪资',
  128. trigger: ['change', 'blur']
  129. }
  130. ]
  131. },
  132. // 城市下拉显示
  133. cityShow: false,
  134. // 城市列表
  135. cityList: city,
  136. // 职位下拉显示
  137. positionShow: false,
  138. // 职位列表
  139. positionList: [
  140. {
  141. value: 1,
  142. label: '保安'
  143. },
  144. {
  145. value: 2,
  146. label: '服务员'
  147. },
  148. {
  149. value: 3,
  150. label: '消防员'
  151. }
  152. ],
  153. // 行业下拉显示
  154. industryShow: false,
  155. // 行业列表
  156. industryList: industry,
  157. // 薪资下拉显示
  158. salaryShow: false,
  159. // 薪资列表
  160. salaryList: [
  161. {
  162. value: 1,
  163. label: '1 ~ 3'
  164. },
  165. {
  166. value: 2,
  167. label: '3 ~ 5'
  168. },
  169. {
  170. value: 3,
  171. label: '5 ~ 7'
  172. },
  173. {
  174. value: 4,
  175. label: '7 ~ 10'
  176. },
  177. {
  178. value: 5,
  179. label: '10 ~ 以上'
  180. }
  181. ],
  182. // 自我评价
  183. evaluateForm: {
  184. content: ''
  185. }
  186. }
  187. },
  188. onLoad(page) {
  189. this.getMemberinfo()
  190. if (page.tabCur) {
  191. this.tabCur = Number(page.tabCur)
  192. }
  193. },
  194. // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
  195. onReady() {
  196. if (this.tabCur === 0) {
  197. this.$refs.intentionForm.setRules(this.intentionRules);
  198. }
  199. },
  200. methods: {
  201. /**
  202. * 获取用户基本信息
  203. */
  204. getMemberinfo(){
  205. this.$u.api.getmemberinfo().then(res => {
  206. if (res.code === 200){
  207. this.evaluateForm.content = res.data.selfAssessment
  208. this.intentionForm.city = res.data.workCity
  209. this.evaluateForm.position = res.data.expectedPost
  210. this.evaluateForm.industry = res.data.expectedIndustry
  211. this.evaluateForm.salary = (res.data.expectedLowestSalary + 'k ~ ' + res.data.expectedHighestSalary + 'k')
  212. } else {
  213. this.$refs.uToast.show({
  214. title: res.msg,
  215. type: 'error'
  216. })
  217. }
  218. }).catch(err => {
  219. this.$refs.uToast.show({
  220. title: err.msg,
  221. type: 'error'
  222. })
  223. })
  224. },
  225. /**
  226. * 城市下拉
  227. * @param { Object } item
  228. */
  229. cityConfirm(item) {
  230. this.intentionForm.city = item[0].label
  231. this.intentionForm.cityId = item[0].value
  232. },
  233. /**
  234. * 职位下拉
  235. * @param {Object} item
  236. */
  237. positionConfirm(item) {
  238. this.intentionForm.position = item[0].label
  239. this.intentionForm.positionId = item[0].value
  240. },
  241. /**
  242. * 行业下拉
  243. * @param {Object} item
  244. */
  245. industryConfirm(item) {
  246. this.intentionForm.industry = item[0].label
  247. this.intentionForm.industryId = item[0].value
  248. },
  249. /**
  250. * 薪资下拉
  251. * @param {Object} item
  252. */
  253. salaryConfirm(item) {
  254. this.intentionForm.salary = item[0].label
  255. this.intentionForm.salaryId = item[0].value
  256. },
  257. /**
  258. * 跳转到指定页面
  259. */
  260. jumpPage(url) {
  261. this.$u.route(url)
  262. },
  263. submitIntention() {
  264. this.$refs.intentionForm.validate(valid => {
  265. if (valid) {
  266. const form = {
  267. ...this.intentionForm
  268. }
  269. uni.showLoading({
  270. title: '数据提交中,请等待'
  271. })
  272. this.$u.api.resume.submitJobIntention({
  273. workCity: form.city,
  274. expectedPost: form.position,
  275. expectedIndustry: form.industry,
  276. expectedLowestSalary: form.salary.split(' ~ ')[0],
  277. expectedHighestSalary: form.salary.split(' ~ ')[1]
  278. }).then(res => {
  279. if (res.code === 200) {
  280. this.$refs.uToast.show({
  281. title: '更新成功',
  282. type: 'success'
  283. })
  284. setTimeout(() => {
  285. uni.hideLoading()
  286. this.jumpPage('/pages/myResume/myResume');
  287. }, 300)
  288. } else {
  289. uni.hideLoading();
  290. this.$refs.uToast.show({
  291. title: res.msg,
  292. type: 'error'
  293. })
  294. }
  295. }).catch(() => {
  296. uni.hideLoading();
  297. this.$refs.uToast.show({
  298. title: '系统异常',
  299. type: 'error'
  300. })
  301. })
  302. }
  303. })
  304. },
  305. /**
  306. * 提交自我评价
  307. */
  308. submitEvaluation() {
  309. if (this.evaluateForm.content) {
  310. uni.showLoading({
  311. title: '数据提交中,请等待'
  312. })
  313. this.$u.api.resume.submitSelfAssessment({
  314. selfAssessment: this.evaluateForm.content
  315. }).then(res => {
  316. if (res.code === 200) {
  317. this.$refs.uToast.show({
  318. title: '更新成功',
  319. type: 'success'
  320. })
  321. setTimeout(() => {
  322. uni.hideLoading()
  323. this.jumpPage('/pages/myResume/myResume');
  324. }, 300)
  325. } else {
  326. uni.hideLoading();
  327. this.$refs.uToast.show({
  328. title: res.msg,
  329. type: 'error'
  330. })
  331. }
  332. }).catch(() => {
  333. uni.hideLoading();
  334. this.$refs.uToast.show({
  335. title: '系统异常',
  336. type: 'error'
  337. })
  338. })
  339. } else {
  340. uni.hideLoading()
  341. this.$refs.uToast.show({
  342. title: '请输入自我评价',
  343. type: 'warning'
  344. })
  345. }
  346. }
  347. }
  348. }
  349. </script>
  350. <style lang="scss" scoped>
  351. @import './evaluationIntention.scss'
  352. </style>