diff --git a/src/modules/03_recruiting/views/03_editor/index.vue b/src/modules/03_recruiting/views/03_editor/index.vue index 861574658..bfe9a11b6 100644 --- a/src/modules/03_recruiting/views/03_editor/index.vue +++ b/src/modules/03_recruiting/views/03_editor/index.vue @@ -59,8 +59,11 @@ const qeditor = ref(""); const title = ref(""); const filter = ref(""); //search data table const filterAgency = ref(""); //search data table +const provinceOptionsMain = ref([]); const provinceOptions = ref([]); +const districtOptionsMain = ref([]); const districtOptions = ref([]); +const subdistrictOptionsMain = ref([]); const subdistrictOptions = ref([]); const cmsGoverment = ref([]); const cmsAgency = ref([]); @@ -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' + )" + > + +
{ :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' + )" + > + +
{ 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' + )" + > +
('filterKeyword2',{required:true}) -const rows = defineModel('rows',{required:true}) -const rowsData = defineModel('rowsData',{required:true}) +const filterKeyword2 = defineModel("filterKeyword2", { + required: true, +}); +const rows = defineModel("rows", { required: true }); +const rowsData = defineModel("rowsData", { required: true }); const selected = ref([]); //ราชชื่อที่เลือกส่งไปออกคำสั่ง const dataMapToSend = computed(() => { @@ -109,6 +111,9 @@ const columns2 = ref([ 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([ field: "dateOfBirth", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return date2Thai(row.dateOfBirth); + }, }, ]); diff --git a/src/modules/05_placement/components/AppointMent/DialogOrders.vue b/src/modules/05_placement/components/AppointMent/DialogOrders.vue index 0f14c409d..fa4dd5882 100644 --- a/src/modules/05_placement/components/AppointMent/DialogOrders.vue +++ b/src/modules/05_placement/components/AppointMent/DialogOrders.vue @@ -110,6 +110,9 @@ const columns2 = ref([ 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([ 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)" > +
{{ props.rowIndex + 1 }}
@@ -341,13 +347,7 @@ watch( props.row.status ? statusText(props.row.status) : "-" }}
-
- {{ - props.row.dateOfBirth - ? date2Thai(props.row.dateOfBirth) - : "-" - }} -
+
diff --git a/src/modules/05_placement/components/PersonalList/Table.vue b/src/modules/05_placement/components/PersonalList/Table.vue index 8edc839c8..71db2219c 100644 --- a/src/modules/05_placement/components/PersonalList/Table.vue +++ b/src/modules/05_placement/components/PersonalList/Table.vue @@ -1402,7 +1402,7 @@ onMounted(async () => { - + ([ 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([ 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([ 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([ 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([ 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([ @@ -182,7 +198,7 @@ watchEffect(() => {