item.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div>
  3. <div v-if="items.length">
  4. <div v-for="val in items" :key="val.id" class="itemBox mb-3" style="height: 134px;">
  5. <div class="d-flex justify-space-between" style="padding: 10px 20px;">
  6. <div class="position">
  7. <div class="d-flex align-center">
  8. <span class="position-name">{{ formatName(val.name) }}</span>
  9. </div>
  10. <div class="mt-3 other-info">
  11. <span>{{ !val.areaId ? '全国' : val.area?.str }}</span>
  12. <span class="lines" v-if="!val.areaId || val.eduName"></span>
  13. <span>{{ val.eduName }}</span>
  14. <span class="lines"></span>
  15. <span>{{ val.expName }}</span>
  16. <span class="lines"></span>
  17. <span v-if="!val.payFrom && !val.payTo">面议</span>
  18. <span v-else>{{ val.payFrom ? val.payFrom + '-' : '' }}{{ val.payTo }}{{ val.payName ? '/' + val.payName : '' }}</span>
  19. <span class="lines" v-if="val.positionName"></span>
  20. <span>{{ val.positionName }}</span>
  21. </div>
  22. </div>
  23. <div class="text-center color-primary d-flex flex-column justify-center cursor-pointer" @click="handleToResume(val)">
  24. <div class="font-weight-bold font-size-18">{{ val.count || 0 }}</div>
  25. <div class="font-size-14">已投递简历</div>
  26. </div>
  27. </div>
  28. <div class="bottom pa-5 d-flex justify-space-between align-center">
  29. <div>到期时间:{{ val.expireTime ? timesTampChange(val.expireTime, 'Y-M-D') : '长期有效' }}</div>
  30. <div class="d-flex">
  31. <span class="cursor-pointer actions" @click="handleEdit(val)">编辑</span>
  32. <span class="lines"></span>
  33. <span class="cursor-pointer actions" @click="handleRemove(val)">移出招聘会</span>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. <Empty v-else :elevation="false"></Empty>
  39. </div>
  40. <Loading :visible="loading"></Loading>
  41. </template>
  42. <script setup>
  43. defineOptions({ name: 'enterprise-position-item'})
  44. import { ref } from 'vue'
  45. import { useRouter, useRoute } from 'vue-router'
  46. import { timesTampChange } from '@/utils/date'
  47. import Snackbar from '@/plugins/snackbar'
  48. import { getEnterprisePubJobTypePermission } from '@/api/recruit/enterprise/position'
  49. import { quitJobFairPosition } from '@/api/recruit/enterprise/jobFair'
  50. import Confirm from '@/plugins/confirm'
  51. import { formatName } from '@/utils/getText'
  52. const emit = defineEmits(['refresh'])
  53. defineProps({
  54. items: Array
  55. })
  56. const loading = ref(false)
  57. const router = useRouter()
  58. const route = useRoute()
  59. // 职位编辑
  60. const handleEdit = async (val) => {
  61. const data = await getEnterprisePubJobTypePermission()
  62. if (!data || !data.length) return Snackbar.warning('没有该操作权限,请联系平台管理员升级后再试')
  63. router.push(`/recruit/enterprise/jobFair/details/${route.params.id}/edit?id=${val.id}`)
  64. }
  65. const handleRemove = ({ id }) => {
  66. Confirm('确定要移出该职位吗?', '提示').then(async () => {
  67. await quitJobFairPosition({
  68. jobFairId: route.params.id,
  69. jobId: id
  70. })
  71. Snackbar.success('移出成功')
  72. emit('refresh')
  73. })
  74. }
  75. // 查看职位投递简历
  76. const handleToResume = (val) => {
  77. router.push(`/recruit/enterprise/invite/resume?id=${val.id}&jobFairId=${route.params.id}`)
  78. }
  79. </script>
  80. <style scoped lang="scss">
  81. .itemBox {
  82. position: relative;
  83. border: 1px solid #e5e6eb;
  84. }
  85. .position-name {
  86. color: var(--color-333);
  87. font-size: 19px;
  88. }
  89. .lines {
  90. display: inline-block;
  91. width: 1px;
  92. height: 17px;
  93. vertical-align: middle;
  94. background-color: #e0e0e0;
  95. margin: 0 10px;
  96. }
  97. .other-info {
  98. font-size: 15px;
  99. color: var(--color-666);
  100. }
  101. .bottom {
  102. position: absolute;
  103. bottom: 0;
  104. left: 0;
  105. width: 100%;
  106. height: 40px;
  107. background-color: #f7f8fa;
  108. font-size: 14px;
  109. color: var(--color-888);
  110. }
  111. .actions:hover {
  112. color: var(--v-primary-base);
  113. }
  114. </style>