fix แสดงเลขที่ตำแหน่ง

This commit is contained in:
Bright 2024-02-08 15:07:55 +07:00
parent 840974d968
commit 4127b76bc0

View file

@ -742,6 +742,28 @@ export class PositionController extends Controller {
relations: ["posLevel", "posType", "posExecutive"],
});
if(body.isAll === true) {
if(posMaster.orgRootId !== null && posMaster.orgChild1Id == null && posMaster.orgChild2Id == null
&& posMaster.orgChild2Id == null && posMaster.orgChild3Id == null) {
body.type = 0;
}
else if(posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && posMaster.orgChild2Id == null
&& posMaster.orgChild2Id == null && posMaster.orgChild3Id == null) {
body.type = 1;
}
else if(posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && posMaster.orgChild2Id !== null
&& posMaster.orgChild2Id == null && posMaster.orgChild3Id == null) {
body.type = 2;
}
else if(posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && posMaster.orgChild2Id !== null
&& posMaster.orgChild2Id !== null && posMaster.orgChild3Id == null) {
body.type = 3;
}
else if(posMaster.orgRootId !== null && posMaster.orgChild1Id !== null && posMaster.orgChild2Id !== null
&& posMaster.orgChild2Id !== null && posMaster.orgChild3Id !== null) {
body.type = 4;
}
}
return {
id: posMaster.id,
orgRootId: posMaster.orgRootId,