From 475490d1f2172ce6c7d65a9016fc93ce69b4c3f9 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Wed, 15 Nov 2023 17:44:12 +0700 Subject: [PATCH] no message --- .../FormEvaluation/FormEvaluateScore.vue | 53 ++++++++++------ .../FormEvaluation/FormEvaluateScoreAdd.vue | 19 +++++- .../probation/FormEvaluation/FormReport.vue | 63 +++++++++++-------- .../FormEvaluation/FormSaveResult.vue | 53 +++++++++++----- .../2_InvestigateFacts/MainPage.vue | 4 +- .../3_InvestigateDisciplinary/Table.vue | 4 +- 6 files changed, 131 insertions(+), 65 deletions(-) diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue index a63590df8..64a05d4a0 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue @@ -28,16 +28,8 @@ const { const route = useRoute(); const assignId = ref(route.params.form.toString()); const personalId = ref(route.params.personalId.toString()); - const myForm = ref(null); - -const edit = () => { - status.value = true; -}; -const cancel = () => { - status.value = false; - fecthAssign(); -}; +const dateAutherise = ref(); const evaluate_no = ref(); const evaluate_id = ref(""); const start_date = ref(new Date()); @@ -82,6 +74,10 @@ const training_seminar_percent = ref(0); const other_training_percent = ref(0); const develop_result = ref(); const evaluate_result = ref(); + +const list2_1 = probationStore.behavior_no1; +const list2_2 = probationStore.behavior_no2; +const list2_3 = probationStore.behavior_no3; const evaluate_result_option = ref([ { name: "ผ่าน (สูงกว่าร้อยละ 60)", value: 1 }, { name: "ไม่ผ่าน (ต่ำกว่าร้อยละ 60)", value: 0 }, @@ -91,10 +87,20 @@ const develop_result_option = ref([ { name: "ผ่าน (สูงกว่าร้อยละ 60)", value: 1 }, { name: "ไม่ผ่าน (ต่ำกว่าร้อยละ 60)", value: 0 }, ]); -// footer -const dateAutherise = ref(); -const fecthAssign = async () => { +/**set true */ +function edit(){ + status.value = true; +}; + +/** set false */ +function cancel(){ + status.value = false; + fecthAssign(); +}; + +/** get ข้อมูล */ +async function fecthAssign(){ showLoader(); await http .get(config.API.evaluateChairman(assignId.value)) @@ -129,8 +135,8 @@ const fecthAssign = async () => { }); }; -const fetchEvaluate = async () => { - // showLoader(); +/** เอาค่าจ่าก ดาต้า เก็บไว้ที่ตัวเเปร */ + async function fetchEvaluate(){ try { let data = await dataArr.value; evaluate_id.value = data.id; @@ -181,10 +187,6 @@ const fetchEvaluate = async () => { } catch (error) {} }; -const list2_1 = probationStore.behavior_no1; -const list2_2 = probationStore.behavior_no2; -const list2_3 = probationStore.behavior_no3; - // score const score1 = computed(() => { if ( @@ -292,7 +294,8 @@ const score5 = computed(() => { ); }); -const savaForm = () => { +/** ฟังชั่นเช็คค่าไม่ว่าง */ +function savaForm(){ let hasError = false; if ( learn_level.value === 0 || @@ -326,7 +329,8 @@ const savaForm = () => { } }; -const putformData = () => { +/** ฟังชั่น อัพเดต ข้อมูล */ +function putformData(){ const data = { evaluate_no: evaluate_no.value, start_date: start_date.value, @@ -389,6 +393,8 @@ const putformData = () => { }); }); }; + +/** ตรวจสอบการเปลี่ยนเเปลงค่า props */ watch(props, async () => { if (props.tab && props.action == "edit") { evaluate_no.value = Number(props.tab.charAt(4)); @@ -397,6 +403,7 @@ watch(props, async () => { await fecthAssign(); } }); + onMounted(async () => { if (props.tab && props.action == "edit") { evaluate_no.value = Number(props.tab.charAt(4)); @@ -424,6 +431,7 @@ onMounted(async () => { แก้ไขข้อมูล +
ยกเลิก @@ -441,6 +449,7 @@ onMounted(async () => {
+
@@ -763,6 +772,7 @@ onMounted(async () => {
+
@@ -811,6 +821,7 @@ onMounted(async () => {
+
@@ -859,6 +870,7 @@ onMounted(async () => {
+
@@ -929,6 +941,7 @@ onMounted(async () => {
+
คะแนนรวมพฤติกรรมการปฏิบัติราชการ
diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue index 07ea731db..55046d03b 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue @@ -80,6 +80,7 @@ const develop_result_option = ref([ ]); // footer const dateAutherise = ref(null); + onMounted(() => { fecthAssign(assignId.value); }); @@ -232,7 +233,9 @@ const lengthdiscipline_level = computed(() => { return discipline_level.value.filter((item: number) => item !== 0).length; }); const variablesToWatch = [learn_level, apply_level, success_level]; -const savaForm = async () => { + +/** ฟังชั่นเช็คค่าไม่ว่าง */ +async function savaForm(){ let hasError = false; if ( learn_level.value === 0 || @@ -293,6 +296,8 @@ const savaForm = async () => { dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ"); } }; + +/** ฟังชั่น อัพเดต ข้อมูล */ const putformData = () => { const data = { evaluate_no: evaluate_no.value, @@ -351,15 +356,18 @@ const putformData = () => { }); }); }; + const alerts = Array(20) .fill(null) .map(() => ref(false)); +/** ฟังชั่น คลาส css*/ const getBordered = (i: boolean) => { return { border_custom: i, }; }; + variablesToWatch.forEach((variable, index) => { watch(variable, (item: any) => { if (item !== 0) { @@ -367,16 +375,22 @@ variablesToWatch.forEach((variable, index) => { } }); }); + +/** ตรวจสอบการเปลี่ยนเเปลงค่า lengthconduct*/ watch(lengthconduct, (newLength) => { if (newLength === 4) { alerts[3].value = false; } }); + +/** ตรวจสอบการเปลี่ยนเเปลงค่า lengthmoral_level*/ watch(lengthmoral_level, (newLength) => { if (newLength === 3) { alerts[4].value = false; } }); + +/** ตรวจสอบการเปลี่ยนเเปลงค่า lengthdiscipline_level*/ watch(lengthdiscipline_level, (newLength) => { if (newLength === 5) { alerts[5].value = false; @@ -493,6 +507,7 @@ watch(lengthdiscipline_level, (newLength) => { +
{ +
@@ -1365,6 +1381,7 @@ watch(lengthdiscipline_level, (newLength) => { option-label="name" disable /> +
([ }, ]); -// const saveEdit = async (id: string) => { -// await myForm.value.validate().then((result: boolean) => { -// if (result) { -// dialogConfirm($q, async () => await postData("put")); -// }else { -// dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ"); -// } -// }); -// }; - -const fecthAssign = async (id: string) => { +/** get ข้อมูลรายการมอยหมาย เก็บไว้ตัวแปร + * @param id personal id + */ +async function fecthAssign(id: string) { showLoader(); await http .get(config.API.evaluateReportcreate(id)) @@ -103,8 +96,11 @@ const fecthAssign = async (id: string) => { .finally(() => { hideLoader(); }); -}; +} +/** get ข้อมูล เก็บไว้ตัวแปร + * @param id personal id + */ const fecthResult = async (id: string) => { await http .get(config.API.createformReport(id)) @@ -129,9 +125,8 @@ const fecthResult = async (id: string) => { .catch((e) => {}); }; -// part new - -const savaForm = async () => { +/** เช็คก่อน save */ +async function savaForm() { await myForm.value.validate().then((result: boolean) => { if (result) { dialogConfirm($q, async () => await postData("post")); @@ -139,8 +134,10 @@ const savaForm = async () => { dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ"); } }); -}; -const downloadFile = (response: any, filename: string) => { +} + +/** แปลงรหัสไฟล์ */ +function downloadFile(response: any, filename: string) { const link = document.createElement("a"); var fileName = filename; link.href = window.URL.createObjectURL(new Blob([response.data])); @@ -148,9 +145,13 @@ const downloadFile = (response: any, filename: string) => { document.body.appendChild(link); link.click(); document.body.removeChild(link); -}; +} -const clickdownloadFile = async (type: string) => { +/** + * ดาว์โหลดไฟล์ + * @param type docx/pdf + */ +async function clickdownloadFile(type: string) { showLoader(); await http .get(config.API.reportEvaluateResult(type, assignId.value), { @@ -165,8 +166,12 @@ const clickdownloadFile = async (type: string) => { .finally(() => { hideLoader(); }); -}; -const postData = async (action: string) => { +} + +/** post/put data + * @param action post put + */ +async function postData(action: string) { const data = await { start_date: date_start.value, date_finish: date_finish.value, @@ -207,15 +212,20 @@ const postData = async (action: string) => { fecthResult(assignId.value); }); } -}; -const selectResult = () => { +} + +/** ผลการประเมินการทดลองปฏิบัติหน้าที่ราชการ */ +function selectResult() { if (result.value !== 3) { expand_month.value = ""; } changeReson52(Number(result.value)); -}; +} +/** แปลง val เป็นตัวหนังสือ + * @param val ตัวเลข + */ function changeReson52(val: number) { switch (val) { case 1: @@ -278,7 +288,6 @@ onMounted(() => { ผู้ทดลองปฏิบัติหน้าที่ราชการ {{ person.name }}
-
ตำแหน่งในสายงาน {{ person.PositionLineName }} @@ -293,6 +302,7 @@ onMounted(() => {
+
ประเมินผล @@ -351,6 +361,7 @@ onMounted(() => {
+
{ คณะกรรมการ
+
{ disable option-label="name" /> +
(null); const behavio_strengthRef = ref(null); const behavio_inproveRef = ref(null); -const edit = () => { - status.value = true; -}; - -const cancel = () => { - status.value = false; - props.fecthAssign?.(assignId.value) -}; const props = defineProps({ tab: String, data: Object, @@ -85,7 +77,17 @@ const props = defineProps({ fecthAssign: Function, }); -const fecthFormdata = async () => { +function edit(){ + status.value = true; +}; + +function cancel(){ + status.value = false; + props.fecthAssign?.(assignId.value) +}; + +/** get data */ +async function fecthFormdata(){ await http .get(config.API.formevaluateRecord(assignId.value)) .then(async (res: any) => { @@ -100,7 +102,8 @@ const fecthFormdata = async () => { }); }; -const fectFormfull = async () => { +/** get form */ +async function fectFormfull(){ Autherise.value = probationStore.director.name + ` (${probationStore.director.PositionLineName}, ${probationStore.director.PositionLevelName}, ${probationStore.director.Oc})`; list1_1.value = probationStore.assignOutput; @@ -117,7 +120,8 @@ const fectFormfull = async () => { fecthFormRound(); }; -const fecthFormRound = async () => { +/** get form รอบ */ +async function fecthFormRound(){ try { let data = await dataArr.value; evaluate_id.value = data.id; @@ -207,7 +211,8 @@ const behavio_strengthRules = [ (val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น", ]; -const savaForm = () => { +/** เช็ค data */ +function savaForm(){ achievement_strengthRef.value.validate(); achievement_inproveRef.value.validate(); behavio_strengthRef.value.validate(); @@ -250,7 +255,8 @@ const savaForm = () => { } }; -const putformData = () => { +/** update data */ +function putformData(){ const data = { evaluate_no: evaluate_no.value, start_date: start_date.value, @@ -292,7 +298,10 @@ const putformData = () => { ); }; -const saveformdata = async (data: any) => { +/** save data + * @param data ข้อมูลที่ส่งไป + */ +async function saveformdata(data: any){ await http .post(config.API.createformevaluate(assignId.value), data) .then((res: any) => { @@ -304,7 +313,11 @@ const saveformdata = async (data: any) => { }); }; -const editData = async (data: any) => { +/** + * แก้ไขข้อมูล + * @param data ข้อมูลที่อัปเดต + */ +async function editData = async (data: any){ await http .put(config.API.editFormEvaluate(assignId.value, evaluate_id.value), data) .then((res: any) => { @@ -316,6 +329,7 @@ const editData = async (data: any) => { }); }; +/** เช็คค่า props */ watch(props, async () => { if (props.tab && props.action == "edit") { evaluate_no.value = Number(props.tab.charAt(4)); @@ -415,6 +429,7 @@ onMounted(async () => {
ผลผลิตของงานที่คาดหวัง
+ @@ -446,6 +461,7 @@ onMounted(async () => {
+
ผลผลิตของงานที่เกิดขึ้นจริง @@ -725,6 +741,7 @@ onMounted(async () => { 2.1 ความประพฤติ
+ @@ -756,6 +773,7 @@ onMounted(async () => {
+
@@ -792,6 +810,7 @@ onMounted(async () => {
+
@@ -828,6 +847,7 @@ onMounted(async () => {
+
@@ -870,6 +890,7 @@ onMounted(async () => {
+
@@ -891,6 +912,7 @@ onMounted(async () => {
+
@@ -958,6 +980,7 @@ onMounted(async () => {
+
diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue b/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue index 300144b71..7cf1198fe 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue @@ -103,7 +103,7 @@ onMounted(async () => {
- { icon="mdi-plus" > เพิ่มรายการสืบสวนข้อเท็จจริง - + -->
diff --git a/src/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue b/src/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue index a6d42c273..39c9898fb 100644 --- a/src/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue +++ b/src/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue @@ -66,7 +66,7 @@ function resetFilter() {