ปรับ Table บันทึกผล
This commit is contained in:
parent
34c9802171
commit
8130c180f0
4 changed files with 53 additions and 21 deletions
|
|
@ -23,7 +23,7 @@
|
||||||
@click="selectData(props)"
|
@click="selectData(props)"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
>
|
>
|
||||||
<div
|
<!-- <div
|
||||||
v-if="
|
v-if="
|
||||||
col.name == 'receiveDate' ||
|
col.name == 'receiveDate' ||
|
||||||
col.name == 'dateAnnounce' ||
|
col.name == 'dateAnnounce' ||
|
||||||
|
|
@ -32,8 +32,8 @@
|
||||||
class="table_ellipsis"
|
class="table_ellipsis"
|
||||||
>
|
>
|
||||||
{{ col.value == null ? null : date2Thai(col.value) }}
|
{{ col.value == null ? null : date2Thai(col.value) }}
|
||||||
</div>
|
</div> -->
|
||||||
<div v-else-if="col.name == 'year'" class="table_ellipsis">
|
<div v-if="col.name == 'year'" class="table_ellipsis">
|
||||||
{{ col.value + 543 }}
|
{{ col.value + 543 }}
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="table_ellipsis">
|
<div v-else class="table_ellipsis">
|
||||||
|
|
@ -532,7 +532,7 @@ const checkValidate = ref<boolean>(false); //validate data ผ่านหรื
|
||||||
const profileId = ref<string>(
|
const profileId = ref<string>(
|
||||||
route.params.id ? route.params.id.toString() : ""
|
route.params.id ? route.params.id.toString() : ""
|
||||||
);
|
);
|
||||||
const rows = ref<RequestItemsObject[]>([]);
|
const rows = ref<any>([]);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const visibleColumns = ref<String[]>([]);
|
const visibleColumns = ref<String[]>([]);
|
||||||
profileData.insignia.columns.length == 0
|
profileData.insignia.columns.length == 0
|
||||||
|
|
@ -550,6 +550,7 @@ profileData.insignia.columns.length == 0
|
||||||
"dateAnnounce",
|
"dateAnnounce",
|
||||||
"refCommandNo",
|
"refCommandNo",
|
||||||
"refCommandDate",
|
"refCommandDate",
|
||||||
|
"createdAt"
|
||||||
])
|
])
|
||||||
: (visibleColumns.value = profileData.insignia.columns);
|
: (visibleColumns.value = profileData.insignia.columns);
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
|
@ -961,13 +962,13 @@ const fetchData = async () => {
|
||||||
volume: e.volume,
|
volume: e.volume,
|
||||||
section: e.section,
|
section: e.section,
|
||||||
page: e.page,
|
page: e.page,
|
||||||
receiveDate: new Date(e.receiveDate),
|
receiveDate: date2Thai(e.receiveDate),
|
||||||
dateAnnounce: new Date(e.dateAnnounce),
|
dateAnnounce: date2Thai(e.dateAnnounce),
|
||||||
refCommandNo: e.refCommandNo,
|
refCommandNo: e.refCommandNo,
|
||||||
refCommandDate:
|
refCommandDate:
|
||||||
e.refCommandDate == null ? null : new Date(e.refCommandDate),
|
e.refCommandDate == null ? null : date2Thai(e.refCommandDate),
|
||||||
createdFullName: e.createdFullName,
|
createdFullName: e.createdFullName,
|
||||||
createdAt: new Date(e.createdAt),
|
createdAt: date2Thai(e.createdAt),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, watch, reactive, computed, } from "vue";
|
import { ref, onMounted, watch, reactive, computed } from "vue";
|
||||||
import { useQuasar, QForm } from "quasar";
|
import { useQuasar, QForm } from "quasar";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
@ -216,7 +216,7 @@ const getTable = async () => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.personalList(examIdString))
|
.get(config.API.personalList(examIdString))
|
||||||
.then(async (res: any) => {
|
.then(async (res: any) => {
|
||||||
// console.log(res);
|
console.log(res);
|
||||||
dataRes.value = res.data.result;
|
dataRes.value = res.data.result;
|
||||||
rowsAll.value = [];
|
rowsAll.value = [];
|
||||||
(rowsFilter.value = []),
|
(rowsFilter.value = []),
|
||||||
|
|
@ -226,7 +226,7 @@ const getTable = async () => {
|
||||||
idCard: data.idCard,
|
idCard: data.idCard,
|
||||||
fullName: data.fullName + " " + data.idCard,
|
fullName: data.fullName + " " + data.idCard,
|
||||||
name: data.fullName,
|
name: data.fullName,
|
||||||
profilePhoto: data.profilePhoto,
|
profilePhoto: data.profilePhoto ?? "",
|
||||||
organizationName:
|
organizationName:
|
||||||
data.organizationName +
|
data.organizationName +
|
||||||
" " +
|
" " +
|
||||||
|
|
@ -616,11 +616,15 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
<q-item v-ripple>
|
<q-item v-ripple>
|
||||||
<q-item-section avatar>
|
<q-item-section avatar>
|
||||||
<img
|
<img
|
||||||
v-if="props.row.avatar == null"
|
v-if="props.row.profilePhoto == ''"
|
||||||
src="@/assets/avatar_user.jpg"
|
src="@/assets/avatar_user.jpg"
|
||||||
class="col-4 img-info"
|
class="col-4 img-info"
|
||||||
/>
|
/>
|
||||||
<img v-else :src="props.row.avatar" class="col-4 img-info" />
|
<img
|
||||||
|
v-else
|
||||||
|
:src="props.row.profilePhoto"
|
||||||
|
class="col-4 img-info"
|
||||||
|
/>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
|
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,12 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
|
||||||
position: e.position,
|
position: e.position,
|
||||||
status: status(e.status),
|
status: status(e.status),
|
||||||
dateReceive: date2Thai(e.dateReceive),
|
dateReceive: date2Thai(e.dateReceive),
|
||||||
name: e.fullName,
|
name: e.prefix + e.fullName,
|
||||||
type: e.requestInsignia,
|
type: e.requestInsignia,
|
||||||
employeeType: profileType(e.profileType),
|
employeeType: profileType(e.profileType),
|
||||||
profileType: e.profileType,
|
profileType: e.profileType,
|
||||||
|
volumeNo: e.volumeNo,
|
||||||
|
section: e.section,
|
||||||
page: e.page,
|
page: e.page,
|
||||||
number: e.no,
|
number: e.no,
|
||||||
vatnumber: e.number,
|
vatnumber: e.number,
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,6 @@ const fecthInsigniaType = async () => {
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
console.log("fecthInsigniaType");
|
console.log("fecthInsigniaType");
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const visibleColumns = ref<String[]>([
|
const visibleColumns = ref<String[]>([
|
||||||
|
|
@ -96,6 +95,8 @@ const visibleColumns = ref<String[]>([
|
||||||
"type",
|
"type",
|
||||||
"dateReceive",
|
"dateReceive",
|
||||||
"employeeType",
|
"employeeType",
|
||||||
|
"volumeNo",
|
||||||
|
"section",
|
||||||
"page",
|
"page",
|
||||||
"number",
|
"number",
|
||||||
"vatnumber",
|
"vatnumber",
|
||||||
|
|
@ -114,7 +115,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "status",
|
name: "status",
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|
@ -142,6 +142,15 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "employeeType",
|
||||||
|
align: "left",
|
||||||
|
label: "สถานภาพ",
|
||||||
|
field: "employeeType",
|
||||||
|
sortable: true,
|
||||||
|
sort: (a: string, b: string) =>
|
||||||
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "type",
|
name: "type",
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|
@ -161,14 +170,24 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "employeeType",
|
name: "volumeNo",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "สถานภาพ",
|
label: "เล่มในราชกิจนุเบกษา",
|
||||||
field: "employeeType",
|
field: "volumeNo",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "section",
|
||||||
|
align: "left",
|
||||||
|
label: "ตอนในราชกิจนุเบกษา",
|
||||||
|
field: "section",
|
||||||
|
sortable: true,
|
||||||
|
sort: (a: string, b: string) =>
|
||||||
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "page",
|
name: "page",
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|
@ -540,7 +559,10 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
:borderless="false"
|
:borderless="false"
|
||||||
style="min-width: 150px"
|
style="min-width: 150px"
|
||||||
@update:model-value="
|
@update:model-value="
|
||||||
DataStore.searchData(DataStore.invoiceType,DataStore.employeeClass)
|
DataStore.searchData(
|
||||||
|
DataStore.invoiceType,
|
||||||
|
DataStore.employeeClass
|
||||||
|
)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -561,7 +583,10 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
:borderless="false"
|
:borderless="false"
|
||||||
style="min-width: 150px"
|
style="min-width: 150px"
|
||||||
@update:model-value="
|
@update:model-value="
|
||||||
DataStore.searchData(DataStore.invoiceType,DataStore.employeeClass)
|
DataStore.searchData(
|
||||||
|
DataStore.invoiceType,
|
||||||
|
DataStore.employeeClass
|
||||||
|
)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue