item.vue 4.9 KB

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