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