|
|
|
@ -11,6 +11,7 @@ |
|
|
|
import { BasicForm, useForm } from '/@/components/Form' |
|
|
|
import { BasicModal, useModalInner } from '/@/components/Modal' |
|
|
|
import { createOrganizationMember, editOrganizationMember } from '/@/api/staff/staff' |
|
|
|
import { getOrganizationDepartment } from '/@/api/staff/department' |
|
|
|
|
|
|
|
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] = useForm({ |
|
|
|
labelWidth: 100, |
|
|
|
@ -31,7 +32,19 @@ |
|
|
|
title: `${ifUpdate.value ? '编辑' : '添加'}员工`, |
|
|
|
confirmLoading: false, |
|
|
|
}) |
|
|
|
const result = await getOrganizationDepartment({}) |
|
|
|
const list = (result || []).map((item) => { |
|
|
|
const { departmentName, id } = item |
|
|
|
return { |
|
|
|
value: id, |
|
|
|
label: departmentName, |
|
|
|
} |
|
|
|
}) |
|
|
|
const departmentList = ref<any>([]) |
|
|
|
departmentList.value.push(...list) |
|
|
|
|
|
|
|
await updateSchema({ field: 'phone', componentProps: { disabled: !!ifUpdate.value } }) |
|
|
|
await updateSchema({ field: 'orgDepartmentId', componentProps: { options: departmentList } }) |
|
|
|
if (!!ifUpdate.value) { |
|
|
|
await setFieldsValue({ ...record }) |
|
|
|
} |
|
|
|
|