แก้ ส่งไปพัก ราช การ // map idCard
This commit is contained in:
parent
7d4d2e157c
commit
e93e6ed6c1
4 changed files with 38 additions and 15 deletions
|
|
@ -9,13 +9,13 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useInvestigateFactStore } from "@/modules/11_discipline/store/InvestigateFactStore";
|
import { useInvestigateFactStore } from "@/modules/11_discipline/store/InvestigateFactStore";
|
||||||
import { useDisciplineMainStore } from "@/modules/11_discipline/store/Main";
|
import { useDisciplineMainStore } from "@/modules/11_discipline/store/Main";
|
||||||
|
|
||||||
import type { ArrayPersonAdd } from "../../interface/response/Investigate";
|
import type { ArrayPersonAdd } from "@/modules/11_discipline/interface/response/investigate";
|
||||||
import type { FormData } from "@/modules/11_discipline/interface/request/InvestigateFact";
|
import type { FormData } from "@/modules/11_discipline/interface/request/InvestigateFact";
|
||||||
import type {
|
import type {
|
||||||
FormData as FormDataComplaint,
|
FormData as FormDataComplaint,
|
||||||
ArrayPerson,
|
ArrayPerson,
|
||||||
ArrayFileList,
|
ArrayFileList,
|
||||||
} from "@/modules/11_discipline/interface/request/Complaint";
|
} from "@/modules/11_discipline/interface/request/complaint";
|
||||||
|
|
||||||
import PopupSendToNext from "@/modules/11_discipline/components/PopupSendToNext.vue";
|
import PopupSendToNext from "@/modules/11_discipline/components/PopupSendToNext.vue";
|
||||||
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
||||||
|
|
|
||||||
|
|
@ -12,12 +12,12 @@ import { useDisciplineMainStore } from "@/modules/11_discipline/store/Main";
|
||||||
import type {
|
import type {
|
||||||
PersonsArray,
|
PersonsArray,
|
||||||
Persons,
|
Persons,
|
||||||
} from "@/modules/11_discipline/interface/request/disciplinary";
|
} from "@/modules/11_discipline/interface/request/Disciplinary";
|
||||||
import type {
|
import type {
|
||||||
FormData as FormDataComplaint,
|
FormData as FormDataComplaint,
|
||||||
ArrayPerson,
|
ArrayPerson,
|
||||||
ArrayFileList,
|
ArrayFileList,
|
||||||
} from "@/modules/11_discipline/interface/request/Complaint";
|
} from "@/modules/11_discipline/interface/request/complaint";
|
||||||
import type { FormData as FormInvestigateFact } from "@/modules/11_discipline/interface/request/InvestigateFact";
|
import type { FormData as FormInvestigateFact } from "@/modules/11_discipline/interface/request/InvestigateFact";
|
||||||
|
|
||||||
import PopupSendToNext from "@/modules/11_discipline/components/PopupSendToNext.vue";
|
import PopupSendToNext from "@/modules/11_discipline/components/PopupSendToNext.vue";
|
||||||
|
|
@ -344,9 +344,10 @@ function emitPerson(data: PersonsArray[]) {
|
||||||
.put(config.API.disciplinarySuspend(id.value), {
|
.put(config.API.disciplinarySuspend(id.value), {
|
||||||
persons: dataMapId,
|
persons: dataMapId,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then(async(res) => {
|
||||||
success($q, "ส่งไปพักราชการสำเร็จ");
|
success($q, "ส่งไปพักราชการสำเร็จ");
|
||||||
// router.push(`/discipline/investigatefacts`);
|
// router.push(`/discipline/investigatefacts`);
|
||||||
|
await fetchDetailDisciplinary();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,28 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch, computed } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
|
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
|
||||||
|
import { title } from "process";
|
||||||
|
|
||||||
const modal = defineModel<boolean>("modal", { required: true });
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const { dialogConfirm, dialogMessageNotify } = mixin;
|
const { dialogConfirm, dialogMessageNotify } = mixin;
|
||||||
|
|
||||||
|
const dataMapToSend = computed(() => {
|
||||||
|
return selected.value.map((i: any) => ({
|
||||||
|
id: i.id,
|
||||||
|
prefix: i.prefix,
|
||||||
|
firstName: i.firstName,
|
||||||
|
lastName: i.lastName,
|
||||||
|
citizenId: i.idcard,
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
const rows = ref<any[]>([]);
|
const rows = ref<any[]>([]);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
title: {
|
title: {
|
||||||
|
|
@ -60,18 +71,30 @@ const initialPagination = ref<any>({
|
||||||
|
|
||||||
/** ฟังชั่นส่งคนไปออกคำสั่ง */
|
/** ฟังชั่นส่งคนไปออกคำสั่ง */
|
||||||
function onclickSend() {
|
function onclickSend() {
|
||||||
if (selected.value.length === 0) {
|
if (props.title == "ส่งไปพักราชการ") {
|
||||||
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 บุคคล");
|
|
||||||
} else {
|
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
async () => {
|
async () => {
|
||||||
modalCommand.value = true;
|
emit("returnPerson", selected.value);
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
},
|
},
|
||||||
"ยืนยันส่งไปออกคำสั่ง",
|
`ยืนยันการ${props.title}`,
|
||||||
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
|
`ต้องการยืนยันการ${props.title}หรือไม่`
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
if (selected.value.length === 0) {
|
||||||
|
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 บุคคล");
|
||||||
|
} else {
|
||||||
|
dialogConfirm(
|
||||||
|
$q,
|
||||||
|
async () => {
|
||||||
|
modalCommand.value = true;
|
||||||
|
modal.value = false;
|
||||||
|
},
|
||||||
|
"ยืนยันส่งไปออกคำสั่ง",
|
||||||
|
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,7 +119,6 @@ watch(
|
||||||
<q-dialog v-model="modal">
|
<q-dialog v-model="modal">
|
||||||
<q-card style="width: 820px; max-width: 80vw">
|
<q-card style="width: 820px; max-width: 80vw">
|
||||||
<DialogHeader :tittle="props.title" :close="onClickClose" />
|
<DialogHeader :tittle="props.title" :close="onClickClose" />
|
||||||
|
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
||||||
<q-card-section class="q-pt-none q-mt-md">
|
<q-card-section class="q-pt-none q-mt-md">
|
||||||
|
|
@ -208,7 +230,7 @@ watch(
|
||||||
<DialogCreateCommand
|
<DialogCreateCommand
|
||||||
v-model:modal="modalCommand"
|
v-model:modal="modalCommand"
|
||||||
:command-type-code="'C-PM-32'"
|
:command-type-code="'C-PM-32'"
|
||||||
:persons="selected"
|
:persons="selected ? dataMapToSend : []"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import type { QTableProps } from "quasar";
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
import type { Persons } from "@/modules/11_discipline/interface/request/disciplinary";
|
import type { Persons } from "@/modules/11_discipline/interface/request/Disciplinary";
|
||||||
import type {
|
import type {
|
||||||
investigateDisDataRowType,
|
investigateDisDataRowType,
|
||||||
DataOption,
|
DataOption,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue