@@ -150,6 +141,7 @@ const getList = async () => {
try {
//首先获取用户信息
userProfile.value = await getUserProfile()
+ console.log(userProfile.value)
queryParams.orgid = userProfile.value.dept.id
const data = await PersonApi.getPersonPage(queryParams)
list.value = data.list
@@ -173,8 +165,8 @@ const resetQuery = () => {
/** 添加/修改操作 */
const formRef = ref()
-const openForm = async (type: string, id?: number) => {
- if (type == 'update') {
+const openForm = async (type: string, id?: number, currentPerson?: any) => {
+ if (type == 'update' && id) {
const res = await PersonArchiveApi.getPersonArchiveByUserid(id)
if (!res) {
message.error('该人员没有档案')
@@ -184,7 +176,7 @@ const openForm = async (type: string, id?: number) => {
formRef.value.open(type, id, userProfile.value)
}
} else {
- formRef.value.open(type, id, userProfile.value)
+ formRef.value.open(type, id, userProfile.value, currentPerson)
}
}
@@ -227,10 +219,10 @@ const handleCommand = async (command: string, row: PersonArchiveVO) => {
return
}
else{
- openForm('create')
+ openForm('create', row.id, row)
}
}else{
- openForm('create')
+ openForm('create', row.id, row)
}
break
case 'handleDelete':