From 72a1171b8fd226c44df91eadc9b7c8e2e4628605 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Wed, 3 Jan 2024 16:44:07 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20=E0=B8=81?= =?UTF-8?q?=E0=B8=A3=E0=B8=A3=E0=B8=A1=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/2_InvestigateFacts/Form.vue | 216 +++++++++--------- .../3_InvestigateDisciplinary/EditPage.vue | 11 +- .../3_InvestigateDisciplinary/Form.vue | 78 ++++--- .../Director/DialogInvestigateTotal.vue | 5 +- .../11_discipline/components/DialogDuty.vue | 10 +- .../store/InvestigateDisStore.ts | 10 + 6 files changed, 186 insertions(+), 144 deletions(-) diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue index d94502151..33bf1a240 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue @@ -54,6 +54,7 @@ const type = ref(""); const modalEditDirector = ref(false); const editDirectorId = ref(); const dutyVal = ref(); +const commandNoVal = ref(); const filter = ref(""); const isUpdate = ref(false); @@ -128,7 +129,7 @@ const formData = reactive({ organizationId: "", persons: [], investigationExtendHistory: [], - isDisciplinary:false + isDisciplinary: false, }); /** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */ @@ -293,20 +294,21 @@ watch(props.data, async () => { mainStore.rowsAdd = props.data.persons; mainStore.rowsCheck = mainStore.rowsAdd.filter( - (item: any) => item.isDisciplinary === false && item.isSend === 'NEW' + (item: any) => item.isDisciplinary === false && item.isSend === "NEW" ); const dataMap = props.data.directors.map((item: any) => ({ - id: item.id, - directorId: item.directorId, + id: item.id ? item.id:'-', + directorId: item.directorId ? item.directorId:'-', name: `${item.prefix}${item.firstName} ${item.lastName}`, - prefix: item.prefix, - firstName: item.firstName, - lastName: item.lastName, - position: item.position, - email: item.email, - phone: item.phone, - duty: item.duty, + prefix: item.prefix ? item.prefix:'-', + firstName: item.firstName ? item.firstName:'-', + lastName: item.lastName ? item.lastName:'-', + position: item.position ? item.position:'-', + email: item.email ? item.email:'-', + phone: item.phone ? item.phone:'-', + commandNo: item.commandNo ? item.commandNo:'-', + duty: item.duty ? item.duty:'-', check: "props", })); @@ -571,20 +573,24 @@ function emitPerson(data: FormData[]) { }); } -function openEditDirector(id: string, duty: string) { - editDirectorId.value = id; +function openEditDirector(data: any) { + editDirectorId.value = data.directorId; modalEditDirector.value = true; - dutyVal.value = duty; + dutyVal.value = data.duty; + commandNoVal.value = data.commandNo; } function closeEditDirector() { modalEditDirector.value = false; } -async function saveDuty(id: string, duty: string) { +async function saveDuty(id: string, duty: string, resolution: string) { showLoader(); await http - .put(config.API.investigateEditDuty(formData.id, id), { duty: duty }) + .put(config.API.investigateEditDuty(formData.id, id), { + duty: duty, + commandNo: resolution, + }) .then((res: any) => { success($q, "บันทึกสำเร็จ"); closeEditDirector(); @@ -680,7 +686,10 @@ onMounted(async () => {
{ flat round color="blue" - @click=" - openEditDirector( - props.row.directorId, - props.row.duty - ) - " + @click="openEditDirector(props.row)" icon="mdi-pencil-outline" > แก้ไข - - {
- -
-
- +
+ - -
- -
- - -
-
- -
+ @update:model-value="changeFormData()" + > +
- +
+ + +
+
+ +
+
@@ -1504,6 +1495,15 @@ onMounted(async () => { + + (""); const idInvestigate = ref(""); const idComplaint = ref(""); -const respondentRows = ref(); +const respondentRows = ref([]); const personObjComplaint = reactive({ id: "", personId: "", @@ -117,6 +117,7 @@ const dataInvestigatefacts = reactive({ organizationId: "", persons: [], investigationExtendHistory: [], + isDisciplinary: false, }); /** function fetchData สอบสวนความผิดทางวินัย*/ @@ -251,7 +252,9 @@ async function onSubmit(id: string) { /** ยืนยัน ส่งไปออกคำสั่ง */ async function sentIssue() { - respondentRows.value = await store.rowSent.filter((x) => x.isSuspend === 'NEW' && x.isSend === 'NEW'); + respondentRows.value = await store.rowSent.filter( + (x) => x.isSuspend === "NEW" && x.isSend === "NEW" + ); modalPopup.value = true; } @@ -381,7 +384,6 @@ onMounted(async () => {