item.vue 6.1 KB

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