jobDetails.vue 8.3 KB

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