แก้ไขบัค

This commit is contained in:
Thanit Konmek 2023-07-13 10:50:12 +07:00
parent a2ac793131
commit f9fac262ef
10 changed files with 174 additions and 152 deletions

View file

@ -1,6 +1,11 @@
<template>
<Information :notiNoEdit="notiNoEdit" v-model:statusEdit="statusEdit" />
<Government :notiNoEdit="notiNoEdit" v-model:statusEdit="statusEdit" />
<Government
:notiNoEdit="notiNoEdit"
v-model:statusEdit="statusEdit"
profileType="profileType"
employeeClass="employeeClass"
/>
<Address :notiNoEdit="notiNoEdit" v-model:statusEdit="statusEdit" />
<Family :notiNoEdit="notiNoEdit" v-model:statusEdit="statusEdit" />
<!-- <Certicate v-model:statusEdit="statusEdit" :profileType="profileType" /> -->

View file

@ -135,17 +135,17 @@ const fetchPlacementData = async (val: number) => {
// rows.value = DataStore.DataMainOrig;
DataStore.DataMainOrig.map((e: any) => {
rows.value.push({
examRound: e.examRound,
examOrder: e.examOrder,
examTypeName: e.examTypeName,
examTypeValue: e.examTypeValue,
accountEndDate: date2Thai(e.accountEndDate),
accountExpirationDate: date2Thai(e.accountExpirationDate),
accountStartDate: date2Thai(e.accountStartDate),
fiscalYear: e.fiscalYear,
numberOfCandidates: e.numberOfCandidates,
});
// rows.value.push({
// examRound: e.examRound,
// examOrder: e.examOrder,
// examTypeName: e.examTypeName,
// examTypeValue: e.examTypeValue,
// accountEndDate: date2Thai(e.accountEndDate),
// accountExpirationDate: date2Thai(e.accountExpirationDate),
// accountStartDate: date2Thai(e.accountStartDate),
// fiscalYear: e.fiscalYear,
// numberOfCandidates: e.numberOfCandidates,
// });
});
examTypeFilter();
@ -244,17 +244,17 @@ const searchFilterTable = async () => {
);
// rows.value = DataStore.DataMainUpdate;
DataStore.DataMainUpdate.map((e: any) => {
rows.value.push({
examRound: e.examRound,
examOrder: e.examOrder,
examTypeName: e.examTypeName,
examTypeValue: e.examTypeValue,
accountEndDate: date2Thai(e.accountEndDate),
accountExpirationDate: date2Thai(e.accountExpirationDate),
accountStartDate: date2Thai(e.accountStartDate),
fiscalYear: e.fiscalYear,
numberOfCandidates: e.numberOfCandidates,
});
// rows.value.push({
// examRound: e.examRound,
// examOrder: e.examOrder,
// examTypeName: e.examTypeName,
// examTypeValue: e.examTypeValue,
// accountEndDate: date2Thai(e.accountEndDate),
// accountExpirationDate: date2Thai(e.accountExpirationDate),
// accountStartDate: date2Thai(e.accountStartDate),
// fiscalYear: e.fiscalYear,
// numberOfCandidates: e.numberOfCandidates,
// });
});
}
};

View file

