item.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. tab: {
  61. type: String,
  62. default: '0'
  63. }
  64. })
  65. // 企业详情
  66. const handleToEnterprise = (item) => {
  67. const id = item.enterprise.id
  68. if (!id) return
  69. window.open(`/recruit/personal/company/details/${id}?key=briefIntroduction`)
  70. }
  71. // 同意
  72. const handleAgree = (val) => {
  73. if (!val.id) return
  74. const query = {
  75. id: val.id
  76. }
  77. const baseInfo = localStorage.getItem('baseInfo')
  78. if (baseInfo) {
  79. const { phone } = JSON.parse(baseInfo)
  80. query.phone = phone
  81. }
  82. Confirm(t('common.confirmTitle'), '是否确定接收此面试邀请?').then(async () => {
  83. await userInterviewInviteConsent(query)
  84. Snackbar.success(t('common.operationSuccessful'))
  85. emits('refresh')
  86. })
  87. }
  88. // 拒绝
  89. const handleRefuse = (val) => {
  90. if (!val.id) return
  91. Confirm(t('common.confirmTitle'), '您是否确定要拒绝此面试邀请?').then(async () => {
  92. await userInterviewInviteReject(val.id)
  93. Snackbar.success(t('common.operationSuccessful'))
  94. emits('refresh')
  95. })
  96. }
  97. </script>
  98. <style scoped lang="scss">
  99. .position-item {
  100. height: 144px;
  101. background-color: #fff;
  102. border-radius: 12px;
  103. &:hover {
  104. box-shadow: 0 16px 40px 0 rgba(153, 153, 153, .3);
  105. }
  106. .info-header {
  107. height: 48px;
  108. background: linear-gradient(90deg,#f5fcfc,#fcfbfa);
  109. border-radius: 12px;
  110. .img-box {
  111. padding: 12px 24px;
  112. .name {
  113. color: var(--color-222);
  114. font-weight: 400;
  115. font-size: 13px;
  116. .gray {
  117. color: var(--color-666);
  118. }
  119. }
  120. }
  121. .header-btn {
  122. padding: 10px 10px 0 0;
  123. float: right;
  124. .v-btn {
  125. z-index: 1;
  126. }
  127. }
  128. }
  129. .info-content {
  130. display: flex;
  131. padding: 16px 24px;
  132. justify-content: space-between;
  133. .job-info {
  134. width: 430px;
  135. max-width: 430px;
  136. font-weight: 500;
  137. font-size: 16px;
  138. margin-right: 12px;
  139. .job-name {
  140. height: 22px;
  141. line-height: 22px;
  142. color: var(--color-222);
  143. margin-bottom: 12px;
  144. }
  145. .job-other {
  146. color: var(--color-666);
  147. height: 22px;
  148. line-height: 22px;
  149. font-size: 14px;
  150. .enterprise-name {
  151. cursor: pointer;
  152. &:hover {
  153. color: var(--v-primary-base)
  154. }
  155. }
  156. }
  157. }
  158. }
  159. }
  160. </style>