item.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div class="position-item mb-3 job-closed" :class="val.active ? 'elevation-8' : 'elevation-3'"
  3. style="position: relative;"
  4. v-for="(val, i) in props.items" :key="i" @mouseenter="val.active = true" @mouseleave="val.active = false"
  5. >
  6. <div class="info-header">
  7. <div v-if="val.active && val.status === '0' && val.job.status === '0'" class="header-btn">
  8. <v-btn color="primary" size="small" @click.stop="handleAgree(val)">同意</v-btn>
  9. <v-btn class="ml-3" color="error" size="small" @click.stop="handleRefuse(val)">拒绝</v-btn>
  10. </div>
  11. <div v-if="val.job.status === '1'" class="font-size-14 header-btn color-error">职位已关闭</div>
  12. <!-- <div v-if="tab === '1' || tab === '98'" class="float-right font-size-13" :style="{'padding': '12px 12px 0 0', 'color': tab === '1' ? 'var(--v-primary-base)' : 'var(--v-error-base)'}">
  13. 您已于{{ timesTampChange(val.updateTime, 'Y-M-D h:m') }}{{ tab === '1' ? '接受' : '拒绝'}}了此面试邀请
  14. </div> -->
  15. <div class="img-box">
  16. <v-avatar :image="getUserAvatar(val.contact.avatar, val.contact.sex)" size="x-small"></v-avatar>
  17. <span class="name">
  18. <span class="mx-3">{{ val.contact.name }}</span>
  19. <span class="gray">{{ val.contact.postNameCn }}</span>
  20. <span v-if="val.invitePhone" class="septal-line"></span>
  21. <span class="gray">{{ val.invitePhone }}</span>
  22. </span>
  23. </div>
  24. </div>
  25. <div class="info-content">
  26. <div class="font-size-16 color-333 mr-5" style="width: 470px;">
  27. <div v-if="tab === '1' || tab === '98'" class="font-size-13 mb-1" :style="{'color': tab === '1' ? 'var(--v-primary-base)' : 'var(--v-error-base)'}">您已于{{ timesTampChange(val.updateTime, 'Y-M-D h:m') }}{{ tab === '1' ? '接受' : '拒绝'}}了此面试邀请</div>
  28. <div>面试时间:{{ timesTampChange(val.time, 'Y-M-D h:m') }}</div>
  29. <div class="mt-3 ellipsis" style="max-width: 470px;">面试地点:{{ val.address }}</div>
  30. </div>
  31. <div class="job-info color-666">
  32. <div class="job-name ellipsis" style="max-width: 410px;">
  33. <span class="mr-3" :class="{'cursor-pointer': val.job.status === '0', 'position-name': val.job.status === '0'}" @click.stop="handleToPositionDetails(val)">{{ formatName(val.job.name) }}</span>
  34. <span v-if="!val.job.payFrom && !val.job.payTo">面议</span>
  35. <span v-else>{{ val.job.payFrom ? val.job.payFrom + '-' : '' }}{{ val.job.payTo }}{{ val.job.payName ? '/' + val.job.payName : '' }}</span>
  36. </div>
  37. <div class="job-other d-flex align-center">
  38. <div style="width: 30px;height: 30px;">
  39. <v-img width="30" height="30" :src="val.enterprise.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'" rounded contain></v-img>
  40. </div>
  41. <div class="ellipsis" style="max-width: 400px;">
  42. <span class="mx-2 enterprise-name" @click.stop="jumpToEnterpriseDetail(val.enterprise.id, true)">{{ formatName(val.enterprise.anotherName || val.enterprise.name) }}</span>
  43. <span v-if="val.enterprise.industryName || val.enterprise.scaleName">
  44. [
  45. <span>{{ val.enterprise.industryName }}</span>
  46. <span v-if="val.enterprise.industryName && val.enterprise.scaleName">&nbsp;·&nbsp;</span>
  47. <span>{{ val.enterprise.scaleName }}</span>
  48. ]
  49. </span>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </template>
  56. <script setup>
  57. defineOptions({ name: 'interview-item'})
  58. import { useI18n } from '@/hooks/web/useI18n'
  59. import { timesTampChange } from '@/utils/date'
  60. import { userInterviewInviteReject, userInterviewInviteConsent } from '@/api/recruit/personal/personalCenter'
  61. import Snackbar from '@/plugins/snackbar'
  62. import Confirm from '@/plugins/confirm'
  63. import { getUserAvatar } from '@/utils/avatar'
  64. import { useRouter } from 'vue-router'
  65. import { formatName } from '@/utils/getText'
  66. import { jumpToEnterpriseDetail } from '@/utils/position'
  67. const { t } = useI18n()
  68. const emits = defineEmits(['refresh'])
  69. const props = defineProps({
  70. items: {
  71. type: Array,
  72. default: () => []
  73. },
  74. tab: {
  75. type: String,
  76. default: '0'
  77. }
  78. })
  79. const router = useRouter()
  80. // 职位详情
  81. const handleToPositionDetails = (item) => {
  82. if (item.job.status === '1') return
  83. router.push(`/recruit/personal/position/details/${item.job.id}`)
  84. }
  85. // 同意
  86. const handleAgree = (val) => {
  87. if (!val.id) return
  88. const query = {
  89. id: val.id
  90. }
  91. const userInfo = localStorage.getItem('userInfo')
  92. if (userInfo) {
  93. const { phone } = JSON.parse(userInfo)
  94. query.phone = phone
  95. }
  96. Confirm(t('common.confirmTitle'), '是否确定接收此面试邀请?').then(async () => {
  97. await userInterviewInviteConsent(query)
  98. Snackbar.success(t('common.operationSuccessful'))
  99. emits('refresh')
  100. })
  101. }
  102. // 拒绝
  103. const handleRefuse = (val) => {
  104. if (!val.id) return
  105. Confirm(t('common.confirmTitle'), '您是否确定要拒绝此面试邀请?').then(async () => {
  106. await userInterviewInviteReject(val.id)
  107. Snackbar.success(t('common.operationSuccessful'))
  108. emits('refresh')
  109. })
  110. }
  111. </script>
  112. <style scoped lang="scss">
  113. .position-item {
  114. height: 160px;
  115. background-color: #fff;
  116. border-radius: 12px;
  117. .info-header {
  118. height: 48px;
  119. background: linear-gradient(90deg,#f5fcfc,#fcfbfa);
  120. border-radius: 12px;
  121. .img-box {
  122. padding: 12px 24px;
  123. .name {
  124. color: var(--color-222);
  125. font-weight: 400;
  126. font-size: 13px;
  127. .gray {
  128. color: var(--color-666);
  129. }
  130. }
  131. }
  132. .header-btn {
  133. padding: 10px 10px 0 0;
  134. float: right;
  135. .v-btn {
  136. z-index: 1;
  137. }
  138. }
  139. }
  140. .info-content {
  141. display: flex;
  142. padding: 16px 24px;
  143. justify-content: space-between;
  144. .job-info {
  145. width: 360px;
  146. max-width: 360px;
  147. font-weight: 500;
  148. font-size: 14px;
  149. margin-right: 12px;
  150. .job-name {
  151. height: 22px;
  152. line-height: 22px;
  153. margin-bottom: 12px;
  154. }
  155. .job-other {
  156. height: 22px;
  157. line-height: 22px;
  158. .enterprise-name {
  159. cursor: pointer;
  160. &:hover {
  161. color: var(--v-primary-base)
  162. }
  163. }
  164. }
  165. }
  166. }
  167. }
  168. .position-name:hover {
  169. color: var(--v-primary-base);
  170. }
  171. </style>