แก้บัค แบบประเมินผล (คณะกรรมการ)

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-10-03 11:00:24 +07:00
parent 77e4294ec5
commit f773550bfd
8 changed files with 792 additions and 285 deletions

View file

@ -59,9 +59,7 @@ const fetchPublishFile = async () => {
hideLoader();
});
};
// json
const loadTreeData = async () => {
expanded.value = [];
await http
@ -69,7 +67,6 @@ const loadTreeData = async () => {
.then((res: any) => {
treeData.value = res.data;
dataRespone.value = res.data;
// Filter objects with "name" null
const filteredData = res.data.filter(filterByPersonIdNull);
treeData.value = filteredData;
@ -81,7 +78,6 @@ const loadTreeData = async () => {
hideLoader();
});
};
function filterByPersonIdNull(obj: any) {
if (obj.name === null && obj.isCondition != true) {
return true;
@ -92,12 +88,10 @@ function filterByPersonIdNull(obj: any) {
}
return false;
}
// position
const fetchplacementPosition = async () => {
await http
.get(config.API.apppointmentPosition())
.get(config.API.apppointmentPositionUse())
.then((res: any) => {
placementPosition.value = res.data.result;
})
@ -105,9 +99,6 @@ const fetchplacementPosition = async () => {
messageError($q, e);
});
};
const props = defineProps({
personalId: String,
modal: Boolean,
@ -117,10 +108,8 @@ const props = defineProps({
},
personal: Object,
});
const myFilterMethod = (node: any, filter: string) => {
const filt = filter;
return (
(node.name && node.name.indexOf(filt) > -1) ||
(node.organizationName && node.organizationName.indexOf(filt) > -1) ||
@ -138,7 +127,6 @@ const myFilterMethod = (node: any, filter: string) => {
(node.positionLevel && node.positionLevel.indexOf(filt) > -1)
);
};
const validateData = async () => {
checkValidate.value = true;
await myFormPosition.value.validate().then((result: boolean) => {
@ -147,7 +135,6 @@ const validateData = async () => {
}
});
};
const saveAppoint = async () => {
myFormPosition.value.validate().then(async (result: boolean) => {
if (props.personalId !== undefined) {
@ -165,8 +152,8 @@ const saveAppoint = async () => {
};
showLoader();
await http
.put(config.API.appointmentPosition(id.value), dataAppoint)
.then((res) => {
.put(config.API.appointEmployeePosition(id.value), dataAppoint)
.then(() => {
success($q, "บันทึกสำเร็จ");
})
.catch((e) => {
@ -182,8 +169,6 @@ const saveAppoint = async () => {
}
});
};
const closeModal = () => {
if (editDataStatus.value == true) {
dialogConfirm(
@ -199,7 +184,6 @@ const closeModal = () => {
closeAndClear();
}
};
const closeAndClear = async () => {
await props.close();
editDataStatus.value = false;