修正部门配置

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