myPostPush.vue 11 KB

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