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

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

lifanagju_citu 11 hónapja
szülő
commit
ba3d85ef9a

+ 15 - 0
src/api/enterprise.js

@@ -83,4 +83,19 @@ export const getPersonCvDetail = async (userId, id) => {
   return await request.get({
     url: `/app-admin-api/menduner/system/person-cv/detail?userId=${userId}&id=${id}`
   })
+}
+
+// 招聘端-牛人管理-加入不合适
+export const joinEliminate = async (ids) => {
+  return await request.post({
+    url: `/app-admin-api/menduner/system/person-cv/eliminate?ids=${ids}`
+  })
+}
+
+// 招聘端-系统管理-用户管理-列表
+export const getEnterpriseUserList = async (params) => {
+  return await request.get({
+    url: '/app-admin-api/menduner/system/user/page',
+    params
+  })
 }

+ 20 - 8
src/views/enterprise/personnelManagement/components/table.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
-    <div class="text-end">
-      <v-btn color="primary" :disabled="selected.length ? false : true" variant="tonal" @click="handleInappropriate">不合适</v-btn>
+    <div class="text-end" v-if="tab === '0'">
+      <v-btn color="primary" :disabled="selected.length ? false : true" variant="tonal" @click="handleJoinEliminate('all')">不合适</v-btn>
     </div>
     <v-data-table
       class="mt-3"
@@ -35,8 +35,10 @@
         <span v-else></span>
       </template>
       <template v-slot:item.actions="{ item }">
-        <v-btn v-if="tab === '0'" color="primary" variant="text" @click="previewFile(item.url)">附件</v-btn>
-        <v-btn color="primary" variant="text">不合适</v-btn>
+        <div v-if="tab === '0'">
+          <v-btn color="primary" variant="text" @click="previewFile(item.url)">附件</v-btn>
+          <v-btn color="primary" variant="text" @click="handleJoinEliminate('', item)">不合适</v-btn>
+        </div>
       </template>
     </v-data-table>
   </div>
@@ -47,7 +49,12 @@ defineOptions({ name: 'table-page'})
 import { ref, computed } from 'vue'
 import { previewFile } from '@/utils'
 import { timesTampChange } from '@/utils/date'
+import { joinEliminate } from '@/api/enterprise'
+import { useI18n } from '@/hooks/web/useI18n'
+import Snackbar from '@/plugins/snackbar'
 
+const { t } = useI18n()
+const emit = defineEmits(['refresh'])
 defineProps({
   tab: String,
   items: Array
@@ -71,15 +78,20 @@ const headers = [
   { title: '操作', value: 'actions' }
 ]
 
-const handleInappropriate = () => {
-  console.log(selected.value, 'handleInappropriate')
-}
-
 // 人才详情
 const handleToPersonDetail = ({ userId, id }) => {
   if (!userId || !id) return
   window.open(`/enterprise/talentPool/details/${userId}?id=${id}`)
 }
+
+// 不合适
+const handleJoinEliminate = async (type, item) => {
+  const ids = type ? selected.value : [item?.id]
+  if (!ids) return
+  await joinEliminate(ids)
+  Snackbar.success(t('common.operationSuccessful'))
+  emit('refresh')
+}
 </script>
 
 <style scoped lang="scss">

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

@@ -11,7 +11,7 @@
 
     <v-window v-model="tab" class="mt-1">
       <v-window-item v-for="k in tabList" :value="k.value" :key="k.value">
-        <TablePage :items="items" :tab="k.value"></TablePage>
+        <TablePage :items="items" :tab="k.value" @refresh="getList"></TablePage>
         <CtPagination
           :total="total"
           :page="query.pageNo"
@@ -35,7 +35,7 @@ import Screen from './components/screen.vue'
 const total = ref(0)
 const query = ref({
   pageNo: 1,
-  pageSize: 1,
+  pageSize: 10,
   status: 0
 })
 const tab = ref('0')

+ 82 - 2
src/views/enterprise/systemManagement/userManagement/index.vue

@@ -1,11 +1,91 @@
 <template>
-  <div>用户管理</div>
+  <v-card class="pa-5 card-box">
+    <v-data-table
+      :headers="headers"
+      :items="items"
+      hide-default-header
+      height="70vh"
+    >
+      <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>
+      </template>
+    </v-data-table>
+    <CtPagination
+      :total="total"
+      :page="query.pageNo"
+      :limit="query.pageSize"
+      @handleChange="handleChangePage"
+    ></CtPagination>
+  </v-card>
 </template>
 
 <script setup>
 defineOptions({ name: 'system-management-user'})
+import { ref } from 'vue'
+import { timesTampChange } from '@/utils/date'
+import { getEnterpriseUserList } from '@/api/enterprise'
+
+const total = ref(10)
+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' }
+]
+
+// 获取企业用户列表
+const getData = async () => {
+  const { list, total: number } = await getEnterpriseUserList(query.value)
+  items.value = list
+  total.value = number
+}
+getData()
+
+const handleChangePage = (e) => {
+  query.value.pageNo = e
+  getData()
+}
+
+const handleEnable = (item) => {
+  console.log(item, '启用')
+}
+
+const handleDisabled = (item) => {
+  console.log(item, '禁用')
+}
 </script>
 
 <style scoped lang="scss">
-
+:deep(.v-table > .v-table__wrapper > table > thead) {
+  background-color: #f7f8fa !important
+}
+:deep(.v-selection-control__input) {
+  color: #767778
+}
 </style>