没有部门

main
白封羽 2023-01-05 12:01:57 +08:00
parent e44b27f239
commit e7ac6d7b82
1 changed files with 4 additions and 1 deletions

View File

@ -68,11 +68,14 @@ class ReimbursementCreate extends React.Component<any, any> {
this.formRef.current?.resetFields(["departureName", "destinationName"])
})
store.subscribe(this.handleStoreChange);
let defaultDepartment = this.departments?.length>0?{id: this.departments[0].departmentId, name: this.departments[0].departmentName}:null;
if(defaultDepartment==null)
defaultDepartment={id:-1,name:""}
this.state = {
loading: false,
open: this.props.open,
invoices: [],
selectedDepartment: {id: this.departments[0].departmentId, name: this.departments[0].departmentName},
selectedDepartment: defaultDepartment,
departmentsProps: {
items: departmentsPropItems,
onClick: this.handleMenuClick,