@ -616,7 +616,7 @@ const fiscalYearFilter = async () => {
};
const OrderType = ref<string>("");
const OrderTypeOption = reactive<DataOption[]>([{ id: "", name: "ทั้งหมด" }]);
const OrderTypeOption = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
const addedOrderTypeValues: string[] = [];
const OrderTypeFilter = async () => {
// API
@ -640,7 +640,8 @@ const OrderTypeFilter = async () => {
// }
if (!addedOrderTypeValues.includes(OrderTypeValue)) {
OrderTypeOption.push({
id: OrderTypeValue,
// id: OrderTypeValue ?? 0,
id: OrderTypeOption.length,
name: OrderTypeValue,
});
addedOrderTypeValues.push(OrderTypeValue);
@ -658,7 +659,7 @@ const OrderStatus = ref<string>("");
const OrderStatusText = ref<FormOrderPlacementMainData[]>(
DataStore.DataMainOrigOrder
);
const OrderStatusOption = reactive<DataOption[]>([{ id: "", name: "ทั้งหมด" }]);
const OrderStatusOption = reactive<DataOption[]>([{ id: 1, name: "ทั้งหมด" }]);
const addedOrderStatusValues: string[] = [];
const OrderStatusFilter = async () => {
// API
@ -686,7 +687,8 @@ const OrderStatusFilter = async () => {
if (!addedOrderStatusValues.includes(OrderStatusValue)) {
OrderStatusOption.push({
id: OrderStatusValue,
// id: OrderStatusValue,
id: OrderStatusOption.length,
name: OrderStatusValue,
});
addedOrderStatusValues.push(OrderStatusValue);

View file

@ -449,14 +449,14 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
case "typeOrderOption":
update(() => {
typeOrderOption.value = typeOrderOptionFilter.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: DataOption) => v.name!.indexOf(val) > -1
);
});
break;
case "byOrderOption":
update(() => {
byOrderOption.value = byOrderOptionFilter.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: DataOption) => v.name!.indexOf(val) > -1
);
});
break;
@ -464,7 +464,7 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
case "registerOption":
update(() => {
registerOption.value = registerOptionFilter.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: DataOption) => v.name!.indexOf(val) > -1
);
});
break;
@ -472,7 +472,7 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
case "announceOption":
update(() => {
announceOption.value = announceOptionFilter.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: DataOption) => v.name!.indexOf(val) > -1
);
});
break;
@ -480,14 +480,14 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
case "positionOption":
update(() => {
positionOption.value = positionOptionFilter.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: DataOption) => v.name!.indexOf(val) > -1
);
});
break;
case "testOption":
update(() => {
testOption.value = testOptionFilter.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: DataOption) => v.name!.indexOf(val) > -1
);
});
break;

View file

@ -23,7 +23,7 @@ import type {
Education,
Family,
Address,
} from "@/modules/05_placement/interface/index/Main.ts";
} from "@/modules/05_placement/interface/index/Main";
import type { Information } from "@/modules/05_placement/components/PersonalDetail/profileType";

View file

