Merge branch 'registy/discipline' into develop
This commit is contained in:
commit
a6681875e9
3 changed files with 65 additions and 5 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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" />
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
Loading…
Add table
Add a link
Reference in a new issue