api โครงสร้างกำลัง
This commit is contained in:
parent
3cb654bf17
commit
88041a1974
1 changed files with 20 additions and 30 deletions
|
|
@ -33,56 +33,46 @@ const itemStructure = ref<any>([
|
|||
name: "สร้างใหม่",
|
||||
},
|
||||
{
|
||||
val: "STRUCTURE",
|
||||
val: "ORG",
|
||||
name: "ทำสำเนาเฉพาะโครงสร้าง",
|
||||
},
|
||||
{
|
||||
val: "STRUCTUREANDPOSITION",
|
||||
val: "ORG_POSITION",
|
||||
name: "ทำสำเนาโครงสร้างและตำแหน่ง",
|
||||
},
|
||||
{
|
||||
val: "STRUCTUREANDPOSITION",
|
||||
val: "ORG_POSITION_PERSON",
|
||||
name: "ทำสำเนาโครงสร้าง ตำแหน่งและคนครอง",
|
||||
},
|
||||
]);
|
||||
const dataActive = ref<DataActive>();
|
||||
|
||||
async function fetchOrganizationActive() {
|
||||
const data = {
|
||||
activeId: null,
|
||||
activeName: "null",
|
||||
draftId: null,
|
||||
draftName: null,
|
||||
};
|
||||
|
||||
// dataActive.value = data;
|
||||
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.activeOrganization)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
// if (data) {
|
||||
// if (data.activeName === null && data.draftName === null) {
|
||||
// isStatusData.value = false;
|
||||
// } else {
|
||||
// isStatusData.value = true;
|
||||
// }
|
||||
// if (isStatusData.value) {
|
||||
// if (data.activeName === null) {
|
||||
// ishasActive.value = true;
|
||||
// stroe.typeOrganizational = "draft";
|
||||
// } else if (data.draftName === null) {
|
||||
// ishasDraft.value = true;
|
||||
// stroe.typeOrganizational = "current";
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
const data = res.data.result;
|
||||
if (data) {
|
||||
if (data.activeName === null && data.draftName === null) {
|
||||
isStatusData.value = false;
|
||||
} else {
|
||||
isStatusData.value = true;
|
||||
if (isStatusData.value) {
|
||||
if (data.activeName === null) {
|
||||
ishasActive.value = true;
|
||||
stroe.typeOrganizational = "draft";
|
||||
} else if (data.draftName === null) {
|
||||
ishasDraft.value = true;
|
||||
stroe.typeOrganizational = "current";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
console.log(err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue