-
- {{ date2Thai(col.value) }}
-
-
- {{ typeChangeName(col.value) }}
-
-
+
{{ col.value }}
@@ -403,6 +682,192 @@ onMounted(async () => {
+
+
+
+
+
+
+
+
+
+
+
+ filterSelector(inputValue, doneFn,'statusOptions'
+ ) "
+ dense
+ />
+
+
+
+
+ filterSelector(inputValue, doneFn,'prefixOps'
+ ) "
+ />
+
+
+
+
+
+
+
+
+
+
(fileUpload = v[0])"
+ >
+
+
+
+ ลบทั้งหมด
+
+
+ ลบไฟล์ที่อัปโหลด
+
+
+
+
+ {{ "[ไฟล์ jpg,png,pdf,csv,doc,docx ขนาดไม่เกิน 10MB]" }}
+
+
+ {{ scope.uploadSizeLabel }} /
+ {{ scope.uploadProgressLabel }}
+
+
+
+
+ เลือกไฟล์
+
+
+ ยกเลิกการอัปโหลด
+
+
+
+
+
+ กรุณาอัพโหลดเอกสาร
+
+
+
+
+
+ {
+ if (!!fileUpload) {
+ alertUpload = false;
+ } else {
+ alertUpload = true;
+ }
+ }
+ "
+ >
+ บันทึกข้อมูล
+
+
+
+
+
diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/04_Family.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/04_Family.vue
index 5996edee9..797cdfcfe 100644
--- a/src/modules/04_registryNew/components/detail/PersonalInformation/04_Family.vue
+++ b/src/modules/04_registryNew/components/detail/PersonalInformation/04_Family.vue
@@ -7,7 +7,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { useRoute } from "vue-router";
import DialogHistory from "@/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyHistory.vue";
-
+import { useProfileDataStore } from "@/modules/04_registryNew/stores/profile";
const mixin = useCounterMixin();
const $q = useQuasar();
const {
@@ -20,6 +20,7 @@ const {
date2Thai,
} = mixin;
+const store = useProfileDataStore();
const route = useRoute();
const id = ref
(route.params.id.toString());
const dialog = ref(false);
@@ -64,7 +65,7 @@ const spouseData = reactive({
const rows = ref([]);
const historyRows = ref([]);
-
+const prefixFilter = ref([]);
const childrenData: any = reactive({
childrens: [],
});
@@ -233,8 +234,32 @@ function deleteChildren(items: any) {
}
onMounted(async () => {
+ if (
+ store.Ops.prefixOps.length === 0 ||
+ store.Ops.genderOps.length === 0 ||
+ store.Ops.bloodOps.length === 0 ||
+ store.Ops.statusOps.length === 0 ||
+ store.Ops.religionOps.length === 0
+ ) {
+ await fetchPerson();
+ }
+ prefixFilter.value = store.Ops.prefixOps;
await fetchData(id.value);
});
+
+function filterSelector(val: string, update: Function, refData: string) {
+ switch (refData) {
+ case "prefixOps":
+ update(() => {
+ store.Ops.prefixOps = prefixFilter.value.filter(
+ (v: any) => v.name.indexOf(val) > -1
+ );
+ });
+ break;
+ default:
+ break;
+ }
+}
@@ -504,12 +529,22 @@ onMounted(async () => {
outlined
bg-color="white"
lazy-rules
+ hidden-space
dense
- v-model="fatherData.prefix"
- :options="fatherData.optionPrefix"
:rules="[(val) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ']"
label="คำนำหน้าชื่อ"
- hidden-space
+ v-model="fatherData.prefix"
+ use-input
+ clearable
+ input-debounce="0"
+ emit-value
+ map-options
+ :options="store.Ops.prefixOps"
+ option-label="name"
+ option-value="name"
+ @filter="(inputValue:string,
+ doneFn:Function) => filterSelector(inputValue, doneFn,'prefixOps'
+ ) "
/>
@@ -625,10 +660,20 @@ onMounted(async () => {
lazy-rules
dense
v-model="motherData.prefix"
- :options="motherData.optionPrefix"
:rules="[(val) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ']"
label="คำนำหน้าชื่อ"
hidden-space
+ use-input
+ clearable
+ input-debounce="0"
+ emit-value
+ map-options
+ :options="store.Ops.prefixOps"
+ option-label="name"
+ option-value="name"
+ @filter="(inputValue:string,
+ doneFn:Function) => filterSelector(inputValue, doneFn,'prefixOps'
+ ) "
/>
@@ -744,10 +789,20 @@ onMounted(async () => {
lazy-rules
dense
v-model="spouseData.prefix"
- :options="spouseData.optionPrefix"
:rules="[(val) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ']"
label="คำนำหน้าชื่อ"
hidden-space
+ use-input
+ clearable
+ input-debounce="0"
+ emit-value
+ map-options
+ :options="store.Ops.prefixOps"
+ option-label="name"
+ option-value="name"
+ @filter="(inputValue:string,
+ doneFn:Function) => filterSelector(inputValue, doneFn,'prefixOps'
+ ) "
/>
@@ -857,8 +912,18 @@ onMounted(async () => {
bg-color="white"
v-model="items.childrenPrefix"
:rules="[(val) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ']"
- :options="childrenOptionPrefix"
label="คำนำหน้าชื่อ"
+ use-input
+ clearable
+ input-debounce="0"
+ emit-value
+ map-options
+ :options="store.Ops.prefixOps"
+ option-label="name"
+ option-value="name"
+ @filter="(inputValue:string,
+ doneFn:Function) => filterSelector(inputValue, doneFn,'prefixOps'
+ ) "
/>
diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue
index 63f7f0120..ec28c3f79 100644
--- a/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue
+++ b/src/modules/04_registryNew/components/detail/PersonalInformation/05_Education.vue
@@ -215,7 +215,8 @@ const educationOptionFilter = ref([
{ label: "ไม่ใช่", value: false },
]);
-let educationLevelOption: any = [];
+const educationLevelOption = ref([]);
+const educationLevelOptionFilter = ref([]);
const historyDialog = ref(false);
const educationData = reactive({
@@ -300,13 +301,20 @@ async function onSubmit() {
function filterSelector(val: string, update: Function, refData: string) {
switch (refData) {
- case "options":
+ case "educationOption":
update(() => {
educationOption.value = educationOptionFilter.value.filter(
(v: any) => v.label.indexOf(val) > -1
);
});
break;
+ case "educationLevelOption":
+ update(() => {
+ educationLevelOption.value = educationLevelOptionFilter.value.filter(
+ (v: any) => v.label.indexOf(val) > -1
+ );
+ });
+ break;
default:
break;
}
@@ -386,8 +394,12 @@ async function fetchEducationLevel() {
.get(config.API.orgEducationLevel)
.then(async (res) => {
res.data.result.map((r: any) => {
- educationLevelOption.push(r.name);
+ educationLevelOption.value.push({
+ value: r.id,
+ label: r.name,
+ });
});
+ educationLevelOptionFilter.value = educationLevelOption.value;
})
.catch((err) => {
messageError($q, err);
@@ -755,6 +767,8 @@ onMounted(async () => {
outlined
dense
emit-value
+ option-value="label"
+ option-label="label"
map-options
bg-color="white"
v-model="educationData.educationLevel"
@@ -762,7 +776,7 @@ onMounted(async () => {
input-debounce="0"
use-input
@filter="(inputValue:string,
- doneFn:Function) => filterSelector(inputValue, doneFn,'options'
+ doneFn:Function) => filterSelector(inputValue, doneFn,'educationLevelOption'
) "
:rules="[(val) => !!val || `${'กรุณาเลือกระดับการศึกษา'}`]"
label="ระดับการศึกษา"
@@ -1030,12 +1044,12 @@ onMounted(async () => {
bg-color="white"
v-model="educationData.isEducation"
:options="educationOption"
- option-value="value"
+ option-value="label"
option-label="label"
input-debounce="0"
use-input
@filter="(inputValue:string,
- doneFn:Function) => filterSelector(inputValue, doneFn,'options'
+ doneFn:Function) => filterSelector(inputValue, doneFn,'educationOption'
) "
:rules="[
(val) =>
diff --git a/src/modules/04_registryNew/stores/profile.ts b/src/modules/04_registryNew/stores/profile.ts
index 346861a80..195a099d0 100644
--- a/src/modules/04_registryNew/stores/profile.ts
+++ b/src/modules/04_registryNew/stores/profile.ts
@@ -114,7 +114,7 @@ export const useProfileDataStore = defineStore("profile", () => {
const fetchPerson = async () => {
showLoader();
await http
- .get(config.API.person)
+ .get(config.API.profileNewMetaMain)
.then((res) => {
const data = res.data.result;
let optionbloodGroups: DataOption[] = [];
@@ -144,22 +144,16 @@ export const useProfileDataStore = defineStore("profile", () => {
name: r.name.toString(),
});
});
- optionprefixs = optionprefixs.filter((o) =>
- prefixOp.value.find((p) => o.name === p)
- );
Ops.value.prefixOps = optionprefixs;
OpsFilter.value.prefixOps = optionprefixs;
let optionrank: DataOption[] = [];
- data.prefixs.map((r: any) => {
+ data.rank.map((r: any) => {
optionrank.push({
id: r.id.toString(),
name: r.name.toString(),
});
});
- optionrank = optionrank.filter(
- (o) => !prefixOp.value.find((p) => o.name === p)
- );
Ops.value.rankOps = optionrank;
OpsFilter.value.rankOps = optionrank;
diff --git a/src/modules/04_registryNew/views/list.vue b/src/modules/04_registryNew/views/list.vue
index f1272f89d..b155cd921 100644
--- a/src/modules/04_registryNew/views/list.vue
+++ b/src/modules/04_registryNew/views/list.vue
@@ -608,7 +608,7 @@ onMounted(async () => {
-