myPostPush.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. <template>
  2. <div class="myPostPush">
  3. <!-- tbas -->
  4. <div class="tab flex align-center justify-center">
  5. <div class="tab-box flex align-center">
  6. <div @click="selectTab(index)" :class="tabIndex==index?'active':''" class="tab-box-item"
  7. v-for="(item,index) in tabs" :key="index">
  8. {{item.name}}
  9. </div>
  10. </div>
  11. </div>
  12. <!-- 列表 -->
  13. <div class="list flex align-center justify-center">
  14. <div class="list-box flex justify-between">
  15. <div class="list-box-l" v-if="postPushList.length>0">
  16. <div class="list-box-l-item" v-for="(item,index) in postPushList" :key="index">
  17. <div class="list-box-l-item-top flex align-center justify-between">
  18. <div class="list-box-l-item-top-l flex align-center">
  19. <img :src="item.company?.companyLogo?item.company.companyLogo:'/default.jpg'" alt="" />
  20. <span style="font-weight: 500;margin-left: 20px;">
  21. {{ item.company?.companyName || item.company?.companyAllName }}
  22. </span>
  23. </div>
  24. <div class="list-box-l-item-top-r flex align-center justify-center "
  25. :class="item.status==1?'shz':(item.status==2?'zpz':(item.status==3?'yjj':'yxx'))">
  26. {{item.statusName}}
  27. </div>
  28. </div>
  29. <div class="list-box-l-item-title">
  30. {{item.ruleClassifyName}}
  31. <span style="margin-left: 20px;color: #00DD9A;">{{item.salaryRange}} <span
  32. v-if="item.salaryTimes">--{{ item.salaryTimes }}</span></span>
  33. </div>
  34. <div v-if="item.auditContent" class="list-box-l-item-con" style="color: red;">
  35. 拒绝原因:{{ item.auditContent }}
  36. </div>
  37. <div class="list-box-l-item-bom">
  38. <div style="font-size: 13px;margin-bottom: 10px;color: #999;">{{ item.city }} {{ item.county
  39. }} {{ item.address }}</div>
  40. <div class="list-box-l-item-tag flex algin-center">
  41. <div class="list-box-l-item-tag-i">{{ item.education }}</div>
  42. <div class="list-box-l-item-tag-i">{{ item.experience }}</div>
  43. </div>
  44. </div>
  45. <div class="list-box-l-item-con">
  46. <div v-if="isHtml(item.positionDetails)" v-html="formatHtml(item.positionDetails)"></div>
  47. <template v-else>{{ item.positionDetails }}</template>
  48. </div>
  49. <div class="list-box-l-item-bom flex align-center justify-between">
  50. <div class="list-box-l-item-tag flex algin-center" v-if="item.welfareTag">
  51. <div class="list-box-l-item-tag-i" style="background: #fce9dc;color: #016bf6;"
  52. v-for="(welfareTagName, index) in item.welfareTag?item.welfareTag.split(';') : []"
  53. :key="index">{{ welfareTagName }}
  54. </div>
  55. </div>
  56. <div class="" style="padding: 0 0 20px 0;">
  57. <!-- <el-button v-if="item.status==1"
  58. @click="cancelProject(item.postPushId)">取消招聘</el-button> -->
  59. <el-button v-if="item.status == 2"
  60. @click="closeJob(item.postPushId,'close')">关闭岗位</el-button>
  61. <el-button v-if="item.status == 5"
  62. @click="closeJob(item.postPushId,'open')">开启岗位</el-button>
  63. <el-button v-if="item.status == 1 || item.status == 3 || item.status == 4 || item.status == 6"
  64. @click="updataServeType(item.postPushId,'save')">重新发布</el-button>
  65. <el-button
  66. v-if="item.status == 1 || item.status==6"
  67. @click="updataServeType(item.postPushId,'updata')">修改内容</el-button>
  68. </div>
  69. </div>
  70. </div>
  71. <div class=" flex align-center justify-end" style="width: 100%;">
  72. <el-pagination background layout="prev, pager, next" v-model="page" :default-page-size="limit"
  73. :page-count="pages" @current-change="currentChange" />
  74. </div>
  75. </div>
  76. <div class="list-box-l" style="height: 200px;" v-else>
  77. <el-empty description="暂无岗位" />
  78. </div>
  79. <div class="list-box-r">
  80. <resume @goDetails="goDetails" />
  81. </div>
  82. </div>
  83. </div>
  84. <!-- 岗位组件 -->
  85. <postPush :postPushId="postPushId" :type="type" @closePostPush="closePostPush" v-if="dialogPostPush"
  86. :dialogPostPushs="dialogPostPush" />
  87. </div>
  88. </template>
  89. <script>
  90. import resume from '../../components/resume/resume.vue'
  91. import {
  92. ElMessageBox,
  93. ElMessage,
  94. } from 'element-plus'
  95. import postPush from '../../components/postPush/postPush.vue'
  96. export default {
  97. components: {
  98. resume,
  99. postPush
  100. },
  101. data() {
  102. return {
  103. dialogPostPush: false,
  104. tabs: [{
  105. name: '全部',
  106. status: 0
  107. }, {
  108. name: '待审核',
  109. status: 1
  110. }, {
  111. name: '招聘中',
  112. status: 2
  113. }, {
  114. name: '已拒绝',
  115. status: 3
  116. }, {
  117. name: '已取消',
  118. status: 4
  119. }, {
  120. name: '已关闭',
  121. status: 5
  122. }],
  123. tabIndex: 0, // tab下标
  124. postPushList: [], //岗位列表
  125. page: 1,
  126. pages: 1,
  127. limit: 10,
  128. screenHeight: 0,
  129. postPushId: '', //岗位id
  130. type: '',
  131. companyList:[]
  132. }
  133. },
  134. mounted() {
  135. this.screenHeight = window.innerHeight
  136. this.tabIndex = this.$route.query.tabIndex
  137. this.getTabsList();
  138. this.getlist()
  139. },
  140. methods: {
  141. formatHtml(html) {
  142. return html.replace(/<p>/g, '<p style="margin:0;padding:0;">')
  143. },
  144. isHtml(str) {
  145. return /<\/?[a-z][\s\S]*>/i.test(str)
  146. },
  147. //关闭发布岗位组件的回调
  148. closePostPush(data) {
  149. //关闭组件
  150. this.dialogPostPush = data
  151. //清除岗位id
  152. this.postPushId = ''
  153. //清除类型
  154. this.type = ''
  155. //刷新列表
  156. this.page = 1
  157. this.getlist()
  158. },
  159. //修改/重新发布 type:updata save
  160. updataServeType(postPushId, type) {
  161. if (type == 'updata') { //修改岗位
  162. ElMessageBox.confirm(
  163. '确认修改吗?',
  164. '温馨提示', {
  165. confirmButtonText: '确认',
  166. cancelButtonText: '取消',
  167. type: 'warning',
  168. }
  169. ).then(() => {
  170. this.type = type
  171. this.postPushId = postPushId
  172. this.dialogPostPush = true
  173. }).catch(() => {})
  174. } else { //重新发布
  175. this.type = type
  176. this.postPushId = postPushId
  177. this.dialogPostPush = true
  178. }
  179. },
  180. //取消招聘
  181. cancelProject(postPushId) {
  182. ElMessageBox.confirm(
  183. '确认取消该招聘?',
  184. '温馨提示', {
  185. confirmButtonText: '确认',
  186. cancelButtonText: '取消',
  187. type: 'warning',
  188. }
  189. ).then(() => {
  190. let data = {
  191. postPushId: postPushId
  192. }
  193. this.$Request.post('/app/postPush/cancelPostPush', data).then(res => {
  194. if (res.code == 0) {
  195. ElMessage({
  196. message: '取消成功',
  197. type: 'success',
  198. duration: 1500,
  199. offset: this.screenHeight / 2
  200. })
  201. this.getlist()
  202. } else {
  203. ElMessage({
  204. message: res.msg,
  205. type: 'error',
  206. duration: 1500,
  207. offset: this.screenHeight / 2
  208. })
  209. }
  210. })
  211. }).catch(() => {
  212. })
  213. },
  214. //关闭岗位/开启岗位
  215. closeJob(postPushId, type) {
  216. ElMessageBox.confirm(
  217. type == 'close' ? '关闭岗位后,该岗位不会再推荐给用户,是否关闭?' : '开启岗位后,该岗位会重新推荐给用户,是否开启?',
  218. '温馨提示', {
  219. confirmButtonText: '确定',
  220. cancelButtonText: '取消',
  221. type: 'warning',
  222. }
  223. ).then(res => {
  224. let data = {
  225. postPushId: postPushId
  226. }
  227. this.$Request.get('/app/postPush/closeOrOpen', {
  228. params: data
  229. }).then(res => {
  230. if (res.code == 0) {
  231. ElMessage({
  232. message: type == 'close' ? '已关闭' : '已开启',
  233. type: 'success',
  234. duration: 1500,
  235. offset: this.screenHeight / 2
  236. })
  237. this.getlist()
  238. } else {
  239. ElMessage({
  240. message: res.msg,
  241. type: 'error',
  242. duration: 1500,
  243. offset: this.screenHeight / 2
  244. })
  245. }
  246. })
  247. }).catch(() => {
  248. })
  249. },
  250. //分页
  251. currentChange(e) {
  252. this.page = e
  253. this.getlist()
  254. },
  255. //切换状态
  256. selectTab(index) {
  257. this.tabIndex = index
  258. this.getlist()
  259. },
  260. //岗位列表
  261. getlist() {
  262. let data = {
  263. status: this.tabIndex == 0 ? '' : this.tabIndex,
  264. page: this.page,
  265. limit: this.limit,
  266. companyId: localStorage.getItem('companyId')
  267. }
  268. this.$Request.get('/app/postPush/getMyPostPush', {
  269. params: data
  270. }).then(res => {
  271. if (res.code == 0) {
  272. this.pages = res.data.pages
  273. res.data.records.forEach(ret => {
  274. ret.showpeop = false
  275. if (ret.status == 1) {
  276. ret.statusName = '待审核'
  277. } else if (ret.status == 2) {
  278. ret.statusName = '招聘中'
  279. } else if (ret.status == 3) {
  280. ret.statusName = '已拒绝'
  281. } else if (ret.status == 4) {
  282. ret.statusName = '已取消'
  283. } else if (ret.status == 5) {
  284. ret.statusName = '已关闭'
  285. } else if (ret.status == 6) {
  286. ret.statusName = '暂存'
  287. }
  288. })
  289. this.postPushList = res.data.records
  290. }
  291. })
  292. },
  293. //获取发布的岗位
  294. getTabsList() {
  295. let data = {
  296. companyId: this.$store.state.companyId ? this.$store.state.companyId : localStorage.getItem('companyId')
  297. }
  298. this.$Request.get('/app/postPush/getCompanyClassify', {
  299. params: data
  300. }).then(res => {
  301. if (res.code == 0) {
  302. this.companyList = res.data;
  303. }
  304. })
  305. },
  306. /**
  307. * @param {Object} item 详情参数
  308. * 去详情
  309. */
  310. goDetails(item) {
  311. if (this.companyList.length == 0) {
  312. ElMessage({
  313. message: '请先发布职位!',
  314. type: 'warning',
  315. })
  316. return;
  317. }
  318. if (localStorage.getItem('token')) {
  319. this.$router.push({
  320. name: 'resumeInfo',
  321. query: {
  322. resumesId: item.resumesId
  323. }
  324. })
  325. } else {
  326. this.$router.push({
  327. name: 'login'
  328. })
  329. }
  330. },
  331. }
  332. }
  333. </script>
  334. <style lang="scss" scoped>
  335. $marginTop-60: 120px;
  336. .shz {
  337. background-color: #00DD9A;
  338. color: #ffffff;
  339. }
  340. .zpz {
  341. background-color: #D0E4F9;
  342. color: #2650EC;
  343. }
  344. .yjj {
  345. background-color: #FFD7D7;
  346. color: #F13D3D;
  347. }
  348. .yxx {
  349. background-color: #F3F3F3;
  350. color: #666666;
  351. }
  352. .myPostPush {
  353. padding-bottom: 40px;
  354. }
  355. .active {
  356. border-bottom: 4px solid #00DD9A !important;
  357. color: #00DD9A !important;
  358. }
  359. .tab {
  360. width: 100%;
  361. margin-top: 20px;
  362. .tab-box {
  363. width: calc(100% - $marginTop-60 * 2);
  364. background-color: #ffffff;
  365. border-radius: 12px;
  366. }
  367. .tab-box-item {
  368. border-bottom: 4px solid #ffffff;
  369. margin-left: 40px;
  370. padding: 20px 0;
  371. cursor: pointer;
  372. color: #666666;
  373. }
  374. }
  375. .list {
  376. width: 100%;
  377. margin-top: 20px;
  378. .list-box {
  379. width: calc(100% - $marginTop-60 * 2);
  380. }
  381. .list-box-l {
  382. width: 65%;
  383. .list-box-l-item:hover {
  384. box-shadow: 0 10px 10px 0 rgba(153, 153, 153, 0.3);
  385. }
  386. .list-box-l-item {
  387. margin-bottom: 20px;
  388. background-color: #ffffff;
  389. border-radius: 12px;
  390. cursor: pointer;
  391. }
  392. .list-box-l-item-top {
  393. background-color: #F7FCFB;
  394. padding: 10px 20px;
  395. border-radius: 12px 12px 0 0;
  396. img {
  397. width: 40px;
  398. height: 40px;
  399. border-radius: 50%;
  400. object-fit: cover;
  401. }
  402. .list-box-l-item-top-l {}
  403. .list-box-l-item-top-r {
  404. font-size: 14px;
  405. width: 70px;
  406. height: 30px;
  407. border-radius: 4px;
  408. }
  409. }
  410. .list-box-l-item-title {
  411. font-weight: 500;
  412. padding: 10px 20px;
  413. }
  414. .list-box-l-item-con {
  415. font-size: 13px;
  416. color: #999999;
  417. padding: 0 20px 10px 20px;
  418. white-space: pre-wrap;
  419. }
  420. .list-box-l-item-bom {
  421. padding: 0 20px;
  422. }
  423. .list-box-l-item-tag {
  424. .list-box-l-item-tag-i {
  425. font-size: 13px;
  426. padding: 4px 8px;
  427. border-radius: 8px;
  428. background-color: #F8F8F8;
  429. margin-right: 20px;
  430. margin-bottom: 20px;
  431. }
  432. }
  433. }
  434. .list-box-r {
  435. width: calc(35% - 20px);
  436. height: fit-content;
  437. border-radius: 13px;
  438. background-color: #ffffff;
  439. }
  440. }
  441. </style>