job.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <div>
  3. <div class="text-end mb-3">
  4. <v-btn color="primary" class="mr-3" @click="handleAdd">新增职位</v-btn>
  5. <v-btn color="primary" variant="outlined" @click="handleJoin">选择已发布的职位加入招聘会</v-btn>
  6. <!-- <v-btn :loading="exportLoading" prepend-icon="mdi-export-variant" color="primary" variant="tonal" class="ml-3" @click="handleExport">职位导出</v-btn> -->
  7. </div>
  8. <JobItem :items="jobList" @refresh="getJobList"></JobItem>
  9. <v-navigation-drawer v-model="showDrawer" location="right" temporary width="600">
  10. <Loading :visible="positionLoading" :contained="true"></Loading>
  11. <div class="resume-box">
  12. <div class="resume-header">
  13. <div class="resume-title mr-5">已发布职位</div>
  14. </div>
  15. </div>
  16. <div class="px-3">
  17. <v-text-field
  18. v-model="positionSearch"
  19. append-inner-icon="mdi-magnify"
  20. density="compact"
  21. :label="t('position.positionName')"
  22. variant="outlined"
  23. hide-details
  24. color="primary"
  25. single-line
  26. @click:append-inner="getPositionList"
  27. @keyup.enter="getPositionList"
  28. ></v-text-field>
  29. </div>
  30. <div class="pa-3" v-if="positionItems.length">
  31. <div v-for="val in positionItems" :key="val.id" class="itemBox mb-3" style="height: 80px;">
  32. <div class="d-flex justify-space-between" style="padding: 10px 20px;">
  33. <div class="position">
  34. <div class="d-flex align-center justify-space-between">
  35. <!-- <span v-if="val.name.indexOf('style')" v-html="val.name" class="position-name"></span> -->
  36. <span class="position-name">{{ formatName(val.name) }}</span>
  37. <div>
  38. <v-btn size="small" color="primary" @click="handleTo(val)">添加至双选会</v-btn>
  39. </div>
  40. </div>
  41. <div :class="['mt-3', 'other-info', 'ellipsis']">
  42. <span>{{ val.areaName ? val.area?.str : '全国' }}</span>
  43. <span class="lines" v-if="val.eduName"></span>
  44. <span>{{ val.eduName }}</span>
  45. <span class="lines"></span>
  46. <span>{{ val.expName }}</span>
  47. <span class="lines"></span>
  48. <span v-if="!val.payFrom && !val.payTo">面议</span>
  49. <span v-else>{{ val.payFrom ? val.payFrom + '-' : '' }}{{ val.payTo }}{{ val.payName ? '/' + val.payName : '' }}</span>
  50. <span class="lines" v-if="val.positionName"></span>
  51. <span>{{ val.positionName }}</span>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <CtPagination
  57. v-if="total"
  58. :total="positionTotal"
  59. :page="positionPageInfo.pageNo"
  60. :limit="positionPageInfo.pageSize"
  61. @handleChange="handleChangePage"
  62. ></CtPagination>
  63. </div>
  64. <Empty v-else :elevation="false"></Empty>
  65. </v-navigation-drawer>
  66. </div>
  67. </template>
  68. <script setup>
  69. defineOptions({ name: 'jobFairJob'})
  70. import { ref } from 'vue'
  71. import { getJobFairPosition } from '@/api/recruit/enterprise/jobFair'
  72. import { dealDictArrayData } from '@/utils/position.js'
  73. import JobItem from '../job/item.vue'
  74. import { useRouter, useRoute } from 'vue-router'
  75. import { useI18n } from '@/hooks/web/useI18n'
  76. import Snackbar from '@/plugins/snackbar'
  77. import { getEnterprisePubJobTypePermission } from '@/api/recruit/enterprise/position'
  78. import { getJobAdvertisedList } from '@/api/position'
  79. import download from '@/utils/download'
  80. import { formatName } from '@/utils/getText'
  81. // import Confirm from '@/plugins/confirm'
  82. const props = defineProps({ id: [String, Number]})
  83. const router = useRouter()
  84. const route = useRoute()
  85. const { t } = useI18n()
  86. // 职位列表
  87. const jobList = ref([])
  88. const positionItems = ref([])
  89. const positionTotal = ref(0)
  90. const positionLoading = ref(false)
  91. const total = ref(0)
  92. const positionPageInfo = ref({
  93. pageSize: 10,
  94. pageNo: 1,
  95. })
  96. const positionSearch = ref('')
  97. const getJobList = async () => {
  98. const data = await getJobFairPosition(props.id)
  99. if (!data || !data.length) return jobList.value = []
  100. jobList.value = dealDictArrayData([], data)
  101. }
  102. const handleAdd = async () => {
  103. const data = await getEnterprisePubJobTypePermission()
  104. if (!data || !data.length) return Snackbar.warning('没有该操作权限,请联系平台管理员升级后再试')
  105. router.push(`/recruit/enterprise/jobFair/details/${route.params.id}/edit`)
  106. }
  107. const showDrawer = ref(false)
  108. const handleJoin = async () => {
  109. getPositionList()
  110. showDrawer.value = true
  111. }
  112. const handleChangePage = (index) => {
  113. positionPageInfo.value.pageNo = index
  114. getPositionList()
  115. }
  116. const handleTo = (val) => {
  117. router.push(`/recruit/enterprise/jobFair/details/${route.params.id}/edit?id=${val.id}`)
  118. }
  119. // 获取职位列表
  120. const getPositionList = async () => {
  121. positionLoading.value = true
  122. const query = {
  123. ...positionPageInfo.value,
  124. status: 0,
  125. hasExpiredData: false,
  126. hire: false
  127. }
  128. if ( positionSearch.value) {
  129. Object.assign(query, {
  130. name: positionSearch.value,
  131. })
  132. }
  133. try {
  134. const { list, total } = await getJobAdvertisedList(query)
  135. positionTotal.value = total
  136. positionItems.value = list.length ? dealDictArrayData([], list) : []
  137. } finally {
  138. positionLoading.value = false
  139. }
  140. }
  141. getJobList()
  142. // // 导出参加双选会职位
  143. // const exportLoading = ref(false)
  144. // const handleExport = async () => {
  145. // exportLoading.value = true
  146. // try {
  147. // const data = await getJobFairAdvertisedExport()
  148. // download.excel(data, '招聘会职位列表' + '.xlsx')
  149. // } finally {
  150. // exportLoading.value = false
  151. // }
  152. // }
  153. </script>
  154. <style scoped lang="scss">
  155. .resume-box {
  156. padding-top: 120px;
  157. }
  158. .itemBox {
  159. position: relative;
  160. border: 1px solid #e5e6eb;
  161. }
  162. .position-name {
  163. color: var(--color-333);
  164. font-size: 19px;
  165. }
  166. .position {
  167. width: 100%;
  168. position: relative;
  169. .item-select {
  170. position: absolute;
  171. left: -8px;
  172. top: -13px;
  173. }
  174. }
  175. .lines {
  176. display: inline-block;
  177. width: 1px;
  178. height: 17px;
  179. vertical-align: middle;
  180. background-color: #e0e0e0;
  181. margin: 0 10px;
  182. }
  183. .other-info {
  184. font-size: 15px;
  185. color: var(--color-666);
  186. }
  187. .bottom {
  188. position: absolute;
  189. bottom: 0;
  190. left: 0;
  191. width: 100%;
  192. height: 40px;
  193. background-color: #f7f8fa;
  194. font-size: 14px;
  195. color: var(--color-888);
  196. }
  197. .actions:hover {
  198. color: var(--v-primary-base);
  199. }
  200. </style>