|
|
@ -13,7 +13,7 @@ const { TextArea } = Input; |
|
|
|
const NominateModal = (props) => { |
|
|
|
const { queryData, recordId, visible, user, onCancel, depMessage, loading, depUser, clientHeight, depData, onVisibleChange, dispatch } = props |
|
|
|
const [depId, setDepId] = useState(0) |
|
|
|
const [depUsers, setDepUsers] = useState() |
|
|
|
const [depUsers, setDepUsers] = useState([]) |
|
|
|
// const [value, setValue] = useState(undefined);
|
|
|
|
const [selectedUserId, setSelectedUserId] = useState(null); |
|
|
|
const [form] = Form.useForm(); |
|
|
@ -24,15 +24,11 @@ const NominateModal = (props) => { |
|
|
|
// 根据选择的部门ID获取对应的用户数据
|
|
|
|
//setDepUsers([])
|
|
|
|
const res = await dispatch(getDepUser(value)) |
|
|
|
const copy = res.payload.data.filter(user => { |
|
|
|
if (user.isAdmin) { |
|
|
|
return user |
|
|
|
} |
|
|
|
}) |
|
|
|
let processedUsers = copy.map((item) => { |
|
|
|
let processedUsers = res.payload.data?.map((item) => { |
|
|
|
return { |
|
|
|
label: item.name, |
|
|
|
value: item.id, |
|
|
|
phone: item.phone |
|
|
|
} |
|
|
|
}) |
|
|
|
setDepUsers(processedUsers) |
|
|
@ -48,6 +44,9 @@ const NominateModal = (props) => { |
|
|
|
onCancel() |
|
|
|
setDepUsers([]) |
|
|
|
form.resetFields() |
|
|
|
// const phone = depUsers.find(u => u.value == values.nameId)?.phone;
|
|
|
|
// console.log(phone, 'phone')
|
|
|
|
// dispatch(pushAppointSMS({ phone, info: 'info...' }))
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|