jobDetails.vue 7.8 KB

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