@ -20,6 +20,7 @@ import type {
EduOps,
Education,
DataOption,
optionData,
} from "@/modules/05_placement/interface/index/Main";
import type { QTableProps } from "quasar";
import type { PropType } from "vue";
@ -482,8 +483,8 @@ const fetchLevel = async () => {
.get(config.API.educationLevel)
.then((res) => {
const data = res.data.result;
let option: DataOption[] = [];
data.map((r: DataOption) => {
let option: optionData[] = [];
data.map((r: optionData) => {
option.push({ id: r.id.toString(), name: r.name.toString() });
});
Ops.value.levelOptions = option;
@ -503,8 +504,8 @@ const fetchPositionPath = async () => {
.get(config.API.positionPath)
.then((res) => {
const data = res.data.result;
let option: DataOption[] = [];
data.map((r: DataOption) => {
let option: optionData[] = [];
data.map((r: optionData) => {
option.push({ id: r.id.toString(), name: r.name.toString() });
});
Ops.value.positionPathOptions = option;
@ -523,7 +524,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
case "levelOptions":
update(() => {
Ops.value.levelOptions = OpsFilter.value.levelOptions.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: optionData) => v.name.indexOf(val) > -1
);
});
break;
@ -531,7 +532,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
update(() => {
Ops.value.positionPathOptions =
OpsFilter.value.positionPathOptions.filter(
(v: DataOption) => v.name.indexOf(val) > -1
(v: optionData) => v.name.indexOf(val) > -1
);
});
break;
@ -548,27 +549,27 @@ const fetchData = async () => {
let data = res.data.result;
rows.value = [];
data.map((e: ResponseObject) => {
rows.value.push({
id: e.id,
level: e.educationLevel,
levelId: e.educationLevelId,
positionPath: e.positionPath,
positionPathId: e.positionPathId,
institute: e.institute,
degree: e.degree,
field: e.field,
gpa: e.gpa,
country: e.country,
duration: e.duration,
durationYear: e.durationYear,
other: e.other,
fundName: e.fundName,
finishDate: new Date(e.finishDate),
startDate: new Date(e.startDate).getFullYear(),
endDate: new Date(e.endDate).getFullYear(),
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
});
// rows.value.push({
// id: e.id,
// level: e.educationLevel,
// levelId: e.educationLevelId,
// positionPath: e.positionPath,
// positionPathId: e.positionPathId,
// institute: e.institute,
// degree: e.degree,
// field: e.field,
// gpa: e.gpa,
// country: e.country,
// duration: e.duration,
// durationYear: e.durationYear,
// other: e.other,
// fundName: e.fundName,
// finishDate: new Date(e.finishDate),
// startDate: new Date(e.startDate).getFullYear(),
// endDate: new Date(e.endDate).getFullYear(),
// createdFullName: e.createdFullName,
// createdAt: new Date(e.createdAt),
// });
});
})
.catch((e) => {
@ -603,22 +604,22 @@ const clickNext = async () => {
* กดดอมลตอไป
*/
const getData = () => {
const row = rows.value[rowIndex.value];
levelId.value = row.levelId;
positionPathId.value = row.positionPathId;
institute.value = row.institute;
degree.value = row.degree;
field.value = row.field;
gpa.value = row.gpa;
country.value = row.country;
duration.value = row.duration;
durationYear.value = row.durationYear;
other.value = row.other;
fundName.value = row.fundName;
finishDate.value = row.finishDate;
startDate.value = row.startDate;
endDate.value = row.endDate;
id.value = row.id;
// const row = rows.value[rowIndex.value];
// levelId.value = row.levelId;
// positionPathId.value = row.positionPathId;
// institute.value = row.institute;
// degree.value = row.degree;
// field.value = row.field;
// gpa.value = row.gpa;
// country.value = row.country;
// duration.value = row.duration;
// durationYear.value = row.durationYear;
// other.value = row.other;
// fundName.value = row.fundName;
// finishDate.value = row.finishDate;
// startDate.value = row.startDate;
// endDate.value = row.endDate;
// id.value = row.id;
};
/**

View file

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

View file

@ -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) => {

View file

@ -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="`${'วัน/เดือน/ปี เกิด'}`"
>

View file

@ -1,7 +1,7 @@
import type { zipCodeOption } from "../../components/PersonalDetail/profileType";
interface DataOption {
id: number | null;
name: string | null;
id: number;
name: string;
disable?: boolean;
}
interface DataOption1 {
@ -15,25 +15,30 @@ interface DataOptionInsignia {
typeName: string;
}
interface optionData {
id: string;
name: string;
}
interface EduOps {
levelOptions: DataOption[];
positionPathOptions: DataOption[];
levelOptions: optionData[];
positionPathOptions: optionData[];
}
interface InformationOps {
prefixOps: DataOption[];
genderOps: DataOption[];
bloodOps: DataOption[];
statusOps: DataOption[];
religionOps: DataOption[];
employeeClassOps: DataOption[];
employeeTypeOps: DataOption[];
prefixOps: optionData[];
genderOps: optionData[];
bloodOps: optionData[];
statusOps: optionData[];
religionOps: optionData[];
employeeClassOps: optionData[];
employeeTypeOps: optionData[];
}
interface AddressOps {
provinceOps: DataOption[];
districtOps: DataOption[];
districtCOps: DataOption[];
provinceOps: optionData[];
districtOps: optionData[];
districtCOps: optionData[];
subdistrictOps: zipCodeOption[];
subdistrictCOps: zipCodeOption[];
}
@ -167,5 +172,7 @@ export type {
Education,
Family,
Address,
AddressDataDefualt,
optionData,
};
export { AddressDataDefualt };