แก้ ฟิลเตอร์
This commit is contained in:
parent
2f1572bde0
commit
f8d5fe7ba0
7 changed files with 94 additions and 98 deletions
|
|
@ -15,7 +15,7 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom
|
|||
const $q = useQuasar();
|
||||
const storeCommand = useCommandMainStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, date2Thai,onSearchDataTable } = mixin;
|
||||
const { dialogConfirm, date2Thai, onSearchDataTable } = mixin;
|
||||
|
||||
const props = defineProps({
|
||||
Modal: Boolean,
|
||||
|
|
@ -31,9 +31,11 @@ const emit = defineEmits([
|
|||
"update:selected",
|
||||
]);
|
||||
|
||||
const filterKeyword2 = defineModel<string>('filterKeyword2',{required:true})
|
||||
const rows = defineModel<PersonData[]>('rows',{required:true})
|
||||
const rowsData = defineModel<PersonData[]>('rowsData',{required:true})
|
||||
const filterKeyword2 = defineModel<string>("filterKeyword2", {
|
||||
required: true,
|
||||
});
|
||||
const rows = defineModel<PersonData[]>("rows", { required: true });
|
||||
const rowsData = defineModel<PersonData[]>("rowsData", { required: true });
|
||||
|
||||
const selected = ref<PersonData[]>([]); //ราชชื่อที่เลือกส่งไปออกคำสั่ง
|
||||
const dataMapToSend = computed(() => {
|
||||
|
|
@ -109,6 +111,9 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format: (val, row) => {
|
||||
return `${row.root} (${row.rootShortName}) ${row.nodeName} (${row.nodeShortName}${row.posMasterNo})`;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "typeCommand",
|
||||
|
|
@ -134,6 +139,9 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
field: "dateOfBirth",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return date2Thai(row.dateOfBirth);
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -110,6 +110,9 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format: (val, row) => {
|
||||
return `${row.root} (${row.rootShortName}) ${row.nodeName} (${row.nodeShortName}${row.posMasterNo})`;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "typeCommand",
|
||||
|
|
@ -137,6 +140,9 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
field: "dateOfBirth",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return date2Thai(row.dateOfBirth);
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
@ -330,8 +336,8 @@ watch(
|
|||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="pageNext(props.row.id)"
|
||||
>
|
||||
<!-- @click="pageNext(props.row.id)" -->
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
|
|
@ -341,13 +347,7 @@ watch(
|
|||
props.row.status ? statusText(props.row.status) : "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'dateOfBirth'">
|
||||
{{
|
||||
props.row.dateOfBirth
|
||||
? date2Thai(props.row.dateOfBirth)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.name == 'organizationName'">
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
|
|
|
|||
|
|
@ -1402,7 +1402,7 @@ onMounted(async () => {
|
|||
</q-dialog>
|
||||
|
||||
<!-- dialog เพิ่มรายชื่อ -->
|
||||
<q-dialog v-model="modaladdlist">
|
||||
<q-dialog v-model="modaladdlist" persistent>
|
||||
<q-card style="width: 950px; max-width: 80vw">
|
||||
<DialogHeader
|
||||
tittle="ส่งรายชื่อไปยังหน่วยงาน"
|
||||
|
|
|
|||
|
|
@ -79,6 +79,9 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format(val, row) {
|
||||
return `${row.prefix ?? ""}${row.firstName ?? ""} ${row.lastName ?? ""}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "organizationName",
|
||||
|
|
@ -90,6 +93,9 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format: (val, row) => {
|
||||
return `${row.root} (${row.rootShortName}) ${row.nodeName} (${row.nodeShortName}${row.posMasterNo})`;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "dateOfBirth",
|
||||
|
|
@ -101,7 +107,11 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format(val, row) {
|
||||
return date2Thai(row.dateOfBirth);
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: "createdAt",
|
||||
align: "left",
|
||||
|
|
@ -113,6 +123,9 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
sortOrder: "da",
|
||||
format(val, row) {
|
||||
return date2Thai(row.createdAt);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
|
|
@ -124,6 +137,9 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format(val, row) {
|
||||
return statusText(row.status);
|
||||
},
|
||||
},
|
||||
]);
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
|
|
@ -182,7 +198,7 @@ watchEffect(() => {
|
|||
<template>
|
||||
<q-dialog v-model="props.modal" persistent>
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<DialogHeader :tittle="'ส่งไปออกsคำสั่งรับโอน'" :close="clickClose" />
|
||||
<DialogHeader :tittle="'ส่งไปออกคำสั่งรับโอน'" :close="clickClose" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
|
|
@ -261,29 +277,7 @@ watchEffect(() => {
|
|||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
{{
|
||||
props.row.firstName
|
||||
? `${props.row.prefix ?? ""}${
|
||||
props.row.firstName ?? ""
|
||||
} ${props.row.lastName ?? ""}`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'dateOfBirth'">
|
||||
{{
|
||||
props.row.dateOfBirth
|
||||
? date2Thai(props.row.dateOfBirth)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'createdAt'">
|
||||
{{
|
||||
props.row.createdAt
|
||||
? date2Thai(props.row.createdAt)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.name == 'organizationName'">
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
|
|
@ -308,11 +302,6 @@ watchEffect(() => {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'status'">
|
||||
{{
|
||||
props.row.status ? statusText(props.row.status) : "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -113,6 +113,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format: (val, row) => {
|
||||
return `${row.root} (${row.rootShortName}) ${row.nodeName} (${row.nodeShortName}${row.posMasterNo})`;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "dateOfBirth",
|
||||
|
|
@ -124,6 +127,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format(val, row) {
|
||||
return date2Thai(row.dateOfBirth);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "createdAt",
|
||||
|
|
@ -136,6 +142,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
sortOrder: "da",
|
||||
format(val, row) {
|
||||
return date2Thai(row.createdAt);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
|
|
@ -147,6 +156,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format(val, row) {
|
||||
return statusText(row.status);
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
@ -545,9 +557,6 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'status'">
|
||||
{{ props.row.status ? statusText(props.row.status) : "-" }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -80,6 +80,15 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "fullname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return `${
|
||||
row.firstName
|
||||
? `${row.prefix ?? ""}${row.firstName ?? ""} ${
|
||||
row.lastName ?? ""
|
||||
}`
|
||||
: "-"
|
||||
}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "organizationName",
|
||||
|
|
@ -89,6 +98,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "organizationName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (val, row) => {
|
||||
return `${row.root} (${row.rootShortName}) ${row.nodeName} (${row.nodeShortName}${row.posMasterNo})`;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "dateOfBirth",
|
||||
|
|
@ -98,6 +110,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "dateOfBirth",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return date2Thai(row.dateOfBirth);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "typeCommand",
|
||||
|
|
@ -125,6 +140,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "createdAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return date2Thai(row.createdAt);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
|
|
@ -134,6 +152,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "status",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return statusText(row.status);
|
||||
},
|
||||
},
|
||||
]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
|
|
@ -345,7 +366,7 @@ onMounted(async () => {
|
|||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
row-key="citizenId"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
|
|
@ -487,27 +508,6 @@ onMounted(async () => {
|
|||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
{{
|
||||
props.row.firstName
|
||||
? `${props.row.prefix ?? ""}${
|
||||
props.row.firstName ?? ""
|
||||
} ${props.row.lastName ?? ""}`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.name == 'status'">
|
||||
{{ props.row.status ? statusText(props.row.status) : "-" }}
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.name == 'dateOfBirth'">
|
||||
{{
|
||||
props.row.dateOfBirth
|
||||
? date2Thai(props.row.dateOfBirth)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.name == 'organizationName'">
|
||||
<div class="col-4">
|
||||
|
|
@ -532,12 +532,6 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.name == 'createdAt'">
|
||||
{{
|
||||
props.row.createdAt ? date2Thai(props.row.createdAt) : "-"
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -95,6 +95,13 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "fullname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return `${
|
||||
row.firstName
|
||||
? `${row.prefix ?? ""}${row.firstName ?? ""} ${row.lastName ?? ""}`
|
||||
: "-"
|
||||
}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "organizationName",
|
||||
|
|
@ -104,6 +111,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "organizationName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (val, row) => {
|
||||
return `${row.root} (${row.rootShortName}) ${row.nodeName} (${row.nodeShortName}${row.posMasterNo})`;
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "dateOfBirth",
|
||||
|
|
@ -113,6 +123,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "dateOfBirth",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return date2Thai(row.dateOfBirth);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "typeCommand",
|
||||
|
|
@ -138,6 +151,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "createdAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return date2Thai(row.createdAt);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
|
|
@ -147,6 +163,9 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "status",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format(val, row) {
|
||||
return statusText(row.status);
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
@ -343,7 +362,7 @@ onMounted(async () => {
|
|||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
row-key="citizenId"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
|
|
@ -460,26 +479,7 @@ onMounted(async () => {
|
|||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
{{
|
||||
props.row.firstName
|
||||
? `${props.row.prefix ?? ""}${
|
||||
props.row.firstName ?? ""
|
||||
} ${props.row.lastName ?? ""}`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.name == 'status'">
|
||||
{{ props.row.status ? statusText(props.row.status) : "-" }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'dateOfBirth'">
|
||||
{{
|
||||
props.row.dateOfBirth
|
||||
? date2Thai(props.row.dateOfBirth)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'organizationName'">
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
|
|
@ -502,11 +502,7 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'createdAt'">
|
||||
{{
|
||||
props.row.createdAt ? date2Thai(props.row.createdAt) : "-"
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue