Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into me

This commit is contained in:
Thanit Konmek 2023-07-13 09:46:47 +07:00
commit a2ac793131
2 changed files with 45 additions and 13 deletions

View file

@ -1,5 +1,5 @@
import env from "../index"; import env from "../index";
const placement = `${env.API_URI}/Placement/placement`; const placement = `${env.API_PLACEMENT_URI}/Placement/placement`;
const orgTree = `${env.API_URI_ORG_TREE}`; const orgTree = `${env.API_URI_ORG_TREE}`;
export default { export default {
@ -18,29 +18,30 @@ export default {
//personal //personal
placementPersonalId: (personalId: string) => placementPersonalId: (personalId: string) =>
`${placement}personal/${personalId}`, `${placement}/personal/${personalId}`,
//personal //personal
placementPropertyId: (personalId: string) => placementPropertyId: (personalId: string) =>
`${placement}property/${personalId}`, `${placement}/property/${personalId}`,
//information //information
placementInformationId: (personalId: string) => placementInformationId: (personalId: string) =>
`${placement}information/${personalId}`, `${placement}/information/${personalId}`,
//address //address
placementAddressId: (personalId: string) => placementAddressId: (personalId: string) =>
`${placement}address/${personalId}`, `${placement}/address/${personalId}`,
//family //family
placementFamilyId: (personalId: string) => `${placement}family/${personalId}`, placementFamilyId: (personalId: string) =>
`${placement}/family/${personalId}`,
//certificate //certificate
placementCertId: (personalId: string) => placementCertId: (personalId: string) =>
`${placement}certificate/${personalId}`, `${placement}/certificate/${personalId}`,
placementCertDetailId: (personalId: string, certificateId: string) => placementCertDetailId: (personalId: string, certificateId: string) =>
`${placement}certificate/${personalId}/${certificateId}`, `${placement}/certificate/${personalId}/${certificateId}`,
//education //education
placementEducationId: (id: string) => `${placement}education/${id}`, placementEducationId: (id: string) => `${placement}/education/${id}`,
}; };

View file

@ -125,12 +125,29 @@ onMounted(async () => {
}); });
const fetchPlacementData = async (val: number) => { const fetchPlacementData = async (val: number) => {
showLoader(); showLoader();
rows.value = [];
http http
.get(config.API.MainDetail(val)) .get(config.API.MainDetail(val))
.then((res) => { .then((res) => {
dataPlacement.value = res.data.result; dataPlacement.value = res.data.result;
DataStore.DataMainOrig = dataPlacement.value; DataStore.DataMainOrig = dataPlacement.value;
rows.value = DataStore.DataMainOrig; console.log(DataStore.DataMainOrig);
// 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,
});
});
examTypeFilter(); examTypeFilter();
examTimeFilter(); examTimeFilter();
expiredAccountFilter(); expiredAccountFilter();
@ -218,13 +235,27 @@ const examTypeFilter = () => {
}; };
//--------------||--------------------------------------// //--------------||--------------------------------------//
const searchFilterTable = async () => { const searchFilterTable = async () => {
rows.value = [];
if (examType.value !== undefined && examType.value !== null) { if (examType.value !== undefined && examType.value !== null) {
await DataStore.DataUpdateMain( await DataStore.DataUpdateMain(
examTime.value, examTime.value,
examType.value, examType.value,
expiredAccount.value expiredAccount.value
); );
rows.value = DataStore.DataMainUpdate; // 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,
});
});
} }
}; };
@ -416,10 +447,10 @@ const paginationLabel = (start: number, end: number, total: number) => {
{{ props.row.examTypeName }} {{ props.row.examTypeName }}
</q-td> </q-td>
<q-td key="accountStartDate" :props="props"> <q-td key="accountStartDate" :props="props">
{{ date2Thai(props.row.accountStartDate) }} {{ props.row.accountStartDate }}
</q-td> </q-td>
<q-td key="accountExpirationDate" :props="props"> <q-td key="accountExpirationDate" :props="props">
{{ date2Thai(props.row.accountExpirationDate) }} {{ props.row.accountExpirationDate }}
</q-td> </q-td>
</q-tr> </q-tr>
</template> </template>