evaluationIntention.vue 11 KB

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