ปรับวินัย

This commit is contained in:
setthawutttty 2024-01-10 18:01:19 +07:00
parent 4f0584c415
commit 141a8aa435
6 changed files with 53 additions and 103 deletions

View file

@ -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(() => {});
}
/**

View file

@ -81,22 +81,22 @@ const dateMonth = ref<DataDateMonthObject>({
});
/** 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 เดอนป

View file

@ -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();
});
}

View file

@ -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="`${'วันที่เริ่มการสอบสวน'}`"
>
<template v-slot:prepend>
@ -1110,7 +1089,7 @@ onMounted(async () => {
"
outlined
dense
lazy-rules
hide-bottom-space
borderless
:model-value="
@ -1120,11 +1099,6 @@ onMounted(async () => {
)
: null
"
:rules="[
(val) =>
!!val ||
`${'กรุณาเลือกวันที่สิ้นสุดการสอบสวน'}`,
]"
:label="`${'วันที่สิ้นสุดการสอบสวน'}`"
>
<template v-slot:prepend>
@ -1204,11 +1178,6 @@ onMounted(async () => {
: null
"
:label="`${'วันที่สรุปพยานหลักฐาน'}`"
:rules="[
(val) =>
!!val || `${'กรุณาเลือกวันที่สรุปพยานหลักฐาน'}`,
]"
lazy-rules
>
<template v-slot:prepend>
<q-icon
@ -1256,11 +1225,7 @@ onMounted(async () => {
: null
"
:label="`${'วันที่รายงานผลการสอบสวน'}`"
:rules="[
(val) =>
!!val || `${'กรุณาเลือกวันที่รายงานผลการสอบสวน'}`,
]"
lazy-rules
>
<template v-slot:prepend>
<q-icon
@ -1381,8 +1346,6 @@ onMounted(async () => {
for="#casefault"
label="กรณีมีความผิด"
hide-bottom-space
:rules="[(val) => !!val || `${'กรุณากรอกกรณีมีความผิด'}`]"
lazy-rules
@update:model-value="changeFormData()"
/>
</div>
@ -1398,8 +1361,7 @@ onMounted(async () => {
ref="disciplinaryInvestigateAtRef"
v-model="formData.disciplinaryInvestigateAt"
label="สอบสวนที่"
:rules="[(val) => !!val || `${'กรุณากรอกสอบสวนที่'}`]"
lazy-rules
@update:model-value="changeFormData()"
/>
</div>
@ -1420,10 +1382,7 @@ onMounted(async () => {
hide-bottom-space
:options="investigateDis.optionsfaultLevel"
label="ระดับโทษความผิด"
:rules="[
(val) => !!val || `${'กรุณาเลือกระดับโทษความผิด'}`,
]"
lazy-rules
group-label="group"
group-values="options"
@update:model-value="changeFormData()"
@ -1453,10 +1412,6 @@ onMounted(async () => {
ref="disciplinaryRefLawRef"
v-model="formData.disciplinaryRefLaw"
label="อ้างอิงมาตราตามกฎหมาย"
:rules="[
(val) => !!val || `${'กรุณากรอกอ้างอิงมาตราตามกฎหมาย'}`,
]"
lazy-rules
@update:model-value="changeFormData()"
/>
</div>
@ -1474,8 +1429,6 @@ onMounted(async () => {
v-model="formData.disciplinarySummaryEvidence"
label="สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา"
type="textarea"
:rules="[(val:string) => !!val || `${'กรุณากรอกสรุปพยานหลักฐานสนับสนุนข้อกล่าวหา'}`]"
lazy-rules
@update:model-value="changeFormData()"
/>
</div>
@ -1492,8 +1445,6 @@ onMounted(async () => {
label="บันทึกถ้อยคำของผู้กล่าวหา"
hide-bottom-space
type="textarea"
:rules="[(val:string) => !!val || `${'กรุณากรอกบันทึกถ้อยคำของผู้กล่าวหา'}`]"
lazy-rules
@update:model-value="changeFormData()"
/>
</div>
@ -1510,8 +1461,6 @@ onMounted(async () => {
label="พยานและบันทึกถ้อยคำพยาน"
hide-bottom-space
type="textarea"
:rules="[(val:string) => !!val || `${'กรุณากรอกพยานและบันทึกถ้อยคำพยาน'}`]"
lazy-rules
@update:model-value="changeFormData()"
/>
</div>
@ -1528,8 +1477,6 @@ onMounted(async () => {
label="ผลการสอบสวน"
hide-bottom-space
type="textarea"
:rules="[(val:string) => !!val || `${'กรุณากรอกผลการสอบสวน'}`]"
lazy-rules
@update:model-value="changeFormData()"
/>
</div>
@ -1557,12 +1504,8 @@ onMounted(async () => {
outlined
dense
:readonly="isReadonly"
lazy-rules
ref="disciplinaryStatusResultRef"
v-model="formData.disciplinaryStatusResult"
:rules="[
(val) => !!val || `${'กรุณาเลือกผลการสอบสวน'}`,
]"
:options="mainStore.statusResultOptions"
label="ผลการสอบสวน"
emit-value
@ -1599,10 +1542,6 @@ onMounted(async () => {
dense
ref="disciplinaryCauseTextRef"
v-model="formData.disciplinaryCauseText"
:rules="[
(val) =>
!!val || `${'กรุณาเลือกร้ายแรง/ไม่ร้ายแรง'}`,
]"
:options="investigateDis.causeTextOptions"
label="ร้ายแรง/ไม่ร้ายแรง"
emit-value
@ -1630,10 +1569,8 @@ onMounted(async () => {
outlined
ref="disciplinaryResultRef"
dense
lazy-rules
borderless
v-model="formData.disciplinaryResult"
:rules="[(val) => !!val || `${'กรุณากรอกเหตุผล'}`]"
hide-bottom-space
:label="`${'เหตุผล'}`"
type="textarea"

View file

@ -94,8 +94,8 @@ watch(props, () => {
dense
class="col-12 q-mb-sm"
debounce="300"
placeholder="มติ/คำสั่งแต่งตั้ง"
:rules="[(val) => !!val || `กรุณากรอก มติ/คำสั่งแต่งตั้ง`]"
placeholder="มติ/คำสั่ง"
:rules="[(val) => !!val || `กรุณากรอก มติ/คำสั่ง`]"
hide-bottom-space
/>
</q-card-section>

View file

@ -80,6 +80,7 @@ export const useInvestigateDisStore = defineStore(
"offenseDetails",
"disciplinaryFaultLevel",
"disciplinaryCaseFault",
"disciplinaryDate",
"createdAt",
"status",
]);
@ -148,10 +149,19 @@ export const useInvestigateDisStore = defineStore(
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "createdAt",
name: "disciplinaryDate",
align: "left",
label: "วันที่สอบสวน",
sortable: true,
field: "disciplinaryDate",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "createdAt",
align: "left",
label: "วันที่รับเรื่อง",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
@ -217,7 +227,7 @@ export const useInvestigateDisStore = defineStore(
{
name: "commandNo",
align: "left",
label: "มติ",
label: "มติ/คำสั่ง",
sortable: true,
field: "commandNo",
headerStyle: "font-size: 14px",
@ -251,11 +261,12 @@ export const useInvestigateDisStore = defineStore(
async function fetchList(data: investigateDisDataRowType[]) {
let datalist: any[] = data.map((e: any) => ({
id: e.id,
title: e.title ? e.title :'-',
respondentType: e.respondentType ? convertRespondentType(e.respondentType):'-',
offenseDetails: e.offenseDetails ? convertFault(e.offenseDetails):'-',
title: e.title ? e.title : '-',
respondentType: e.respondentType ? convertRespondentType(e.respondentType) : '-',
offenseDetails: e.offenseDetails ? convertFault(e.offenseDetails) : '-',
disciplinaryFaultLevel: e.disciplinaryFaultLevel ?? "-",
disciplinaryCaseFault: e.disciplinaryCaseFault ?? "-",
disciplinaryDate: e.disciplinaryDateStart && e.disciplinaryDateEnd ? `${date2Thai(e.disciplinaryDateStart)} - ${date2Thai(e.disciplinaryDateEnd)}` : '-',
status: convertStatus(e.status) ?? "-",
createdAt: e.createdAt ? date2Thai(e.createdAt) : "-",
}));