Merge branch 'registy/discipline' into develop

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-06-05 13:06:41 +07:00
commit a6681875e9
3 changed files with 65 additions and 5 deletions

View file

@ -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<string>(pathRegistryEmp(route.name?.toString() ?? ""));
const isLeave = defineModel<boolean>("isLeave", {
required: true,
});
const citizenId = defineModel<string>("citizenId", {
required: true,
});
const baseColumns = ref<QTableColumn[]>([
{
@ -152,8 +157,8 @@ const baseVisibleColumns = ref<string[]>([
"lastUpdatedAt",
]);
const rows = ref<RequestItemsObject[]>([]); //
const rowsMain = ref<RequestItemsObject[]>([]); //
const rows = ref<Discipline[]>([]); //
const rowsMain = ref<Discipline[]>([]); //
const mode = ref<string>("table"); // Table card
const filterKeyword = ref<string>(""); //
@ -244,6 +249,10 @@ const fileUpload = ref<File | null>(null);
const fileData = ref<ResFileData | null>(null);
const isUpload = ref<boolean>(false);
const modalCommand = ref<boolean>(false);
const command = ref<string>("");
const commandId = ref<string>("");
/**
* 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' : ''"
>
<div>
<div
v-if="col.name == 'refCommandId' && props.row.refCommandId"
@click="col.value ? openViewCommand(props.row) : null"
:class="
col.value
? 'table_ellipsis text-blue cursor-pointer'
: 'table_ellipsis'
"
>
{{ col.value ? col.value : "-" }}
<q-tooltip v-if="col.value">ดูคำสั่ง</q-tooltip>
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
@ -975,6 +1002,13 @@ onMounted(() => {
:visible-columns="visibleColumnsHistory"
:fetch-data="fetchDataHistory"
/>
<DialogPreviewCommand
v-model:modal="modalCommand"
v-model:command="command"
v-model:command-id="commandId"
:citizen-id="citizenId"
/>
</template>
<style scoped></style>

View file

@ -58,7 +58,10 @@ const storeRegistry = useRegistryNewDataStore();
<Info :is-leave="storeRegistry.isLeave" />
</q-tab-panel>
<q-tab-panel name="2">
<Discipline :is-leave="storeRegistry.isLeave" />
<Discipline
:is-leave="storeRegistry.isLeave"
:citizen-id="storeRegistry.citizenId"
/>
</q-tab-panel>
<q-tab-panel name="3">
<Leave :is-leave="storeRegistry.isLeave" />

View file

@ -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 };