index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <v-card class="pa-5" style="height: calc(100vh - 130px);font-size: 14px;">
  3. <div class="d-flex justify-space-between">
  4. <div class="d-flex mb-3">
  5. <Autocomplete class="mr-3" v-model="query.jobId" :item="jobItem"></Autocomplete>
  6. <Autocomplete v-model="query.status" :item="statusItem"></Autocomplete>
  7. <v-btn color="primary" class="half-button ml-3" @click="handleSearch">查 询</v-btn>
  8. <v-btn class="half-button ml-3" variant="outlined" color="primary" @click="handleReset">重 置</v-btn>
  9. <v-btn class="half-button ml-10" prepend-icon="mdi-refresh" variant="outlined" color="primary" @click="handleReset">刷 新</v-btn>
  10. </div>
  11. </div>
  12. <v-divider class="mb-3"></v-divider>
  13. <div class="d-flex" style="height: calc(100vh - 228px);">
  14. <div>
  15. <div class="d-flex justify-space-between px-5">
  16. <div v-if="selectDateValue">
  17. <span>{{ timesTampChange(selectDateValue, 'Y-M-D') }}</span>
  18. <span class="ml-2" style="cursor: pointer; color: var(--v-primary-base);" @click="handleClear">{{ $t('common.cleanUp') }}</span>
  19. </div>
  20. <div v-else class="color-999">{{ $t('interview.noDateSelected') }}</div>
  21. <v-btn color="primary" variant="text" size="small" @click="selectDateValue = new Date(); handleChangeDate()">{{ $t('interview.today') }}</v-btn>
  22. </div>
  23. <VueDatePicker
  24. class="mr-5"
  25. v-model="selectDateValue"
  26. inline auto-apply
  27. locale="zh-CN"
  28. :enable-time-picker="false"
  29. :day-names="['一', '二', '三', '四', '五', '六', '七']"
  30. :markers="markers"
  31. hide-offset-dates
  32. @update:model-value="handleChangeDate"
  33. >
  34. <template #marker>
  35. <span class="custom-marker"></span>
  36. </template>
  37. </VueDatePicker>
  38. </div>
  39. <v-divider style="height: auto;" class="mr-5" vertical></v-divider>
  40. <div style="flex: 1;">
  41. <div v-if="items.length">
  42. <div style="height: calc(100vh - 318px);overflow: auto;padding-right: 12px;">
  43. <itemPage :items="items" :statusList="statusList" :positionItems="positionItems" @refresh="handleRefresh"></itemPage>
  44. </div>
  45. <CtPagination
  46. v-if="total > 0"
  47. :total="total"
  48. :page="query.pageNo"
  49. :limit="query.pageSize"
  50. @handleChange="handleChangePage"
  51. ></CtPagination>
  52. </div>
  53. <Empty v-else :elevation="false"></Empty>
  54. </div>
  55. </div>
  56. </v-card>
  57. </template>
  58. <script setup>
  59. defineOptions({ name: 'enterprise-interview'})
  60. import { ref } from 'vue'
  61. import { getInterviewInvitePage, getEnterpriseInterviewCountByTime } from '@/api/recruit/enterprise/interview'
  62. import { getDict } from '@/hooks/web/useDictionaries'
  63. import { getJobAdvertised } from '@/api/enterprise'
  64. import { dealDictArrayData } from '@/utils/position'
  65. import { timesTampChange, getStartAndEndOfDay } from '@/utils/date'
  66. import itemPage from './components/item.vue'
  67. const items = ref([])
  68. const statusList = ref()
  69. const total = ref(0)
  70. const query = ref({
  71. pageSize: 20,
  72. pageNo: 1,
  73. status: null,
  74. jobId: null,
  75. time: []
  76. })
  77. const positionItems = ref([])
  78. const jobItem = ref({ width: 300, items: positionItems, clearable: true, hireDetails: true, label: '职位' })
  79. const statusItem = ref({ width: 300, items: statusList, clearable: true, hireDetails: true, label: '面试状态' })
  80. // 获取有面试的日期列表
  81. const markers = ref([])
  82. const getCountByTime = async () => {
  83. const data = await getEnterpriseInterviewCountByTime()
  84. if (!data || !data.length) return
  85. markers.value = data.map(e => {
  86. return { date: e.key, type: 'dot' }
  87. })
  88. }
  89. getCountByTime()
  90. // 状态字典
  91. const getStatusList = async () => {
  92. const { data } = await getDict('menduner_interview_invite_status')
  93. statusList.value = data
  94. }
  95. getStatusList()
  96. // 列表
  97. const getData = async () => {
  98. const { list, total: number } = await getInterviewInvitePage(query.value)
  99. items.value = list
  100. total.value = number
  101. }
  102. getData()
  103. const handleRefresh = () => {
  104. query.value.pageNo = 1
  105. getData()
  106. }
  107. // 分页
  108. const handleChangePage = (e) => {
  109. query.value.pageNo = e
  110. getData()
  111. }
  112. // 日期选择
  113. const selectDateValue = ref(null)
  114. const handleChangeDate = () => {
  115. const time = getStartAndEndOfDay(selectDateValue.value)
  116. if (!time || !time.length) return delete query.value.time
  117. query.value.time = time
  118. query.value.pageNo = 1
  119. getData()
  120. }
  121. // 清除
  122. const handleClear = () => {
  123. query.value.pageNo = 1
  124. selectDateValue.value = null
  125. delete query.value.time
  126. getData()
  127. }
  128. const handleSearch = () => {
  129. query.value.pageNo = 1
  130. getData()
  131. }
  132. const handleReset = () => {
  133. query.value = {
  134. pageSize: 10,
  135. pageNo: 1,
  136. status: null,
  137. jobId: null,
  138. time: []
  139. }
  140. selectDateValue.value = null
  141. getData()
  142. }
  143. // 职位
  144. const getPositionList = async () => {
  145. const data = await getJobAdvertised()
  146. if (!data.length) return
  147. const list = dealDictArrayData([], data)
  148. positionItems.value = list.map(e => {
  149. const salary = e.payFrom && e.payTo ? `${e.payFrom ? e.payFrom + '-' : ''}${e.payTo}${e.payName ? '/' + e.payName : ''}` : '面议'
  150. return { label: `${e.name}${e.areaName ? '_' + e.areaName : ''} ${salary}`, value: e.id }
  151. })
  152. }
  153. getPositionList()
  154. </script>
  155. <style scoped lang="scss">
  156. :deep(.dp__menu) {
  157. border: none !important;
  158. }
  159. .custom-marker {
  160. position: absolute;
  161. bottom: 0;
  162. right: 50%;
  163. transform: translateX(50%);
  164. height: 8px;
  165. width: 8px;
  166. border-radius: 100%;
  167. background-color: var(--v-primary-base);
  168. }
  169. /* 滚动条样式 */
  170. ::-webkit-scrollbar {
  171. -webkit-appearance: none;
  172. width: 4px;
  173. height: 0px;
  174. }
  175. /* 滚动条内的轨道 */
  176. ::-webkit-scrollbar-track {
  177. background: rgba(0, 0, 0, 0.1);
  178. border-radius: 0;
  179. }
  180. /* 滚动条内的滑块 */
  181. ::-webkit-scrollbar-thumb {
  182. cursor: pointer;
  183. border-radius: 5px;
  184. background: rgba(0, 0, 0, 0.15);
  185. transition: color 0.2s ease;
  186. }
  187. </style>