evaluationIntention.vue 9.2 KB

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