diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index 4b15bff2c..0ae5e8565 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -211,13 +211,12 @@ function confirmDelete(id: string) { .delete(config.API.complaintFileDelete(formData.id, id)) .then((res) => { success($q, `ลบไฟล์สำเร็จ`); + props.getData(); }) .catch((e) => { messageError($q, e); }) - .finally(() => { - props.getData(); - }); + .finally(() => {}); } /** diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue b/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue index fb5167dd8..40f8b2a50 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue @@ -81,22 +81,22 @@ const dateMonth = ref({ }); /** function เรียกข่อมูล calendar*/ -function getRandomColor() { - return ( - "hsl(" + - 360 * Math.random() + - "," + - (25 + 70 * Math.random()) + - "%," + - (85 + 10 * Math.random()) + - "%)" - ); -} +// function getRandomColor() { +// return ( +// "hsl(" + +// 360 * Math.random() + +// "," + +// (25 + 70 * Math.random()) + +// "%," + +// (85 + 10 * Math.random()) + +// "%)" +// ); +// } async function fetchCalendar() { showLoader(); - const defaultColor = "#E3FDDA"; - const gradientColors = generateGradientColors(props.lists.length); + const defaultColor = "#e3fdda"; + const gradientColors = '#f7d0dd' const events = await props.lists.map( (e: ExtendHistoryObject, index: number) => ({ @@ -107,7 +107,7 @@ async function fetchCalendar() { allDay: false, color: props.lists.length > 1 && index > 0 - ? gradientColors[index] + ? gradientColors : defaultColor, }) ); @@ -123,13 +123,13 @@ async function fetchCalendar() { }, 1000); } -function generateGradientColors(length: number) { - const colors = []; - for (let i = 0; i < length; i++) { - colors.push(getRandomColor()); - } - return colors; -} +// function generateGradientColors(length: number) { +// const colors = []; +// for (let i = 0; i < length; i++) { +// colors.push(getRandomColor()); +// } +// return colors; +// } /** * function convert เดือนปี diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue index 783979380..c0429aed6 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue @@ -410,12 +410,13 @@ function confirmDeleteRelevant(id: string) { .delete(config.API.investigateRelevantFileDelete(formData.id, id)) .then((res) => { success($q, `ลบไฟล์สำเร็จ`); + props.getData(); }) .catch((e) => { messageError($q, e); }) .finally(() => { - props.getData(); + }); } @@ -437,12 +438,13 @@ function confirmDelete(id: string) { .delete(config.API.investigateFileDelete(formData.id, id)) .then((res) => { success($q, `ลบไฟล์สำเร็จ`); + props.getData(); }) .catch((e) => { messageError($q, e); }) .finally(() => { - props.getData(); + }); } async function addPerson(data: any) { @@ -611,12 +613,13 @@ async function saveDuty(id: string, duty: string, resolution: string) { .then((res: any) => { success($q, "บันทึกสำเร็จ"); closeEditDirector(); + props.getData?.(); }) .catch((e) => { messageError($q, e); }) .finally(async () => { - props.getData?.(); + hideLoader(); }); } diff --git a/src/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue b/src/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue index 8976738da..14f119361 100644 --- a/src/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue +++ b/src/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue @@ -580,23 +580,6 @@ function closeEditDirector() { modalEditDirector.value = false; } -// async function saveDuty(id: string, duty: string) { -// showLoader(); -// await http -// .put(config.API.disciplinaryEditDuty(props.data.id, id), { duty: duty }) -// .then((res: any) => { -// success($q, "บันทึกสำเร็จ"); -// closeEditDirector(); -// }) -// .catch((e) => { -// messageError($q, e); -// }) -// .finally(async () => { -// props.fetchData(); -// hideLoader(); -// }); -// } - async function saveDuty(id: string, duty: string, resolution: string) { showLoader(); await http @@ -607,12 +590,13 @@ async function saveDuty(id: string, duty: string, resolution: string) { .then((res: any) => { success($q, "บันทึกสำเร็จ"); closeEditDirector(); + props.fetchData(); }) .catch((e) => { messageError($q, e); }) .finally(async () => { - props.fetchData(); + hideLoader(); }); } @@ -1057,11 +1041,6 @@ onMounted(async () => { ) : null " - :rules="[ - (val) => - !!val || - `${'กรุณาเลือกวันที่เริ่มการสอบสวน'}`, - ]" :label="`${'วันที่เริ่มการสอบสวน'}`" >