jobDetails.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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>经验{{ 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" />
  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. };
  128. },
  129. onLoad(param) {
  130. this.getVeteDegrEduc();
  131. this.getDict('company_scope');
  132. this.getDict('company_trade');
  133. if (param.id) {
  134. this.getPostDetails(param.id)
  135. this.judgeIsSubmit(param.id)
  136. }
  137. if (param.isSubmit) {
  138. this.isSubmit = param.isSubmit
  139. }
  140. },
  141. onShow() {},
  142. methods: {
  143. /**
  144. * 获取字典
  145. * company_scope 公司规模
  146. * company_trade 公司类型
  147. */
  148. getDict(key) {
  149. this.$u.api.getDictdataUrl({
  150. key: key
  151. }).then(res => {
  152. if (res.code === 200) {
  153. if (key === 'company_scope') {
  154. this.companyScopeList = res.data
  155. } else if (key === 'company_trade') {
  156. this.companyTradeList = res.data;
  157. }
  158. }
  159. })
  160. },
  161. /**
  162. * 获取企业类别
  163. * @param {Object} val
  164. */
  165. getCompanyType(val) {
  166. let name;
  167. this.companyTradeList.forEach(item => {
  168. if (item.text == val) {
  169. name = item.label
  170. }
  171. })
  172. return name;
  173. },
  174. /**
  175. * 获取企业规模
  176. * @param {Object} val
  177. */
  178. getCompanyScope(val) {
  179. let name;
  180. this.companyScopeList.forEach(item => {
  181. if (item.text == val) {
  182. name = item.label
  183. }
  184. })
  185. return name;
  186. },
  187. /**
  188. * 获取文化程度类别
  189. */
  190. getVeteDegrEduc() {
  191. this.$u.api.getDictdataUrl({
  192. key: 'degr_educ'
  193. }).then(res => {
  194. if (res.code == 200) {
  195. this.degrEducList = res.data.map(item => {
  196. return {
  197. ...item,
  198. value: item.text
  199. }
  200. });
  201. }
  202. });
  203. },
  204. /**
  205. * 获取教育等级名称
  206. * @param {Object} value
  207. */
  208. getEducationBg(value) {
  209. let name;
  210. this.degrEducList.forEach(item => {
  211. if (item.value == value) {
  212. name = item.label
  213. }
  214. })
  215. return name;
  216. },
  217. /**
  218. * 通过职位id获取详情
  219. * @param { String } id 职位id
  220. */
  221. getPostDetails(id) {
  222. this.$u.api.company.getPostDetails({
  223. id
  224. }).then(res => {
  225. if (res.code === 200) {
  226. this.recruitmentData = res.data;
  227. this.getCompanyDetails(res.data.companyId);
  228. } else {
  229. this.$refs.uToast.show({
  230. title: res.msg,
  231. type: 'error'
  232. })
  233. }
  234. }).catch(() => {
  235. this.$refs.uToast.show({
  236. title: '系统异常!',
  237. type: 'error'
  238. })
  239. })
  240. },
  241. /**
  242. * 获取企业详情
  243. * @param { String } id 获取详情企业id
  244. */
  245. getCompanyDetails(id) {
  246. this.$u.api.company.getCompanyDetails({
  247. id: id
  248. }).then(res => {
  249. if (res.code === 200) {
  250. this.companyInfo = res.data
  251. } else {
  252. this.$refs.uToast.show({
  253. title: res.msg,
  254. type: 'error'
  255. })
  256. }
  257. }).catch((err) => {
  258. this.$refs.uToast.show({
  259. title: '系统异常!',
  260. type: 'error'
  261. })
  262. })
  263. },
  264. judgeIsSubmit(id) {
  265. this.$u.api.company.judgeIsSubmit({
  266. id
  267. }).then(res => {
  268. if (res.code === 200) {
  269. if (res.data === 0) {
  270. this.isSubmit = false
  271. } else {
  272. this.isSubmit = true
  273. }
  274. } else {
  275. this.$refs.uToast.show({
  276. title: res.msg,
  277. type: 'error'
  278. })
  279. }
  280. }).catch(() => {
  281. this.$refs.uToast.show({
  282. title: '系统异常!',
  283. type: 'error'
  284. })
  285. })
  286. },
  287. /**
  288. * 企业信息事件
  289. */
  290. tapHeadCardBody(param) {
  291. this.$u.route({
  292. url: 'pages/businessDetails/businessDetails',
  293. params: {
  294. id: param.companyId
  295. }
  296. });
  297. },
  298. /**
  299. * 企业位置事件
  300. */
  301. tapHeadCardFoot(param) {
  302. },
  303. /**
  304. * 提交简历按钮事件
  305. */
  306. handleResumeClick() {
  307. if (Number(this.vuex_memberInfo.auditStatus) === 2) {
  308. this.$u.api.company.deliveryResume({
  309. postId: this.recruitmentData.id
  310. }).then(res => {
  311. if (res.code === 200) {
  312. this.$u.route({
  313. url: 'pages/resumeDeliveryResults/resumeDeliveryResults',
  314. params: {
  315. // item: JSON.stringify(param)
  316. }
  317. });
  318. } else {
  319. this.$refs.uToast.show({
  320. title: res.msg,
  321. type: 'error'
  322. })
  323. }
  324. }).catch(() => {
  325. this.$refs.uToast.show({
  326. title: '系统异常!',
  327. type: 'error'
  328. })
  329. })
  330. } else {
  331. this.$refs['judgeAuth'].modalShow(true)
  332. }
  333. }
  334. }
  335. }
  336. </script>
  337. <style lang="scss" scoped>
  338. @import './scss/jobDetails.scss';
  339. </style>