|
|
|
@ -4,19 +4,21 @@ |
|
|
|
@ 备注: 人员管理 |
|
|
|
--> |
|
|
|
<script lang='ts' setup> |
|
|
|
import { orgInfo } from '@/api/hr/org/type' |
|
|
|
import { orgInfo,msgAry } from '@/api/hr/org/type' |
|
|
|
import { getOrgTreeList } from '@/api/hr/org/index' |
|
|
|
import { archivesCont,searchCriteriaForPeople } from '@/api/hr/people/type' |
|
|
|
import { emptypeOptions } from '@/api/hr/people/datacont' |
|
|
|
import { getArchivesListPage } from '@/api/hr/people/index' |
|
|
|
import { getArchivesListPage,analysisRedisExelect } from '@/api/hr/people/index' |
|
|
|
import UserRole from '@/assets/icons/user.svg' |
|
|
|
import { UploadFilled } from '@element-plus/icons-vue' |
|
|
|
/** |
|
|
|
* 引入页面 |
|
|
|
*/ |
|
|
|
import ArchivesCont from '@/views/hr/archives/archivescont.vue' |
|
|
|
import ArchivesCont from '@/views/hr/archives/archivescont.vue' |
|
|
|
|
|
|
|
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 = import.meta.env.VITE_APP_BASE_API + "/hrapi/staff/uploadUserFilesRedis" |
|
|
|
|
|
|
|
const searchOrgFormRef = ref(ElForm); |
|
|
|
const orgTreeRef = ref(ElTree); //行政组织树 |
|
|
|
@ -34,6 +36,8 @@ const searchArchiveQuery = reactive<searchCriteriaForPeople>({ |
|
|
|
page:1, |
|
|
|
pagesize:13 |
|
|
|
}) |
|
|
|
// const progressSize = 0 |
|
|
|
const progressSize = ref(0) |
|
|
|
const archivesBox= ref(false); //详情弹窗 |
|
|
|
/**用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职)', |
|
|
|
`company` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '入职公司', |
|
|
|
@ -107,12 +111,17 @@ const piLiangBox = ref(false) |
|
|
|
const openPiliangBox = () =>{ |
|
|
|
piLiangBox.value = true |
|
|
|
} |
|
|
|
let jiBuQiVal = 0; |
|
|
|
//关闭导入 |
|
|
|
const handleOpenClose = () =>{ |
|
|
|
piLiangBox.value = false |
|
|
|
piLiangBox.value = false |
|
|
|
peopleListAry.value = [] |
|
|
|
progressSize.value = 0 |
|
|
|
peopleMsg.value = [] |
|
|
|
jiBuQiVal = 0 |
|
|
|
} |
|
|
|
const excelLoading = ref(false) |
|
|
|
|
|
|
|
const excelJiexi = ref(false) |
|
|
|
/** |
|
|
|
* Excel文件change事件 |
|
|
|
* |
|
|
|
@ -127,7 +136,12 @@ const excelLoading = ref(false) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const peopleListAry = ref<any[]>(); |
|
|
|
let peopleListAry = new Array; |
|
|
|
const peopleMsg = ref<string[]>([]) |
|
|
|
const meritsYearIng = ref<any>(); |
|
|
|
const rewPunYearsIng = ref<any>(); |
|
|
|
const redisListKey = ref<string>(); |
|
|
|
const totalNum = ref<number>(); |
|
|
|
/** |
|
|
|
@ 作者: 秦东 |
|
|
|
@ 时间: 2024-02-03 14:04:48 |
|
|
|
@ -138,15 +152,86 @@ const uploadTrue = (response: any, uploadFile: UploadFile, uploadFiles: UploadFi |
|
|
|
console.log("response",response); |
|
|
|
console.log("uploadFile",uploadFile); |
|
|
|
console.log("uploadFiles",uploadFiles); |
|
|
|
peopleListAry.value = response.data.listAry |
|
|
|
peopleListAry.push("文件上传成功!开始解析数据并写入数据库!") |
|
|
|
peopleMsg.value.push("文件上传成功!开始解析数据并写入数据库!") |
|
|
|
// peopleListAry.value.push("文件上传成功!开始解析数据并写入数据库!") |
|
|
|
console.log("上传成功",response.code) |
|
|
|
if (response.code == 0){ |
|
|
|
jiBuQiVal = 0 |
|
|
|
progressSize.value = 0 |
|
|
|
excelJiexi.value = true |
|
|
|
meritsYearIng.value = response.data.meritsYearIng |
|
|
|
rewPunYearsIng.value = response.data.rewPunYearsIng |
|
|
|
redisListKey.value = response.data.redisListKey |
|
|
|
totalNum.value = response.data.totalNum |
|
|
|
insetPeopleCont() |
|
|
|
} |
|
|
|
} |
|
|
|
const uploadError = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => { |
|
|
|
excelLoading.value = false; |
|
|
|
excelLoading.value = true; |
|
|
|
console.log("1response",response); |
|
|
|
console.log("1uploadFile",uploadFile); |
|
|
|
console.log("1uploadFiles",uploadFiles); |
|
|
|
let msgAry = new Array |
|
|
|
msgAry.push("响应时间过长,系统自动转为后台静默处理,可先关闭窗口!完成时间大约90分钟。请于90分钟后刷新信息") |
|
|
|
// errorMsg = ["响应时间过长,系统自动转为后台静默处理,可先关闭窗口!完成时间大约90分钟。请于90分钟后刷新信息"] |
|
|
|
peopleListAry.value = msgAry |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const excelUpload = ref<any>() |
|
|
|
|
|
|
|
const insetPeopleCont = () =>{ |
|
|
|
console.log("启动数据写入数据库",jiBuQiVal,totalNum.value) |
|
|
|
if (jiBuQiVal < totalNum.value){ |
|
|
|
let sendData = { |
|
|
|
meritsYearIng:meritsYearIng.value, |
|
|
|
rewPunYearsIng:rewPunYearsIng.value, |
|
|
|
redisListKey:redisListKey.value, |
|
|
|
number:jiBuQiVal, |
|
|
|
} |
|
|
|
console.log("启动数据写入数据库",sendData) |
|
|
|
analysisRedisExelect(sendData) |
|
|
|
.then((data:any)=>{ |
|
|
|
console.log("启动数据写入11111数据库",data) |
|
|
|
peopleMsg.value.push(data.data.msgstr) |
|
|
|
jiBuQiVal++ |
|
|
|
// if (jibuq+ 1 >= totalNum.value){ |
|
|
|
|
|
|
|
// } |
|
|
|
progressSize.value = Math.round((jiBuQiVal/totalNum.value)*10000)/100 |
|
|
|
insetPeopleCont() |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
excelJiexi.value = false |
|
|
|
progressSize.value = 100 |
|
|
|
excelUpload.value.clearFiles() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//启动数据写入数据库 |
|
|
|
const writeDataBase = () => { |
|
|
|
let jibuq = 0 |
|
|
|
for(let i = 0; i < totalNum.value;i++){ |
|
|
|
let sendData = { |
|
|
|
meritsYearIng:meritsYearIng.value, |
|
|
|
rewPunYearsIng:rewPunYearsIng.value, |
|
|
|
redisListKey:redisListKey.value, |
|
|
|
number:i, |
|
|
|
} |
|
|
|
console.log("启动数据写入数据库",sendData) |
|
|
|
analysisRedisExelect(sendData) |
|
|
|
.then((data:any)=>{ |
|
|
|
console.log("启动数据写入11111数据库",data) |
|
|
|
peopleMsg.value.push(data.data.msgstr) |
|
|
|
jibuq++ |
|
|
|
if (jibuq+ 1 >= totalNum.value){ |
|
|
|
excelJiexi.value = false |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
//加载数据 |
|
|
|
onMounted(() => { |
|
|
|
haveOrgTreeInfo(); |
|
|
|
@ -291,15 +376,17 @@ onMounted(() => { |
|
|
|
width="800" |
|
|
|
:before-close="handleOpenClose" |
|
|
|
> |
|
|
|
<el-row v-loading="excelLoading" element-loading-text="文档解析中,请稍候..."> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-row v-loading="excelLoading" element-loading-text="文档上传中,请稍候..."> |
|
|
|
<el-col :span="24" v-loading="excelJiexi" element-loading-text="文档解析中,请稍候..."> |
|
|
|
<el-upload |
|
|
|
ref="excelUpload" |
|
|
|
class="upload-demo" |
|
|
|
drag |
|
|
|
:action="uploadFFurl" |
|
|
|
:before-upload="handleExcelChange" |
|
|
|
:on-success="uploadTrue" |
|
|
|
:on-error = "uploadError" |
|
|
|
:show-file-list = "false" |
|
|
|
multiple |
|
|
|
> |
|
|
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon> |
|
|
|
@ -311,13 +398,21 @@ onMounted(() => { |
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
<div class="divBoxCont"> |
|
|
|
<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 ref="myScrollbar" style="height: 300px"> |
|
|
|
<el-row> |
|
|
|
<el-col v-for="(item,index) in peopleListAry" :key="index" :span="24"> |
|
|
|
<el-col v-for="(item,index) in peopleMsg" :key="index" :span="24"> |
|
|
|
{{ item}} |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
|
</el-scrollbar> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
</el-container> |
|
|
|
</template> |
|
|
|
|