fix Columns ช่าวยราชการ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-04-03 10:55:55 +07:00
parent 9371dd15fc
commit 86b2aaf2e2

View file

@ -29,22 +29,38 @@ const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */ /** ตัวแปรข้อมูล */
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
"commandName",
"agency", "agency",
"dateStart", "dateStart",
"dateEnd", "dateEnd",
"commandNo", "commandNo",
"document", "document",
"lastUpdateFullName",
"lastUpdatedAt", "lastUpdatedAt",
]); ]);
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{
name: "commandName",
align: "left",
label: "ประเภทคำสั่ง",
sortable: true,
field: "commandName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{ {
name: "agency", name: "agency",
align: "left", align: "left",
label: "หน่วยงานที่ให้ช่วยราชการ", label: "หน่วยงานที่ให้ช่วยราชการ/ส่งตัวกลับ",
sortable: true, sortable: true,
field: "agency", field: "agency",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "dateStart", name: "dateStart",
@ -55,6 +71,8 @@ const columns = ref<QTableProps["columns"]>([
format: (v) => date2Thai(v), format: (v) => date2Thai(v),
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "dateEnd", name: "dateEnd",
@ -65,6 +83,8 @@ const columns = ref<QTableProps["columns"]>([
format: (v) => date2Thai(v), format: (v) => date2Thai(v),
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "commandNo", name: "commandNo",
@ -74,6 +94,8 @@ const columns = ref<QTableProps["columns"]>([
field: "commandNo", field: "commandNo",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "document", name: "document",
@ -83,6 +105,19 @@ const columns = ref<QTableProps["columns"]>([
field: "document", field: "document",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "lastUpdatedAt", name: "lastUpdatedAt",
@ -102,6 +137,7 @@ const pagination = ref({
}); });
const visibleColumnsHistory = ref<string[]>([ const visibleColumnsHistory = ref<string[]>([
"commandName",
"agency", "agency",
"dateStart", "dateStart",
"dateEnd", "dateEnd",
@ -111,14 +147,28 @@ const visibleColumnsHistory = ref<string[]>([
"lastUpdatedAt", "lastUpdatedAt",
]); ]);
const columnsHistory = ref<QTableProps["columns"]>([ const columnsHistory = ref<QTableProps["columns"]>([
{
name: "commandName",
align: "left",
label: "ประเภทคำสั่ง",
sortable: true,
field: "commandName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{ {
name: "agency", name: "agency",
align: "left", align: "left",
label: "หน่วยงานที่ให้ช่วยราชการ", label: "หน่วยงานที่ให้ช่วยราชการ/ส่งตัวกลับ",
sortable: true, sortable: true,
field: "agency", field: "agency",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "dateStart", name: "dateStart",
@ -129,6 +179,8 @@ const columnsHistory = ref<QTableProps["columns"]>([
format: (v) => date2Thai(v), format: (v) => date2Thai(v),
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "dateEnd", name: "dateEnd",
@ -139,6 +191,8 @@ const columnsHistory = ref<QTableProps["columns"]>([
format: (v) => date2Thai(v), format: (v) => date2Thai(v),
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "commandNo", name: "commandNo",
@ -148,6 +202,8 @@ const columnsHistory = ref<QTableProps["columns"]>([
field: "commandNo", field: "commandNo",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "document", name: "document",
@ -157,6 +213,8 @@ const columnsHistory = ref<QTableProps["columns"]>([
field: "document", field: "document",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "lastUpdateFullName", name: "lastUpdateFullName",
@ -166,6 +224,8 @@ const columnsHistory = ref<QTableProps["columns"]>([
field: "lastUpdateFullName", field: "lastUpdateFullName",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "lastUpdatedAt", name: "lastUpdatedAt",
@ -173,9 +233,11 @@ const columnsHistory = ref<QTableProps["columns"]>([
label: "วันที่แก้ไข", label: "วันที่แก้ไข",
sortable: true, sortable: true,
field: "lastUpdatedAt", field: "lastUpdatedAt",
format: (v) => date2Thai(v, false, true),
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
format: (v) => date2Thai(v, false, true), sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
]); ]);
@ -316,6 +378,7 @@ onMounted(async () => {
<span class="text-weight-medium">{{ col.label }}</span> <span class="text-weight-medium">{{ col.label }}</span>
</q-th> </q-th>
<q-th auto-width /> <q-th auto-width />
<q-th auto-width />
</q-tr> </q-tr>
</template> </template>
@ -331,17 +394,20 @@ onMounted(async () => {
</q-td> </q-td>
<q-td auto-width> <q-td auto-width>
<q-btn <q-btn
v-if="props.row.isUpload"
flat flat
dense dense
round round
color="green" color="green"
size="14px" size="14px"
icon="mdi-file-document-outline" icon="mdi-file-document-outline"
v-if="props.row.isUpload"
@click="onDownloadFile(props.row.id, props.row.profileId)" @click="onDownloadFile(props.row.id, props.row.profileId)"
> >
<q-tooltip>ดาวนโหลด</q-tooltip> <q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn> </q-btn>
</q-td>
<q-td auto-width>
<q-btn <q-btn
color="info" color="info"
flat flat