jobDetails.vue 8.1 KB

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