Browse Source

性格测试

qin_v13
hreenshan112 11 months ago
parent
commit
71d3e0c8ae
  1. 9
      src/api/hr/people/index.ts
  2. 173
      src/views/hr/archives/index.vue

9
src/api/hr/people/index.ts

@ -389,6 +389,15 @@ export function analysisRedisOrgExelect(data?: any): AxiosPromise {
} }
//解析人员绩效成绩
export function anaRedisOrgStaffExc(data?: any): AxiosPromise {
return request({
url: '/hrapi/staff/anaRedisOrgStaffExc',
method: 'post',
data: data
});
}
/** /**
* ID获取当前行政组织人员及子行政组织 * ID获取当前行政组织人员及子行政组织
*/ */

173
src/views/hr/archives/index.vue

@ -21,6 +21,7 @@ import {
analysisRedisExelect, analysisRedisExelect,
analysisRedisOrgExelect, analysisRedisOrgExelect,
downLoadNineTestPage, downLoadNineTestPage,
anaRedisOrgStaffExc,
} from "@/api/hr/people/index"; } from "@/api/hr/people/index";
import UserRole from "@/assets/icons/user.svg"; import UserRole from "@/assets/icons/user.svg";
import { UploadFilled } from "@element-plus/icons-vue"; import { UploadFilled } from "@element-plus/icons-vue";
@ -55,6 +56,8 @@ const direction = ref("rtl");
// const uploadFFurl = import.meta.env.VITE_APP_BASE_API + "/hrapi/staff/uploadUserFiles" // const uploadFFurl = import.meta.env.VITE_APP_BASE_API + "/hrapi/staff/uploadUserFiles"
const uploadFFurl = const uploadFFurl =
import.meta.env.VITE_APP_BASE_API + "/hrapi/staff/uploadUserFilesRedis"; import.meta.env.VITE_APP_BASE_API + "/hrapi/staff/uploadUserFilesRedis";
const uploadFFurlStaff =
import.meta.env.VITE_APP_BASE_API + "/hrapi/staff/upLoadPeopelMerits";
const searchOrgFormRef = ref(ElForm); const searchOrgFormRef = ref(ElForm);
const orgTreeRef = ref(ElTree); // const orgTreeRef = ref(ElTree); //
@ -149,12 +152,18 @@ const piLiangBox = ref(false);
const orgListTemp = ref<any>([]); const orgListTemp = ref<any>([]);
// //
const openPiliangBox = () => { const openPiliangBox = () => {
haveOrgList();
piLiangBox.value = true;
};
//
const haveOrgList = () => {
gainTempleateOrgList().then((data: any) => { gainTempleateOrgList().then((data: any) => {
console.log("打开批量导入面板", data); console.log("打开批量导入面板", data);
orgListTemp.value = data.data; orgListTemp.value = data.data;
}); });
piLiangBox.value = true;
}; };
let jiBuQiVal = 0; let jiBuQiVal = 0;
// //
const handleOpenClose = () => { const handleOpenClose = () => {
@ -195,6 +204,20 @@ function handleExcelChangeTemp(file: UploadFile) {
} }
} }
function handleExcelChangeTempStaff(file: UploadFile) {
excelLoading.value = true;
if (stafftempForm.orgId == 0 || stafftempForm.orgId == "") {
ElMessage.warning("对不起!你没有选定上传的是哪个行政组织得人员信息!");
excelLoading.value = false;
return false;
}
if (!/\.(xlsx|xls|XLSX|XLS)$/.test(file.name)) {
ElMessage.warning("上传Excel只能为xlsx、xls格式");
excelLoading.value = false;
return false;
}
}
let peopleListAry = new Array(); let peopleListAry = new Array();
const peopleMsg = ref<string[]>([]); const peopleMsg = ref<string[]>([]);
const meritsYearIng = ref<any>(); const meritsYearIng = ref<any>();
@ -240,6 +263,7 @@ const uploadError = (response: any, uploadFile: UploadFile, uploadFiles: UploadF
}; };
const excelUpload = ref<any>(); const excelUpload = ref<any>();
const excelUploadStaff = ref<any>();
const insetPeopleCont = () => { const insetPeopleCont = () => {
// console.log("",jiBuQiVal,totalNum.value) // console.log("",jiBuQiVal,totalNum.value)
@ -313,6 +337,9 @@ const ruleForm = reactive({
const tempForm = reactive({ const tempForm = reactive({
orgId: 0, orgId: 0,
}); });
const stafftempForm = reactive({
orgId: 0,
});
/** /**
@ 作者: 秦东 @ 作者: 秦东
@ 时间: 2024-08-24 08:51:41 @ 时间: 2024-08-24 08:51:41
@ -513,6 +540,7 @@ const openSetup = ref(false);
*/ */
const setupClick = () => { const setupClick = () => {
openSetup.value = true; openSetup.value = true;
haveOrgList();
temList(); temList();
}; };
/** /**
@ -576,6 +604,73 @@ const downStatistics = (val: any) => {
openTableType.value = true; openTableType.value = true;
downClassType.value = 2; downClassType.value = 2;
}; };
//
const staffChengji = reactive({
orgId: "",
redisListKey: "",
total: "",
years: "",
levels: "",
number: 0,
});
/**
@ 作者: 秦东
@ 时间: 2024-02-03 14:04:48
@ 功能: 上传成功
*/
const uploadTrueStaff = (
response: any,
uploadFile: UploadFile,
uploadFiles: UploadFiles
) => {
excelLoading.value = false;
// console.log("response",response);
// console.log("uploadFile",uploadFile);
// console.log("uploadFiles",uploadFiles);
peopleListAry.push("文件上传成功!开始解析数据并写入数据库!");
peopleMsg.value.push("文件上传成功!开始解析数据并写入数据库!");
// peopleListAry.value.push("")
console.log("上传成功", response.code);
if (response.code == 0) {
jiBuQiVal = 0;
progressSize.value = 0;
excelJiexi.value = true;
staffChengji.orgId = response.data.orgId;
staffChengji.redisListKey = response.data.redisListKey;
staffChengji.total = response.data.total;
staffChengji.years = response.data.years;
staffChengji.levels = response.data.levels;
console.log("上传成功===>", staffChengji);
insetPeopleContStall();
}
};
//
const insetPeopleContStall = () => {
// console.log("",jiBuQiVal,totalNum.value)
if (jiBuQiVal < staffChengji.total) {
staffChengji.number = jiBuQiVal;
// console.log("",sendData)
anaRedisOrgStaffExc(staffChengji).then((data: any) => {
console.log("启动数据写入11111数据库", data, data.data);
peopleMsg.value.push(data.data.msgStr);
jiBuQiVal++;
// if (jibuq+ 1 >= totalNum.value){
// }
progressSize.value = Math.round((jiBuQiVal / staffChengji.total) * 10000) / 100;
insetPeopleContStall();
nextTick(() => {
// handleClick();
});
});
} else {
excelJiexi.value = false;
progressSize.value = 100;
excelUploadStaff.value.clearFiles();
}
};
</script> </script>
<template> <template>
<div class="app-container"> <div class="app-container">
@ -978,10 +1073,8 @@ const downStatistics = (val: any) => {
<el-tabs v-model="setupActiveName" type="border-card"> <el-tabs v-model="setupActiveName" type="border-card">
<el-tab-pane label="员工档案导入模版" name="1"> <el-tab-pane label="员工档案导入模版" name="1">
<template #label> <template #label>
<el-space wrap>
<span class="fa fa-upload"></span> <span class="fa fa-upload"></span>
<span>员工档案导入模版</span> <span>员工档案导入模版</span>
</el-space>
</template> </template>
<div <div
@ -1034,10 +1127,8 @@ const downStatistics = (val: any) => {
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="性格分析表" name="2"> <el-tab-pane label="性格分析表" name="2">
<template #label> <template #label>
<el-space wrap>
<span class="fa fa-list"></span> <span class="fa fa-list"></span>
<span>性格分析表</span> <span>性格分析表</span>
</el-space>
</template> </template>
<div class="downLink"> <div class="downLink">
<div>团队角色九型人格测试</div> <div>团队角色九型人格测试</div>
@ -1065,10 +1156,8 @@ const downStatistics = (val: any) => {
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="测试统计" name="3"> <el-tab-pane label="测试统计" name="3">
<template #label> <template #label>
<el-space wrap>
<span class="fa fa-bar-chart"></span> <span class="fa fa-bar-chart"></span>
<span>测试统计</span> <span>测试统计</span>
</el-space>
</template> </template>
<el-table :data="characterList" border style="width: 100%"> <el-table :data="characterList" border style="width: 100%">
@ -1087,6 +1176,76 @@ const downStatistics = (val: any) => {
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="测试统计" name="4">
<template #label>
<span class="fa fa-line-chart"></span>
<span>考评人员成绩统计表</span>
</template>
<el-row v-loading="excelLoading" element-loading-text="文档上传中,请稍候...">
<el-col :span="24">
<el-form
:model="stafftempForm"
label-width="auto"
style="max-width: 100%"
>
<el-form-item label="请选择上传那个公司的人员信息">
<el-radio-group v-model="stafftempForm.orgId">
<el-radio v-for="item in orgListTemp" :value="item.id">{{
item.name
}}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</el-col>
<el-col
:span="24"
v-loading="excelJiexi"
element-loading-text="文档解析中,请稍候..."
>
<el-upload
ref="excelUploadStaff"
class="upload-demo"
drag
:action="uploadFFurlStaff"
:data="{ orgId: stafftempForm.orgId.toString() }"
:before-upload="handleExcelChangeTempStaff"
:on-success="uploadTrueStaff"
:on-error="uploadError"
:show-file-list="false"
multiple
>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">
将电子表格拖到此处或 <em>单击上载</em>
</div>
</el-upload>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-progress
:text-inside="true"
:stroke-width="20"
:percentage="progressSize"
>
<span>已完成{{ progressSize }}%</span>
</el-progress>
</el-col>
</el-row>
<el-scrollbar height="300px" ref="scrollbarRef" always>
<div ref="innerRef">
<p
v-for="(item, index) in peopleMsg"
:key="index"
class="scrollbar-demo-item"
>
{{ item }}
</p>
</div>
</el-scrollbar>
</el-tab-pane>
</el-tabs> </el-tabs>
</el-drawer> </el-drawer>

Loading…
Cancel
Save