13 changed files with 1892 additions and 131 deletions
@ -0,0 +1,200 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-11-28 10:11:16 |
|||
@ 备注: 人员列表 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { emptypeOptions } from "@/api/hr/people/datacont"; |
|||
import { orgInfo } from "@/api/hr/org/type"; |
|||
import { authorizeOrgTree } from '@/api/system/roleapi/power' |
|||
import { |
|||
teamcontlist |
|||
} from "@/api/hr/org/index"; |
|||
|
|||
const orgTreeRef = ref(ElTree); //行政组织树 |
|||
const orgTreeLoading = ref(false); //加载行政组织树 |
|||
const orgTreeList = ref<orgInfo[]>(); //行政组织树数据 |
|||
const tiemList = ref([]); //班组列表 |
|||
const orgTreeProps = { |
|||
children: "child", |
|||
label: "name", |
|||
}; //行政组织树对照值 |
|||
|
|||
const searchInfo = reactive({ |
|||
orgId:"", |
|||
name:"", |
|||
employ:"", |
|||
team:"", |
|||
joinTime:"" |
|||
}) |
|||
|
|||
const getOrgPowerTrue = () => { |
|||
orgTreeLoading.value = true |
|||
let sendInfo = { |
|||
menuId:"50" |
|||
} |
|||
authorizeOrgTree(sendInfo).then((res) => { |
|||
console.log(res) |
|||
orgTreeList.value = res.data |
|||
orgTreeLoading.value = false |
|||
}).finally(() => { |
|||
orgTreeLoading.value = false |
|||
}) |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-01-14 10:27:12 |
|||
@ 功能: 获取班组列表 |
|||
*/ |
|||
const gainTimeList = () => { |
|||
let searchMap = { |
|||
page: 1, |
|||
pagesize: 2000, |
|||
name: "", |
|||
}; |
|||
teamcontlist(searchMap).then((data) => { |
|||
tiemList.value = data.data.list; |
|||
}); |
|||
}; |
|||
const resetChecked = () => { |
|||
orgTreeRef.value.setCheckedKeys([]) |
|||
} |
|||
/** |
|||
* 选中行政组织树节点 |
|||
*/ |
|||
const handleOrgTreeNodeClick = (data: orgInfo) => { |
|||
// console.log(data) |
|||
searchInfo.orgId = data.id; |
|||
// getArchivesPage(); |
|||
}; |
|||
onMounted(() => { |
|||
getOrgPowerTrue(); |
|||
gainTimeList(); |
|||
}) |
|||
</script> |
|||
<template> |
|||
<div class="app-content"> |
|||
<el-container> |
|||
<el-aside width="300px" style="padding: 10px 10px"> |
|||
<el-card :body-style="{ height: 'calc(100vh - 190px)', padding: '0px 5px' }"> |
|||
<el-button |
|||
type="primary" |
|||
style="width: 100%; margin: 10px 0" |
|||
@click="resetChecked" |
|||
> |
|||
查看全部 |
|||
</el-button> |
|||
<el-tree-v2 |
|||
style="max-width: 100%" |
|||
:data="orgTreeList" |
|||
:props="orgTreeProps" |
|||
v-loading="orgTreeLoading" |
|||
node-key="id" |
|||
:expand-on-click-node="false" |
|||
:check-on-click-node="true" |
|||
:check-strictly="true" |
|||
:default-expand-all="false" |
|||
:height="1200" |
|||
@node-click="handleOrgTreeNodeClick" |
|||
/> |
|||
</el-card> |
|||
</el-aside> |
|||
|
|||
|
|||
|
|||
<el-main style="padding: 10px 10px 0 0"> |
|||
<el-card :body-style="{ height: 'calc(100vh - 190px)', padding: '0px 15px' }"> |
|||
<el-form ref="searchForm" :model="searchInfo" :inline="true" style="width: 100%; margin-top: 10px;"> |
|||
<el-form-item label="工号 / 姓名 / 手机号" prop="keywords"> |
|||
<el-input |
|||
v-model="searchInfo.name" |
|||
placeholder="请输入工号/姓名/手机号" |
|||
clearable |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="用工关系" prop="number"> |
|||
<el-select |
|||
v-model="searchInfo.employ" |
|||
multiple |
|||
clearable |
|||
collapse-tags |
|||
placeholder="用工关系" |
|||
style="width: 200px" |
|||
> |
|||
<el-option |
|||
v-for="item in emptypeOptions" |
|||
:key="item.id" |
|||
:label="item.name" |
|||
:value="item.id" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="班组" prop="number"> |
|||
<el-select |
|||
v-model="searchInfo.team" |
|||
clearable |
|||
collapse-tags |
|||
placeholder="员工班组" |
|||
style="width: 240px" |
|||
> |
|||
<el-option |
|||
v-for="item in tiemList" |
|||
:key="item.id" |
|||
:label="item.name" |
|||
:value="item.id" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="入职日期" prop="number"> |
|||
<el-date-picker |
|||
v-model="searchInfo.joinTime" |
|||
type="date" |
|||
placeholder="入职日期" |
|||
format="YYYY-MM-DD" |
|||
value-format="YYYY-MM-DD" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="" prop="number"> |
|||
<el-button type="primary" @click="getArchivesPage"> |
|||
<template #icon><i-ep-search /></template> |
|||
搜索 |
|||
</el-button> |
|||
<el-button @click="resetArcFormQuery"> |
|||
<template #icon><i-ep-refresh /></template> |
|||
重置 |
|||
</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="func-but"> |
|||
<el-button v-hasButton="[215437071358111744]" type="primary" @click="handleAddArchives"> |
|||
<template #icon><i-ep-plus /></template> |
|||
新增 |
|||
</el-button> |
|||
<el-button |
|||
v-hasPerm="['215437153071542272']" |
|||
plain |
|||
type="primary" |
|||
@click="openPiliangBox" |
|||
> |
|||
<el-icon><MessageBox /></el-icon> |
|||
批量导入数据 |
|||
</el-button> |
|||
</div> |
|||
</el-card> |
|||
</el-main> |
|||
</el-container> |
|||
</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.app-content { |
|||
height: calc(100vh - 170px); |
|||
background-color: aqua; |
|||
|
|||
:deep .el-drawer__body { |
|||
padding: 0 10px; |
|||
} |
|||
} |
|||
.common-layout { |
|||
|
|||
} |
|||
</style> |
|||
@ -0,0 +1,274 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-12-03 14:22:19 |
|||
@ 备注: 添加人员 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { addNewPeople } from "@/api/system/roleapi/power"; |
|||
import defaultImg from "@/assets/images/1.png"; |
|||
const props = defineProps({ |
|||
show: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
orgTree: { |
|||
type: Array as PropType<orgInfo[]>, |
|||
default: () => [] |
|||
} |
|||
}) |
|||
const imgUploadApiUrl = import.meta.env.VITE_APP_BASE_API+"/setupFile/uploads/oneFileUpload";//图片上传地址 |
|||
const emit = defineEmits(['update:show','updateInfo']) |
|||
const ubLockPage = computed(() => props.show) |
|||
const orgTreeList = computed(() => props.orgTree) //行政组织树数据 |
|||
const butLoading = ref(false) |
|||
const fileUploadIng = ref(false); |
|||
const systemMenuTreeProps = { |
|||
children: "child", |
|||
label: "name", |
|||
value:"id" |
|||
} //行政组织树对照值 |
|||
const formRef = ref<any>(); |
|||
const rules = ref<any>({ |
|||
name: [{ required: true, message: '请输入姓名', trigger: 'blur' }], |
|||
code: [{ required: true, message: '请输入工号', trigger: 'blur' }], |
|||
orgId: [{ required: true, message: '请选择行政组织', trigger: 'change' }], |
|||
employment: [{ required: true, message: '请输入用工关系', trigger: 'blur' }], |
|||
mobile: [{ required: true, message: '请输入手机号', trigger: 'blur' }], |
|||
}); |
|||
const userInfo = ref({ |
|||
name: "", |
|||
code: "", |
|||
mobile: "", |
|||
nation: "", |
|||
sex: "1", |
|||
age: "", |
|||
oldName: "", |
|||
icon: defaultImg, |
|||
orgId:"", |
|||
employment:"", |
|||
address:"" |
|||
}) |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-12-03 14:26:25 |
|||
@ 功能: 关闭 |
|||
*/ |
|||
const closeLock = () => { |
|||
emit('update:show', false) |
|||
emit('updateInfo') |
|||
userInfo.value.icon = defaultImg |
|||
butLoading.value = false |
|||
formRef.value.resetFields(); |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-12-03 15:40:14 |
|||
@ 功能: 提交数据 |
|||
*/ |
|||
const onSubmit = () => { |
|||
butLoading.value = true |
|||
formRef.value.validate((valid) => { |
|||
if (valid) { |
|||
// 提交表单数据 |
|||
addNewPeople(userInfo.value).then((res) => { |
|||
if (res.code == 0) { |
|||
ElMessage.success("新增成功"); |
|||
closeLock(); |
|||
} else { |
|||
ElMessage.error(res.msg); |
|||
} |
|||
butLoading.value = false |
|||
}) |
|||
} else { |
|||
butLoading.value = false |
|||
} |
|||
}); |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-08-31 14:35:18 |
|||
@ 功能: 上传前判断类型 |
|||
*/ |
|||
const beforeAvatarUpload: UploadProps["beforeUpload"] = (rawFile) => { |
|||
fileUploadIng.value = true; |
|||
if (!/\.(png|jpg|gif|jpeg|svg|bmp)$/.test(rawFile.name)) { |
|||
ElMessage.warning("您上传的图片不符合要求!"); |
|||
fileUploadIng.value = false; |
|||
return false; |
|||
} |
|||
}; |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-08-31 14:40:31 |
|||
@ 功能: 上传成功 |
|||
*/ |
|||
const handleAvatarSuccess: UploadProps["onSuccess"] = ( |
|||
response, |
|||
uploadFile, |
|||
uploadFiles |
|||
) => { |
|||
userInfo.value.icon = URL.createObjectURL(uploadFile.raw!); |
|||
// console.log("上传成功-------------------->", uploadFile); |
|||
// console.log("上传成功-------------------->", props.archivesdata.id); |
|||
fileUploadIng.value = false; |
|||
ElMessage.success("上传成功"); |
|||
|
|||
}; |
|||
</script> |
|||
<template> |
|||
<el-dialog |
|||
v-model="ubLockPage" |
|||
title="新增人员信息" |
|||
width="650" |
|||
draggable |
|||
:destroy-on-close="true" |
|||
:before-close="closeLock" |
|||
> |
|||
<el-form :model="userInfo" :rules="rules" ref="formRef" label-width="80px"> |
|||
<table> |
|||
<tr> |
|||
<td> |
|||
<el-form-item label="姓名" prop="name"> |
|||
<el-input v-model="userInfo.name" placeholder="请输入姓名" /> |
|||
</el-form-item> |
|||
</td> |
|||
<td> |
|||
<el-form-item label="曾用名" prop="oldName"> |
|||
<el-input v-model="userInfo.oldName" placeholder="请输入曾用名" /> |
|||
</el-form-item> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<el-form-item label="工号" prop="code"> |
|||
<el-input v-model="userInfo.code" placeholder="请输入工号" /> |
|||
</el-form-item> |
|||
</td> |
|||
<td rowspan="3" align="center"> |
|||
<el-upload |
|||
class="avatar-uploader" |
|||
:action="imgUploadApiUrl" |
|||
:show-file-list="false" |
|||
:on-success="handleAvatarSuccess" |
|||
:before-upload="beforeAvatarUpload" |
|||
v-loading="fileUploadIng" |
|||
> |
|||
<el-avatar shape="square" :size="180" :src="userInfo.icon" class="bianKuang" /> |
|||
</el-upload> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<el-form-item label="民族" prop="nation"> |
|||
<el-input v-model="userInfo.nation" placeholder="请输入民族" /> |
|||
</el-form-item> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<el-form-item label="性别" prop="sex"> |
|||
<el-radio-group v-model="userInfo.sex"> |
|||
<el-radio label="1">男</el-radio> |
|||
<el-radio label="2">女</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2"> |
|||
<el-form-item label="归属部门" prop="orgId"> |
|||
<el-tree-select |
|||
v-model="userInfo.orgId" |
|||
:data="orgTreeList" |
|||
check-strictly |
|||
:render-after-expand="false" |
|||
:props="systemMenuTreeProps" |
|||
style="width: 100%" |
|||
clearable |
|||
/> |
|||
</el-form-item> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<el-form-item label="联系电话" prop="mobile"> |
|||
<el-input v-model="userInfo.mobile" placeholder="请输入联系电话" /> |
|||
</el-form-item> |
|||
</td> |
|||
<td> |
|||
<el-form-item label="用工关系" prop="employment"> |
|||
<el-select v-model="userInfo.employment" placeholder="请选择用工关系" style="width: 100%"> |
|||
<el-option label="临时工" value="1" /> |
|||
<el-option label="编外人员" value="2" /> |
|||
<el-option label="实习&实习生" value="3" /> |
|||
<el-option label="试用员工" value="4" /> |
|||
<el-option label="待分配" value="5" /> |
|||
<el-option label="待岗" value="6" /> |
|||
<el-option label="临时调入" value="7" /> |
|||
<el-option label="正式员工" value="8" /> |
|||
<el-option label="长期病假" value="9" /> |
|||
<el-option label="停薪留职" value="10" /> |
|||
<el-option label="退休" value="11" /> |
|||
<el-option label="辞职" value="12" /> |
|||
<el-option label="辞退" value="13" /> |
|||
<el-option label="离职" value="14" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<el-form-item label="出生日期" prop="age"> |
|||
<el-date-picker |
|||
v-model="userInfo.age" |
|||
type="date" |
|||
placeholder="请选择出生日期" |
|||
format="YYYY/MM/DD" |
|||
value-format="YYYY-MM-DD" |
|||
/> |
|||
</el-form-item> |
|||
</td> |
|||
<td> |
|||
<el-form-item label="联系地址" prop="address"> |
|||
<el-input v-model="userInfo.address" placeholder="请输入联系地址" /> |
|||
</el-form-item> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<el-form-item label="身体状况" prop="bodyStatus"> |
|||
<el-select v-model="userInfo.bodyStatus" placeholder="请选择身体状况" style="width: 100%"> |
|||
<el-option label="良好" value="1" /> |
|||
<el-option label="一般" value="2" /> |
|||
<el-option label="较弱" value="3" /> |
|||
<el-option label="有生理缺陷" value="4" /> |
|||
<el-option label="有生理缺陷" value="4" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</td> |
|||
<td> |
|||
<el-form-item label="婚姻状况" prop="marriageStatus"> |
|||
<el-select v-model="userInfo.marriageStatus" placeholder="请选择婚姻状况" style="width: 100%"> |
|||
<el-option label="未婚" value="1" /> |
|||
<el-option label="已婚" value="2" /> |
|||
<el-option label="离异" value="4" /> |
|||
<el-option label="丧偶" value="3" /> |
|||
</el-select> |
|||
</el-form-item> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<div class="flex justify-center"> |
|||
<el-button type="primary" :loading="butLoading" @click="onSubmit">提交</el-button> |
|||
<el-button @click="closeLock">取消</el-button> |
|||
</div> |
|||
</el-form> |
|||
</el-dialog> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.bianKuang { |
|||
border: 1px solid #ccc; |
|||
} |
|||
|
|||
|
|||
</style> |
|||
@ -0,0 +1,235 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-12-02 16:17:37 |
|||
@ 备注: 批量导入 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { orgInfo } from "@/api/hr/org/type"; |
|||
import { |
|||
analysisRedisOrgExelect, |
|||
} from "@/api/hr/people/index"; |
|||
import { ElScrollbar as ElScrollbarType } from "element-plus"; |
|||
const uploadFFurl = import.meta.env.VITE_APP_BASE_API + "/hrapi/staff/uploadUserFilesRedis"; |
|||
const props = defineProps({ |
|||
show: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
orgTree: { |
|||
type: Array as PropType<orgInfo[]>, |
|||
default: () => [] |
|||
} |
|||
}) |
|||
const ubLockPage = computed(() => props.show) |
|||
const emit = defineEmits(['update:show','updateInfo']) |
|||
const closeUploadTemp = () => { |
|||
emit('update:show', false) |
|||
emit('updateInfo') |
|||
tempForm.orgId = "" |
|||
excelLoading.value = false; |
|||
excelJiexi.value = false; |
|||
} |
|||
const orgTreeList = computed(() => props.orgTree) //行政组织树数据 |
|||
const excelLoading = ref(false); |
|||
const excelJiexi = ref(false); |
|||
const tempForm = reactive({ |
|||
orgId: "", |
|||
}); |
|||
const systemMenuTreeProps = { |
|||
children: "child", |
|||
label: "name", |
|||
value:"id" |
|||
} |
|||
const excelUpload = ref<any>(); |
|||
let peopleListAry = new Array(); //输出信息 |
|||
const peopleMsg = ref<string[]>([]); |
|||
let jiBuQiVal = 0; |
|||
const progressSize = ref(0); |
|||
const meritsYearIng = ref<any>(); |
|||
const rewPunYearsIng = ref<any>(); |
|||
const redisListKey = ref<string>(); |
|||
const totalNum = ref<number>(); |
|||
const innerRef = ref<HTMLDivElement>(); |
|||
const scrollbarRef = ref<InstanceType<typeof ElScrollbarType>>(); |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-12-02 16:53:45 |
|||
@ 功能: 上传前检查 |
|||
*/ |
|||
function handleExcelChangeTemp(file: UploadFile) { |
|||
excelLoading.value = true; |
|||
if (tempForm.orgId == 0 || tempForm.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; |
|||
} |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-12-02 16:55:17 |
|||
@ 功能: 上传失败 |
|||
*/ |
|||
const uploadError = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => { |
|||
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; |
|||
}; |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-12-02 16:56:39 |
|||
@ 功能: 上传成功 |
|||
*/ |
|||
const uploadTrue = (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; |
|||
meritsYearIng.value = response.data.meritsYearIng; |
|||
rewPunYearsIng.value = response.data.rewPunYearsIng; |
|||
redisListKey.value = response.data.redisListKey; |
|||
totalNum.value = response.data.totalNum; |
|||
// console.log("上传成功===>", staffChengji); |
|||
insetPeopleCont(); |
|||
} |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-12-02 17:01:05 |
|||
@ 功能: 写入数据库 |
|||
*/ |
|||
const insetPeopleCont = () => { |
|||
// console.log("启动数据写入数据库===============》", jiBuQiVal, totalNum.value); |
|||
if (jiBuQiVal < totalNum.value) { |
|||
let sendData = { |
|||
meritsYearIng: meritsYearIng.value, |
|||
rewPunYearsIng: rewPunYearsIng.value, |
|||
redisListKey: redisListKey.value, |
|||
number: jiBuQiVal, |
|||
orgId: tempForm.orgId.toString(), |
|||
}; |
|||
// console.log("启动数据写入数据库", sendData); |
|||
analysisRedisOrgExelect(sendData).then((data: any) => { |
|||
// console.log("启动数据写入11111数据库",data,data.data.msgStr) |
|||
peopleMsg.value.push(data.data.msgStr); |
|||
jiBuQiVal++; |
|||
// if (jibuq+ 1 >= totalNum.value){ |
|||
|
|||
// } |
|||
progressSize.value = Math.round((jiBuQiVal / totalNum.value) * 10000) / 100; |
|||
insetPeopleCont(); |
|||
nextTick(() => { |
|||
handleClick(); |
|||
}); |
|||
}); |
|||
} else { |
|||
excelJiexi.value = false; |
|||
progressSize.value = 100; |
|||
excelUpload.value.clearFiles(); |
|||
} |
|||
}; |
|||
|
|||
const handleClick = () => { |
|||
nextTick(() => { |
|||
// console.log("滚动条长度",innerRef.value!.clientHeight) |
|||
if (innerRef.value!.clientHeight > 300) { |
|||
scrollbarRef.value!.setScrollTop(innerRef.value!.clientHeight); |
|||
} |
|||
}); |
|||
}; |
|||
</script> |
|||
<template> |
|||
<el-dialog |
|||
v-model="ubLockPage" |
|||
title="批量导入人员信息" |
|||
width="800" |
|||
draggable |
|||
:destroy-on-close="true" |
|||
:before-close="closeUploadTemp" |
|||
> |
|||
<el-row v-loading="excelLoading" element-loading-text="文档上传中,请稍候..." style="width: 100%"> |
|||
<el-col :span="24"> |
|||
<el-form :model="tempForm" label-width="auto" style="width: 100%"> |
|||
<el-form-item label="请选择上传那个公司的人员信息"> |
|||
<el-tree-select |
|||
v-model="tempForm.orgId" |
|||
:data="orgTreeList" |
|||
check-strictly |
|||
:render-after-expand="false" |
|||
:props="systemMenuTreeProps" |
|||
style="width: 100%" |
|||
clearable |
|||
/> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-col> |
|||
<el-col |
|||
:span="24" |
|||
v-loading="excelJiexi" |
|||
element-loading-text="文档解析中,请稍候..." |
|||
> |
|||
<el-upload |
|||
ref="excelUpload" |
|||
class="upload-demo" |
|||
drag |
|||
:action="uploadFFurl" |
|||
:data="{ orgId: tempForm.orgId.toString() }" |
|||
:before-upload="handleExcelChangeTemp" |
|||
:on-success="uploadTrue" |
|||
: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 style="width: 100%;"> |
|||
<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 style="padding:10px 20px;"> |
|||
<div ref="innerRef"> |
|||
<p |
|||
v-for="(item, index) in peopleMsg" |
|||
:key="index" |
|||
class="scrollbar-demo-item" |
|||
> |
|||
{{ item }} |
|||
</p> |
|||
</div> |
|||
</el-scrollbar> |
|||
</el-dialog> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.app-content { |
|||
|
|||
} |
|||
</style> |
|||
@ -0,0 +1,96 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-12-02 15:50:46 |
|||
@ 备注: 解除人员信息锁 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { |
|||
jiechuUserLock, |
|||
} from "@/api/hr/org/index"; |
|||
|
|||
|
|||
const props = defineProps({ |
|||
show: { |
|||
type: Boolean, |
|||
default: false |
|||
} |
|||
}) |
|||
const ubLockPage = computed(() => props.show) |
|||
const emit = defineEmits(['update:show','updateInfo']) |
|||
const unLockForm = reactive({ |
|||
numText: "", |
|||
}); |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-12-02 15:53:20 |
|||
@ 功能: 关闭解锁弹窗 |
|||
*/ |
|||
const closeLock = () => { |
|||
emit('update:show', false) |
|||
emit('updateInfo') |
|||
} |
|||
const ruleFormRefLock = ref(null); |
|||
var butLoad = ref(false); |
|||
//提交数据 |
|||
const picksubus = () => { |
|||
butLoad.value = true; |
|||
ruleFormRefLock.value.validate((isValid: boolean) => { |
|||
if (isValid) { |
|||
jiechuUserLock({ userId: unLockForm.numText }) |
|||
.then((res: any) => { |
|||
butLoad.value = false; |
|||
closeLock() |
|||
}) |
|||
.finally(() => { |
|||
butLoad.value = false; |
|||
}); |
|||
} else { |
|||
butLoad.value = false; |
|||
} |
|||
}); |
|||
}; |
|||
const resetForm = () => { |
|||
closeLock(); |
|||
ruleFormRefLock.value.resetFields(); |
|||
}; |
|||
</script> |
|||
<template> |
|||
<el-dialog |
|||
v-model="ubLockPage" |
|||
title="清除锁定人员信息锁" |
|||
width="500" |
|||
draggable |
|||
:destroy-on-close="true" |
|||
:before-close="closeLock" |
|||
> |
|||
<el-form |
|||
ref="ruleFormRefLock" |
|||
:model="unLockForm" |
|||
:rules="editTitleRules" |
|||
label-width="80" |
|||
style="width: 100%" |
|||
> |
|||
<el-form-item label="工号" prop="numText"> |
|||
<el-text>请输入工号;以英文逗号隔开(,)</el-text> |
|||
<el-input |
|||
v-model="unLockForm.numText" |
|||
type="textarea" |
|||
placeholder="请输入工号;以英文逗号隔开(,)" |
|||
clearable |
|||
:autosize="{ minRows: 4, maxRows: 10 }" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" v-loading="butLoad" @click="picksubus"> |
|||
确定 |
|||
</el-button> |
|||
<el-button @click="resetForm(ruleFormRef)">取消</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-dialog> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.app-content { |
|||
|
|||
} |
|||
</style> |
|||
@ -0,0 +1,222 @@ |
|||
<!-- eslint-disable vue/no-side-effects-in-computed-properties --> |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-12-03 10:44:56 |
|||
@ 备注: 上传模版 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { orgInfo } from "@/api/hr/org/type"; |
|||
import { |
|||
uploadUserTemplate |
|||
|
|||
} from "@/api/hr/org/index"; |
|||
import { uploadUrl } from "@/api/DesignForm"; |
|||
const props = defineProps({ |
|||
show: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
orgTree: { |
|||
type: Array as PropType<orgInfo[]>, |
|||
default: () => [] |
|||
}, |
|||
ruleForm: { |
|||
type: Object as PropType<typeof ruleForm>, |
|||
default: () => ({}) |
|||
} |
|||
}) |
|||
const addTemLoading = ref(false); |
|||
let peopleListAry = new Array(); |
|||
const excelLoading = ref(false); |
|||
const excelUploadUs = ref(); |
|||
|
|||
const emits = defineEmits(['update:show']) |
|||
const ruleFormRef = ref<any>(); |
|||
const ruleFormIng = ref({ |
|||
id: "", |
|||
orgId: "", |
|||
fileName: "", |
|||
filePath: "", |
|||
fileUrl: "", |
|||
}); |
|||
const orgTreePropsBut = { |
|||
children: "child", |
|||
value: "id", |
|||
label: "name", |
|||
}; //行政组织树对照值 |
|||
const orgTreeList = computed(() => props.orgTree) //行政组织树数据 |
|||
const ubLockPage = computed({ |
|||
get: () =>{ |
|||
if(props.show){ |
|||
ruleFormIng.value.id = props.ruleForm.id |
|||
ruleFormIng.value.orgId = props.ruleForm.orgId |
|||
ruleFormIng.value.fileName = props.ruleForm.fileName |
|||
ruleFormIng.value.filePath = props.ruleForm.filePath |
|||
ruleFormIng.value.fileUrl = props.ruleForm.fileUrl |
|||
} |
|||
return props.show |
|||
}, |
|||
set: (val) => { |
|||
emits("update:show", val); |
|||
}, |
|||
}) |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-04-19 13:13:18 |
|||
@ 功能: 表单验证规则 |
|||
*/ |
|||
const dataFormRules = reactive({ |
|||
orgId: [{ required: true, message: "请选择行政组织", trigger: "blur" }], |
|||
fileName: [{ required: true, message: "请上传模版文件", trigger: "blur" }], |
|||
}); |
|||
//关闭 |
|||
const tempOpenClose = () => { |
|||
emits('update:show', false) |
|||
ruleFormIng.value.id = "" |
|||
ruleFormIng.value.orgId = 0 |
|||
ruleFormIng.value.fileName = "" |
|||
ruleFormIng.value.filePath = "" |
|||
ruleFormIng.value.fileUrl = "" |
|||
} |
|||
//文件前缀检查 |
|||
const handleExcelChange = (file: UploadFile) => { |
|||
excelLoading.value = true; |
|||
if (!/\.(xlsx|xls|XLSX|XLS)$/.test(file.name)) { |
|||
ElMessage.warning("上传Excel只能为xlsx、xls格式"); |
|||
excelLoading.value = false; |
|||
return false; |
|||
} |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-08-24 14:46:32 |
|||
@ 功能: 文件上传成功 |
|||
*/ |
|||
const uploadTrueUs = ( |
|||
response: any, |
|||
uploadFile: UploadFile, |
|||
uploadFiles: UploadFiles |
|||
) => { |
|||
// console.log("response",response); |
|||
// console.log("uploadFile",uploadFile); |
|||
// console.log("uploadFiles",uploadFiles); |
|||
excelLoading.value = false; |
|||
ruleFormIng.value.fileName = uploadFile.name; |
|||
ruleFormIng.value.filePath = response.data.physicspath; |
|||
ruleFormIng.value.fileUrl = response.data.url; |
|||
}; |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-12-03 11:02:30 |
|||
@ 功能: 文件上传失败 |
|||
*/ |
|||
const uploadError = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => { |
|||
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; |
|||
}; |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2025-12-03 11:05:57 |
|||
@ 功能: 提交上传数据 |
|||
*/ |
|||
const saveTemp = () => { |
|||
addTemLoading.value = true; |
|||
ruleFormRef.value.validate((valid: any) => { |
|||
if (valid) { |
|||
ruleFormIng.value.orgId = ruleFormIng.value.orgId.toString(); |
|||
// console.log("上传传输信息--->", ruleForm); |
|||
if (ruleFormIng.value.id == 0 || ruleFormIng.value.id == "") { |
|||
uploadUserTemplate(ruleForm) |
|||
.then((data: any) => { |
|||
console.log("上传传输信息-1-->", data); |
|||
tempOpenClose(); |
|||
}) |
|||
.finally(() => { |
|||
addTemLoading.value = false; |
|||
}); |
|||
} else { |
|||
editUserTemplateInfo(ruleForm) |
|||
.then((data: any) => { |
|||
console.log("上传传输信息-2-->", data); |
|||
tempOpenClose(); |
|||
}) |
|||
.finally(() => { |
|||
addTemLoading.value = false; |
|||
}); |
|||
} |
|||
} else { |
|||
addTemLoading.value = false; |
|||
} |
|||
}); |
|||
}; |
|||
</script> |
|||
<template> |
|||
<el-dialog |
|||
v-model="ubLockPage" |
|||
title="上传导入模版" |
|||
width="400" |
|||
:before-close="tempOpenClose" |
|||
> |
|||
<el-form |
|||
ref="ruleFormRef" |
|||
style="max-width: 600px" |
|||
:model="ruleForm" |
|||
:rules="dataFormRules" |
|||
label-width="auto" |
|||
class="demo-ruleForm" |
|||
:size="formSize" |
|||
status-icon |
|||
> |
|||
<el-form-item label="归属行政组织" prop="orgId"> |
|||
<el-tree-select |
|||
v-model="ruleFormIng.orgId" |
|||
:data="orgTreeList" |
|||
:props="orgTreePropsBut" |
|||
:render-after-expand="false" |
|||
:expand-on-click-node="false" |
|||
:check-on-click-node="true" |
|||
:check-strictly="true" |
|||
:default-expand-all="false" |
|||
style="width: 240px" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="信息模版" prop="fileName"> |
|||
<el-input v-model="ruleFormIng.fileName" /> |
|||
<el-upload |
|||
ref="excelUploadUs" |
|||
class="upload-demo" |
|||
drag |
|||
v-loading="excelLoading" |
|||
:action="uploadUrl" |
|||
:limit="1" |
|||
:before-upload="handleExcelChange" |
|||
:on-success="uploadTrueUs" |
|||
:on-error="uploadError" |
|||
:show-file-list="false" |
|||
> |
|||
<el-icon class="el-icon--upload"><upload-filled /></el-icon> |
|||
<div class="el-upload__text">将电子表格拖到此处或 <em>单击上载</em></div> |
|||
</el-upload> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" v-loading="addTemLoading" @click="saveTemp()"> |
|||
确定上传 |
|||
</el-button> |
|||
<el-button @click="tempOpenClose()">取消</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-dialog> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.app-content { |
|||
|
|||
} |
|||
</style> |
|||
@ -0,0 +1,12 @@ |
|||
# EditorConfig is awesome: https://EditorConfig.org |
|||
|
|||
# top-most EditorConfig file |
|||
root = true |
|||
|
|||
[*] |
|||
indent_style = space |
|||
indent_size = 4 |
|||
end_of_line = crlf |
|||
charset = utf-8 |
|||
trim_trailing_whitespace = false |
|||
insert_final_newline = false |
|||
Loading…
Reference in new issue