updated probation

This commit is contained in:
Warunee Tamkoo 2024-09-06 16:21:25 +07:00
parent 4c85c5bc8c
commit 77609f20ad
13 changed files with 93 additions and 54 deletions

View file

@ -256,6 +256,7 @@ function save() {
};
dialogConfirm($q, async () => {
showLoader();
await http
.put(
config.API.editFormEvaluateCommader(assignId.value, evaluate_id.value),
@ -264,9 +265,11 @@ function save() {
.then((res: any) => {
status.value = false;
success($q, "บันทึกสำเร็จ");
hideLoader();
})
.catch((e: any) => {
messageError($q, e);
hideLoader();
});
});
}

View file

@ -228,6 +228,7 @@ function putformData() {
commander_dated: dateToISO(dateAutherise.value),
};
dialogConfirm($q, async () => {
showLoader();
await http
.post(config.API.createformCommader(assignId.value), data)
.then(() => {
@ -236,6 +237,9 @@ function putformData() {
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
});
}

View file

@ -376,6 +376,7 @@ function putformData() {
};
dialogConfirm($q, async () => {
showLoader();
await http
.put(
config.API.editFormEvaluateChairman(assignId.value, evaluate_id.value),
@ -388,6 +389,9 @@ function putformData() {
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
});
}

View file

@ -354,6 +354,7 @@ const putformData = () => {
director2_dated: dateToISO(director2_dated.value),
};
dialogConfirm($q, async () => {
showLoader();
await http
.post(config.API.createformChairman(assignId.value), data)
.then(() => {
@ -362,6 +363,9 @@ const putformData = () => {
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
});
};

View file

@ -191,6 +191,7 @@ async function postData(action: string) {
expand_month: expand_month.value,
};
if (action === "post") {
showLoader();
await http
.post(config.API.createformReport(assignId.value), data)
.then(() => {
@ -202,9 +203,10 @@ async function postData(action: string) {
})
.finally(() => {
status.value = false;
fecthResult(assignId.value);
hideLoader();
});
} else if (action === "put") {
showLoader();
await http
.put(config.API.createformReport(assignId.value), data)
.then(() => {
@ -216,7 +218,7 @@ async function postData(action: string) {
})
.finally(() => {
status.value = false;
fecthResult(assignId.value);
hideLoader();
});
}
}

View file

@ -28,6 +28,7 @@ const {
dateToISO,
messageError,
hideLoader,
showLoader,
dialogConfirm,
} = mixin;
const { ratingColors } = probationStore;
@ -312,6 +313,7 @@ function putformData() {
* @param data อมลทงไป
*/
async function saveformdata(data: any) {
showLoader();
await http
.post(config.API.createformevaluate(assignId.value), data)
.then((res: any) => {
@ -320,6 +322,9 @@ async function saveformdata(data: any) {
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
@ -328,14 +333,17 @@ async function saveformdata(data: any) {
* @param data อมลทปเดต
*/
async function editData(data: any) {
showLoader();
await http
.put(config.API.editFormEvaluate(assignId.value, evaluate_id.value), data)
.then((res: any) => {
status.value = false;
success($q, "บันทึกสำเร็จ");
hideLoader();
})
.catch((e: any) => {
messageError($q, e);
hideLoader();
});
}

View file

@ -26,6 +26,8 @@ const {
messageError,
dialogConfirm,
dialogMessageNotify,
showLoader,
hideLoader,
} = mixin;
const { ratingColors } = probationStore;
@ -292,6 +294,7 @@ function putformData() {
* @param data อมลทไดจาก งช putformData
*/
async function saveformdata(data: any) {
showLoader();
await http
.post(config.API.createformevaluate(assignId.value), data)
.then(() => {
@ -300,6 +303,9 @@ async function saveformdata(data: any) {
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}

View file

@ -20,7 +20,8 @@ const mixin = useCounterMixin();
const {
date2Thai,
success,
notifyError,
showLoader,
hideLoader,
dateToISO,
messageError,
dialogConfirm,
@ -297,6 +298,7 @@ function putformData() {
* @param data อมลท save
*/
async function saveformdata(data: any) {
showLoader();
await http
.post(config.API.formevaluateCommander(assignId.value), data)
.then(() => {
@ -305,6 +307,9 @@ async function saveformdata(data: any) {
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}

View file

@ -324,6 +324,7 @@ function putformData() {
/** save data */
async function saveformdata(data: any) {
showLoader();
await http
.post(config.API.formevaluateCommander(assignId.value), data)
.then((res: any) => {
@ -332,6 +333,9 @@ async function saveformdata(data: any) {
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}