แก้ไขบัค
This commit is contained in:
parent
a2ac793131
commit
f9fac262ef
10 changed files with 174 additions and 152 deletions
|
|
@ -8,7 +8,6 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import type {
|
||||
Address,
|
||||
DataOption,
|
||||
zipCodeOption,
|
||||
} from "@/modules/05_placement/components/PersonalDetail/profileType";
|
||||
import { defaultAddress } from "@/modules/05_placement/components/PersonalDetail/profileType";
|
||||
|
|
@ -17,12 +16,12 @@ import type { RequestItemsHistoryObject } from "@/modules//05_placement/interfac
|
|||
import type { ResponseObject } from "@/modules//05_placement/interface/response/Address";
|
||||
import HistoryTable from "@/components/TableHistory.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import { AddressDataDefualt } from "@/modules//05_placement/interface/index/Main";
|
||||
|
||||
import type {
|
||||
AddressOps,
|
||||
Address as AddressType,
|
||||
optionData,
|
||||
} from "@/modules//05_placement/interface/index/Main";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { PropType } from "vue";
|
||||
|
|
@ -247,35 +246,35 @@ const filterSelector = (val: any, update: Function, refData: string) => {
|
|||
case "provinceOps":
|
||||
update(() => {
|
||||
Ops.value.provinceOps = OpsFilter.value.provinceOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
(v: optionData) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "districtOps":
|
||||
update(() => {
|
||||
Ops.value.districtOps = OpsFilter.value.districtOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
(v: optionData) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "districtCOps":
|
||||
update(() => {
|
||||
Ops.value.districtCOps = OpsFilter.value.districtCOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
(v: optionData) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "subdistrictOps":
|
||||
update(() => {
|
||||
Ops.value.subdistrictOps = OpsFilter.value.subdistrictOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
(v: optionData) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "subdistrictCOps":
|
||||
update(() => {
|
||||
Ops.value.subdistrictCOps = OpsFilter.value.subdistrictCOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
(v: optionData) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
|
|
@ -465,7 +464,7 @@ const fetchProvince = async () => {
|
|||
.get(config.API.province)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
let option: optionData[] = [];
|
||||
data.map((r: any) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
});
|
||||
|
|
@ -487,17 +486,17 @@ const fetchDistrict = async (id: string | null, position: string) => {
|
|||
.get(config.API.listDistrict(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
let option: optionData[] = [];
|
||||
data.map((r: any) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
});
|
||||
if (position == "1") {
|
||||
Ops.value.districtOps = option;
|
||||
OpsFilter.value.districtOps = option;
|
||||
} else {
|
||||
Ops.value.districtCOps = option;
|
||||
OpsFilter.value.districtCOps = option;
|
||||
}
|
||||
// if (position == "1") {
|
||||
// Ops.value.districtOps = option;
|
||||
// OpsFilter.value.districtOps = option;
|
||||
// } else {
|
||||
// Ops.value.districtCOps = option;
|
||||
// OpsFilter.value.districtCOps = option;
|
||||
// }
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
|
|||
|
|
@ -125,13 +125,13 @@ const fetchPrefix = async () => {
|
|||
};
|
||||
|
||||
const addChildren = async () => {
|
||||
familyData.value.childrens.push({
|
||||
id: `${familyData.value.childrens.length + 1}`,
|
||||
childrenPrefixId: "",
|
||||
childrenFirstName: "",
|
||||
childrenLastName: "",
|
||||
childrenCareer: "",
|
||||
});
|
||||
// familyData.value.childrens.push({
|
||||
// id: `${familyData.value.childrens.length + 1}`,
|
||||
// childrenPrefixId: "",
|
||||
// childrenFirstName: "",
|
||||
// childrenLastName: "",
|
||||
// childrenCareer: "",
|
||||
// });
|
||||
|
||||
familyData.value.childrens.sort(
|
||||
(a: childrenFamily, b: childrenFamily) => Number(b.id) - Number(a.id)
|
||||
|
|
@ -154,26 +154,26 @@ const fetchHistory = async () => {
|
|||
.then((res) => {
|
||||
const data: ResponseObject[] = res.data.result;
|
||||
data.map((row: ResponseObject) => {
|
||||
const arrayData: ResponseHistory = {
|
||||
couple: row.couple ? "1" : "0",
|
||||
couplePrefixId: row.couplePrefixId,
|
||||
coupleFirstName: row.coupleFirstName,
|
||||
coupleLastName: row.coupleLastName,
|
||||
coupleLastNameOld: row.coupleLastNameOld,
|
||||
coupleCareer: row.coupleCareer,
|
||||
fatherPrefixId: row.fatherPrefixId,
|
||||
fatherFirstName: row.fatherFirstName,
|
||||
fatherLastName: row.fatherLastName,
|
||||
fatherCareer: row.fatherCareer,
|
||||
motherPrefixId: row.motherPrefixId,
|
||||
motherFirstName: row.motherFirstName,
|
||||
motherLastName: row.motherLastName,
|
||||
motherCareer: row.motherCareer,
|
||||
childrens: row.childrens,
|
||||
createdFullName: row.createdFullName,
|
||||
createdAt: new Date(row.createdAt),
|
||||
};
|
||||
familyDataHistory.value.push(arrayData);
|
||||
// const arrayData: ResponseHistory = {
|
||||
// couple: row.couple ? "1" : "0",
|
||||
// couplePrefixId: row.couplePrefixId,
|
||||
// coupleFirstName: row.coupleFirstName,
|
||||
// coupleLastName: row.coupleLastName,
|
||||
// coupleLastNameOld: row.coupleLastNameOld,
|
||||
// coupleCareer: row.coupleCareer,
|
||||
// fatherPrefixId: row.fatherPrefixId,
|
||||
// fatherFirstName: row.fatherFirstName,
|
||||
// fatherLastName: row.fatherLastName,
|
||||
// fatherCareer: row.fatherCareer,
|
||||
// motherPrefixId: row.motherPrefixId,
|
||||
// motherFirstName: row.motherFirstName,
|
||||
// motherLastName: row.motherLastName,
|
||||
// motherCareer: row.motherCareer,
|
||||
// childrens: row.childrens,
|
||||
// createdFullName: row.createdFullName,
|
||||
// createdAt: new Date(row.createdAt),
|
||||
// };
|
||||
// familyDataHistory.value.push(arrayData);
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@ import type {
|
|||
} from "@/modules/05_placement/components/PersonalDetail/profileType";
|
||||
import { defaultInformation } from "@/modules/05_placement/components/PersonalDetail/profileType";
|
||||
|
||||
import type { InformationOps } from "@/modules/05_placement/interface/index/Main";
|
||||
import type {
|
||||
InformationOps,
|
||||
optionData,
|
||||
} from "@/modules/05_placement/interface/index/Main";
|
||||
import HeaderTop from "@/modules/05_placement/components/PersonalDetail/Information/top.vue";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -111,51 +114,52 @@ const fetchPerson = async () => {
|
|||
.get(config.API.person)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let optionbloodGroups: DataOption[] = [];
|
||||
let optionbloodGroups: optionData[] = [];
|
||||
console.log(data);
|
||||
data.bloodGroups.map((r: any) => {
|
||||
optionbloodGroups.push({
|
||||
id: r.id.toString(),
|
||||
name: r.name.toString(),
|
||||
id: r.id ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.bloodOps = optionbloodGroups;
|
||||
OpsFilter.value.bloodOps = optionbloodGroups;
|
||||
|
||||
let optiongenders: DataOption[] = [];
|
||||
let optiongenders: optionData[] = [];
|
||||
data.genders.map((r: any) => {
|
||||
optiongenders.push({
|
||||
id: r.id.toString(),
|
||||
name: r.name.toString(),
|
||||
id: r.id ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.genderOps = optiongenders;
|
||||
OpsFilter.value.genderOps = optiongenders;
|
||||
|
||||
let optionprefixs: DataOption[] = [];
|
||||
let optionprefixs: optionData[] = [];
|
||||
data.prefixs.map((r: any) => {
|
||||
optionprefixs.push({
|
||||
id: r.id.toString(),
|
||||
name: r.name.toString(),
|
||||
id: r.id ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.prefixOps = optionprefixs;
|
||||
OpsFilter.value.prefixOps = optionprefixs;
|
||||
|
||||
let optionrelationships: DataOption[] = [];
|
||||
let optionrelationships: optionData[] = [];
|
||||
data.relationships.map((r: any) => {
|
||||
optionrelationships.push({
|
||||
id: r.id.toString(),
|
||||
name: r.name.toString(),
|
||||
id: r.id ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.statusOps = optionrelationships;
|
||||
OpsFilter.value.statusOps = optionrelationships;
|
||||
|
||||
let optionreligions: DataOption[] = [];
|
||||
let optionreligions: optionData[] = [];
|
||||
data.religions.map((r: any) => {
|
||||
optionreligions.push({
|
||||
id: r.id.toString(),
|
||||
name: r.name.toString(),
|
||||
id: r.id ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.religionOps = optionreligions;
|
||||
|
|
@ -438,7 +442,11 @@ const getClass = (val: boolean) => {
|
|||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
:model-value="date2Thai(informaData.dateOfBirth)"
|
||||
:model-value="
|
||||
informaData.dateOfBirth
|
||||
? date2Thai(informaData.dateOfBirth)
|
||||
: ''
|
||||
"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก วัน/เดือน/ปี เกิด'}`]"
|
||||
:label="`${'วัน/เดือน/ปี เกิด'}`"
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue