item.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <div class="position-item mb-3 job-closed elevation-2"
  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="handleAgree(val)">同意</v-btn>
  9. <v-btn class="ml-3" color="error" size="small" @click="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="handleToPositionDetails(val)">{{ 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'"></v-img>
  40. </div>
  41. <div class="ellipsis" style="max-width: 400px;">
  42. <span class="mx-2 enterprise-name" @click="handleToEnterprise(val)">{{ dealEnterpriseName(val.enterprise.anotherName || val.enterprise.name) }}</span>
  43. [
  44. <span>{{ val.enterprise.industryName }}</span>
  45. <span>&nbsp;·&nbsp;{{ val.enterprise.scaleName }}</span>
  46. ]
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </template>
  53. <script setup>
  54. defineOptions({ name: 'interview-item'})
  55. import { useI18n } from '@/hooks/web/useI18n'
  56. import { timesTampChange } from '@/utils/date'
  57. import { userInterviewInviteReject, userInterviewInviteConsent } from '@/api/recruit/personal/personalCenter'
  58. import Snackbar from '@/plugins/snackbar'
  59. import Confirm from '@/plugins/confirm'
  60. import { getUserAvatar } from '@/utils/avatar'
  61. import { useRouter } from 'vue-router'
  62. import { dealEnterpriseName } from '@/utils/getText'
  63. const { t } = useI18n()
  64. const emits = defineEmits(['refresh'])
  65. const props = defineProps({
  66. items: {
  67. type: Array,
  68. default: () => []
  69. },
  70. tab: {
  71. type: String,
  72. default: '0'
  73. }
  74. })
  75. const router = useRouter()
  76. // 企业详情
  77. const handleToEnterprise = (item) => {
  78. const id = item.enterprise.id
  79. if (!id) return
  80. router.push(`/recruit/personal/company/details/${id}?key=briefIntroduction`)
  81. }
  82. // 职位详情
  83. const handleToPositionDetails = (item) => {
  84. if (item.job.status === '1') return
  85. router.push(`/recruit/personal/position/details/${item.job.id}`)
  86. }
  87. // 同意
  88. const handleAgree = (val) => {
  89. if (!val.id) return
  90. const query = {
  91. id: val.id
  92. }
  93. const userInfo = localStorage.getItem('userInfo')
  94. if (userInfo) {
  95. const { phone } = JSON.parse(userInfo)
  96. query.phone = phone
  97. }
  98. Confirm(t('common.confirmTitle'), '是否确定接收此面试邀请?').then(async () => {
  99. await userInterviewInviteConsent(query)
  100. Snackbar.success(t('common.operationSuccessful'))
  101. emits('refresh')
  102. })
  103. }
  104. // 拒绝
  105. const handleRefuse = (val) => {
  106. if (!val.id) return
  107. Confirm(t('common.confirmTitle'), '您是否确定要拒绝此面试邀请?').then(async () => {
  108. await userInterviewInviteReject(val.id)
  109. Snackbar.success(t('common.operationSuccessful'))
  110. emits('refresh')
  111. })
  112. }
  113. </script>
  114. <style scoped lang="scss">
  115. .position-item {
  116. height: 160px;
  117. background-color: #fff;
  118. border-radius: 12px;
  119. &:hover {
  120. box-shadow: 0px 3px 5px -1px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, 0.2)), 0px 5px 8px 0px var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.14)), 0px 1px 14px 0px var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, 0.12)) !important;
  121. }
  122. .info-header {
  123. height: 48px;
  124. background: linear-gradient(90deg,#f5fcfc,#fcfbfa);
  125. border-radius: 12px;
  126. .img-box {
  127. padding: 12px 24px;
  128. .name {
  129. color: var(--color-222);
  130. font-weight: 400;
  131. font-size: 13px;
  132. .gray {
  133. color: var(--color-666);
  134. }
  135. }
  136. }
  137. .header-btn {
  138. padding: 10px 10px 0 0;
  139. float: right;
  140. .v-btn {
  141. z-index: 1;
  142. }
  143. }
  144. }
  145. .info-content {
  146. display: flex;
  147. padding: 16px 24px;
  148. justify-content: space-between;
  149. .job-info {
  150. width: 360px;
  151. max-width: 360px;
  152. font-weight: 500;
  153. font-size: 14px;
  154. margin-right: 12px;
  155. .job-name {
  156. height: 22px;
  157. line-height: 22px;
  158. margin-bottom: 12px;
  159. }
  160. .job-other {
  161. height: 22px;
  162. line-height: 22px;
  163. .enterprise-name {
  164. cursor: pointer;
  165. &:hover {
  166. color: var(--v-primary-base)
  167. }
  168. }
  169. }
  170. }
  171. }
  172. }
  173. .position-name:hover {
  174. color: var(--v-primary-base);
  175. }
  176. </style>