Merge branch 'develop' of github.com:Frappet/hrms-mgt into develop

* 'develop' of github.com:Frappet/hrms-mgt:
  fix ตั้งค่าเว็บไซต์ระบบสรรหา
  แก้ ฟิลเตอร์
This commit is contained in:
Warunee Tamkoo 2024-12-23 20:33:19 +07:00
commit 636cd67923
8 changed files with 176 additions and 105 deletions

View file

@ -59,8 +59,11 @@ const qeditor = ref<string>("");
const title = ref<string>("");
const filter = ref<string>(""); //search data table
const filterAgency = ref<string>(""); //search data table
const provinceOptionsMain = ref<DataOption[]>([]);
const provinceOptions = ref<DataOption[]>([]);
const districtOptionsMain = ref<DataOption[]>([]);
const districtOptions = ref<DataOption[]>([]);
const subdistrictOptionsMain = ref<zipCodeOption[]>([]);
const subdistrictOptions = ref<zipCodeOption[]>([]);
const cmsGoverment = ref<CmsTable[]>([]);
const cmsAgency = ref<CmsTable[]>([]);
@ -570,6 +573,7 @@ async function fetchProvince() {
option.push({ id: r.id.toString(), name: r.name.toString() });
});
provinceOptions.value = option;
provinceOptionsMain.value = option;
})
.catch((e: any) => {
messageError($q, e);
@ -595,6 +599,7 @@ async function fetchDistrict(id: string | null) {
option.push({ id: r.id.toString(), name: r.name.toString() });
});
districtOptions.value = option;
districtOptionsMain.value = option;
})
.catch((e: any) => {
messageError($q, e);
@ -625,6 +630,7 @@ async function fetchSubDistrict(id: string | null) {
});
});
subdistrictOptions.value = option;
subdistrictOptionsMain.value = option;
})
.catch((e: any) => {
messageError($q, e);
@ -737,6 +743,33 @@ function getClass(val: boolean) {
};
}
function filterSelector(val: string, update: Function, refData: string) {
switch (refData) {
case "province":
update(() => {
provinceOptions.value = provinceOptionsMain.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
);
});
break;
case "district":
update(() => {
districtOptions.value = districtOptionsMain.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
);
});
break;
case "subdistrict":
update(() => {
subdistrictOptions.value = subdistrictOptionsMain.value.filter(
(v: zipCodeOption) => v.name.indexOf(val) > -1
);
});
default:
break;
}
}
onMounted(async () => {
await fetchData();
await fetchProvince();
@ -1017,8 +1050,22 @@ onMounted(async () => {
:options="provinceOptions"
option-value="id"
:label="`${'จังหวัด'}`"
@update:model-value="(value:any) => selectProvince(value)"
/>
use-input
hide-selected
fill-input
@update:model-value="(value:string) => selectProvince(value)"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'province'
)"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-italic text-grey">
ไมอม
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div class="col-xs-6 col-sm-3 col-md-3">
<q-select
@ -1037,8 +1084,22 @@ onMounted(async () => {
:options="districtOptions"
option-value="id"
:label="`${'เขต / อำเภอ'}`"
@update:model-value="(value:any) => selectDistrict(value)"
/>
use-input
hide-selected
fill-input
@update:model-value="(value:string) => selectDistrict(value)"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'district'
)"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-italic text-grey">
ไมอม
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div class="col-xs-6 col-sm-3 col-md-3">
<q-select
@ -1056,9 +1117,23 @@ onMounted(async () => {
option-label="name"
:options="subdistrictOptions"
option-value="id"
:label="`${'แขวง/ตำบล '}`"
@update:model-value="(value:any) => selectSubDistrict(value)"
/>
:label="`${'แขวง/ตำบล'}`"
use-input
hide-selected
fill-input
@update:model-value="(value:string) => selectSubDistrict(value)"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'subdistrict'
)"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-italic text-grey">
ไมอม
</q-item-section>
</q-item>
</template></q-select
>
</div>
<div class="col-xs-6 col-sm-3 col-md-3">
<q-input

View file

@ -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);
},
},
]);

View file

@ -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">

View file

@ -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="ส่งรายชื่อไปยังหน่วยงาน"

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>