no message
This commit is contained in:
parent
47f84f444b
commit
c9e8f3b89c
9 changed files with 1150 additions and 217 deletions
|
|
@ -434,7 +434,7 @@ const fieldLabels = {
|
|||
:key="index"
|
||||
>
|
||||
<div class="col-12 col-sm-12 col-md-4">
|
||||
<span class="text-grey-7">{{
|
||||
<span class="text-grey-6 text-weight-medium">{{
|
||||
fieldLabels[field as keyof typeof fieldLabels]
|
||||
}}</span>
|
||||
</div>
|
||||
|
|
@ -450,7 +450,7 @@ const fieldLabels = {
|
|||
:key="index"
|
||||
>
|
||||
<div class="col-12 col-sm-12 col-md-4">
|
||||
<span class="text-grey-7">{{
|
||||
<span class="text-grey-6 text-weight-medium">{{
|
||||
fieldLabels[field as keyof typeof fieldLabels]
|
||||
}}</span>
|
||||
</div>
|
||||
|
|
@ -466,7 +466,7 @@ const fieldLabels = {
|
|||
<div class="col-12 col-sm-6 col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12 col-md-4">
|
||||
<span class="text-grey-7">วันที่สั่งบรรจุ</span>
|
||||
<span class="text-grey-6 text-weight-medium">วันที่สั่งบรรจุ</span>
|
||||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-8">
|
||||
<span>{{
|
||||
|
|
@ -478,7 +478,7 @@ const fieldLabels = {
|
|||
<div class="col-12 col-sm-6 col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12 col-md-4">
|
||||
<span class="text-grey-7">วันที่เริ่มปฏิบัติราชการ</span>
|
||||
<span class="text-grey-6 text-weight-medium">วันที่เริ่มปฏิบัติราชการ</span>
|
||||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-8">
|
||||
<span>{{
|
||||
|
|
@ -495,7 +495,7 @@ const fieldLabels = {
|
|||
>
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12 col-md-4">
|
||||
<span class="text-grey-7">เหตุผลที่วันที่ไม่ตรงกัน</span>
|
||||
<span class="text-grey-6 text-weight-medium">เหตุผลที่วันที่ไม่ตรงกัน</span>
|
||||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-8">
|
||||
<span>{{
|
||||
|
|
@ -507,7 +507,7 @@ const fieldLabels = {
|
|||
<div class="col-12 col-sm-6 col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12 col-md-4">
|
||||
<span class="text-grey-7">วันเกษียณอายุ</span>
|
||||
<span class="text-grey-6 text-weight-medium">วันเกษียณอายุ</span>
|
||||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-8">
|
||||
<span>{{
|
||||
|
|
@ -523,7 +523,7 @@ const fieldLabels = {
|
|||
<div class="col-12 col-sm-6 col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12 col-md-4">
|
||||
<span class="text-grey-7">อายุราชการ</span>
|
||||
<span class="text-grey-6 text-weight-medium">อายุราชการ</span>
|
||||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-8">
|
||||
<span>{{ formMain.ageAll !== "" ? formMain.ageAll : "-" }}</span>
|
||||
|
|
@ -533,7 +533,7 @@ const fieldLabels = {
|
|||
<div class="col-12 col-sm-6 col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12 col-md-4">
|
||||
<span class="text-grey-7">ขาดราชการ</span>
|
||||
<span class="text-grey-6 text-weight-medium">ขาดราชการ</span>
|
||||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-8">
|
||||
<span>{{ formMain.absent ? formMain.absent : 0 }}</span>
|
||||
|
|
@ -543,7 +543,7 @@ const fieldLabels = {
|
|||
<div class="col-12 col-sm-6 col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12 col-md-4">
|
||||
<span class="text-grey-7">อายุราชการเกื้อกูล</span>
|
||||
<span class="text-grey-6 text-weight-medium">อายุราชการเกื้อกูล</span>
|
||||
</div>
|
||||
<div class="col-12 col-sm-12 col-md-8">
|
||||
<span>{{ formMain.age ? formMain.age : 0 }}</span>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ const {
|
|||
} = mixin;
|
||||
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const mode = ref<string>("card");
|
||||
const mode = ref<string>("table");
|
||||
const filterKeyword = ref<string>("");
|
||||
const formFilter = reactive<FormFilter>({
|
||||
page: 1,
|
||||
|
|
@ -416,13 +416,13 @@ function getData() {
|
|||
rows.value = data;
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="row items-center q-gutter-x-sm q-py-sm">
|
||||
|
||||
<q-btn color="teal-5" icon="add" flat round @click="openDialogAdd()"
|
||||
><q-tooltip>เพิ่มข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
|
|
@ -560,17 +560,9 @@ onMounted(() => {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:item="props" v-else>
|
||||
<div class="col-xs-12 col-sm-6 col-md-4">
|
||||
<q-card flat bordered class="q-pa-md">
|
||||
<div class="row q-pb-sm">
|
||||
<div class="column">
|
||||
<div class="text-weight-bold">
|
||||
{{ props.row.level !== "" ? props.row.level : "-" }}
|
||||
</div>
|
||||
<div class="text-weight-light full-width text-left text-grey-9">
|
||||
{{ date2Thai(props.row.date) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6">
|
||||
<q-card flat bordered class="q-pa-none">
|
||||
<div class="row bg-grey-3">
|
||||
<q-space />
|
||||
<div class="q-gutter-x-sm">
|
||||
<q-btn
|
||||
|
|
@ -593,62 +585,49 @@ onMounted(() => {
|
|||
</div>
|
||||
<q-separator />
|
||||
<q-card-section class="q-pa-none">
|
||||
<q-list>
|
||||
<q-item class="q-pa-none">
|
||||
<q-item-section>
|
||||
<q-item-label>รายละเอียด</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-item-label caption>{{
|
||||
props.row.detail !== "" ? props.row.detail : "-"
|
||||
}}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<div class="row q-pa-sm">
|
||||
<div class="col text-grey-6 text-weight-medium">
|
||||
ระดับการลงโทษทางวินัย
|
||||
</div>
|
||||
<div class="col">
|
||||
{{ props.row.level !== "" ? props.row.level : "-" }}
|
||||
</div>
|
||||
<div class="col text-grey-6 text-weight-medium">วัน/เดือน/ปี</div>
|
||||
<div class="col">
|
||||
{{ props.row.date ? date2Thai(props.row.date) : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="row q-pa-sm bg-grey-2">
|
||||
<div class="col text-grey-6 text-weight-medium">รายละเอียด</div>
|
||||
<div class="col">
|
||||
{{ props.row.detail !== "" ? props.row.detail : "-" }}
|
||||
</div>
|
||||
<div class="col text-grey-6 text-weight-medium">ล้างมลทิน</div>
|
||||
<div class="col">
|
||||
{{ props.row.unStigma !== "" ? props.row.unStigma : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="row q-pa-sm">
|
||||
<div class="col text-grey-6 text-weight-medium">เลขที่คำสั่ง</div>
|
||||
<div class="col">
|
||||
{{
|
||||
props.row.refCommandNo !== "" ? props.row.refCommandNo : "-"
|
||||
}}
|
||||
</div>
|
||||
<div class="col text-grey-6 text-weight-medium">
|
||||
เอกสารอ้างอิง (ลงวันที่)
|
||||
</div>
|
||||
<div class="col">
|
||||
{{
|
||||
props.row.refCommandDate
|
||||
? date2Thai(props.row.refCommandDate)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<q-item class="q-pa-none">
|
||||
<q-item-section>
|
||||
<q-item-label>ล้างมลทิน</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-item-label caption>
|
||||
{{
|
||||
props.row.unStigma !== "" ? props.row.unStigma : "-"
|
||||
}}</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item class="q-pa-none">
|
||||
<q-item-section>
|
||||
<q-item-label>เลขที่คำสั่ง</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-item-label caption>
|
||||
{{
|
||||
props.row.refCommandNo !== ""
|
||||
? props.row.refCommandNo
|
||||
: "-"
|
||||
}}</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item class="q-pa-none">
|
||||
<q-item-section>
|
||||
<q-item-label
|
||||
>เอกสารอ้างอิง (ลงวันที่)</q-item-label
|
||||
></q-item-section
|
||||
>
|
||||
<q-item-section side>
|
||||
<q-item-label caption>
|
||||
{{
|
||||
props.row.refCommandDate
|
||||
? date2Thai(props.row.refCommandDate)
|
||||
: "-"
|
||||
}}</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import DialogHistory from "@/modules/04_registryNew/components/detail/Government
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
||||
const rowsTotal = ref<ResponseTotalObject[]>([]);
|
||||
const id = ref<string>("");
|
||||
const route = useRoute();
|
||||
|
|
@ -38,7 +37,7 @@ const {
|
|||
dateToISO,
|
||||
} = mixin;
|
||||
|
||||
const mode = ref<string>("card");
|
||||
const mode = ref<string>("table");
|
||||
const filterKeyword = ref<string>("");
|
||||
const currentPage = ref<number>(1);
|
||||
const maxPage = ref<number>(1);
|
||||
|
|
@ -479,7 +478,6 @@ onMounted(() => {
|
|||
</script>
|
||||
<template>
|
||||
<div class="row items-center q-gutter-x-sm q-py-sm">
|
||||
|
||||
<q-btn color="teal-5" icon="add" flat round @click="openDialogAdd()"
|
||||
><q-tooltip>เพิ่มข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
|
|
@ -619,13 +617,8 @@ onMounted(() => {
|
|||
</template>
|
||||
<template v-slot:item="props" v-else>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-6">
|
||||
<q-card flat bordered class="q-pa-md">
|
||||
<div class="row q-pb-sm items-center">
|
||||
<div class="column">
|
||||
<div class="text-weight-bold">
|
||||
{{ props.row.typeLeave !== "" ? props.row.typeLeave : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<q-card flat bordered class="q-pa-none">
|
||||
<div class="row bg-grey-3">
|
||||
<q-space />
|
||||
<div class="q-gutter-x-sm">
|
||||
<q-btn
|
||||
|
|
@ -648,94 +641,51 @@ onMounted(() => {
|
|||
</div>
|
||||
<q-separator />
|
||||
<q-card-section class="q-pa-none">
|
||||
<q-list>
|
||||
<q-item class="q-pa-none">
|
||||
<q-item-section>
|
||||
<q-item-label>วัน/เดือน/ปี ที่ลา</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-item-label caption>{{
|
||||
dateThaiRange([props.row.dateStartLeave, props.row.dateEndLeave])
|
||||
}}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item class="q-pa-none">
|
||||
<q-item-section>
|
||||
<q-item-label>จำนวนวันลา</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-item-label caption>
|
||||
{{
|
||||
props.row.numLeave ? props.row.numLeave : "-"
|
||||
}}</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item class="q-pa-none">
|
||||
<q-item-section>
|
||||
<q-item-label>ลามาเเล้ว</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-item-label caption>
|
||||
{{
|
||||
props.row.sumLeave
|
||||
? props.row.sumLeave
|
||||
: "-"
|
||||
}}</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item class="q-pa-none">
|
||||
<q-item-section>
|
||||
<q-item-label
|
||||
>รวมเป็น</q-item-label
|
||||
></q-item-section
|
||||
>
|
||||
<q-item-section side>
|
||||
<q-item-label caption>
|
||||
{{
|
||||
props.row.totalLeave
|
||||
? props.row.totalLeave
|
||||
: "-"
|
||||
}}</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item class="q-pa-none">
|
||||
<q-item-section>
|
||||
<q-item-label
|
||||
>สถานะ</q-item-label
|
||||
></q-item-section
|
||||
>
|
||||
<q-item-section side>
|
||||
<q-item-label caption>
|
||||
{{
|
||||
props.row.status
|
||||
? statusLeave(props.row.status)
|
||||
: "-"
|
||||
}}</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item class="q-pa-none">
|
||||
<q-item-section>
|
||||
<q-item-label
|
||||
>เหตุผล</q-item-label
|
||||
></q-item-section
|
||||
>
|
||||
<q-item-section side>
|
||||
<q-item-label caption>
|
||||
{{
|
||||
props.row.reason
|
||||
!== ''? props.row.reason
|
||||
: "-"
|
||||
}}</q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<div class="row q-pa-sm">
|
||||
<div class="col text-grey-6 text-weight-medium">ประเภทการลา</div>
|
||||
<div class="col">
|
||||
{{ props.row.typeLeave !== "" ? props.row.typeLeave : "-" }}
|
||||
</div>
|
||||
<div class="col text-grey-6 text-weight-medium">
|
||||
วัน/เดือน/ปี ที่ลา
|
||||
</div>
|
||||
<div class="col">
|
||||
{{
|
||||
props.row.dateStartLeave
|
||||
? date2Thai(props.row.dateStartLeave)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="row q-pa-sm bg-grey-2">
|
||||
<div class="col text-grey-6 text-weight-medium">จำนวนวันลา</div>
|
||||
<div class="col">
|
||||
{{ props.row.numLeave ? props.row.numLeave : "-" }}
|
||||
</div>
|
||||
<div class="col text-grey-6 text-weight-medium">ลามาเเล้ว</div>
|
||||
<div class="col">
|
||||
{{ props.row.sumLeave ? props.row.sumLeave : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="row q-pa-sm">
|
||||
<div class="col text-grey-6 text-weight-medium">รวมเป็น</div>
|
||||
<div class="col">
|
||||
{{ props.row.totalLeave ? props.row.totalLeave : "-" }}
|
||||
</div>
|
||||
<div class="col text-grey-6 text-weight-medium">สถานะ</div>
|
||||
<div class="col">
|
||||
{{ props.row.status ? statusLeave(props.row.status) : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="row q-pa-sm bg-grey-2">
|
||||
<div class="col-3 text-grey-6 text-weight-medium">เหตุผล</div>
|
||||
<div class="col-3">
|
||||
{{ props.row.reason !== "" ? props.row.reason : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ const objectRef: MyObjectRef = {
|
|||
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filterKeyword = ref<string>("");
|
||||
const mode = ref<string>("card");
|
||||
const mode = ref<string>("table");
|
||||
|
||||
const formFilter = reactive<FormFilter>({
|
||||
page: 1,
|
||||
|
|
@ -446,17 +446,9 @@ onMounted(() => {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:item="props" v-else>
|
||||
<div class="col-xs-12 col-sm-6 col-md-4">
|
||||
<q-card flat bordered class="q-pa-md">
|
||||
<div class="row q-pb-sm">
|
||||
<div class="column">
|
||||
<div class="text-weight-bold">
|
||||
{{ props.row.level !== "" ? props.row.level : "-" }}
|
||||
</div>
|
||||
<div class="text-weight-light full-width text-left text-grey-9">
|
||||
{{ date2Thai(props.row.date) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6">
|
||||
<q-card flat bordered class="q-pa-none">
|
||||
<div class="row bg-grey-3">
|
||||
<q-space />
|
||||
<div class="q-gutter-x-sm">
|
||||
<q-btn
|
||||
|
|
@ -478,31 +470,45 @@ onMounted(() => {
|
|||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<q-list>
|
||||
<q-item
|
||||
v-for="col in props.cols.filter((col) => col.name !== 'desc')"
|
||||
:key="col.name"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ col.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-item-label
|
||||
caption
|
||||
v-if="
|
||||
col.name === 'refCommandDate' ||
|
||||
col.name == 'dateStart' ||
|
||||
col.name == 'dateEnd'
|
||||
"
|
||||
>
|
||||
{{ col.value ? date2Thai(col.value) : "-" }}
|
||||
</q-item-label>
|
||||
<q-item-label caption v-else>{{
|
||||
col.value ? col.value : "-"
|
||||
}}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-card-section class="q-pa-none">
|
||||
<div class="row q-pa-sm">
|
||||
<div class="col text-grey-6 text-weight-medium">เริ่มต้น</div>
|
||||
<div class="col">
|
||||
{{ props.row.dateStart ? date2Thai(props.row.dateStart) : "-" }}
|
||||
</div>
|
||||
<div class="col text-grey-6 text-weight-medium">สิ้นสุด</div>
|
||||
<div class="col">
|
||||
{{ props.row.dateEnd ? date2Thai(props.row.dateEnd) : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="row q-pa-sm bg-grey-2">
|
||||
<div class="col text-grey-6 text-weight-medium">
|
||||
เอกสารอ้างอิง
|
||||
</div>
|
||||
<div class="col">
|
||||
{{ props.row.reference ? props.row.reference : "-" }}
|
||||
</div>
|
||||
<div class="col text-grey-6 text-weight-medium">รายละเอียด</div>
|
||||
<div class="col">
|
||||
{{ props.row.detail ? props.row.detail : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="row q-pa-sm">
|
||||
<div class="col text-grey-6 text-weight-medium">เลขที่คำสั่ง</div>
|
||||
<div class="col">
|
||||
{{ props.row.refCommandNo ? props.row.refCommandNo : "-" }}
|
||||
</div>
|
||||
<div class="col text-grey-6 text-weight-medium">
|
||||
เอกสารอ้างอิง (ลงวันที่)
|
||||
</div>
|
||||
<div class="col">
|
||||
{{ props.row.refCommandDate ? date2Thai(props.row.refCommandDate) : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
</q-card>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,526 @@
|
|||
<script setup lang="ts"></script>
|
||||
<script setup lang="ts">
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
import { ref, onMounted, reactive } from "vue";
|
||||
import type {
|
||||
RowList,
|
||||
FormFilter,
|
||||
MyObjectRef,
|
||||
} from "@/modules/04_registryNew/interface/index/other";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import DialogHistory from "@/modules/04_registryNew/components/detail/Other/01_OtherInformationHistory.vue";
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, showLoader, hideLoader, success, messageError } = mixin;
|
||||
|
||||
const id = ref<string>("");
|
||||
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
const mode = ref<string>("table");
|
||||
const filterKeyword = ref<string>("");
|
||||
const rows = ref<RowList[]>([]);
|
||||
|
||||
const currentPage = ref<number>(1);
|
||||
const maxPage = ref<number>(1);
|
||||
const formFilter = reactive<FormFilter>({
|
||||
page: 1,
|
||||
pageSize: 12,
|
||||
keyword: "",
|
||||
type: "",
|
||||
posType: "",
|
||||
posLevel: "",
|
||||
retireYear: "",
|
||||
rangeYear: { min: 0, max: 60 },
|
||||
isShowRetire: false,
|
||||
isProbation: false,
|
||||
});
|
||||
|
||||
/** modal */
|
||||
const modal = ref<boolean>(false);
|
||||
const edit = ref<boolean>(false);
|
||||
const modalHistory = ref<boolean>(false);
|
||||
|
||||
const date = ref<Date | null>(null);
|
||||
const detail = ref<string>();
|
||||
|
||||
const detailRef = ref<object | null>(null);
|
||||
const objectRef: MyObjectRef = {
|
||||
detail: detailRef,
|
||||
};
|
||||
|
||||
const visibleColumns = ref<String[]>(["date", "detail"]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "date",
|
||||
align: "left",
|
||||
label: "วันที่",
|
||||
sortable: true,
|
||||
field: "date",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px; width: 50px;",
|
||||
},
|
||||
{
|
||||
name: "detail",
|
||||
align: "left",
|
||||
label: "รายละเอียด",
|
||||
sortable: true,
|
||||
field: "detail",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
/** เปิด dialog */
|
||||
function openDialogAdd() {
|
||||
modal.value = true;
|
||||
}
|
||||
|
||||
/** dialog แก้ไข
|
||||
* @param props ข้อมูล row ของรายการ
|
||||
*/
|
||||
function openDialogEdit(props: RowList) {
|
||||
modal.value = true;
|
||||
edit.value = true;
|
||||
|
||||
date.value = props.date;
|
||||
detail.value = props.detail;
|
||||
}
|
||||
/** dialog ประติ
|
||||
* @param id id รายการ
|
||||
*/
|
||||
function openDialogHistory(idOrder: string) {
|
||||
id.value = idOrder;
|
||||
modalHistory.value = true;
|
||||
}
|
||||
|
||||
/** ปิด dialog */
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
edit.value = false;
|
||||
date.value = null;
|
||||
detail.value = "";
|
||||
}
|
||||
|
||||
/** validate check*/
|
||||
function validateForm() {
|
||||
const hasError = [];
|
||||
for (const key in objectRef) {
|
||||
if (Object.prototype.hasOwnProperty.call(objectRef, key)) {
|
||||
const property = objectRef[key];
|
||||
if (property.value && typeof property.value.validate === "function") {
|
||||
const isValid = property.value.validate();
|
||||
hasError.push(isValid);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasError.every((result) => result === true)) {
|
||||
if ((edit.value = false)) {
|
||||
saveData();
|
||||
} else {
|
||||
editData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
function saveData() {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .post(config.API.profileOtherId(profileId.value), {
|
||||
// id: id.value,
|
||||
// date: date.value,
|
||||
// detail: detail.value,
|
||||
// })
|
||||
// .then((res) => {
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// modal.value = false;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// await fetchData();
|
||||
// });
|
||||
closeDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
* บันทึกแก้ไขข้อมูล
|
||||
*/
|
||||
const editData = async () => {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .put(config.API.profileOtherId(id.value), {
|
||||
// id: id.value,
|
||||
// date: date.value,
|
||||
// detail: detail.value,
|
||||
// })
|
||||
// .then((res) => {
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// modal.value = false;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// await fetchData();
|
||||
// });
|
||||
closeDialog();
|
||||
};
|
||||
|
||||
function getData() {
|
||||
const data: RowList[] = [
|
||||
{
|
||||
id: "08dc3c0e-b6ef-4e6c-8c84-787447416450",
|
||||
date: null,
|
||||
detail: "ทดสอบ 1",
|
||||
createdFullName: "สาวิตรี ศรีสมัย",
|
||||
createdAt: new Date("2024-03-04T05:48:27.615Z"),
|
||||
},
|
||||
{
|
||||
id: "08dc3c0e-bd30-48e8-8d14-31bcaf92b3a2",
|
||||
date: null,
|
||||
detail: "ทดสอบ 2",
|
||||
createdFullName: "สาวิตรี ศรีสมัย",
|
||||
createdAt: new Date("2024-03-04T05:48:38.105Z"),
|
||||
},
|
||||
{
|
||||
id: "08dc3c0e-c874-41fe-8b55-7c992ebf99b2",
|
||||
date: new Date("2024-03-03T17:00:00.000Z"),
|
||||
detail: "ข้อมูลอื่นๆ",
|
||||
createdFullName: "สาวิตรี ศรีสมัย",
|
||||
createdAt: new Date("2024-03-04T05:48:57.002Z"),
|
||||
},
|
||||
];
|
||||
|
||||
rows.value = data;
|
||||
}
|
||||
|
||||
const infoRows = [
|
||||
{ title: 'รายละเอียด', value: '' },
|
||||
{ title: 'ล้างมลทิน', value: '' },
|
||||
{ title: 'เลขที่คำสั่ง', value: '' },
|
||||
{ title: 'เอกสารอ้างอิง (ลงวันที่)', value: '' }
|
||||
]
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div>ข้อมูลอื่นๆ</div>
|
||||
<div class="row items-center q-gutter-x-sm q-py-sm">
|
||||
<q-btn color="teal-5" icon="add" flat round @click="openDialogAdd()"
|
||||
><q-tooltip>เพิ่มข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
|
||||
<q-space />
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
debounce="300"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filterKeyword == ''"
|
||||
name="search"
|
||||
@click.stop.prevent="filterKeyword = ''"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
<q-icon
|
||||
v-if="filterKeyword"
|
||||
name="cancel"
|
||||
@click.stop.prevent="filterKeyword = ''"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select
|
||||
v-if="mode == 'table'"
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
/>
|
||||
<q-btn-toggle
|
||||
v-model="mode"
|
||||
dense
|
||||
class="no-shadow toggle-borderd"
|
||||
toggle-color="grey-4"
|
||||
:options="[
|
||||
{ value: 'table', slot: 'table' },
|
||||
{ value: 'card', slot: 'card' },
|
||||
]"
|
||||
>
|
||||
<template v-slot:table>
|
||||
<q-icon
|
||||
name="format_list_bulleted"
|
||||
size="24px"
|
||||
:style="{
|
||||
color: mode === 'table' ? '#787B7C' : '#C9D3DB',
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-slot:card>
|
||||
<q-icon
|
||||
name="mdi-view-grid-outline"
|
||||
size="24px"
|
||||
:style="{
|
||||
color: mode === 'card' ? '#787B7C' : '#C9D3DB',
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
</q-btn-toggle>
|
||||
</div>
|
||||
|
||||
<d-table
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
dense
|
||||
bordered
|
||||
flat
|
||||
:card-container-class="mode === 'card' ? 'q-col-gutter-md' : ''"
|
||||
:grid="mode === 'card'"
|
||||
:paging="true"
|
||||
:visible-columns="visibleColumns"
|
||||
:filter="filterKeyword"
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width></q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props" v-if="mode === 'table'">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.id"
|
||||
@click="openDialogEdit(props.row)"
|
||||
>
|
||||
<div v-if="col.name === 'no'">
|
||||
{{
|
||||
(formFilter.page - 1) * formFilter.pageSize + props.rowIndex + 1
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'date'" class="table_ellipsis">
|
||||
{{ col.value ? date2Thai(col.value) : "-" }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
color="info"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
icon="mdi-history"
|
||||
@click="openDialogHistory(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขอื่นๆ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:item="props" v-else>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6">
|
||||
<q-card flat bordered>
|
||||
<div class="row bg-grey-3">
|
||||
<q-space />
|
||||
<div class="q-gutter-x-sm">
|
||||
<q-btn
|
||||
color="teal-5"
|
||||
icon="mdi-pencil-outline"
|
||||
flat
|
||||
round
|
||||
@click="openDialogEdit(props.row)"
|
||||
><q-tooltip>แก้ไข</q-tooltip></q-btn
|
||||
>
|
||||
<q-btn
|
||||
color="edit"
|
||||
icon="mdi-history"
|
||||
flat
|
||||
round
|
||||
@click="openDialogHistory(props.row.id)"
|
||||
><q-tooltip>ประวิติแก้ไขอื่นๆ</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<q-card-section class="q-pa-none">
|
||||
<div class="row q-pa-sm">
|
||||
<div class="col text-grey-6 text-weight-medium">รายละเอียด</div>
|
||||
<div class="col">
|
||||
{{ props.row.detail !== "" ? props.row.detail : "-" }}
|
||||
</div>
|
||||
<div class="col text-grey-6 text-weight-medium">ล้างมลทิน</div>
|
||||
<div class="col">
|
||||
{{ props.row.unStigma ? props.row.unStigma : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="row bg-grey-2 q-pa-sm">
|
||||
<div class="col text-grey-6 text-weight-medium">เลขที่คำสั่ง</div>
|
||||
<div class="col">
|
||||
{{
|
||||
props.row.refCommandNo ? props.row.refCommandNo : "-"
|
||||
}}
|
||||
</div>
|
||||
<div class="col text-grey-6 text-weight-medium">
|
||||
เอกสารอ้างอิง (ลงวันที่)
|
||||
</div>
|
||||
<div class="col">
|
||||
{{
|
||||
props.row.refCommandDate
|
||||
? date2Thai(props.row.refCommandDate)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="currentPage"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="Number(maxPage)"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
<template v-slot:no-data="{ icon, message, filter }">
|
||||
<div class="full-width row flex-center text-accent q-gutter-sm">
|
||||
<span
|
||||
><div
|
||||
style="
|
||||
height: 50vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
"
|
||||
class="text-grey-5"
|
||||
>
|
||||
<q-icon name="search" size="4rem" />
|
||||
|
||||
<span>ไม่พบข้อมูล</span>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</d-table>
|
||||
|
||||
<!-- dialog add edit -->
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="min-width: 600px">
|
||||
<form @submit.prevent="validateForm">
|
||||
<q-card-section class="flex justify-between" style="padding: 0">
|
||||
<DialogHeader tittle="อื่นๆ" :close="closeDialog" />
|
||||
</q-card-section>
|
||||
|
||||
<q-separator />
|
||||
<q-card-section class="q-p-sm">
|
||||
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="date"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
ref="dateRef"
|
||||
class="full-width inputgreen cursor-pointer"
|
||||
outlined
|
||||
dense
|
||||
:model-value="date2Thai(date)"
|
||||
:label="`${'วันที่'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
:style="'color: var(--q-primary)'"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
ref="detailRef"
|
||||
class="full-width inputgreen cursor-pointer"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="detail"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกรายละเอียด'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'รายละเอียด'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
id="onSubmit"
|
||||
type="submit"
|
||||
dense
|
||||
unelevated
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
class="q-px-md"
|
||||
>
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<DialogHistory v-model:modal="modalHistory" v-model:id="id" />
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped></style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,261 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch, reactive } from "vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
import type {
|
||||
RowList,
|
||||
} from "@/modules/04_registryNew/interface/index/other";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type {
|
||||
RequestItemsObject,
|
||||
FormFilter,
|
||||
} from "@/modules/04_registryNew/interface/index/discipline";
|
||||
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const id = defineModel<string>("id", { required: true });
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
|
||||
const currentPage = ref<number>(1);
|
||||
const maxPage = ref<number>(1);
|
||||
const filterKeyword = ref<string>("");
|
||||
const rows = ref<RowList[]>([]); //select data history
|
||||
const formFilter = reactive<FormFilter>({
|
||||
page: 1,
|
||||
pageSize: 12,
|
||||
keyword: "",
|
||||
type: "",
|
||||
posType: "",
|
||||
posLevel: "",
|
||||
retireYear: "",
|
||||
rangeYear: { min: 0, max: 60 },
|
||||
isShowRetire: false,
|
||||
isProbation: false,
|
||||
});
|
||||
|
||||
const visibleColumns = ref<String[]>([
|
||||
"date",
|
||||
"detail",
|
||||
"createdFullName",
|
||||
"createdAt",
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "date",
|
||||
align: "left",
|
||||
label: "วันที่",
|
||||
sortable: true,
|
||||
field: "date",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px; width: 50px;",
|
||||
},
|
||||
{
|
||||
name: "detail",
|
||||
align: "left",
|
||||
label: "รายละเอียด",
|
||||
sortable: true,
|
||||
field: "detail",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "createdFullName",
|
||||
align: "left",
|
||||
label: "ผู้ดำเนินการ",
|
||||
sortable: true,
|
||||
field: "createdFullName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "createdAt",
|
||||
align: "left",
|
||||
label: "วันที่แก้ไข",
|
||||
sortable: true,
|
||||
field: "createdAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
function getHistory() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.profileOtherHisId(id.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((e: RowList) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
date: e.date,
|
||||
detail: e.detail,
|
||||
createdFullName: e.createdFullName,
|
||||
createdAt: new Date(e.createdAt),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
watch(modal, (status) => {
|
||||
if (status == true) {
|
||||
getHistory();
|
||||
filterKeyword.value = "";
|
||||
} else {
|
||||
filterKeyword.value = "";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="min-width: 80%">
|
||||
<q-card-section class="flex justify-between" style="padding: 0">
|
||||
<DialogHeader
|
||||
tittle="ประวัติแก้ไขอื่นๆ"
|
||||
:close="() => (modal = false)"
|
||||
/>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator />
|
||||
<q-card-section class="q-p-sm">
|
||||
<div class="row q-gutter-sm q-mb-sm">
|
||||
<q-space />
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
placeholder="ค้นหา"
|
||||
debounce="300"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filterKeyword == ''"
|
||||
name="search"
|
||||
@click.stop.prevent="filterKeyword = ''"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
<q-icon
|
||||
v-if="filterKeyword"
|
||||
name="cancel"
|
||||
@click.stop.prevent="filterKeyword = ''"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
/>
|
||||
</div>
|
||||
<d-table
|
||||
ref="table"
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:paging="true"
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
:visible-columns="visibleColumns"
|
||||
:filter="filterKeyword"
|
||||
>
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div v-if="col.name === 'no'">
|
||||
{{
|
||||
(formFilter.page - 1) * formFilter.pageSize +
|
||||
props.rowIndex +
|
||||
1
|
||||
}}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.name == 'refCommandDate' ||
|
||||
col.name == 'date' ||
|
||||
col.name == 'createdAt'
|
||||
"
|
||||
>
|
||||
{{ col.value == null ? null : date2Thai(col.value) }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="currentPage"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="Number(maxPage)"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
<template v-slot:no-data="{ icon, message, filter }">
|
||||
<div class="full-width row flex-center text-accent q-gutter-sm">
|
||||
<span
|
||||
><div
|
||||
style="
|
||||
height: 50vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
"
|
||||
class="text-grey-5"
|
||||
>
|
||||
<q-icon name="search" size="4rem" />
|
||||
|
||||
<span>ไม่พบข้อมูล</span>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
|
@ -1,6 +1,184 @@
|
|||
<script setup lang="ts"></script>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import type { ArrayFileList } from "@/modules/04_registryNew/interface/index/document";
|
||||
const $q = useQuasar;
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
dialogConfirm,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
messageError,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const id = ref<string>("");
|
||||
const documentFile = ref<any>(null);
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
const fileList = ref<ArrayFileList[]>([]);
|
||||
/**
|
||||
* ฟังชั่นอัปโหลดไฟล์
|
||||
* @param documentFile ไฟล์ที่รับมา
|
||||
*/
|
||||
function fileUploadDoc(documentFile: any) {
|
||||
documentFile.forEach((file: any) => {
|
||||
fileDocDataUpload.value.push(file);
|
||||
});
|
||||
}
|
||||
|
||||
function getData() {}
|
||||
/**
|
||||
* ฟังก์ชั่นสำหรับอัพโหลดไฟล์เอกสารหลักฐาน
|
||||
*/
|
||||
function upLoadFileDoc() {
|
||||
const Data = new FormData();
|
||||
Data.append("file", documentFile.value);
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.complaintFileUpload(id.value), Data)
|
||||
.then((res) => {
|
||||
success($q, "อัพโหลดไฟล์สำเร็จ");
|
||||
getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
documentFile.value = null;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* เปิดลิงค์ไฟล์
|
||||
* @param link รับมาเป็น https ลิงค์
|
||||
*/
|
||||
function downloadFile(link: string) {
|
||||
window.open(link, "_blank");
|
||||
}
|
||||
|
||||
/**
|
||||
* ลบไฟล์
|
||||
* @param id id file
|
||||
*/
|
||||
function deleteFile(id: string) {
|
||||
dialogRemove($q, () => confirmDelete(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* ยืนยัน ลบ ไฟล์
|
||||
* @param id id file
|
||||
*/
|
||||
function confirmDelete(idOrder: string) {
|
||||
showLoader();
|
||||
http
|
||||
.delete(config.API.complaintFileDelete(id.value, idOrder))
|
||||
.then((res) => {
|
||||
success($q, `ลบไฟล์สำเร็จ`);
|
||||
getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div>เอกสารหลักฐาน</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<div flat class="q-pa-none">
|
||||
<div class="col-12 row q-col-gutter-md">
|
||||
<div class="row col-12">
|
||||
<q-card bordered class="row col-12" style="border: 1px solid #d6dee1">
|
||||
<div class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md">
|
||||
อัปโหลดไฟล์เอกสารหลักฐาน
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-col-gutter-y-sm q-pa-sm">
|
||||
<div class="col-12 row">
|
||||
<q-file
|
||||
for="inputFiles"
|
||||
class="col-12"
|
||||
outlined
|
||||
dense
|
||||
v-model="documentFile"
|
||||
@added="fileUploadDoc"
|
||||
label="ไฟล์เอกสารหลักฐาน"
|
||||
hide-bottom-space
|
||||
accept=".pdf,.xlsx,.docx,.png,.jpg"
|
||||
clearable
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" color="primary" />
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<q-btn
|
||||
size="14px"
|
||||
v-if="documentFile"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="add"
|
||||
icon="mdi-upload"
|
||||
@click="upLoadFileDoc()"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</template>
|
||||
</q-file>
|
||||
|
||||
<!-- <div class="col-1 self-center" v-if="formData.documentFile"></div> -->
|
||||
</div>
|
||||
|
||||
<div v-if="fileList.length > 0" class="col-xs-12 row">
|
||||
<q-list class="full-width rounded-borders" bordered separator>
|
||||
<q-item
|
||||
clickable
|
||||
v-ripple
|
||||
v-for="data in fileList"
|
||||
:key="data.id"
|
||||
class="items-center"
|
||||
>
|
||||
<q-item-section>{{ data.fileName }}</q-item-section>
|
||||
<q-space />
|
||||
<div>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="blue"
|
||||
icon="mdi-download"
|
||||
@click="downloadFile(data.pathName)"
|
||||
><q-tooltip>ดาวน์โหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="red"
|
||||
class="q-ml-sm"
|
||||
icon="mdi-delete-outline"
|
||||
@click="deleteFile(data.id)"
|
||||
><q-tooltip>ลบไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
|
||||
<div class="col-12" v-else>
|
||||
<q-card class="q-pa-md" bordered> ไม่มีรายการเอกสาร </q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
|
|||
9
src/modules/04_registryNew/interface/index/document.ts
Normal file
9
src/modules/04_registryNew/interface/index/document.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
interface ArrayFileList {
|
||||
id:string
|
||||
pathName:string
|
||||
fileName:string
|
||||
}
|
||||
|
||||
export type {
|
||||
ArrayFileList
|
||||
}
|
||||
30
src/modules/04_registryNew/interface/index/other.ts
Normal file
30
src/modules/04_registryNew/interface/index/other.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
interface RowList {
|
||||
id: string;
|
||||
date: Date | null;
|
||||
detail: string;
|
||||
createdFullName: string;
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
interface FormFilter {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
keyword: string;
|
||||
type: string;
|
||||
posType: string;
|
||||
posLevel: string;
|
||||
retireYear: string | null;
|
||||
rangeYear: { min: number; max: number };
|
||||
isShowRetire: boolean;
|
||||
isProbation: boolean;
|
||||
}
|
||||
interface MyObjectRef {
|
||||
detail: object | null;
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
export type {
|
||||
RowList,
|
||||
FormFilter,
|
||||
MyObjectRef,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue