diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_Discipline.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_Discipline.vue index a726a067f..950352b8a 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_Discipline.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/02_Discipline.vue @@ -16,9 +16,11 @@ import type { DisciplineOps, DataOption, } from "@/modules/04_registryPerson/interface/index/discipline"; +import type { Discipline } from "@/modules/04_registryPerson/interface/response/Discipline"; import DialogHeader from "@/components/DialogHeader.vue"; import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue"; +import DialogPreviewCommand from "@/modules/18_command/components/DialogPreviewCommand.vue"; const route = useRoute(); const $q = useQuasar(); @@ -47,6 +49,9 @@ const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); const isLeave = defineModel("isLeave", { required: true, }); +const citizenId = defineModel("citizenId", { + required: true, +}); const baseColumns = ref([ { @@ -152,8 +157,8 @@ const baseVisibleColumns = ref([ "lastUpdatedAt", ]); -const rows = ref([]); //รายการวินัย -const rowsMain = ref([]); //รายการวินัย +const rows = ref([]); //รายการวินัย +const rowsMain = ref([]); //รายการวินัย const mode = ref("table"); //การแสดงผล Table card const filterKeyword = ref(""); //คำค้นหา @@ -244,6 +249,10 @@ const fileUpload = ref(null); const fileData = ref(null); const isUpload = ref(false); +const modalCommand = ref(false); +const command = ref(""); +const commandId = ref(""); + /** * function ค้นหา คำใน option * @param val คำค้นหา @@ -305,7 +314,7 @@ async function fetchData(id: string) { * กดเลือกข้อมูลที่จะแก้ไข * @param props ค่า props ใน row ที่เลือก */ -async function openDialogEdit(props: RequestItemsObject) { +async function openDialogEdit(props: Discipline) { showLoader(); try { modal.value = true; @@ -478,6 +487,12 @@ function handleDelete(id: string) { }); } +function openViewCommand(data: Discipline) { + command.value = data.refCommandNo; + commandId.value = data.refCommandId; + modalCommand.value = true; +} + /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ onMounted(() => { fetchData(profileId.value); @@ -621,7 +636,19 @@ onMounted(() => { :key="col.id" :class="props.row.isEntry ? 'text-grey' : ''" > -
+
+ {{ col.value ? col.value : "-" }} + ดูคำสั่ง +
+
{{ col.value ? col.value : "-" }}
@@ -975,6 +1002,13 @@ onMounted(() => { :visible-columns="visibleColumnsHistory" :fetch-data="fetchDataHistory" /> + + diff --git a/src/modules/04_registryPerson/components/detail/GovernmentInformation/Main.vue b/src/modules/04_registryPerson/components/detail/GovernmentInformation/Main.vue index 3f30cf12e..189faa16b 100644 --- a/src/modules/04_registryPerson/components/detail/GovernmentInformation/Main.vue +++ b/src/modules/04_registryPerson/components/detail/GovernmentInformation/Main.vue @@ -58,7 +58,10 @@ const storeRegistry = useRegistryNewDataStore(); - + diff --git a/src/modules/04_registryPerson/interface/response/Discipline.ts b/src/modules/04_registryPerson/interface/response/Discipline.ts new file mode 100644 index 000000000..866389e21 --- /dev/null +++ b/src/modules/04_registryPerson/interface/response/Discipline.ts @@ -0,0 +1,23 @@ +interface Discipline { + createdAt: Date | null; + createdFullName: string; + createdUserId: string; + date: Date | null; + detail: string; + id: string; + isDeleted: false; + isEntry: false; + isUpload: true; + lastUpdateFullName: string; + lastUpdateUserId: string; + lastUpdatedAt: Date | null; + level: string; + profileEmployeeId: string; + profileId: string; + refCommandDate: Date | null; + refCommandNo: string; + refCommandId: string; + unStigma: string; +} + +export type { Discipline };