没有部门

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"]) this.formRef.current?.resetFields(["departureName", "destinationName"])
}) })
store.subscribe(this.handleStoreChange); 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 = { this.state = {
loading: false, loading: false,
open: this.props.open, open: this.props.open,
invoices: [], invoices: [],
selectedDepartment: {id: this.departments[0].departmentId, name: this.departments[0].departmentName}, selectedDepartment: defaultDepartment,
departmentsProps: { departmentsProps: {
items: departmentsPropItems, items: departmentsPropItems,
onClick: this.handleMenuClick, onClick: this.handleMenuClick,