แก้ ui

This commit is contained in:
setthawutttty 2023-12-04 14:28:17 +07:00
parent 5c28d14047
commit 66124a819d
9 changed files with 246 additions and 189 deletions

View file

@ -297,6 +297,7 @@ function confirmCancelInvestigate() {
})
.finally(() => {
hideLoader();
success($q, "ยกเลิกยุติเรื่องสำเร็จ");
});
}

View file

@ -624,6 +624,7 @@ onMounted(() => {
ref="dateReceivedRef"
outlined
dense
:input-style="isReadonly ? { color: 'teal' }:{color:'black'}"
:readonly="isReadonly"
hide-bottom-space
class="full-width datepicker"
@ -700,6 +701,7 @@ onMounted(() => {
for="inputDateconsideration"
ref="dateConsiderationRef"
outlined
:input-style="isReadonly ? { color: 'teal' }:{color:'black'}"
dense
class="full-width datepicker"
:model-value="
@ -708,11 +710,10 @@ onMounted(() => {
: null
"
:readonly="isReadonly"
label="วันที่กำหนดวันพิจารณา"
label="วันที่กำหนดพิจารณา"
hide-bottom-space
:rules="[
(val) =>
!!val || `${'กรุณาเลือกวันที่กำหนดวันพิจารณา'}`,
(val) => !!val || `${'กรุณาเลือกวันที่กำหนดพิจารณา'}`,
]"
lazy-rules
>
@ -773,6 +774,7 @@ onMounted(() => {
for="inputDatewarn"
ref="dateNotificationRef"
outlined
:input-style="isReadonly ? { color: 'teal' }:{color:'black'}"
dense
:readonly="isReadonly"
hide-bottom-space

View file

@ -2,7 +2,7 @@
import { onMounted, reactive, ref, watch } from "vue";
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //
import FormInvestigatefacts from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue"; //
import { useRoute } from "vue-router";
import { useRouter, useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useInvestigateFactStore } from "@/modules/11_discipline/store/InvestigateFactStore";
import { useDisciplineMainStore } from "@/modules/11_discipline/store/main";
@ -25,6 +25,7 @@ const mixin = useCounterMixin();
const store = useInvestigateFactStore();
const { dialogConfirm, showLoader, success, hideLoader, messageError } = mixin;
const route = useRoute();
const router = useRouter();
const id = ref<string>(route.params.id as string);
/** ข้อมูล v-model ของฟอร์มสืบสวน */
@ -138,9 +139,11 @@ function getData() {
.get(config.API.investigateById(id.value))
.then((res) => {
const dataList = res.data.result;
console.log(dataList)
data.id = dataList.id;
data.idComplaint = dataList.idComplaint;
data.respondentType = dataList.respondentType;
data.organizationId = dataList.organizationId;
data.persons = dataList.persons;
data.investigationDetail = dataList.investigationDetail;
data.investigationDetailOther = dataList.investigationDetailOther;
@ -157,6 +160,7 @@ function getData() {
data.investigationStatusResult = dataList.investigationStatusResult;
data.investigationExtendStatus = dataList.investigationExtendStatus;
data.investigationDaysExtend = dataList.investigationDaysExtend;
console.log(dataList)
})
.catch((e) => {
messageError($q, e);
@ -193,13 +197,33 @@ async function onSubmit(data: any) {
const modalPopup = ref<boolean>(false);
/** ยืนยัน ส่งไปสอบสวน */
function sentInvestigate() {
modalPopup.value = true;
// dialogConfirm(
// $q,
// () => confirmSentInvestigate(),
// "",
// "?"
// );
if (mainStore.rowsAdd.length > 0) {
modalPopup.value = true;
} else {
dialogConfirm(
$q,
() => sentConfirmNoPerson(),
"ยืนยันส่งไปสอบสวน",
"ต้องการยืนยันส่งไปสอบสวนใช่หรือไม่?"
);
}
}
function sentConfirmNoPerson() {
showLoader();
http
.put(config.API.investigateApprove(id.value), {
persons: [],
})
.then((res) => {})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
getData();
router.push(`/discipline/investigatefacts`)
});
}
function closePopup() {
@ -237,12 +261,13 @@ function confirmEndInvestigate() {
http
.get(config.API.investigateReject(id.value))
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
success($q, "ยุติเรื่องสำเร็จ");
await getData();
});
}
@ -260,6 +285,7 @@ function confirmCancelInvestigate() {
})
.finally(() => {
hideLoader();
success($q, "ยกเลิกยุติเรื่องสำเร็จ");
});
}

View file

@ -219,6 +219,7 @@ watch(props.data, async () => {
isUpdate.value = true;
formData.id = props.data.id;
formData.complaint = props.data.complaint;
formData.organizationId = props.data.organizationId;
formData.respondentType = props.data.respondentType;
formData.complaintdetail = props.data.complaintdetail;
formData.investigationDescription = props.data.investigationDescription;
@ -764,6 +765,7 @@ onMounted(async () => {
for="#date"
class="full-width cursor-pointer"
ref="dateRef"
:input-style="isReadonly ? { color: 'teal' }:{color:'black'}"
:readonly="isReadonly"
outlined
dense
@ -850,6 +852,7 @@ onMounted(async () => {
<template #trigger>
<q-input
for="#dateEnd"
:input-style="isReadonly ? { color: 'teal' }:{color:'black'}"
ref="dateEndRef"
class="full-width cursor-pointer"
:readonly="isReadonly"

View file

@ -197,6 +197,7 @@ function confirmSentIssueGate() {
messageError($q, e);
})
.finally(() => {
router.push(`/discipline/disciplinary`)
fetchDetailDisciplinary();
});
}
@ -232,6 +233,7 @@ function confirmEndInvestigate() {
messageError($q, e);
})
.finally(() => {
success($q, "ยุติเรื่องสำเร็จ");
fetchDetailDisciplinary();
});
}
@ -247,6 +249,7 @@ function confirmCancelInvestigate() {
messageError($q, e);
})
.finally(() => {
success($q, "ยกเลิกยุติเรื่องสำเร็จ");
fetchDetailDisciplinary();
});
}
@ -316,6 +319,7 @@ function emitPerson(data: PersonsArray[]) {
messageError($q, e);
})
.finally(() => {
success($q, "ส่งไปพักราชการสำเร็จ");
hideLoader();
fetchDetailDisciplinary();
});

View file

@ -457,68 +457,69 @@ onMounted(async () => {
<q-card bordered>
<div class="col-12 row q-pa-md">
<div class="col-12 row q-col-gutter-md">
<div class="col-xs-12 col-sm-3">
<q-select
:readonly="isReadonly"
for="SelectrespondentType"
v-model="formData.respondentType"
ref="respondentTypeRef"
dense
outlined
label="ผู้ถูกร้องเรียน"
option-value="id"
option-label="name"
emit-value
use-input
map-options
hide-bottom-space
:options="complainstStore.complainantoptions"
:rules="[(val) => !!val || `${'กรุณาเลือกผู้ร้องเรียน'}`]"
lazy-rules
@update:model-value="
selectComplainant(formData.respondentType);
changeFormData();
"
@filter="(inputValue: any,
<div class="row col-12 q-col-gutter-x-md">
<div class="col-xs-12 col-sm-3">
<q-select
:readonly="isReadonly"
for="SelectrespondentType"
v-model="formData.respondentType"
ref="respondentTypeRef"
dense
outlined
label="ผู้ถูกร้องเรียน"
option-value="id"
option-label="name"
emit-value
use-input
map-options
hide-bottom-space
:options="complainstStore.complainantoptions"
:rules="[(val) => !!val || `${'กรุณาเลือกผู้ร้องเรียน'}`]"
lazy-rules
@update:model-value="
selectComplainant(formData.respondentType);
changeFormData();
"
@filter="(inputValue: any,
doneFn: Function) => filterSelector(inputValue, doneFn, 'filterrespondentType'
)"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
ไมอม
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div
class="col-xs-12 col-sm-3"
v-if="formData.respondentType === 'ORGANIZATION'"
id="organizationId"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
ไมอม
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div
class="col-xs-12 col-sm-3"
v-if="formData.respondentType === 'ORGANIZATION'"
id="organizationId"
>
<q-select
:readonly="isReadonly"
for="inputOffice"
name="organizationId"
ref="organizationIdRef"
dense
hide-bottom-space
outlined
option-label="name"
option-value="id"
emit-value
map-options
v-model="formData.organizationId"
:options="organizationOption"
label="เลือกสำนักงาน"
:rules="[(val) => !!val || `${'กรุณาเลือกสำนักงาน'}`]"
lazy-rules
@update:model-value="changeFormData()"
/>
</div>
<div class="col-xs-12 col-sm-3" id="consideredAgency">
<!-- <q-select
<q-select
:readonly="isReadonly"
for="inputOffice"
name="organizationId"
ref="organizationIdRef"
dense
hide-bottom-space
outlined
option-label="name"
option-value="id"
emit-value
map-options
v-model="formData.organizationId"
:options="organizationOption"
label="เลือกสำนักงาน"
:rules="[(val) => !!val || `${'กรุณาเลือกสำนักงาน'}`]"
lazy-rules
@update:model-value="changeFormData()"
/>
</div>
<div class="col-xs-12 col-sm-3" id="consideredAgency">
<!-- <q-select
ref="consideredAgencyRef"
for="selectAgency"
dense
@ -546,12 +547,9 @@ onMounted(async () => {
</q-item>
</template>
</q-select> -->
</div>
</div>
<div
v-if="formData.respondentType !== 'ORGANIZATION'"
class="col-6"
></div>
<div
class="row col-12"
v-if="formData.respondentType === 'PERSON'"
@ -665,106 +663,114 @@ onMounted(async () => {
</div>
</q-card>
</div>
<datepicker
:readonly="isReadonly"
menu-class-name="modalfix"
for="#dateAllegation"
v-model="formData.disciplinaryDateInvestigation"
class="col-xs-12 col-sm-3"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
@update:model-value="changeFormData()"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
:readonly="isReadonly"
outlined
dense
class="col-xs-12 col-sm-4"
hide-bottom-space
:model-value="
formData.disciplinaryDateInvestigation != null
? date2Thai(formData.disciplinaryDateInvestigation)
: null
"
:label="`${'วันที่มีคำสั่งให้สอบสวน'}`"
:rules="[
(val) =>
!!val || `${'กรุณาเลือกวันที่มีคำสั่งให้สอบสวน'}`,
]"
lazy-rules
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<datepicker
:readonly="isReadonly"
menu-class-name="modalfix"
for="#dateAllegation"
v-model="formData.disciplinaryDateAllegation"
class="col-xs-12 col-sm-3"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
@update:model-value="changeFormData()"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
:readonly="isReadonly"
ref="disciplinaryDateAllegationRef"
outlined
dense
class="col-xs-12 col-sm-4"
hide-bottom-space
:model-value="
formData.disciplinaryDateAllegation != null
? date2Thai(formData.disciplinaryDateAllegation)
: null
"
:label="`${'วันที่รับทราบข้อกล่าวหา'}`"
:rules="[
(val) =>
!!val || `${'กรุณาเลือกวันที่รับทราบข้อกล่าวหา'}`,
]"
lazy-rules
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<div class="row col-12 q-col-gutter-x-md">
<datepicker
:readonly="isReadonly"
menu-class-name="modalfix"
for="#dateAllegation"
v-model="formData.disciplinaryDateInvestigation"
class="col-xs-12 col-sm-3"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
@update:model-value="changeFormData()"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
:readonly="isReadonly"
outlined
dense
:input-style="
isReadonly ? { color: 'teal' } : { color: 'black' }
"
class="col-xs-12 col-sm-4"
hide-bottom-space
:model-value="
formData.disciplinaryDateInvestigation != null
? date2Thai(formData.disciplinaryDateInvestigation)
: null
"
:label="`${'วันที่มีคำสั่งให้สอบสวน'}`"
:rules="[
(val) =>
!!val || `${'กรุณาเลือกวันที่มีคำสั่งให้สอบสวน'}`,
]"
lazy-rules
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<datepicker
:readonly="isReadonly"
menu-class-name="modalfix"
for="#dateAllegation"
v-model="formData.disciplinaryDateAllegation"
class="col-xs-12 col-sm-3"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
@update:model-value="changeFormData()"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
:readonly="isReadonly"
ref="disciplinaryDateAllegationRef"
outlined
:input-style="
isReadonly ? { color: 'teal' } : { color: 'black' }
"
dense
class="col-xs-12 col-sm-4"
hide-bottom-space
:model-value="
formData.disciplinaryDateAllegation != null
? date2Thai(formData.disciplinaryDateAllegation)
: null
"
:label="`${'วันที่รับทราบข้อกล่าวหา'}`"
:rules="[
(val) =>
!!val || `${'กรุณาเลือกวันที่รับทราบข้อกล่าวหา'}`,
]"
lazy-rules
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="row col-12">
<q-card
@ -822,6 +828,11 @@ onMounted(async () => {
ref="dateRef"
:readonly="isReadonly"
outlined
:input-style="
isReadonly
? { color: 'teal' }
: { color: 'black' }
"
dense
lazy-rules
borderless
@ -911,6 +922,11 @@ onMounted(async () => {
outlined
dense
lazy-rules
:input-style="
isReadonly
? { color: 'teal' }
: { color: 'black' }
"
hide-bottom-space
borderless
:model-value="
@ -942,7 +958,6 @@ onMounted(async () => {
</q-card>
</div>
<datepicker
:readonly="isReadonly"
menu-class-name="modalfix"
@ -968,8 +983,11 @@ onMounted(async () => {
ref="disciplinaryDateEvidentRef"
outlined
dense
class="full-width datepicker"
class="full-width"
hide-bottom-space
:input-style="
isReadonly ? { color: 'teal' } : { color: 'black' }
"
:model-value="
formData.disciplinaryDateEvident != null
? date2Thai(formData.disciplinaryDateEvident)
@ -986,7 +1004,7 @@ onMounted(async () => {
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
color="primary"
>
</q-icon>
</template>
@ -997,7 +1015,7 @@ onMounted(async () => {
<datepicker
:readonly="isReadonly"
menu-class-name="modalfix"
for="#dateEvident"
for="#dateResult"
v-model="formData.disciplinaryDateResult"
:locale="'th'"
autoApply
@ -1013,13 +1031,17 @@ onMounted(async () => {
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
:readonly="isReadonly"
ref="disciplinaryDateResultRef"
outlined
:input-style="
isReadonly ? { color: 'teal' } : { color: 'black' }
"
dense
class="full-width datepicker"
class="full-width"
hide-bottom-space
:model-value="
formData.disciplinaryDateResult != null
@ -1037,14 +1059,13 @@ onMounted(async () => {
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
color="primary"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<div class="row col-12">
<q-card
bordered

View file

@ -67,8 +67,8 @@ function onclickSend() {
emit("returnPerson", selected.value);
props.close?.();
},
`ยืนยันการส่ง${props.title}`,
`ต้องการยืนยันการส่ง${props.title}หรือไม่`
`ยืนยันการ${props.title}`,
`ต้องการยืนยันการ${props.title}หรือไม่`
);
}

View file

@ -151,7 +151,7 @@ export const useInvestigateDisStore = defineStore(
{
name: "title",
align: "left",
label: "เรื่อง",
label: "เรื่องร้องเรียน",
sortable: true,
field: "title",
headerStyle: "font-size: 14px",
@ -160,7 +160,7 @@ export const useInvestigateDisStore = defineStore(
{
name: "respondentType",
align: "left",
label: "ผู้ถูกสบสวน",
label: "ผู้ถูกสบสวน",
sortable: true,
field: "respondentType",
headerStyle: "font-size: 14px",

View file

@ -92,7 +92,7 @@ export const useInvestigateFactStore = defineStore(
{
name: "respondentType",
align: "left",
label: "ผู้ถูกสบสวน",
label: "ผู้ถูกสบสวน",
sortable: true,
field: "respondentType",
headerStyle: "font-size: 14px",