修正部门配置

main
白封羽 2023-01-07 11:39:11 +08:00
parent ec17ab2e10
commit eb9de2f1e3
1 changed files with 13 additions and 12 deletions

View File

@ -34,10 +34,10 @@ class DepartmentConfig extends React.Component<any, any> {
}
})
if (newRow) {
let data={
let data = {
departmentName: row.departmentName,
departmentManagerId: row.departmentManagerId,
staffIds:[]
staffIds: []
}
axiosInstance.post("management/department", data).then((res) => {
this.update()
@ -45,11 +45,11 @@ class DepartmentConfig extends React.Component<any, any> {
this.update()
})
} else {
let data={
let data = {
departmentName: row.departmentName,
departmentManagerId: row.departmentManagerId,
}
axiosInstance.put("management/department/"+row.departmentId, data).then((res) => {
axiosInstance.put("management/department/" + row.departmentId, data).then((res) => {
this.update()
}).catch((err) => {
this.update()
@ -76,15 +76,16 @@ class DepartmentConfig extends React.Component<any, any> {
return []
}
let res = []
console.log(columns)
for (let i = 0; i < columns.length; i++) {
console.log(columns[i].departmentName)
res.push({
id: columns[i].departmentId,
departmentId: columns[i].departmentId,
departmentName: columns[i].departmentName,
departmentManagerId: columns[i].departmentManager.staffId,
departmentManagerName: columns[i].departmentManager.staffName,
})
if (columns[i].deletedAt == null)
res.push({
id: columns[i].departmentId,
departmentId: columns[i].departmentId,
departmentName: columns[i].departmentName,
departmentManagerId: columns[i].departmentManager.staffId,
departmentManagerName: columns[i].departmentManager.staffName,
})
}
console.log(res);
return res