Xiao_123 пре 9 месеци
родитељ
комит
ce3acccd6b

+ 7 - 0
src/api/recruit/enterprise/interview/index.js

@@ -45,4 +45,11 @@ export const feedbackInterviewInvite = async (data) => {
     url: '/app-admin-api/menduner/system/interview-invite/feedback',
     data
   })
+}
+
+// 获取当前企业有面试的日期列表
+export const getEnterpriseInterviewCountByTime = async () => {
+  return await request.get({
+    url: '/app-admin-api/menduner/system/interview-invite/get/count/by/time'
+  })
 }

+ 3 - 6
src/components/Enterprise/details.vue

@@ -47,7 +47,7 @@
           <div class="content-right">
             <div class="welfare">
               <h4>工作时间及福利</h4>
-              <div class="my-3" style="color: var(--color-666);font-size: 14px;">
+              <div v-if="info.enterprise?.workTime" class="my-3" style="color: var(--color-666);font-size: 14px;">
                 <v-icon size="17" color="#ccc" class="mr-2">mdi-clock</v-icon>{{ info.enterprise.workTime }}
               </div>
               <div class="welfare-tags">
@@ -56,13 +56,10 @@
             </div>
             <div class="welfare my-3">
               <h4>工商信息</h4>
-              <div :class="['mt-2', 'business-item']" v-for="(val, index) in businessList" :key="val.value">
+              <div :class="['mt-2', 'business-item']" v-for="val in businessList" :key="val.value">
                 <div>{{ val.label }}</div>
                 <div class="business-value ellipsis">{{ info.business[val.value] }}</div>
-                <div :class="['my-3', {'border-bottom-dashed': index === businessList.length - 1 }]"></div>
-              </div>
-              <div class="business-source">
-                数据来源:企查查
+                <div :class="['my-3']"></div>
               </div>
             </div>
           </div>

+ 8 - 17
src/utils/date.js

@@ -41,25 +41,16 @@ export const getDayBounds = (timestamp) => {
 }
 
 // 传入 Wed May 01 2024 00:00:00 GMT+0800 (中国标准时间) 输出 [2024-07-18 00:00:00, 2024-07-18 23:59:59]
-export const getStartAndEndOfDay = (dateString) => {
-  const date = new Date(dateString + ' UTC')
-  if (isNaN(date.getTime())) {
-    throw new Error('Invalid date string')
-  }
-
-  const startDate = new Date(date.getFullYear(), date.getMonth(), date.getDate())
-  const endDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59)
+export const getStartAndEndOfDay = (dateTimeStr) => {
+  const date = new Date(dateTimeStr)
 
-  function formatDate(dateObj) {
-    let month = ('0' + (dateObj.getMonth() + 1)).slice(-2)
-    let day = ('0' + dateObj.getDate()).slice(-2)
-    let hours = ('0' + dateObj.getHours()).slice(-2)
-    let minutes = ('0' + dateObj.getMinutes()).slice(-2)
-    let seconds = ('0' + dateObj.getSeconds()).slice(-2)
-    return dateObj.getFullYear() + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
-  }
+  const year = date.getFullYear()
+  const month = String(date.getMonth() + 1).padStart(2, '0')
+  const day = String(date.getDate()).padStart(2, '0')
 
-  return [formatDate(startDate), formatDate(endDate)]
+  const startTime = `${year}-${month}-${day} 00:00:00`
+  const endTime = `${year}-${month}-${day} 23:59:59`
+  return [startTime, endTime]
 }
 
 // 传入一组时间戳,返回 [最早时间点,最晚时间点]

+ 39 - 8
src/views/recruit/enterprise/interview/index.vue

@@ -44,16 +44,23 @@
             <span class="ml-2" style="cursor: pointer;" @click="handleClear">{{ $t('common.cleanUp') }}</span>
           </div>
           <div v-else class="color-999">{{ $t('interview.noDateSelected') }}</div>
-          <v-btn color="primary" variant="text" size="small" @click="selectDateValue = new Date()">{{ $t('interview.today') }}</v-btn>
+          <v-btn color="primary" variant="text" size="small" @click="selectDateValue = new Date(); handleChangeDate()">{{ $t('interview.today') }}</v-btn>
         </div>
-        <v-date-picker
+        <VueDatePicker 
+          class="mr-5"
           v-model="selectDateValue"
-          color="primary"
-          :hide-header="true"
-          @update:modelValue="handleChangeDate"
-          class="mr-3"
+          inline auto-apply
+          locale="zh-CN"
+          :enable-time-picker="false"
+          :day-names="['一', '二', '三', '四', '五', '六', '七']"
+          :markers="markers"
+          hide-offset-dates
+          @update:model-value="handleChangeDate"
         >
-        </v-date-picker>
+          <template #marker>
+            <span class="custom-marker"></span>
+          </template>
+      </VueDatePicker>
       </div>
       <v-divider style="height: auto;" class="mr-5" vertical></v-divider>
       <div style="flex: 1;overflow: hidden;">
@@ -76,7 +83,7 @@
 <script setup>
 defineOptions({ name: 'enterprise-interview'})
 import { ref } from 'vue'
-import { getInterviewInvitePage } from '@/api/recruit/enterprise/interview'
+import { getInterviewInvitePage, getEnterpriseInterviewCountByTime } from '@/api/recruit/enterprise/interview'
 import { getDict } from '@/hooks/web/useDictionaries'
 import { getJobAdvertised } from '@/api/enterprise'
 import { dealDictArrayData } from '@/utils/position'
@@ -94,6 +101,17 @@ const query = ref({
   time: []
 })
 
+// 获取有面试的日期列表
+const markers = ref([])
+const getCountByTime = async () => {
+  const data = await getEnterpriseInterviewCountByTime()
+  if (!data || !data.length) return
+  markers.value = data.map(e => {
+    return { date: e.key, type: 'dot' }
+  })
+}
+getCountByTime()
+
 // 状态字典
 const getStatusList = async () => {
   const { data } = await getDict('menduner_interview_invite_status')
@@ -168,4 +186,17 @@ getPositionList()
 </script>
 
 <style scoped lang="scss">
+:deep(.dp__menu) {
+  border: none !important;
+}
+.custom-marker {
+  position: absolute;
+  bottom: 0;
+  right: 50%;
+  transform: translateX(50%);
+  height: 8px;
+  width: 8px;
+  border-radius: 100%;
+  background-color: var(--v-primary-base);
+}
 </style>