jobDetails.vue 8.0 KB

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