Browse Source

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

lifanagju_citu 11 tháng trước cách đây
mục cha
commit
cbd730e038

+ 14 - 0
src/api/enterprise.js

@@ -167,4 +167,18 @@ export const updateEnterpriseWelfare = async (data) => {
     url: '/app-admin-api/menduner/system/enterprise/welfare/update',
     data
   })
+}
+
+// 招聘端-系统管理-启用账户
+export const systemUserEnable = async (ids) => {
+  return await request.post({
+    url: `/app-admin-api/menduner/system/user/enable?ids=${ids}`
+  })
+}
+
+// 招聘端-系统管理-禁用账户
+export const systemUserDisable = async (ids) => {
+  return await request.post({
+    url: `/app-admin-api/menduner/system/user/disable?ids=${ids}`
+  })
 }

+ 15 - 1
src/locales/en.js

@@ -41,6 +41,7 @@ export default {
     alreadyExists: 'Already exists',
     pleaseSelect: 'Please select',
     pleaseEnter: 'Please Enter',
+    actions: 'operation'
   },
   sys: {
     api: {
@@ -158,7 +159,20 @@ export default {
       enterpriseVideo: 'Enterprise Video',
       recruitmentQRCode: 'Recruitment QR Code',
     },
-    personalInformationSettings: 'Personal information settings'
+    personalInformationSettings: 'Personal information settings',
+    userManagement: {
+      enable: 'Enable',
+      disable: 'Disabled',
+      disableAccount: 'Are you sure to disable this account?',
+      enableAccount: 'Are you sure to enable this account?',
+      email: 'Email',
+      phone: 'Phone',
+      lastLoginTime: 'Last Login Time',
+      affiliatedEnterprise: 'Affiliated enterprise',
+      accountType: 'Account type',
+      administrators: 'Administrators',
+      regularUser: 'Regular users'
+    }
   },
   resume: {
     basicInfo: 'Basic Information',

+ 15 - 1
src/locales/zh-CN.js

@@ -41,6 +41,7 @@ export default {
     alreadyExists: '已存在',
     pleaseSelect: '请选择',
     pleaseEnter: '请输入',
+    actions: '操作'
   },
   sys: {
     api: {
@@ -158,7 +159,20 @@ export default {
       enterpriseVideo: '企业视频',
       recruitmentQRCode: '招聘二维码',
     },
-    personalInformationSettings: '个人信息设置'
+    personalInformationSettings: '个人信息设置',
+    userManagement: {
+      enable: '启用',
+      disable: '禁用',
+      disableAccount: '是否确认禁用此账户?',
+      enableAccount: '是否确认启用此账户?',
+      email: '邮箱',
+      phone: '手机号',
+      lastLoginTime: '最后登录时间',
+      affiliatedEnterprise: '所属企业',
+      accountType: '账号类型',
+      administrators: '管理员',
+      regularUser: '普通用户'
+    }
   },
   resume: {
     basicInfo: '基础信息',

+ 4 - 12
src/views/enterprise/personnelManagement/components/table.vue

@@ -27,14 +27,6 @@
           <span class="defaultLink ml-3">{{ item?.person?.name }}</span>
         </div>
       </template>
-      <template v-slot:item.exp="{ item }">
-        <span v-if="item?.jobExperience && Object.keys(item?.jobExperience).length">{{ item.jobExperience.positionName }} {{ item.jobExperience.enterpriseName }}</span>
-        <span v-else>未填写工作经历</span>
-      </template>
-      <template v-slot:item.edu="{ item }">
-        <span v-if="item?.eduExperience && Object.keys(item?.eduExperience).length">{{ timesTampChange(item.eduExperience.startTime).slice(0, 4) }}-{{ timesTampChange(item.eduExperience.endTime).slice(0, 4) }} {{ item.eduExperience.schoolName }}</span>
-        <span v-else>未填写教育经历</span>
-      </template>
       <template v-slot:item.actions="{ item }">
         <div v-if="tab === '0'">
           <v-btn color="primary" variant="text" @click="previewFile(item.url)">查看简历</v-btn>
@@ -52,7 +44,6 @@
 defineOptions({ name: 'table-page'})
 import { ref, computed } from 'vue'
 import { previewFile } from '@/utils'
-import { timesTampChange } from '@/utils/date'
 import { joinEliminate, personEntryByEnterprise } from '@/api/enterprise'
 import { useI18n } from '@/hooks/web/useI18n'
 import Snackbar from '@/plugins/snackbar'
@@ -75,10 +66,11 @@ const badgeIcon = computed(() => (item) => {
 const selected = ref([])
 const headers = [
   { title: '牛人', value: 'name' },
-  { title: '基本信息', key: 'info', value: item => `${item.eduName}·${ item.expName }` },
-  { title: '最近工作经历', value: 'exp' },
-  { title: '教育经历', key: 'edu' },
   { title: '应聘职位', value: 'job.name' },
+  { title: '求职状态', key: 'person.jobStatusName' },
+  { title: '工作经验', key: 'person.expName' },
+  { title: '最高学历', key: 'person.eduName' },
+  { title: '岗位薪资', key: 'job', value: item => `${item.job.payFrom}-${item.job.payTo}/${item.job.payName}`},
   { title: '操作', value: 'actions' }
 ]
 

+ 2 - 5
src/views/enterprise/personnelManagement/index.vue

@@ -69,11 +69,8 @@ const getList = async () => {
   total.value = number
   items.value = list.map(e => {
     let obj = e
-    if (e.person) {
-      obj = Object.assign(dealDictObjData({}, e.person), obj)
-      if (e.person.workExpList && e.person.workExpList.length > 0) obj.jobExperience = e.person.workExpList[0]
-      if (e.person.eduExpList && e.person.eduExpList.length > 0) obj.eduExperience = e.person.eduExpList[0]
-    }
+    obj.person = Object.assign(e.person, dealDictObjData({}, e.person))
+    obj.job = Object.assign(e.job, dealDictObjData({}, e.job))
     return obj
   })
 }

+ 38 - 31
src/views/enterprise/systemManagement/userManagement/index.vue

@@ -1,15 +1,22 @@
 <template>
   <v-card class="pa-5 card-box">
+    <div class="mb-3">
+      <v-btn color="primary" variant="tonal" :disabled="!selected.length" @click="handleAction('all', 0, {})">{{ $t('enterprise.userManagement.enable') }}</v-btn>
+      <v-btn class="ml-3" color="primary" variant="tonal" :disabled="!selected.length" @click="handleAction('all', 1, {})">{{ $t('enterprise.userManagement.disable') }}</v-btn>
+    </div>
     <v-data-table
+      v-model="selected"
       :headers="headers"
       :items="items"
+      show-select
       hide-default-header
       height="70vh"
+      item-value="id"
     >
       <template #bottom></template>
       <template v-slot:item.actions="{ item }">
-        <v-btn v-if="item.status === '1'" color="primary" variant="text" @click="handleEnable(item)">启用</v-btn>
-        <v-btn v-if="item.status === '0'" color="primary" variant="text" @click="handleDisabled(item)">禁用</v-btn>
+        <v-btn v-if="item.status === '1' && item.userType !== '1'" color="primary" variant="text" @click="handleAction('', 0, item)">{{ $t('enterprise.userManagement.enable') }}</v-btn>
+        <v-btn v-if="item.status === '0' && item.userType !== '1'" color="primary" variant="text" @click="handleAction('', 1, item)">{{ $t('enterprise.userManagement.disable') }}</v-btn>
       </template>
     </v-data-table>
     <CtPagination
@@ -25,38 +32,29 @@
 defineOptions({ name: 'system-management-user'})
 import { ref } from 'vue'
 import { timesTampChange } from '@/utils/date'
-import { getEnterpriseUserList } from '@/api/enterprise'
+import { useI18n } from '@/hooks/web/useI18n'
+import { getEnterpriseUserList, systemUserEnable, systemUserDisable } from '@/api/enterprise'
+import Confirm from '@/plugins/confirm'
+import Snackbar from '@/plugins/snackbar'
 
+const { t } = useI18n()
 const total = ref(10)
+const items = ref([])
+const selected = ref([])
 const query = ref({
   pageNo: 1,
   pageSize: 10,
   status: 0
 })
-const items = ref([
-  // {
-  //   "id": "1",
-  //   "enterpriseId": "1",
-  //   "enterpriseName": "门墩儿信息科技有限公司",
-  //   "name": "史迪奇",
-  //   "sex": "2",
-  //   "avatar": "http://menduner.citupro.com:6868/admin-api/infra/file/24/get/2b64902c7e0ca60347fe5f23d63b0d620a03eed298b8bb2fd3b80ad1fa27f00f.jpg",
-  //   "status": "0",
-  //   "loginDate": 1718354706000,
-  //   "phone": "13229740091",
-  //   "email": "1687584225@qq.com",
-  //   "logoUrl": "https://www.menduner.com/static/img/loginlogo2.7924c12.png",
-  //   "userType": "1",
-  //   "updateTime": 1718354706000
-  // }
-])
+
 const headers = [
-  { title: '用户名', key: 'name' },
-  { title: '所属企业', key: 'enterpriseName' },
-  { title: '手机号', key: 'phone' },
-  { title: '邮箱', key: 'email' },
-  { title: '最后登录时间', key: 'loginDate', value: item => timesTampChange(item.loginDate) },
-  { title: '操作', key: 'actions' }
+  { title: t('login.username'), key: 'name' },
+  { title: t('enterprise.userManagement.affiliatedEnterprise'), key: 'enterpriseName' },
+  { title: t('enterprise.userManagement.phone'), key: 'phone' },
+  { title: t('enterprise.userManagement.email'), key: 'email' },
+  { title: t('enterprise.userManagement.accountType'), key: 'userType', value: item => item.userType === '1' ? t('enterprise.userManagement.administrators') : t('enterprise.userManagement.regularUser')},
+  { title: t('enterprise.userManagement.lastLoginTime'), key: 'loginDate', value: item => timesTampChange(item.loginDate) },
+  { title: t('common.actions'), key: 'actions' }
 ]
 
 // 获取企业用户列表
@@ -72,12 +70,21 @@ const handleChangePage = (e) => {
   getData()
 }
 
-const handleEnable = (item) => {
-  console.log(item, '启用')
-}
+const apiList = [
+  { api: systemUserEnable, desc: t('enterprise.userManagement.enableAccount') }, 
+  { api: systemUserDisable, desc: t('enterprise.userManagement.disableAccount') }
+]
 
-const handleDisabled = (item) => {
-  console.log(item, '禁用')
+// 启用、禁用账户
+const handleAction = (type, index, item) => {
+  const ids = type ? selected.value : [item.id]
+  Confirm(t('common.confirmTitle'), apiList[index].desc).then(async () => {
+    await apiList[index].api(ids)
+    Snackbar.success(t('common.operationSuccessful'))
+    selected.value = []
+    query.value.pageNo = 1
+    getData()
+  })
 }
 </script>