jobDetails.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. <!--
  2. * @title 职位详情
  3. * @author Rockery(1113269755@qq.com)
  4. -->
  5. <template>
  6. <view class="jobdetails">
  7. <u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }"
  8. :border-bottom="false"></u-navbar>
  9. <view class="jobdetails-head">
  10. <u-card :border="false" :head-border-bottom="false" :foot-border-top="false" :padding="0" :border-radius="0"
  11. class="jobdetails-head-card">
  12. <view slot="head">
  13. <view class="jobdetails-head-cardhead">
  14. <view class="content">
  15. <view class="left">
  16. <view>{{ recruitmentData.postName }}</view>
  17. <view>{{ getDictsLabel(workYearList, recruitmentData.workYear) }} /
  18. {{ getEducationBg(recruitmentData.educationBg) }} / {{ recruitmentData.cityName }}
  19. </view>
  20. </view>
  21. <view class="right">
  22. <view class="salary">
  23. {{ `${recruitmentData.lowestSalary || ''}k - ${recruitmentData.highestSalary || ''}k` }}
  24. </view>
  25. <view v-if="recruitmentData.postStatus == 0">职位已下架</view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <view slot="body">
  31. <view class="jobdetails-head-cardbody">
  32. <view class="container" @tap="tapHeadCardBody(recruitmentData)">
  33. <view class="container-image">
  34. <u-image :src="recruitmentData.companyLogoUrl" width="96" height="96" border-radius="10"
  35. mode="aspectFill">
  36. <view slot="error">
  37. <u-image src="../../static/img/default-company.png" width="96" height="96"
  38. border-radius="10" mode="aspectFill" />
  39. </view>
  40. </u-image>
  41. </view>
  42. <view class="content">
  43. <view class="content-left">
  44. <view>{{ recruitmentData.companyName }}</view>
  45. <view>{{ getCompanyType(companyInfo.trade) }} ·
  46. {{ getCompanyScope(companyInfo.scope) }}
  47. </view>
  48. </view>
  49. <view class="content-right">
  50. <u-icon name="arrow-right" color="#d2d3d5" size="30"></u-icon>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <view slot="foot">
  57. <view class="jobdetails-head-cardfoot">
  58. <view class="content">
  59. <view class="content-left">
  60. <view>
  61. {{ `${recruitmentData.provinceName || ''}${recruitmentData.cityName || ''}${recruitmentData.areaName || ''}` }}({{ recruitmentData.companyAddress || '' }})
  62. </view>
  63. </view>
  64. <!-- <view class="content-right" @tap="tapHeadCardFoot(recruitmentData)">
  65. <u-icon name="map-fill" color="#709078" size="30" class="content-right-icon"></u-icon>
  66. <view class="content-right-text">查看位置</view>
  67. </view> -->
  68. </view>
  69. </view>
  70. </view>
  71. </u-card>
  72. </view>
  73. <view class="jobdetails-content">
  74. <u-card :border="false" :head-border-bottom="false" :foot-border-top="false" :padding="0" :border-radius="0"
  75. class="jobdetails-content-card">
  76. <view slot="head">
  77. <view class="jobdetails-content-cardhead">
  78. <view class="container">
  79. <view class="title">职位描述</view>
  80. <view class="content">
  81. <!-- <u-input :disabled="true" v-model="detailsInfo.description" type="textarea" class="content-textarea" /> -->
  82. <u-parse :html="recruitmentData.description"></u-parse>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <!-- <view slot="body">
  88. <view class="jobdetails-content-cardbody">
  89. <view class="container">
  90. <view class="title">职位要求</view>
  91. <view class="content">
  92. <u-input :disabled="true" v-model="detailsInfo.jobRequire" type="textarea" class="content-textarea" />
  93. </view>
  94. </view>
  95. </view>
  96. </view> -->
  97. </u-card>
  98. </view>
  99. <view class="jobdetailsbtn" v-if="!isSubmit && recruitmentData.postStatus == 1">
  100. <view class="jobdetailsbtn-container">
  101. <view class="jobdetailsbtn-content">
  102. <view>
  103. <u-button type="primary" @click="handleResumeClick" class="jobdetailsubmitbtn">提交简历</u-button>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. <u-toast ref="uToast" />
  109. <judge-auth ref="judgeAuth" @adoptAuth="adoptAuth" />
  110. </view>
  111. </template>
  112. <script>
  113. import JudgeAuth from '@/components/judge-auth/judge-auth.vue'
  114. export default {
  115. components: {
  116. JudgeAuth
  117. },
  118. data() {
  119. return {
  120. recruitmentData: {},
  121. detailsInfo: {},
  122. degrEducList: [],
  123. isSubmit: true,
  124. companyInfo: {},
  125. companyScopeList: [],
  126. companyTradeList: [],
  127. workYearList: []
  128. };
  129. },
  130. onLoad(param) {
  131. this.getVeteDegrEduc();
  132. this.getDict('company_scope');
  133. this.getDict('company_trade');
  134. this.getDict('work_year');
  135. if (param.id) {
  136. this.getPostDetails(param.id)
  137. this.judgeIsSubmit(param.id)
  138. }
  139. if (param.isSubmit) {
  140. this.isSubmit = param.isSubmit
  141. }
  142. },
  143. onShow() {},
  144. methods: {
  145. /**
  146. * 获取字典
  147. * company_scope 公司规模
  148. * company_trade 公司类型
  149. */
  150. getDict(key) {
  151. this.$u.api.getDictdataUrl({
  152. key: key
  153. }).then(res => {
  154. if (res.code === 200) {
  155. if (key === 'company_scope') {
  156. this.companyScopeList = res.data
  157. } else if (key === 'company_trade') {
  158. this.companyTradeList = res.data;
  159. } else if (key === 'work_year') {
  160. this.workYearList = res.data;
  161. }
  162. }
  163. })
  164. },
  165. /**
  166. * 获取企业类别
  167. * @param {Object} val
  168. */
  169. getCompanyType(val) {
  170. let name;
  171. this.companyTradeList.forEach(item => {
  172. if (item.text == val) {
  173. name = item.label
  174. }
  175. })
  176. return name;
  177. },
  178. /**
  179. * 获取企业规模
  180. * @param {Object} val
  181. */
  182. getCompanyScope(val) {
  183. let name;
  184. this.companyScopeList.forEach(item => {
  185. if (item.text == val) {
  186. name = item.label
  187. }
  188. })
  189. return name;
  190. },
  191. /**
  192. * 获取文化程度类别
  193. */
  194. getVeteDegrEduc() {
  195. this.$u.api.getDictdataUrl({
  196. key: 'degr_educ'
  197. }).then(res => {
  198. if (res.code == 200) {
  199. this.degrEducList = res.data.map(item => {
  200. return {
  201. ...item,
  202. value: item.text
  203. }
  204. });
  205. }
  206. });
  207. },
  208. /**
  209. * 获取教育等级名称
  210. * @param {Object} value
  211. */
  212. getEducationBg(value) {
  213. let name;
  214. this.degrEducList.forEach(item => {
  215. if (item.value == value) {
  216. name = item.label
  217. }
  218. })
  219. return name;
  220. },
  221. /**
  222. * 通过职位id获取详情
  223. * @param { String } id 职位id
  224. */
  225. getPostDetails(id) {
  226. this.$u.api.company.getPostDetails({
  227. id
  228. }).then(res => {
  229. if (res.code === 200) {
  230. this.recruitmentData = res.data;
  231. this.getCompanyDetails(res.data.companyId);
  232. } else {
  233. this.$refs.uToast.show({
  234. title: res.msg,
  235. type: 'error'
  236. })
  237. }
  238. }).catch(() => {
  239. this.$refs.uToast.show({
  240. title: '系统异常!',
  241. type: 'error'
  242. })
  243. })
  244. },
  245. /**
  246. * 获取企业详情
  247. * @param { String } id 获取详情企业id
  248. */
  249. getCompanyDetails(id) {
  250. this.$u.api.company.getCompanyDetails({
  251. id: id
  252. }).then(res => {
  253. if (res.code === 200) {
  254. this.companyInfo = res.data
  255. } else {
  256. this.$refs.uToast.show({
  257. title: res.msg,
  258. type: 'error'
  259. })
  260. }
  261. }).catch((err) => {
  262. this.$refs.uToast.show({
  263. title: '系统异常!',
  264. type: 'error'
  265. })
  266. })
  267. },
  268. judgeIsSubmit(id) {
  269. this.$u.api.company.judgeIsSubmit({
  270. id
  271. }).then(res => {
  272. if (res.code === 200) {
  273. if (res.data === 0) {
  274. this.isSubmit = false
  275. } else {
  276. this.isSubmit = true
  277. }
  278. } else {
  279. this.$refs.uToast.show({
  280. title: res.msg,
  281. type: 'error'
  282. })
  283. }
  284. }).catch(() => {
  285. this.$refs.uToast.show({
  286. title: '系统异常!',
  287. type: 'error'
  288. })
  289. })
  290. },
  291. /**
  292. * 企业信息事件
  293. */
  294. tapHeadCardBody(param) {
  295. this.$u.route({
  296. url: 'pages/businessDetails/businessDetails',
  297. params: {
  298. id: param.companyId
  299. }
  300. });
  301. },
  302. /**
  303. * 企业位置事件
  304. */
  305. tapHeadCardFoot(param) {
  306. },
  307. /**
  308. * 通过认证后
  309. */
  310. adoptAuth() {
  311. this.$u.api.company.deliveryResume({
  312. postId: this.recruitmentData.id
  313. }).then(res => {
  314. if (res.code === 200) {
  315. this.$u.route({
  316. url: 'pages/resumeDeliveryResults/resumeDeliveryResults',
  317. type: 'redirectTo'
  318. });
  319. } else {
  320. this.$refs.uToast.show({
  321. title: res.msg,
  322. type: 'error'
  323. })
  324. }
  325. }).catch(() => {
  326. this.$refs.uToast.show({
  327. title: '系统异常!',
  328. type: 'error'
  329. })
  330. })
  331. },
  332. /**
  333. * 提交简历按钮事件
  334. */
  335. handleResumeClick() {
  336. this.$refs['judgeAuth'].modalShow()
  337. },
  338. /**
  339. * 通过value获取label
  340. * @param {Object} list
  341. * @param {Object} value
  342. */
  343. getDictsLabel(list, value) {
  344. let label = '-';
  345. try {
  346. list.forEach(item => {
  347. if (Number(item.text) === Number(value)) {
  348. throw (item)
  349. }
  350. })
  351. } catch (e) {
  352. label = e.label
  353. }
  354. return label
  355. }
  356. }
  357. }
  358. </script>
  359. <style lang="scss" scoped>
  360. @import './scss/jobDetails.scss';
  361. </style>