Forráskód Böngészése

邀请新同事-邀请记录

Xiao_123 6 hónapja
szülő
commit
be8fbcd744

+ 7 - 19
src/views/recruit/enterprise/systemManagement/groupAccount/components/record.vue

@@ -41,10 +41,14 @@ const query = ref({
 const headers = [
   { title: '企业名称', key: 'showInfo.currentAccountEnterpriseAnotherName', sortable: false },
   { title: '邀请人', key: 'showInfo.currentAccountUserName', sortable: false },
-  { title: 'invited', key: 'showInfo.invited', sortable: false },
+  { title: 'invited', key: 'showInfo.name', sortable: false },
   { title: t('enterprise.userManagement.invitationTime'), key: 'showInfo.time', sortable: false },
 ]
-headers.forEach(e => { if (e.title === 'invited') e.title = props.inviteType - 0 ? '受邀企业' : '受邀人' })
+headers.forEach(e => {
+  if (e.title === 'invited') {
+    e.title = props.inviteType - 0 ? '受邀企业' : '受邀人'
+  }
+})
 
 // 获取数据
 const getData = async () => {
@@ -52,37 +56,21 @@ const getData = async () => {
   try {
     const info = JSON.parse(localStorage.getItem('entBaseInfo')) || null
     const { list, total: number } = await enterpriseInviteRecordPage(query.value)
-    // const invitedNames = await Promise.all(list.map(async () => getInvited()))
     tableData.value = list.map(e => {
       const showInfo = {
         currentAccountEnterpriseAnotherName: info?.enterpriseAnotherName || '--',
         currentAccountUserName: info?.name || '--',
-        // invited: invitedNames[index] || '--', // 使用预先获取的invited名称
-        invited: e?.enterpriseUser?.enterpriseName || '--', // 使用预先获取的invited名称
+        name: props.inviteType - 0 ? e?.enterpriseUser?.enterpriseName : e?.enterpriseUser?.name,
         time: e.createTime ? timesTampChange(e.createTime) : '--',
       }
       return { showInfo, ...e }
     })
-    console.log('tableData.value', tableData.value)
     total.value = number
   } finally {
     loading.value = false
   }
 }
 
-// const getInvited = async (val) => {
-//   try {
-//     if (val) {
-//       const api = props.inviteType - 0 ? enterpriseInviteRecordPage: enterpriseInviteRecordPage
-//       const { data } = await api(query.value)
-//       return data.name
-//     } else {
-//       return '-占位-'
-//     }
-//   } catch (error) {
-//     console.log('error', error)
-//   }
-// }
 getData()
 
 const handleChangePage = (index) => {