แก้ ส่งไปพัก ราช การ // 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 { 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 as FormDataComplaint,
|
||||
ArrayPerson,
|
||||
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 FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ import { useDisciplineMainStore } from "@/modules/11_discipline/store/Main";
|
|||
import type {
|
||||
PersonsArray,
|
||||
Persons,
|
||||
} from "@/modules/11_discipline/interface/request/disciplinary";
|
||||
} from "@/modules/11_discipline/interface/request/Disciplinary";
|
||||
import type {
|
||||
FormData as FormDataComplaint,
|
||||
ArrayPerson,
|
||||
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 PopupSendToNext from "@/modules/11_discipline/components/PopupSendToNext.vue";
|
||||
|
|
@ -344,9 +344,10 @@ function emitPerson(data: PersonsArray[]) {
|
|||
.put(config.API.disciplinarySuspend(id.value), {
|
||||
persons: dataMapId,
|
||||
})
|
||||
.then((res) => {
|
||||
.then(async(res) => {
|
||||
success($q, "ส่งไปพักราชการสำเร็จ");
|
||||
// router.push(`/discipline/investigatefacts`);
|
||||
await fetchDetailDisciplinary();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
|
|||
|
|
@ -1,17 +1,28 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { ref, watch, computed } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
|
||||
import { title } from "process";
|
||||
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const mixin = useCounterMixin();
|
||||
const $q = useQuasar();
|
||||
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 props = defineProps({
|
||||
title: {
|
||||
|
|
@ -60,18 +71,30 @@ const initialPagination = ref<any>({
|
|||
|
||||
/** ฟังชั่นส่งคนไปออกคำสั่ง */
|
||||
function onclickSend() {
|
||||
if (selected.value.length === 0) {
|
||||
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 บุคคล");
|
||||
} else {
|
||||
if (props.title == "ส่งไปพักราชการ") {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
modalCommand.value = true;
|
||||
emit("returnPerson", selected.value);
|
||||
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-card style="width: 820px; max-width: 80vw">
|
||||
<DialogHeader :tittle="props.title" :close="onClickClose" />
|
||||
|
||||
<q-separator />
|
||||
|
||||
<q-card-section class="q-pt-none q-mt-md">
|
||||
|
|
@ -208,7 +230,7 @@ watch(
|
|||
<DialogCreateCommand
|
||||
v-model:modal="modalCommand"
|
||||
:command-type-code="'C-PM-32'"
|
||||
:persons="selected"
|
||||
:persons="selected ? dataMapToSend : []"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import type { QTableProps } from "quasar";
|
|||
|
||||
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 {
|
||||
investigateDisDataRowType,
|
||||
DataOption,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue