Преглед на файлове

feat(employeeProfile): add qualification certificate time display

1. add getQualificationLevelTime api to fetch qualification time by user id
2. add logic to display corresponding certificate time based on qualification level
3. include new api call in page data loading flow
huoyi преди 6 дни
родител
ревизия
d6be05a25e
променени са 2 файла, в които са добавени 35 реда и са изтрити 2 реда
  1. 4 0
      src/api/ledger/index.js
  2. 31 2
      src/views/portraitManagement/employeeProfile/index.vue

+ 4 - 0
src/api/ledger/index.js

@@ -294,3 +294,7 @@ export function listQualificationCertificateStatus(query) {
294 294
 export function importQualificationLevel(data) {
295 295
   return request({ url: '/ledger/import/qualificationLevel', method: 'post', data })
296 296
 }
297
+//通过用户id获取职业资格等级获取时间信息
298
+export function getQualificationLevelTime(query) {
299
+  return request({ url: '/ledger/qualificationLevel/user', method: 'get',params: query })
300
+}

+ 31 - 2
src/views/portraitManagement/employeeProfile/index.vue

@@ -131,7 +131,10 @@
131 131
               </div>
132 132
             </Card>
133 133
             <Card title="职业资格证书情况">
134
-              证书名称:一级~五级;时间:年月日
134
+              <div class="cert-info">
135
+                <span class="cert-name">证书名称:{{ portrait?.qualificationLevelText || '-' }} 时间:{{ getQualificationTime|| '-' }}</span>
136
+              
137
+              </div>
135 138
             </Card>
136 139
           </div>
137 140
           <div class="content-bottom-center">
@@ -238,6 +241,7 @@ import { getEmployeePortrait } from '@/api/score/index'
238 241
 import { countTagScore } from '@/api/portraitManagement/portraitManagement'
239 242
 import { onMounted, onUnmounted, reactive, ref, computed, watch } from 'vue'
240 243
 import { useDict } from '@/utils/dict'
244
+import { getQualificationLevelTime } from '@/api/ledger/index'
241 245
 import { useECharts } from '@/hooks/useEcharts'
242 246
 import useUserStore from '@/store/modules/user'
243 247
 import { useRouter } from 'vue-router'
@@ -256,6 +260,7 @@ const abilityChart = ref(null)
256 260
 const activeDimName = ref(null)
257 261
 const tagScoreData = ref(null)
258 262
 const currentQuery = ref(null)
263
+const qualificationData = ref(null)
259 264
 
260 265
 const scoreDetails = computed(() => portrait.value?.scoreDetails || [])
261 266
 
@@ -292,6 +297,25 @@ const deductTotal = computed(() => {
292 297
   return s.toFixed(2)
293 298
 })
294 299
 
300
+// 职业资格等级枚举
301
+const qualificationLevelMap = [
302
+  { label: '一级', field: 'levelOneTime' },
303
+  { label: '二级', field: 'levelTwoTime' },
304
+  { label: '三级', field: 'levelThreeTime' },
305
+  { label: '四级', field: 'levelFourTime' },
306
+  { label: '五级', field: 'levelFiveTime' }
307
+]
308
+
309
+const getQualificationTime = computed(() => {
310
+  const certName = portrait.value?.qualificationLevelText || '-';
311
+  
312
+  const item = qualificationLevelMap.find(l => l.label === certName)
313
+  if (item) {
314
+    return qualificationData.value?.[item.field] || '-'
315
+  }
316
+  return '-'
317
+})
318
+
295 319
 
296 320
 const getSchooling = (schooling) => {
297 321
   const result = (sys_user_schooling.value || []).find(item => item.value === schooling) || { label: schooling }
@@ -358,7 +382,12 @@ const invokerEmployeePortrait = (query) => {
358 382
       tagScoreData.value = data
359 383
     }
360 384
   })
361
-  return Promise.all([portraitPromise, tagPromise]).finally(() => {
385
+  const qualificationPromise = getQualificationLevelTime({ userId }).then(res => {
386
+    qualificationData.value = res.data || null
387
+  }).catch(() => {
388
+    qualificationData.value = null
389
+  })
390
+  return Promise.all([portraitPromise, tagPromise, qualificationPromise]).finally(() => {
362 391
     loading.value = false
363 392
   })
364 393
 }