Merge branch 'develop' into dev-tee

This commit is contained in:
setthawutttty 2023-08-04 10:09:16 +07:00
commit ed9de52200
220 changed files with 31355 additions and 3925 deletions

View file

@ -121,7 +121,8 @@
color="red"
@click="cancelClick()"
label="ยกเลิกแก้ไข"
> <!-- icon="mdi-undo"
>
<!-- icon="mdi-undo"
<q-tooltip>ยกเล</q-tooltip> -->
</q-btn>
<q-btn
@ -130,7 +131,8 @@
color="red"
@click="deleteClick()"
label="ลบวันหยุด"
> <!-- icon="mdi-delete"
>
<!-- icon="mdi-delete"
<q-tooltip>ลบ</q-tooltip> -->
</q-btn>
<q-btn
@ -215,7 +217,6 @@ import type {
DataDateRowObject,
DataDateAddObject,
} from "@/modules/01_metadata/interface/request/Calendar";
import { useDataStore } from "@/stores/data";
const props = defineProps({
dateYear: {
@ -240,8 +241,6 @@ const props = defineProps({
},
});
const store = useDataStore();
const { loaderPage } = store;
const mixin = useCounterMixin(); //
const { success, dateToISO, date2Thai, messageError, showLoader, hideLoader } =
mixin;

View file

@ -156,13 +156,8 @@
</q-card-section>
<q-separator />
<q-card-actions align="right" class="text-primary">
<q-btn
unelevated
label="บันทึก"
color="public"
type="submit"
> <!-- icon="mdi-content-save-outline"
<q-btn unelevated label="บันทึก" color="public" type="submit">
<!-- icon="mdi-content-save-outline"
<q-tooltip>นท</q-tooltip> -->
</q-btn>
</q-card-actions>
@ -221,7 +216,6 @@ import type {
DataDateListsObject,
TabsObject,
} from "@/modules/01_metadata/interface/request/Calendar";
import { useDataStore } from "@/stores/data";
const props = defineProps({
dateYear: {
@ -241,8 +235,6 @@ const props = defineProps({
},
});
const store = useDataStore();
const { loaderPage } = store;
const mixin = useCounterMixin(); //
const {
success,

View file

@ -289,7 +289,6 @@ import type {
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/insignia/Insignia";
import type { DataOption } from "@/modules/01_metadata/interface/index/Main";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -298,8 +297,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -190,7 +190,6 @@ import type {
} from "@/modules/01_metadata/interface/request/insignia/InsigniaType";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/insignia/InsigniaType";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -199,8 +198,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -190,7 +190,6 @@ import type {
} from "@/modules/01_metadata/interface/request/organization/Agency";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/Agency";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -199,8 +198,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -190,7 +190,6 @@ import type {
} from "@/modules/01_metadata/interface/request/organization/Fax";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/Fax";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -199,8 +198,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -190,7 +190,6 @@ import type {
} from "@/modules/01_metadata/interface/request/organization/GovernmentAgency";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/GovernmentAgency";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -199,8 +198,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -190,7 +190,6 @@ import type {
} from "@/modules/01_metadata/interface/request/organization/Level";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/Level";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -199,8 +198,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -202,7 +202,6 @@ import type {
} from "@/modules/01_metadata/interface/request/organization/Organization";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/Organization";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -211,8 +210,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -243,7 +243,6 @@ import type {
} from "@/modules/01_metadata/interface/request/organization/ShortName";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/ShortName";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -252,8 +251,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -190,7 +190,6 @@ import type {
} from "@/modules/01_metadata/interface/request/organization/Status";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/Status";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -199,8 +198,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -190,7 +190,6 @@ import type {
} from "@/modules/01_metadata/interface/request/organization/TelExternal";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/TelExternal";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -199,8 +198,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -190,7 +190,6 @@ import type {
} from "@/modules/01_metadata/interface/request/organization/TelInternal";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/TelInternal";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -199,8 +198,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -190,7 +190,6 @@ import type {
} from "@/modules/01_metadata/interface/request/organization/Type";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/organization/Type";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -199,8 +198,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -194,7 +194,6 @@ import type {
} from "@/modules/01_metadata/interface/request/person/Blood";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/Blood";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -203,8 +202,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -13,25 +13,20 @@
>
<q-tooltip>กล</q-tooltip>
</q-btn>
<div class="text-h6 text-dark text-weight-bold">การจดการขอมลเขต</div>
<q-space />
<q-breadcrumbs class="text-grey" active-color="blue">
<template v-slot:separator>
<q-icon
size="1.2em"
name="chevron_right"
color="blue"
/>
<q-icon size="1.2em" name="chevron_right" color="blue" />
</template>
<q-breadcrumbs-el to="/metadata" label="การจัดการข้อมูลจังหวัด" />
<q-breadcrumbs-el to="/metadata" label="การจัดการข้อมูลจังหวัด" />
<q-breadcrumbs-el label="การจัดการข้อมูลเขต" />
</q-breadcrumbs>
</div>
<q-form ref="myForm">
<q-card flat bordered class=" row col-12">
<q-card flat bordered class="row col-12">
<div class="col-xs-12">
<div class="q-mt-sm">
<data-table
@ -247,14 +242,13 @@ import type {
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/District";
import HistoryTable from "@/components/TableHistory.vue";
import { useRoute, useRouter } from "vue-router";
import { useDataStore } from "@/stores/data";
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();
const dataStore = useDataStore();
const { manageData, changeManageColumns, changeManageCurrentTab } = store;
const { loaderPage } = dataStore; // load api
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history

View file

@ -191,7 +191,6 @@ import type {
} from "@/modules/01_metadata/interface/request/person/Education";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/Education";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -200,8 +199,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -191,7 +191,6 @@ import type {
} from "@/modules/01_metadata/interface/request/person/Gender";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/Gender";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -200,8 +199,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -191,7 +191,6 @@ import type {
} from "@/modules/01_metadata/interface/request/person/Prefix";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/Prefix";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -200,8 +199,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -204,7 +204,7 @@ import type {
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/Province";
import HistoryTable from "@/components/TableHistory.vue";
import { useRouter } from "vue-router";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
type: Function,
@ -212,8 +212,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore; // load api
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -191,7 +191,6 @@ import type {
} from "@/modules/01_metadata/interface/request/person/Relationship";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/Relationship";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -200,8 +199,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -191,7 +191,6 @@ import type {
} from "@/modules/01_metadata/interface/request/person/Religion";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/Religion";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -200,8 +199,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -14,19 +14,21 @@
<q-tooltip>กล</q-tooltip>
</q-btn>
<div class="text-h6 text-dark text-weight-bold">การจดการขอมลแขวง/ตำบล</div>
<div class="text-h6 text-dark text-weight-bold">
การจดการขอมลแขวง/ตำบล
</div>
<q-space />
<q-breadcrumbs class="text-grey" active-color="blue">
<template v-slot:separator>
<q-icon
size="1.2em"
name="chevron_right"
color="blue"
/>
<q-icon size="1.2em" name="chevron_right" color="blue" />
</template>
<q-breadcrumbs-el to="/metadata" label="การจัดการข้อมูลจังหวัด" />
<q-breadcrumbs-el @click="goToProvince()" class="cursor-pointer" label="การจัดการข้อมูลเขต" />
<q-breadcrumbs-el to="/metadata" label="การจัดการข้อมูลจังหวัด" />
<q-breadcrumbs-el
@click="goToProvince()"
class="cursor-pointer"
label="การจัดการข้อมูลเขต"
/>
<q-breadcrumbs-el label="การจัดการข้อมูลแขวง/ตำบล" />
</q-breadcrumbs>
</div>
@ -254,14 +256,13 @@ import type {
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/person/SubDistrict";
import HistoryTable from "@/components/TableHistory.vue";
import { useRoute, useRouter } from "vue-router";
import { useDataStore } from "@/stores/data";
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();
const dataStore = useDataStore();
const { manageData, changeManageColumns, changeManageCurrentTab } = store;
const { loaderPage } = dataStore; // load api
const rows = ref<RequestItemsHistoryObject[]>([]); //list data table
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
const rawHistory = ref<RequestItemsHistoryObject[]>([]); //raw data history

View file

@ -191,7 +191,6 @@ import type {
} from "@/modules/01_metadata/interface/request/position/Executive";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/Executive";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -200,8 +199,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -203,7 +203,6 @@ import type {
} from "@/modules/01_metadata/interface/request/position/ExecutiveSide";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/ExecutiveSide";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -212,8 +211,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -254,7 +254,6 @@ import type {
} from "@/modules/01_metadata/interface/request/position/Level";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/Level";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -263,8 +262,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -191,7 +191,6 @@ import type {
} from "@/modules/01_metadata/interface/request/position/Line";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/Line";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -200,8 +199,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -203,7 +203,6 @@ import type {
} from "@/modules/01_metadata/interface/request/position/Path";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/Path";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -212,8 +211,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -203,7 +203,6 @@ import type {
} from "@/modules/01_metadata/interface/request/position/PathSide";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/PathSide";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -212,8 +211,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -191,7 +191,6 @@ import type {
} from "@/modules/01_metadata/interface/request/position/Status";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/Status";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -200,8 +199,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -191,7 +191,6 @@ import type {
} from "@/modules/01_metadata/interface/request/position/Type";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/position/Type";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -200,8 +199,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -190,7 +190,6 @@ import type {
} from "@/modules/01_metadata/interface/request/positionEmployee/Group";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/positionEmployee/Group";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -199,8 +198,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -190,7 +190,6 @@ import type {
} from "@/modules/01_metadata/interface/request/positionEmployee/Level";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/positionEmployee/Level";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -199,8 +198,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -190,7 +190,6 @@ import type {
} from "@/modules/01_metadata/interface/request/positionEmployee/Line";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/positionEmployee/Line";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -199,8 +198,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -202,7 +202,6 @@ import type {
} from "@/modules/01_metadata/interface/request/positionEmployee/Position";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/positionEmployee/Position";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -211,8 +210,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -202,7 +202,6 @@ import type {
} from "@/modules/01_metadata/interface/request/positionEmployee/PositionSide";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/positionEmployee/PositionSide";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -211,8 +210,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -190,7 +190,6 @@ import type {
} from "@/modules/01_metadata/interface/request/positionEmployee/Status";
import type { ResponseHistoryObject } from "@/modules/01_metadata/interface/response/positionEmployee/Status";
import HistoryTable from "@/components/TableHistory.vue";
import { useDataStore } from "@/stores/data";
const props = defineProps({
fetchDataComponent: {
@ -199,8 +198,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateText, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();

View file

@ -396,7 +396,6 @@ import insigniaType from "@/modules/01_metadata/components/insignia/InsigniaType
import { useCounterMixin } from "@/stores/mixin";
import { useManageDataStore } from "@/modules/01_metadata/store";
import { useDataStore } from "@/stores/data";
import type {
DataSumCalendarObject,
@ -409,8 +408,6 @@ const $q = useQuasar();
const mixin = useCounterMixin(); //
const { genColor15, messageError, showLoader, hideLoader } = mixin;
const store = useManageDataStore();
const dataStore = useDataStore();
const { loaderPage } = dataStore; // load api
const visible = ref(true); // card
const link = ref<number>(store.manageData.link); // tab

View file

@ -217,12 +217,8 @@
</q-card-section>
<q-separator />
<q-card-actions align="right" class="text-primary">
<q-btn
unelevated
label="บันทึก"
color="public"
type="submit"
> <!-- icon="mdi-content-save-outline"
<q-btn unelevated label="บันทึก" color="public" type="submit">
<!-- icon="mdi-content-save-outline"
<q-tooltip>นท</q-tooltip> -->
</q-btn>
</q-card-actions>
@ -314,12 +310,8 @@
</q-card-section>
<q-separator />
<q-card-actions align="right" class="text-primary">
<q-btn
unelevated
label="บันทึก"
color="public"
type="submit"
> <!-- icon="mdi-content-save-outline"
<q-btn unelevated label="บันทึก" color="public" type="submit">
<!-- icon="mdi-content-save-outline"
<q-tooltip>นท</q-tooltip> -->
</q-btn>
</q-card-actions>
@ -335,7 +327,7 @@ import { reactive, ref, watch } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useQuasar } from "quasar";
import { useDataStore } from "@/stores/data";
import { useCounterMixin } from "@/stores/mixin";
import { useManageDataStore } from "@/modules/01_metadata/store";
import type {
@ -354,7 +346,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const mixin = useCounterMixin(); //
const {
success,
@ -366,7 +357,7 @@ const {
showLoader,
hideLoader,
} = mixin;
const { loaderPage } = dataStore; //
const store = useManageDataStore();
const $q = useQuasar(); // noti quasar
const currentTab = ref<string>(

View file

@ -432,15 +432,19 @@ import type { DataOption } from "@/modules/02_organizational/interface/index/Mai
import HistoryTable from "@/components/TableHistory.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import type { QTableProps } from "quasar";
const dataStore = useDataStore();
const { loaderPage } = dataStore;
import type { QTableProps } from "quasar";
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const { success, modalConfirm, modalError, modalDelete } = mixin;
const {
success,
modalConfirm,
modalError,
modalDelete,
showLoader,
hideLoader,
} = mixin;
const { date2Thai } = mixin;
const store = useOrganizationalDataStore();
const { organizationalData, changeOrganizationalColumns } = store;
@ -843,7 +847,7 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => {
});
onMounted(async () => {
loaderPage(false);
hideLoader();
await fetchPosition();
await fetchData();
await fetchHistory();
@ -853,7 +857,7 @@ onMounted(async () => {
* งก get data าส
*/
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.getPostionMasterDraft(true))
.then((res) => {
@ -897,7 +901,7 @@ const fetchData = async () => {
})
.finally(() => {
// updateData.value = false;
loaderPage(false);
hideLoader();
});
};
@ -905,7 +909,7 @@ const fetchData = async () => {
* งชนดอมลประวแกไขขอมลทงหมด
*/
const fetchHistory = async () => {
// loaderPage(true);
// showLoader();
// await http
// .get(config.API.listxxxxxxxxPublishedHistory)
// .then((res) => {
@ -937,7 +941,7 @@ const fetchHistory = async () => {
// statusCode.value = e.response.data.status;
// })
// .finally(async () => {
// loaderPage(false);
// hideLoader();
// });
};
@ -945,7 +949,7 @@ const fetchHistory = async () => {
* get รายการ ตำแหน
*/
const fetchPosition = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.position)
.then((res) => {
@ -1036,7 +1040,7 @@ const fetchPosition = async () => {
})
.catch((e: any) => {})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1185,7 +1189,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
modal.value = false;
loaderPage(true);
showLoader();
await http
.post(config.API.getPositionMaster, {
positionTypeId: positionTypeId.value,
@ -1218,7 +1222,7 @@ const saveData = async () => {
*/
const editData = async () => {
modal.value = false;
loaderPage(true);
showLoader();
await http
.put(config.API.getPositionMasterId(positionMasterId.value), {
positionMasterId: positionMasterId.value,
@ -1252,7 +1256,7 @@ const editData = async () => {
* เมอเรยก api เสรจแลวจะ get data มาใหม
*/
const clearPublishedData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.getPositionMasterSync)
.then((res) => {
@ -1265,7 +1269,7 @@ const clearPublishedData = async () => {
statusCode.value = e.response.data.status;
})
.finally(async () => {
loaderPage(false);
hideLoader();
await fetchHistory();
await fetchData();
});
@ -1277,7 +1281,7 @@ const clearPublishedData = async () => {
*/
const publishedData = async () => {
// editvisible.value = false;
loaderPage(true);
showLoader();
await http
.put(config.API.getPositionMasterPublish)
.then((res) => {
@ -1287,7 +1291,7 @@ const publishedData = async () => {
statusCode.value = e.response.data.status;
})
.finally(async () => {
loaderPage(false);
hideLoader();
await fetchData();
});
};
@ -1383,7 +1387,7 @@ const clickAdd = () => {
* @param row อม row ประวการแกไข
*/
const clickHistory = async (row: RequestItemsObject) => {
loaderPage(true);
showLoader();
await http
.get(config.API.getPositionMasterHistoryId(row.id))
.then((res) => {
@ -1427,7 +1431,7 @@ const clickHistory = async (row: RequestItemsObject) => {
})
.finally(async () => {
modalHistory.value = true;
loaderPage(false);
hideLoader();
});
};
@ -1470,7 +1474,7 @@ const clickIsActive = async (val: string, status: boolean) => {
})
.onOk(async () => {
// edit.value = false;
loaderPage(true);
showLoader();
await http
.delete(config.API.getPositionMasterId(val) + `?Id=${val}`)
.then((res) => {

View file

@ -374,7 +374,8 @@
import { ref, defineAsyncComponent, watch, onMounted } from "vue";
import { useQuasar, QForm } from "quasar";
import type { PropType } from "vue";
import { useDataStore } from "@/stores/data";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import type { DataOption } from "../../interface/index/Main";
@ -382,8 +383,9 @@ import type { DataOption } from "../../interface/index/Main";
const ddNoResultMsg = defineAsyncComponent(
() => import("@/components/DropDownNoResultMsg.vue")
); // Dropdown Filter
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { showLoader, hideLoader } = mixin;
const $q = useQuasar(); // show dialog
const emit = defineEmits(["update:positions", "update:formprops"]);
const props = defineProps({
@ -430,12 +432,12 @@ const positionFilter = ref<Array<any>>([]); //for DropDown
const position = ref<Array<any>>([]); //for DropDown
onMounted(async () => {
loaderPage(false);
hideLoader();
await fetchPositionMaster();
});
const fetchPositionMaster = async () => {
loaderPage(true);
showLoader();
await http
// .get(config.API.getPostionMasterDraft(false))
.get(config.API.getPostionMaster(false))
@ -476,7 +478,7 @@ const fetchPositionMaster = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -333,8 +333,9 @@ import type {
GovermentOption,
} from "../../interface/index/Main";
import { log } from "console";
import { useDataStore } from "@/stores/data";
// import { organizationSet } from "../interface/index/Main";
import { useCounterMixin } from "@/stores/mixin";
const props = defineProps({
organizprops: Array as PropType<OrganizaOption[]>,
@ -343,8 +344,9 @@ const props = defineProps({
const emit = defineEmits(["update:organizprops", "update:formprops"]);
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { showLoader, hideLoader } = mixin;
const $q = useQuasar(); // show dialog
const myForm = ref<QForm | null>(null);
@ -381,7 +383,7 @@ const organizationAgencyCode = ref<GovermentOption[]>([]);
const organizationAgencyCodeFilter = ref<GovermentOption[]>([]);
onMounted(async () => {
loaderPage(false);
hideLoader();
await fetchOrganizationOri();
await fetchOrganizationAgencyCode();
await fetchOrganizationGovernmentCode();
@ -400,7 +402,7 @@ onMounted(async () => {
* หนวยงาน
*/
const fetchOrganizationOri = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organization)
.then((res) => {
@ -416,14 +418,14 @@ const fetchOrganizationOri = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* รหสหนวยงาน
*/
const fetchOrganizationAgencyCode = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationCode)
.then((res) => {
@ -445,14 +447,14 @@ const fetchOrganizationAgencyCode = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* รหสสวนราชการ
*/
const fetchOrganizationGovernmentCode = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationShortName)
.then((res) => {
@ -474,14 +476,14 @@ const fetchOrganizationGovernmentCode = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
// /**
// *
// */
// const fetchOrganizationShortName = async () => {
// loaderPage(true);
// showLoader();
// await http
// .get(config.API.organizationShortName)
// .then((res) => {
@ -503,14 +505,14 @@ const fetchOrganizationGovernmentCode = async () => {
// console.log(e);
// })
// .finally(() => {
// loaderPage(false);
// hideLoader();
// });
// };
/**
* หนวยงานตนสงก
*/
const fetchOrganizationAgency = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listOrganizationHistoryAgency("หน่วยงาน"))
.then((res) => {
@ -529,14 +531,14 @@ const fetchOrganizationAgency = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* วนราชการตนสงก
*/
const fetchOrganizationGovernmentAgency = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listOrganizationHistoryAgency("ส่วนราชการ"))
.then((res) => {
@ -555,14 +557,14 @@ const fetchOrganizationGovernmentAgency = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* ประเภทหนวยงาน
*/
const fetchOrganizationType = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationType)
.then((res) => {
@ -578,14 +580,14 @@ const fetchOrganizationType = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* ระดบหนวยงาน
*/
const fetchOrganizationLevel = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationLevel)
.then((res) => {
@ -601,14 +603,14 @@ const fetchOrganizationLevel = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* เบอรดตอภายใน
*/
const fetchOrganizationTelInternal = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationTelInternal)
.then((res) => {
@ -624,14 +626,14 @@ const fetchOrganizationTelInternal = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* เบอรดตอภายนอก
*/
const fetchOrganizationTelExternal = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationTelExternal)
.then((res) => {
@ -647,14 +649,14 @@ const fetchOrganizationTelExternal = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* เบอรโทรสาร
*/
const fetchOrganizationFax = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationFax)
.then((res) => {
@ -670,7 +672,7 @@ const fetchOrganizationFax = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -772,7 +774,7 @@ const addOrganizationItem = async () => {
const fetchAgencyCode = async (val: string, item: OrganizaOption) => {
let option: GovermentOption[] = [];
loaderPage(true);
showLoader();
await http
.get(config.API.organizationGovernmentCode(val))
.then((res) => {
@ -792,14 +794,14 @@ const fetchAgencyCode = async (val: string, item: OrganizaOption) => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
return option;
};
const fetchGovernmentCode = async (val: string, item: OrganizaOption) => {
let option: GovermentOption[] = [];
loaderPage(true);
showLoader();
await http
.get(config.API.organizationAgencyCode(val))
.then((res) => {
@ -819,7 +821,7 @@ const fetchGovernmentCode = async (val: string, item: OrganizaOption) => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
return option;
};

View file

@ -310,9 +310,13 @@ import type {
GovermentOption,
} from "../../interface/index/Main";
import { log } from "console";
import { useDataStore } from "@/stores/data";
import type { EnumStringMember } from "@babel/types";
// import { organizationSet } from "../interface/index/Main";
import { useCounterMixin } from "@/stores/mixin";
const mixin = useCounterMixin();
const { showLoader, hideLoader } = mixin;
const props = defineProps({
organizprops: Object as PropType<OrganizaOption>,
@ -323,8 +327,6 @@ const props = defineProps({
},
});
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const emit = defineEmits(["update:organizprops", "update:formprops"]);
const $q = useQuasar(); // show dialog
@ -393,7 +395,7 @@ const organization = ref<OrganizaOption>({
emit("update:organizprops", organization.value);
onMounted(async () => {
loaderPage(false);
hideLoader();
// await fillOrgEdit(); // selector(q-select)
await fetchOrganizationOri();
// await fetchOrganizationShortName();
@ -427,7 +429,7 @@ const getClass = (val: boolean) => {
* @param node node that you want to edit data
*/
const fillOrgEdit = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.getOrgDraft(props.org.organizationId))
.then((res) => {
@ -499,7 +501,7 @@ const fillOrgEdit = async () => {
console.log(e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
console.log("success");
};
@ -508,7 +510,7 @@ const fillOrgEdit = async () => {
* หนวยงาน
*/
const fetchOrganizationOri = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organization)
.then((res) => {
@ -524,14 +526,14 @@ const fetchOrganizationOri = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* รหสหนวยงาน
*/
const fetchOrganizationAgencyCode = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationCode)
.then((res) => {
@ -553,14 +555,14 @@ const fetchOrganizationAgencyCode = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* รหสสวนราชการ
*/
const fetchOrganizationGovernmentCode = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationShortName)
.then((res) => {
@ -585,14 +587,14 @@ const fetchOrganizationGovernmentCode = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
// /**
// *
// */
// const fetchOrganizationShortName = async () => {
// loaderPage(true);
// showLoader();
// await http
// .get(config.API.organizationShortName)
// .then((res) => {
@ -614,14 +616,14 @@ const fetchOrganizationGovernmentCode = async () => {
// console.log(e);
// })
// .finally(() => {
// loaderPage(false);
// hideLoader();
// });
// };
/**
* หนวยงานตนสงก
*/
const fetchOrganizationAgency = async () => {
loaderPage(true);
showLoader();
await http
// .get(config.API.organizationAgency)
.get(config.API.listOrganizationHistoryAgency("หน่วยงาน"))
@ -641,14 +643,14 @@ const fetchOrganizationAgency = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* วนราชการตนสงก
*/
const fetchOrganizationGovernmentAgency = async () => {
loaderPage(true);
showLoader();
await http
// .get(config.API.organizationGovernmentAgency)
.get(config.API.listOrganizationHistoryAgency("ส่วนราชการ"))
@ -669,14 +671,14 @@ const fetchOrganizationGovernmentAgency = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* ประเภทหนวยงาน
*/
const fetchOrganizationType = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationType)
.then((res) => {
@ -692,7 +694,7 @@ const fetchOrganizationType = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -700,7 +702,7 @@ const fetchOrganizationType = async () => {
* สถานะหนวยงาน
*/
const fetchOrganizationStatus = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationStatus)
.then((res) => {
@ -716,7 +718,7 @@ const fetchOrganizationStatus = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -724,7 +726,7 @@ const fetchOrganizationStatus = async () => {
* ระดบหนวยงาน
*/
const fetchOrganizationLevel = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationLevel)
.then((res) => {
@ -740,14 +742,14 @@ const fetchOrganizationLevel = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* เบอรดตอภายใน
*/
const fetchOrganizationTelInternal = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationTelInternal)
.then((res) => {
@ -763,14 +765,14 @@ const fetchOrganizationTelInternal = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* เบอรดตอภายนอก
*/
const fetchOrganizationTelExternal = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationTelExternal)
.then((res) => {
@ -786,14 +788,14 @@ const fetchOrganizationTelExternal = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
/**
* เบอรโทรสาร
*/
const fetchOrganizationFax = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationFax)
.then((res) => {
@ -809,13 +811,13 @@ const fetchOrganizationFax = async () => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchAgencyCode = async (val: string, item: OrganizaOption) => {
let option: GovermentOption[] = [];
loaderPage(true);
showLoader();
await http
.get(config.API.organizationGovernmentCode(val))
.then((res) => {
@ -835,14 +837,14 @@ const fetchAgencyCode = async (val: string, item: OrganizaOption) => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
return option;
};
const fetchGovernmentCode = async (val: string, item: OrganizaOption) => {
let option: GovermentOption[] = [];
loaderPage(true);
showLoader();
await http
.get(config.API.organizationAgencyCode(val))
.then((res) => {
@ -862,7 +864,7 @@ const fetchGovernmentCode = async (val: string, item: OrganizaOption) => {
console.log(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
return option;
};

View file

@ -6,8 +6,13 @@ import config from "@/app.config";
import { OrgChart } from "bma-org-chart";
import "bma-org-chart/org-chart.css";
import { useCounterMixin } from "@/stores/mixin";
import chartData from "@/assets/orgChartData";
const mixin = useCounterMixin();
const { showLoader, hideLoader } = mixin;
const dataSource = ref(chartData);
// const dataSource = ref() // Chart
@ -21,8 +26,6 @@ const savePDF = () => {
chartRef.value.savePDF();
};
const loader = ref<boolean>(false); //
onMounted(async () => {
await fetchTreeRoot();
await fetchOrgChart();
@ -32,7 +35,7 @@ onMounted(async () => {
* าน Root ของขอมลทงหมดกอน
*/
const fetchTreeRoot = async () => {
loader.value = true;
showLoader();
let urlRequest = config.API.chartGetTreeRoot;
await http
.get(urlRequest)
@ -45,12 +48,12 @@ const fetchTreeRoot = async () => {
console.log(e);
})
.finally(() => {
loader.value = false;
hideLoader();
});
};
const fetchOrgChart = async () => {
loader.value = true;
showLoader();
let urlRequest = config.API.chartGetOrg(rootOrgID.value);
await http
.get(urlRequest)
@ -65,7 +68,7 @@ const fetchOrgChart = async () => {
console.log(e);
})
.finally(() => {
loader.value = false;
hideLoader();
});
};
@ -111,7 +114,6 @@ const refreshChart = async (data: any) => {
</div>
</q-card>
</div>
<full-loader :visibility="loader"></full-loader>
</template>
<style>

View file

@ -1,123 +1,123 @@
<template>
<div class="toptitle text-dark col-12 row items-center">รายงานบญช</div>
<q-card flat bordered class="col-12">
<div class="row col-12">
<q-tabs
v-model="tab"
no-caps
inline-label
align="left"
class="text-primary"
>
<q-tab name="audit1" label="บัญชี 1" />
<q-tab name="audit2" label="บัญชี 2" />
<q-tab name="audit3" label="บัญชี 3" />
</q-tabs>
</div>
<q-separator />
<q-tab-panels
v-model="tab"
transition-prev="jump-up"
transition-next="jump-up"
animated
swipeable
class="row col-12 text-dark"
>
<q-tab-panel name="audit1">
<div class="row col-12 items-center q-gutter-md">
<q-select
class="col-xs-12 col-sm-6"
v-model="goverment"
label="ระบุหน่วยงานที่ต้องการออกรายงาน"
dense
:options="govermentOP"
lazy-rules
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
/>
<q-btn
size="md"
icon="mdi-download"
round
flat
color="primary"
@click="clickAccount1"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</div>
</q-tab-panel>
<q-tab-panel name="audit2">
<div class="row col-12 items-center q-gutter-md">
<q-select
class="col-xs-12 col-sm-6"
v-model="goverment"
label="ระบุรหัสส่วนราชการ"
dense
:options="govermentOP"
lazy-rules
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
/>
<div class="toptitle text-dark col-12 row items-center">รายงานบญช</div>
<q-card flat bordered class="col-12">
<div class="row col-12">
<q-tabs
v-model="tab"
no-caps
inline-label
align="left"
class="text-primary"
>
<q-tab name="audit1" label="บัญชี 1" />
<q-tab name="audit2" label="บัญชี 2" />
<q-tab name="audit3" label="บัญชี 3" />
</q-tabs>
</div>
<q-separator />
<q-tab-panels
v-model="tab"
transition-prev="jump-up"
transition-next="jump-up"
animated
swipeable
class="row col-12 text-dark"
>
<q-tab-panel name="audit1">
<div class="row col-12 items-center q-gutter-md">
<q-select
class="col-xs-12 col-sm-6"
v-model="goverment"
label="ระบุหน่วยงานที่ต้องการออกรายงาน"
dense
:options="govermentOP"
lazy-rules
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
/>
<q-btn
size="md"
icon="mdi-download"
round
flat
color="primary"
@click="clickAccount1"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</div>
</q-tab-panel>
<q-tab-panel name="audit2">
<div class="row col-12 items-center q-gutter-md">
<q-select
class="col-xs-12 col-sm-6"
v-model="goverment"
label="ระบุรหัสส่วนราชการ"
dense
:options="govermentOP"
lazy-rules
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
/>
<q-btn
size="md"
icon="mdi-download"
flat
round
color="primary"
@click="clickAccount2"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</div>
</q-tab-panel>
<q-tab-panel name="audit3">
<div class="row col-12 items-center q-gutter-md">
<q-select
class="col-xs-12 col-sm-6"
v-model="goverment"
label="ระบุรหัสส่วนราชการ"
dense
:options="govermentOP"
lazy-rules
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
/>
<q-btn
size="md"
icon="mdi-download"
flat
round
color="primary"
@click="clickAccount3"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
<!-- <viewpdf
<q-btn
size="md"
icon="mdi-download"
flat
round
color="primary"
@click="clickAccount2"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
</div>
</q-tab-panel>
<q-tab-panel name="audit3">
<div class="row col-12 items-center q-gutter-md">
<q-select
class="col-xs-12 col-sm-6"
v-model="goverment"
label="ระบุรหัสส่วนราชการ"
dense
:options="govermentOP"
lazy-rules
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
/>
<q-btn
size="md"
icon="mdi-download"
flat
round
color="primary"
@click="clickAccount3"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
<!-- <viewpdf
:src="pdfSrc"
:currentpage="pdfCurrentPage"
:totalpage="pdfTotalPage" /> -->
</q-btn>
</div>
</q-tab-panel>
</q-tab-panels>
</q-card>
</q-btn>
</div>
</q-tab-panel>
</q-tab-panels>
</q-card>
</template>
<script setup lang="ts">
import { onMounted, computed, ref, watch } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter, useRoute } from "vue-router";
import { useDataStore } from "@/stores/data";
import TableReport from "@/modules/02_organizational/components/TableReport.vue";
import DialogHeader from "@/modules/02_organizational/components/DialogHeader.vue";
import DialogFooter from "@/modules/02_organizational/components/DialogFooter.vue";
@ -128,11 +128,10 @@ import type { RequestReport2 } from "@/modules/02_organizational/interface/reque
import http from "@/plugins/http";
import config from "@/app.config";
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const { messageError, modalError, modalWarning } = mixin;
const { messageError, modalError, modalWarning, showLoader, hideLoader } =
mixin;
const router = useRouter();
const route = useRoute();
const { date2Thai, success, dateToISO } = mixin;
@ -143,112 +142,112 @@ const goverment = ref<any>();
const tab = ref<string>("audit1");
const clickAccount1 = async () => {
if (goverment.value === null || goverment.value === undefined) {
modalWarning($q, "คำเตือน", "กรุณาเลือกหน่วยงานที่ต้องการออกรายงาน!");
return;
}
loaderPage(true);
await http
.get(config.API.getReportAccount1(goverment.value?.value as string), {
responseType: "blob",
})
.then((res) => {
var a = document.createElement("a");
a.href = URL.createObjectURL(res.data);
a.download = `รายงานบัญชี1_${goverment.value?.label}.pdf`;
// start download
a.click();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
if (goverment.value === null || goverment.value === undefined) {
modalWarning($q, "คำเตือน", "กรุณาเลือกหน่วยงานที่ต้องการออกรายงาน!");
return;
}
showLoader();
await http
.get(config.API.getReportAccount1(goverment.value?.value as string), {
responseType: "blob",
})
.then((res) => {
var a = document.createElement("a");
a.href = URL.createObjectURL(res.data);
a.download = `รายงานบัญชี1_${goverment.value?.label}.pdf`;
// start download
a.click();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
// window.open(config.API.getReportAccount1(goverment.value));
// window.open(config.API.getReportAccount1(goverment.value));
};
const clickAccount2 = async () => {
if (goverment.value === null || goverment.value === undefined) {
modalWarning($q, "คำเตือน", "กรุณาเลือกหน่วยงานที่ต้องการออกรายงาน!");
return;
}
loaderPage(true);
await http
.get(config.API.getReportAccount2(goverment.value?.value as string), {
responseType: "blob",
})
.then((res) => {
var a = document.createElement("a");
a.href = URL.createObjectURL(res.data);
a.download = `รายงานบัญชี2_${goverment.value?.label}.pdf`;
// start download
a.click();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
//window.open(config.API.getReportAccount2(goverment.value));
if (goverment.value === null || goverment.value === undefined) {
modalWarning($q, "คำเตือน", "กรุณาเลือกหน่วยงานที่ต้องการออกรายงาน!");
return;
}
showLoader();
await http
.get(config.API.getReportAccount2(goverment.value?.value as string), {
responseType: "blob",
})
.then((res) => {
var a = document.createElement("a");
a.href = URL.createObjectURL(res.data);
a.download = `รายงานบัญชี2_${goverment.value?.label}.pdf`;
// start download
a.click();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
//window.open(config.API.getReportAccount2(goverment.value));
};
const clickAccount3 = async () => {
if (goverment.value === null || goverment.value === undefined) {
modalWarning($q, "คำเตือน", "กรุณาเลือกหน่วยงานที่ต้องการออกรายงาน!");
return;
}
loaderPage(true);
await http
.get(config.API.getReportAccount3(goverment.value?.value as string), {
responseType: "blob",
})
.then((res) => {
var a = document.createElement("a");
a.href = URL.createObjectURL(res.data);
a.download = `รายงานบัญชี3_${goverment.value?.label}.pdf`;
// start download
a.click();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
});
// window.open(config.API.getReportAccount3(goverment.value));
if (goverment.value === null || goverment.value === undefined) {
modalWarning($q, "คำเตือน", "กรุณาเลือกหน่วยงานที่ต้องการออกรายงาน!");
return;
}
showLoader();
await http
.get(config.API.getReportAccount3(goverment.value?.value as string), {
responseType: "blob",
})
.then((res) => {
var a = document.createElement("a");
a.href = URL.createObjectURL(res.data);
a.download = `รายงานบัญชี3_${goverment.value?.label}.pdf`;
// start download
a.click();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
// window.open(config.API.getReportAccount3(goverment.value));
};
const fetchOrganizationAgency = async () => {
loaderPage(true);
await http
// .get(config.API.organizationAgency)
.get(config.API.getOCType)
.then((res) => {
const data = res.data.result;
let option: any[] = [];
data.map((r: any) => {
option.push({
value: r.organizationId.toString(),
label: r.organizationName.toString(),
});
});
govermentOP.value = option;
govermentOPfilter.value = option;
})
.catch((e) => {
console.log(e);
})
.finally(() => {
loaderPage(false);
});
showLoader();
await http
// .get(config.API.organizationAgency)
.get(config.API.getOCType)
.then((res) => {
const data = res.data.result;
let option: any[] = [];
data.map((r: any) => {
option.push({
value: r.organizationId.toString(),
label: r.organizationName.toString(),
});
});
govermentOP.value = option;
govermentOPfilter.value = option;
})
.catch((e) => {
console.log(e);
})
.finally(() => {
hideLoader();
});
};
onMounted(async () => {
loaderPage(false);
await fetchOrganizationAgency();
console.log(govermentOP.value);
hideLoader();
await fetchOrganizationAgency();
console.log(govermentOP.value);
});
</script>

View file

@ -5,84 +5,88 @@ import { ref, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { StructChart } from "structure-chart";
import "structure-chart/structure-chart.css";
import { useCounterMixin } from "@/stores/mixin";
import { StructChart } from 'structure-chart'
import 'structure-chart/structure-chart.css'
const mixin = useCounterMixin();
const { showLoader, hideLoader } = mixin;
// import chartData from '@/assets/structChartData'
// const dataSource = ref(chartData)
const dataSource = ref() // Chart
const rootOrgID = ref() // org id root
const dataSourceLock = ref() // Chart home
const chartRef = ref() // chart
const dataSource = ref(); // Chart
const rootOrgID = ref(); // org id root
const dataSourceLock = ref(); // Chart home
const chartRef = ref(); // chart
const savePNG = () => {
chartRef.value.savePNG()
}
chartRef.value.savePNG();
};
const savePDF = () => {
chartRef.value.savePDF()
}
chartRef.value.savePDF();
};
const loader = ref<boolean>(false) // Loader
const loader = ref<boolean>(false); // Loader
onMounted(async() => {
await fetchTreeRoot()
await fetchStructChart()
})
onMounted(async () => {
await fetchTreeRoot();
await fetchStructChart();
});
/**
* าน Root ของขอมลทงหมดจาก API องทำเปนอนดบแรก เพอจะไดรากของขอม
*/
const fetchTreeRoot = async () => {
loader.value = true
let urlRequest = config.API.chartGetTreeRoot
await http.get(urlRequest)
.then((response) => {
if (response.data.result.length > 0) {
rootOrgID.value = response.data.result[0].organizationId
}
})
.catch((e) => {
console.log(e)
})
.finally(() => {
loader.value = false
})
showLoader();
let urlRequest = config.API.chartGetTreeRoot;
await http
.get(urlRequest)
.then((response) => {
if (response.data.result.length > 0) {
rootOrgID.value = response.data.result[0].organizationId;
}
})
.catch((e) => {
console.log(e);
})
.finally(() => {
hideLoader();
});
};
/**
* านขอม organization id จจนจาก API อมลทไดเอามาสราง Structure Chart
*/
const fetchStructChart = async () => {
loader.value = true
let urlRequest = config.API.chartGetStructure(rootOrgID.value)
await http.get(urlRequest)
.then((response) => {
if (response.data.result.length > 0) {
dataSource.value = response.data.result[0]
if (dataSourceLock.value === undefined)
dataSourceLock.value = dataSource.value
breadcrumbsGen()
}
})
.catch((e) => {
console.log(e)
})
.finally(() => {
loader.value = false
})
}
showLoader();
let urlRequest = config.API.chartGetStructure(rootOrgID.value);
await http
.get(urlRequest)
.then((response) => {
if (response.data.result.length > 0) {
dataSource.value = response.data.result[0];
if (dataSourceLock.value === undefined)
dataSourceLock.value = dataSource.value;
breadcrumbsGen();
}
})
.catch((e) => {
console.log(e);
})
.finally(() => {
hideLoader();
});
};
/**
* เมอมการคลกท Chart ใหาน ID ของหนวยงานทกคล แลวดงขอม Chart ของหนวยงานน จาก API
* @param data
*/
const refreshChart = async (data: any) => {
if (data.value !== undefined)
rootOrgID.value = data.value
else rootOrgID.value = data
if (rootOrgID.value !== 0) await fetchStructChart()
if (data.value !== undefined) data.value = 0
}
if (data.value !== undefined) rootOrgID.value = data.value;
else rootOrgID.value = data;
if (rootOrgID.value !== 0) await fetchStructChart();
if (data.value !== undefined) data.value = 0;
};
/**
* === กระบวนการสราง Path ===
@ -93,133 +97,142 @@ const refreshChart = async (data: any) => {
* @param chart Array ของ Object ของหนวยงานยอยใน Tree
*/
const chartTraverse = (id: any, chart: any): any => {
let _returnPath = []
for (const child of chart) {
if (child.deptID === id) {
_returnPath.push({
label: child.departmentName,
id: child.deptID
})
return _returnPath
} else {
if (typeof child.children !== "undefined" &&
child.children !== null &&
child.children.length > 0) {
let _result = chartTraverse(id, child.children)
if (typeof _result !== "undefined" && _result !== null) {
_returnPath.push({
label: child.departmentName,
id: child.deptID
})
return [..._returnPath, ...(_result ?? [])]
}
}
}
}
}
let _returnPath = [];
for (const child of chart) {
if (child.deptID === id) {
_returnPath.push({
label: child.departmentName,
id: child.deptID,
});
return _returnPath;
} else {
if (
typeof child.children !== "undefined" &&
child.children !== null &&
child.children.length > 0
) {
let _result = chartTraverse(id, child.children);
if (typeof _result !== "undefined" && _result !== null) {
_returnPath.push({
label: child.departmentName,
id: child.deptID,
});
return [..._returnPath, ...(_result ?? [])];
}
}
}
}
};
const findPath = (id: any) => {
let _path = []
_path.push({
label: dataSourceLock.value.departmentName,
id: dataSourceLock.value.deptID
})
if (dataSourceLock.value.deptID === id) return _path
if (dataSourceLock.value.children.length > 0) {
let _returnPath = chartTraverse(id, dataSourceLock.value.children)
return [..._path, ...(_returnPath ?? [])]
}
}
let _path = [];
_path.push({
label: dataSourceLock.value.departmentName,
id: dataSourceLock.value.deptID,
});
if (dataSourceLock.value.deptID === id) return _path;
if (dataSourceLock.value.children.length > 0) {
let _returnPath = chartTraverse(id, dataSourceLock.value.children);
return [..._path, ...(_returnPath ?? [])];
}
};
const theBreadcrumb = ref()
const theBreadcrumb = ref();
/**
* สราง Path Breadcrumbs
*/
const breadcrumbsGen = () => {
if (rootOrgID.value !== 0) {
theBreadcrumb.value = []
const newPath = findPath(rootOrgID.value)
theBreadcrumb.value = newPath
}
}
if (rootOrgID.value !== 0) {
theBreadcrumb.value = [];
const newPath = findPath(rootOrgID.value);
theBreadcrumb.value = newPath;
}
};
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">แผนภโครงสราง</div>
<div class="text-dark">
<q-card flat bordered class="col-12 q-mt-sm">
<div class="q-pa-sm row wrap items-center">
<q-btn flat round color="primary" @click="savePNG()" icon="mdi-image">
<q-tooltip>
ดาวนโหลด PNG
</q-tooltip>
</q-btn>
<q-btn flat round color="red-7" @click="savePDF()" icon="mdi-file-pdf-box">
<q-tooltip>
ดาวนโหลด PDF
</q-tooltip>
</q-btn>
<div class="bg-grey-2 q-py-xs q-px-sm rounded-borders">
<q-breadcrumbs>
<template v-slot:separator>
<q-icon
size="1.5em"
name="chevron_right"
color="primary" />
</template>
<template v-for="link in theBreadcrumb" :key="link.id">
<q-breadcrumbs-el :label="link.label" @click="refreshChart(link.id)" class="breadcrumbs-link"/>
</template>
</q-breadcrumbs>
</div>
</div>
<q-separator/>
<div style="overflow-x: auto; overflow-y: auto" class="q-pt-md">
<StructChart
style="height: 70vh;"
ref="chartRef"
class="struct"
:dataSource="dataSource"
@onElementClick="refreshChart"
/>
</div>
</q-card>
</div>
<full-loader :visibility="loader"></full-loader>
<div class="toptitle text-dark col-12 row items-center">แผนภโครงสราง</div>
<div class="text-dark">
<q-card flat bordered class="col-12 q-mt-sm">
<div class="q-pa-sm row wrap items-center">
<q-btn flat round color="primary" @click="savePNG()" icon="mdi-image">
<q-tooltip> ดาวนโหลด PNG </q-tooltip>
</q-btn>
<q-btn
flat
round
color="red-7"
@click="savePDF()"
icon="mdi-file-pdf-box"
>
<q-tooltip> ดาวนโหลด PDF </q-tooltip>
</q-btn>
<div class="bg-grey-2 q-py-xs q-px-sm rounded-borders">
<q-breadcrumbs>
<template v-slot:separator>
<q-icon size="1.5em" name="chevron_right" color="primary" />
</template>
<template v-for="link in theBreadcrumb" :key="link.id">
<q-breadcrumbs-el
:label="link.label"
@click="refreshChart(link.id)"
class="breadcrumbs-link"
/>
</template>
</q-breadcrumbs>
</div>
</div>
<q-separator />
<div style="overflow-x: auto; overflow-y: auto" class="q-pt-md">
<StructChart
style="height: 70vh"
ref="chartRef"
class="struct"
:dataSource="dataSource"
@onElementClick="refreshChart"
/>
</div>
</q-card>
</div>
<full-loader :visibility="loader"></full-loader>
</template>
<style>
.breadcrumbs-link {
cursor: pointer;
cursor: pointer;
}
.struct .section-primary .header,.struct .section-secondary .header,.struct .section-tertiary .header {
font-size: 1rem !important;
.struct .section-primary .header,
.struct .section-secondary .header,
.struct .section-tertiary .header {
font-size: 1rem !important;
}
.struct .section-primary .column-side .side-button,.struct .section-secondary .column-side .side-button, .struct .section-list .column-side .side-button{
background-color: #d9d9d96b !important;
color:#545459 !important;
width: 25px !important;
height: 25px !important;
font-size: 11px !important;
padding: 0px;
.struct .section-primary .column-side .side-button,
.struct .section-secondary .column-side .side-button,
.struct .section-list .column-side .side-button {
background-color: #d9d9d96b !important;
color: #545459 !important;
width: 25px !important;
height: 25px !important;
font-size: 11px !important;
padding: 0px;
}
.struct .section-primary, .section-secondary,.struct .section-list{
padding: 6px 15px 6px 15px;
.struct .section-primary,
.section-secondary,
.struct .section-list {
padding: 6px 15px 6px 15px;
}
.struct .section-primary .header{
font-weight: 600 !important;
.struct .section-primary .header {
font-weight: 600 !important;
}
.struct .section-secondary .header{
font-weight: 400 !important;
.struct .section-secondary .header {
font-weight: 400 !important;
}
.struct .subchild-more{
background-position: center !important;
background-size: 14px !important;
.struct .subchild-more {
background-position: center !important;
background-size: 14px !important;
}
</style>

View file

@ -820,7 +820,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import type { OrganizaOption } from "../interface/index/Main";
import { useDataStore } from "@/stores/data";
// import manageApiErrorMsg from "@/global/user_response_msg";
import HistoryTable from "@/components/TableHistory.vue";
import type { QTableProps } from "quasar";
@ -857,11 +857,10 @@ const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal
//Global Variable
const store = useDataStore();
const mixin = useCounterMixin();
const { loaderPage } = store; // load windows api
const { success, messageError, dialogMessage } = mixin;
const { success, messageError, dialogMessage, showLoader, hideLoader } = mixin;
//Notification Component Variable
const $q = useQuasar(); // show dialog
@ -1029,7 +1028,7 @@ const loadJsonTree = async (fileName: string) => {
manageApiErrorMsg(e);
})
.finally(() => {
// loaderPage(false);
// hideLoader();
});
};
@ -1051,12 +1050,12 @@ const loadFileServer = async (node: any) => {
manageApiErrorMsg(e);
})
.finally(() => {
// loaderPage(false);
// hideLoader();
});
};
const isTreeHasDraft = async () => {
// loaderPage(true);
// showLoader();
let orgHasDraft = false;
let orgPoHasDraft = false;
await http
@ -1072,7 +1071,7 @@ const isTreeHasDraft = async () => {
messageError($q, e);
})
.finally(() => {
// loaderPage(false);
// hideLoader();
});
await http
@ -1088,7 +1087,7 @@ const isTreeHasDraft = async () => {
messageError($q, e);
})
.finally(() => {
// loaderPage(false);
// hideLoader();
});
if (orgHasDraft || orgPoHasDraft) {
@ -1103,7 +1102,7 @@ const isTreeHasDraft = async () => {
*/
const fetchTreeRoot = async (isDraft: boolean) => {
// console.log(isDraft);
loaderPage(true);
showLoader();
console.log("Call API14 GetTreeRoot");
isShowEditTree.value = isDraft; // to show same tree that we fetch
let request = "";
@ -1130,7 +1129,7 @@ const fetchTreeRoot = async (isDraft: boolean) => {
// messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
if (isDraft) {
// node root on first load
// .then error tree render
@ -1148,7 +1147,7 @@ const fetchTreeRoot = async (isDraft: boolean) => {
const fetchChildrenByParentId = async (node: any) => {
// console.log(isDraft);
console.log("Call API4");
loaderPage(true);
showLoader();
let request = "";
if (isShowEditTree.value) {
request = config.API.getDraftTreeNode(node.organizationId, node.keyId);
@ -1168,12 +1167,12 @@ const fetchChildrenByParentId = async (node: any) => {
manageApiErrorMsg(e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchPublishFile = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.getPublishFileHistory)
.then((res) => {
@ -1191,7 +1190,7 @@ const fetchPublishFile = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -1207,7 +1206,7 @@ const onLazyLoad = (node: any) => {
*/
console.log("Call LazyLoad");
await fetchChildrenByParentId(node.node);
/** loaderPage(true);
/** showLoader();
let request = "";
if (isShowEditTree.value) {
request = config.API.getDraftTreeNode(
@ -1244,7 +1243,7 @@ const onLazyLoad = (node: any) => {
// messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});*/
node.done(node.node.children); //return q-tree generate children
@ -1299,7 +1298,7 @@ const apiDeleteOrg = () => {
// console.log("isShowEditTree", isShowEditTree.value);
setTimeout(async () => {
//delay for lazyLoad to be able to tricker again
loaderPage(true);
showLoader();
isShowEditTree.value = true;
await http
.delete(config.API.delTreeOrgDraft(delStructureId.value))
@ -1318,7 +1317,7 @@ const apiDeleteOrg = () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
await isTreeHasDraft();
});
}, 20);
@ -1347,7 +1346,7 @@ const apiDeletePosition = () => {
isShowEditTree.value = false;
setTimeout(async () => {
//delay for lazyLoad to be able to tricker again
loaderPage(true);
showLoader();
isShowEditTree.value = true;
await http
.delete(config.API.delTreePositionDraft(delStructureId.value))
@ -1364,7 +1363,7 @@ const apiDeletePosition = () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
await isTreeHasDraft();
});
}, 20);
@ -1377,7 +1376,7 @@ const apiDeletePosition = () => {
* งก clear data แบบราง
*/
const deleteDraft = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.delTreeOrgPoDraft)
.then((res) => {
@ -1389,7 +1388,7 @@ const deleteDraft = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
router.go(0);
await isTreeHasDraft();
});
@ -1399,7 +1398,7 @@ const deleteDraft = async () => {
* งกนเผยแพรแบบราง
*/
const publishDraft = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.publishOrgPoDraft)
.then((res) => {
@ -1425,7 +1424,7 @@ const publishDraft = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
await isTreeHasDraft();
});
};
@ -1536,7 +1535,7 @@ const addStructure = async (node: any) => {
});
// console.log(node.organizationId);
console.log("Call API1");
loaderPage(true);
showLoader();
isShowEditTree.value = true; // editTree & trigger lazyLoad setExpanded
await http
.post(config.API.addTreeDraft, {
@ -1557,7 +1556,7 @@ const addStructure = async (node: any) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
popupAddOrganization.value = false;
await isTreeHasDraft();
@ -1589,7 +1588,7 @@ const editOrgStructure = async (node: any) => {
if (organizCheck == true) {
// console.log(node.organizationId);
console.log("Call API13");
loaderPage(true);
showLoader();
isShowEditTree.value = true; //end prepare for tricker LazyLoad
await http
.put(config.API.editTreeOrgDraft(node.organizationId), {
@ -1629,7 +1628,7 @@ const editOrgStructure = async (node: any) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
popupEditSelectedOrganization.value = false;
await isTreeHasDraft();
});
@ -1655,7 +1654,7 @@ const editPositionStructure = async (node: any) => {
if (positionCheck == true) {
console.log("Call API3");
loaderPage(true);
showLoader();
isShowEditTree.value = true; //end prepare for tricker LazyLoad
await http
.put(config.API.editTreePositionDraft(node.organizationPositionId), {
@ -1680,7 +1679,7 @@ const editPositionStructure = async (node: any) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
popupEditSelectedPosition.value = false;
await isTreeHasDraft();
});
@ -1696,7 +1695,7 @@ const clickHistory = async () => {
modalHistory.value = true;
// rowsHistory.value = rawHistory.value.filter((f: any) => f.id == row.id);
loaderPage(true);
showLoader();
await http
.get(config.API.getTreeHistory)
.then((res) => {
@ -1722,7 +1721,7 @@ const clickHistory = async () => {
// messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -674,15 +674,13 @@ import type {
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import type { QTableProps } from "quasar";
const dataStore = useDataStore();
const { loaderPage } = dataStore;
import type { QTableProps } from "quasar";
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const { date2Thai, success, modalError, messageError } = mixin;
const { date2Thai, success, modalError, messageError, showLoader, hideLoader } =
mixin;
const store = useOrganizationalDataStore();
const { organizationalData, changeOrganizationalColumns } = store;
const initialPagination = ref<Pagination>({
@ -893,7 +891,7 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => {
});
onMounted(async () => {
loaderPage(false);
hideLoader();
await fetchOrganization();
await fetchOrganizationAgency();
await fetchOrganizationGovernmentAgency();
@ -906,7 +904,7 @@ onMounted(async () => {
* งก get data าส
*/
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationEmployee)
.then((res) => {
@ -1008,7 +1006,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1016,7 +1014,7 @@ const fetchData = async () => {
* get รายการ โครงสราง
*/
const fetchOrganization = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationMain)
.then((res) => {
@ -1075,7 +1073,7 @@ const fetchOrganization = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1083,7 +1081,7 @@ const fetchOrganization = async () => {
* หนวยงานตนสงก
*/
const fetchOrganizationAgency = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listOrganizationHistoryAgency("หน่วยงาน"))
.then((res) => {
@ -1102,7 +1100,7 @@ const fetchOrganizationAgency = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1110,7 +1108,7 @@ const fetchOrganizationAgency = async () => {
* วนราชการตนสงก
*/
const fetchOrganizationGovernmentAgency = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.listOrganizationHistoryAgency("ส่วนราชการ"))
.then((res) => {
@ -1129,7 +1127,7 @@ const fetchOrganizationGovernmentAgency = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1137,7 +1135,7 @@ const fetchOrganizationGovernmentAgency = async () => {
* รหสหนวยงาน
*/
const fetchOrganizationAgencyCode = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationCode)
.then((res) => {
@ -1158,13 +1156,13 @@ const fetchOrganizationAgencyCode = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchAgencyCode = async (val: string) => {
let option: GovermentOption[] = [];
loaderPage(true);
showLoader();
await http
.get(config.API.organizationAgencyCode(val))
.then((res) => {
@ -1184,7 +1182,7 @@ const fetchAgencyCode = async (val: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
return option;
};
@ -1193,7 +1191,7 @@ const fetchAgencyCode = async (val: string) => {
* get รายการ ตำแหน
*/
const fetchPosition = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.positionEmployee)
.then((res) => {
@ -1285,7 +1283,7 @@ const fetchPosition = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1309,7 +1307,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
modal.value = false;
loaderPage(true);
showLoader();
await http
.post(config.API.organizationEmployee, {
organizationOrganizationId: organizationOrganizationId.value,
@ -1361,7 +1359,7 @@ const saveData = async () => {
*/
const editData = async () => {
modal.value = false;
loaderPage(true);
showLoader();
await http
.put(config.API.organizationEmployeeId(id.value), {
organizationOrganizationId: organizationOrganizationId.value,
@ -1426,7 +1424,7 @@ const clickDelete = (id: string) => {
};
const deleteData = async (id: string) => {
loaderPage(true);
showLoader();
await http
.delete(config.API.organizationEmployeeId(id))
.then((res) => {
@ -1436,7 +1434,7 @@ const deleteData = async (id: string) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
await fetchData();
});
};

View file

@ -108,7 +108,7 @@ import { onMounted, computed, ref, watch } from "vue";
import { useQuasar, QForm } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter, useRoute } from "vue-router";
import { useDataStore } from "@/stores/data";
import TableReport from "@/modules/02_organizational/components/TableReport.vue";
import type { Columns } from "@/modules/02_organizational/interface/index/Main";
import http from "@/plugins/http";
@ -116,13 +116,12 @@ import config from "@/app.config";
import type { treeTab } from "@/modules/04_registry/interface/index/Main";
import type { ResponseTree } from "@/modules/02_organizational/interface/response/Mapping";
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const router = useRouter();
const route = useRoute();
const { date2Thai, success, dateToISO, modalError } = mixin;
const { date2Thai, success, dateToISO, modalError, showLoader, hideLoader } =
mixin;
const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]);
@ -273,7 +272,7 @@ onMounted(async () => {
});
const nodeTree = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileOrganizRoot)
.then((res: any) => {
@ -292,7 +291,7 @@ const nodeTree = async () => {
})
.catch((e: any) => {})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -306,7 +305,7 @@ const clickTree = () => {
};
const onHistory = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.report2HistoryId(selected.value))
.then((res) => {
@ -329,13 +328,13 @@ const onHistory = async () => {
);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
const doSearch = async () => {
// type
loaderPage(true);
showLoader();
await http
.get(config.API.report2TreeId(selected.value))
.then((res) => {
@ -370,7 +369,7 @@ const doSearch = async () => {
})
.catch((e) => {})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -386,7 +385,7 @@ const onConfirm = async () => {
ok: "ยืนยัน",
persistent: true,
}).onOk(async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.report2DoneId(selected.value))
.then((res) => {
@ -394,7 +393,7 @@ const onConfirm = async () => {
})
.catch((e) => {})
.finally(async () => {
loaderPage(false);
hideLoader();
await doSearch();
});
});

View file

@ -574,7 +574,7 @@ import { onMounted, computed, ref, watch } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter, useRoute } from "vue-router";
import { useDataStore } from "@/stores/data";
import TableReport from "@/modules/02_organizational/components/TableReport.vue";
import DialogHeader from "@/modules/02_organizational/components/DialogHeader.vue";
import DialogFooter from "@/modules/02_organizational/components/DialogFooter.vue";
@ -585,13 +585,11 @@ import type { RequestReport2 } from "@/modules/02_organizational/interface/reque
import http from "@/plugins/http";
import config from "@/app.config";
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const router = useRouter();
const route = useRoute();
const { date2Thai, success, dateToISO } = mixin;
const { date2Thai, success, dateToISO, showLoader, hideLoader } = mixin;
const id = ref<string>("");
const myForm = ref<QForm | null>(null); //form data input
@ -669,10 +667,10 @@ const sideWorkOPfilter = ref<DataOption[]>([]);
const levelOPfilter = ref<DataOption[]>([]);
onMounted(async () => {
loaderPage(false);
hideLoader();
if (route.params.id != undefined) {
id.value = route.params.id.toString();
loaderPage(true);
showLoader();
await fetchGoverment();
// await fetchAgency();
@ -685,12 +683,12 @@ onMounted(async () => {
await fetchLevel();
await fetchData();
loaderPage(false);
hideLoader();
}
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.report2Id(id.value))
.then(async (res) => {
@ -750,7 +748,7 @@ const fetchData = async () => {
})
.catch((e) => {})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -766,7 +764,7 @@ const checkSave = async () => {
const saveData = async () => {
// console.log(myData.value);
loaderPage(true);
showLoader();
const body: RequestReport2 = {
organizationShortNameId: myData.value.goverment2,
organizationOrganizationId: myData.value.agency2,
@ -787,7 +785,7 @@ const saveData = async () => {
})
.catch((e) => {})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -797,7 +795,7 @@ const clickBack = () => {
//
const fetchGoverment = async () => {
// loaderPage(true);
// showLoader();
await http
.get(config.API.organizationShortName)
.then((res) => {
@ -823,12 +821,12 @@ const fetchGoverment = async () => {
})
.catch((e) => {})
.finally(() => {
// loaderPage(false);
// hideLoader();
});
};
const updateGoverment = async (id: string) => {
// loaderPage(true);
// showLoader();
await http
.get(config.API.getPositionMasterPositionNumberId(id))
.then((res) => {
@ -917,13 +915,13 @@ const updateGoverment = async (id: string) => {
})
.catch((e) => {})
.finally(() => {
// loaderPage(false);
// hideLoader();
});
};
// //
const fetchPositionNum = async () => {
// loaderPage(true);
// showLoader();
await http
.get(config.API.getPositionMasterPositionNumber)
.then((res) => {
@ -937,13 +935,13 @@ const fetchPositionNum = async () => {
})
.catch((e) => {})
.finally(() => {
// loaderPage(false);
// hideLoader();
});
};
//
const fetchCategory = async () => {
// loaderPage(true);
// showLoader();
await http
.get(config.API.positionType)
.then((res) => {
@ -957,13 +955,13 @@ const fetchCategory = async () => {
})
.catch((e) => {})
.finally(() => {
// loaderPage(false);
// hideLoader();
});
};
//
const fetchPositionManage = async () => {
// loaderPage(true);
// showLoader();
await http
.get(config.API.positionExecutive)
.then((res) => {
@ -977,13 +975,13 @@ const fetchPositionManage = async () => {
})
.catch((e) => {})
.finally(() => {
// loaderPage(false);
// hideLoader();
});
};
//
const fetchSideManage = async () => {
// loaderPage(true);
// showLoader();
await http
.get(config.API.positionExecutiveSide)
.then((res) => {
@ -997,13 +995,13 @@ const fetchSideManage = async () => {
})
.catch((e) => {})
.finally(() => {
// loaderPage(false);
// hideLoader();
});
};
//
const fetchPositionWork = async () => {
// loaderPage(true);
// showLoader();
await http
.get(config.API.positionPath)
.then((res) => {
@ -1017,13 +1015,13 @@ const fetchPositionWork = async () => {
})
.catch((e) => {})
.finally(() => {
// loaderPage(false);
// hideLoader();
});
};
///
const fetchSideWork = async () => {
// loaderPage(true);
// showLoader();
await http
.get(config.API.positionSide)
.then((res) => {
@ -1037,13 +1035,13 @@ const fetchSideWork = async () => {
})
.catch((e) => {})
.finally(() => {
// loaderPage(false);
// hideLoader();
});
};
//
const fetchLevel = async () => {
// loaderPage(true);
// showLoader();
await http
.get(config.API.positionLevel)
.then((res) => {
@ -1057,7 +1055,7 @@ const fetchLevel = async () => {
})
.catch((e) => {})
.finally(() => {
// loaderPage(false);
// hideLoader();
});
};

View file

@ -336,7 +336,7 @@ import { onMounted, ref } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter, useRoute } from "vue-router";
import { useQuasar } from "quasar";
import { useDataStore } from "@/stores/data";
import http from "@/plugins/http";
import config from "@/app.config";
import type {
@ -344,14 +344,12 @@ import type {
ResponseHistoryHead,
} from "@/modules/02_organizational/interface/response/Mapping";
const dataStore = useDataStore();
const $q = useQuasar(); // show dia
const mixin = useCounterMixin();
const router = useRouter();
const route = useRoute();
const { loaderPage } = dataStore;
const { date2Thai, success, dateToISO } = mixin;
const { date2Thai, success, dateToISO, showLoader, hideLoader } = mixin;
const id = ref<string>("");
const previous = ref<boolean>(false);
const next = ref<boolean>(false);
@ -360,7 +358,7 @@ const historyHead = ref<ResponseHistoryHead[]>([]);
const historyData = ref<ResponseHistory[]>([]);
onMounted(async () => {
loaderPage(false);
hideLoader();
if (route.params.id != undefined) {
id.value = route.params.id.toString();
@ -386,7 +384,7 @@ const clickPreviousNext = async (page: string) => {
};
const fetchHistory = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.report2HistoryId(id.value))
.then((res) => {
@ -402,7 +400,7 @@ const fetchHistory = async () => {
})
.catch((e) => {})
.finally(async () => {
loaderPage(false);
hideLoader();
if (historyHead.value.length > 1) {
next.value = true;
previous.value = false;
@ -414,7 +412,7 @@ const fetchHistory = async () => {
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(
config.API.report2HistoryDetailId(
@ -455,7 +453,7 @@ const fetchData = async () => {
})
.catch((e) => {})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
</script>

View file

@ -1,116 +1,98 @@
<template>
<div class="toptitle text-dark col-12 row items-center">รายงานบญช</div>
<div class="col-12 row"></div>
<q-card flat bordered class="col-12">
<div class="row col-12">
<q-tabs
v-model="tab"
no-caps
inline-label
align="left"
active-class="text-primary"
class="text-grey-7"
>
<q-tab name="audit1" label="บัญชี 1" />
<q-tab name="audit2" label="บัญชี 2" />
<q-tab name="audit3" label="บัญชี 3" />
</q-tabs>
</div>
<q-separator />
<q-tab-panels
v-model="tab"
transition-prev="jump-up"
transition-next="jump-up"
animated
swipeable
class="row col-12 text-dark"
>
<q-tab-panel name="audit1">
<div class="row col-12 items-center q-gutter-md">
<span class="text-subtitle1 text-weight-medium"
>รายงานบญชฉบบท 1</span
>
<q-select
class="col-xs-12 col-sm-6"
v-model="goverment"
label="รหัสส่วนราชการ"
dense
emit-value
map-options
option-label="name"
:options="govermentOP"
option-value="id"
lazy-rules
hide-bottom-space
:readonly="true"
:borderless="true"
:outlined="false"
:hide-dropdown-icon="true"
/>
<q-btn
size="md"
icon="mdi-download"
round
flat
color="primary"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<!-- <viewpdf
<div class="toptitle text-dark col-12 row items-center">รายงานบญช</div>
<div class="col-12 row"></div>
<q-card flat bordered class="col-12">
<div class="row col-12">
<q-tabs
v-model="tab"
no-caps
inline-label
align="left"
active-class="text-primary"
class="text-grey-7"
>
<q-tab name="audit1" label="บัญชี 1" />
<q-tab name="audit2" label="บัญชี 2" />
<q-tab name="audit3" label="บัญชี 3" />
</q-tabs>
</div>
<q-separator />
<q-tab-panels
v-model="tab"
transition-prev="jump-up"
transition-next="jump-up"
animated
swipeable
class="row col-12 text-dark"
>
<q-tab-panel name="audit1">
<div class="row col-12 items-center q-gutter-md">
<span class="text-subtitle1 text-weight-medium"
>รายงานบญชฉบบท 1</span
>
<q-select
class="col-xs-12 col-sm-6"
v-model="goverment"
label="รหัสส่วนราชการ"
dense
emit-value
map-options
option-label="name"
:options="govermentOP"
option-value="id"
lazy-rules
hide-bottom-space
:readonly="true"
:borderless="true"
:outlined="false"
:hide-dropdown-icon="true"
/>
<q-btn size="md" icon="mdi-download" round flat color="primary">
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<!-- <viewpdf
:src="pdfSrc"
:currentpage="pdfCurrentPage"
:totalpage="pdfTotalPage" /> -->
</div>
</q-tab-panel>
<q-tab-panel name="audit2">
<div class="row col-12 items-center q-gutter-md">
<span class="text-subtitle1 text-weight-medium"
>รายงานบญชฉบบท 2</span
>
<q-btn
size="md"
icon="mdi-download"
flat
round
color="primary"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<!-- <viewpdf
</div>
</q-tab-panel>
<q-tab-panel name="audit2">
<div class="row col-12 items-center q-gutter-md">
<span class="text-subtitle1 text-weight-medium"
>รายงานบญชฉบบท 2</span
>
<q-btn size="md" icon="mdi-download" flat round color="primary">
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<!-- <viewpdf
:src="pdfSrc"
:currentpage="pdfCurrentPage"
:totalpage="pdfTotalPage" /> -->
</div>
</q-tab-panel>
<q-tab-panel name="audit3">
<div class="row col-12 items-center q-gutter-md">
<span class="text-subtitle1 text-weight-medium"
>รายงานบญชฉบบท 3</span
>
<q-btn
size="md"
icon="mdi-download"
flat
round
color="primary"
>
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<!-- <viewpdf
</div>
</q-tab-panel>
<q-tab-panel name="audit3">
<div class="row col-12 items-center q-gutter-md">
<span class="text-subtitle1 text-weight-medium"
>รายงานบญชฉบบท 3</span
>
<q-btn size="md" icon="mdi-download" flat round color="primary">
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<!-- <viewpdf
:src="pdfSrc"
:currentpage="pdfCurrentPage"
:totalpage="pdfTotalPage" /> -->
</div>
</q-tab-panel>
</q-tab-panels>
</q-card>
</div>
</q-tab-panel>
</q-tab-panels>
</q-card>
</template>
<script setup lang="ts">
import { onMounted, computed, ref, watch } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter, useRoute } from "vue-router";
import { useDataStore } from "@/stores/data";
import TableReport from "@/modules/02_organizational/components/TableReport.vue";
import DialogHeader from "@/modules/02_organizational/components/DialogHeader.vue";
import DialogFooter from "@/modules/02_organizational/components/DialogFooter.vue";
@ -121,13 +103,11 @@ import type { RequestReport2 } from "@/modules/02_organizational/interface/reque
import http from "@/plugins/http";
import config from "@/app.config";
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const router = useRouter();
const route = useRoute();
const { date2Thai, success, dateToISO } = mixin;
const { date2Thai, success, dateToISO, showLoader, hideLoader } = mixin;
const govermentOP = ref<DataOption[]>([]);
const govermentOPfilter = ref<DataOption[]>([]);
@ -135,32 +115,32 @@ const goverment = ref<string>("");
const tab = ref<string>("audit1");
const fetchOrganizationAgency = async () => {
loaderPage(true);
await http
// .get(config.API.organizationAgency)
.get(config.API.listOrganizationAgency("หน่วยงาน"))
.then((res) => {
const data = res.data.result;
let option: DataOption[] = [];
data.map((r: any) => {
option.push({
id: r.organizationId.toString(),
name: r.organizationName.toString(),
});
});
govermentOP.value = option;
govermentOPfilter.value = option;
})
.catch((e) => {
console.log(e);
})
.finally(() => {
loaderPage(false);
});
showLoader();
await http
// .get(config.API.organizationAgency)
.get(config.API.listOrganizationAgency("หน่วยงาน"))
.then((res) => {
const data = res.data.result;
let option: DataOption[] = [];
data.map((r: any) => {
option.push({
id: r.organizationId.toString(),
name: r.organizationName.toString(),
});
});
govermentOP.value = option;
govermentOPfilter.value = option;
})
.catch((e) => {
console.log(e);
})
.finally(() => {
hideLoader();
});
};
onMounted(async () => {
loaderPage(false);
await fetchOrganizationAgency();
hideLoader();
await fetchOrganizationAgency();
});
</script>

View file

@ -245,7 +245,6 @@ import HeaderTop from "@/modules/03_recruiting/components/top.vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useDataStore } from "@/stores/data";
const props = defineProps({
provinceOptions: {
@ -266,15 +265,14 @@ const route = useRoute();
const candidateId = ref<string>(route.params.candidateId.toString());
const edit = ref<boolean>(true);
const myform = ref<any>({});
const loader = ref<boolean>(false);
const districtOptions = ref<DataOption[]>([]);
const districtCOptions = ref<DataOption[]>([]);
const subdistrictOptions = ref<DataOption[]>([]);
const subdistrictCOptions = ref<DataOption[]>([]);
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { messageError } = mixin;
const { messageError, showLoader, hideLoader } = mixin;
const emit = defineEmits(["update:form"]);
watch(myform, async (count: any, prevCount: any) => {
@ -319,7 +317,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -362,7 +360,7 @@ const selectSubDistrict = (e: string, name: string) => {
};
const fetchDistrict = async (id: string, position: string) => {
loader.value = true;
showLoader();
await http
.get(config.API.listDistrict(id))
.then((res) => {
@ -381,12 +379,12 @@ const fetchDistrict = async (id: string, position: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchSubDistrict = async (id: string, position: string) => {
loader.value = true;
showLoader();
await http
.get(config.API.listSubDistrict(id))
.then((res) => {
@ -409,7 +407,7 @@ const fetchSubDistrict = async (id: string, position: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -202,7 +202,6 @@ import Table from "@/modules/03_recruiting/components/TableCan.vue";
import DialogHeader from "@/modules/03_recruiting/components/DialogHeader.vue";
import DialogFooter from "@/modules/03_recruiting/components/DialogFooter.vue";
import { useRoute } from "vue-router";
import { useDataStore } from "@/stores/data";
const props = defineProps({
status: {
@ -229,7 +228,7 @@ const modalEdit = ref<boolean>(false); //modal ที่แสดงใช้ส
const rawItem = ref<RequestItemsObject>(); // row
const rowIndex = ref<number>(0); //index row
const previous = ref<boolean>(); //
const dataStore = useDataStore();
const next = ref<boolean>(); //
const editRow = ref<boolean>(false); //
const checkValidate = ref<boolean>(false); //validate data
@ -237,8 +236,8 @@ const route = useRoute();
const candidateId = ref<string>(route.params.candidateId.toString());
const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table
const { messageError } = mixin;
const { loaderPage } = dataStore;
const { messageError, showLoader, hideLoader } = mixin;
const visibleColumns = ref<String[]>([]);
examData.career.columns.length == 0
@ -318,7 +317,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.candidateCareer(candidateId.value))
.then((res) => {
@ -336,7 +335,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -415,7 +414,7 @@ const checkDelete = (row: RequestItemsObject) => {
*/
const clickDeleteRow = async () => {
if (rawItem.value != null) {
loaderPage(true);
showLoader();
await http
.delete(config.API.candidateAdminCareer(rawItem.value.id))
.then(() => {
@ -451,7 +450,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.candidateAdminCareer(candidateId.value), {
name: location.value,
@ -477,7 +476,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.candidateAdminCareer(id.value), {
name: location.value,

View file

@ -146,7 +146,7 @@ import HeaderTop from "@/modules/03_recruiting/components/top.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useRoute } from "vue-router";
import { useDataStore } from "@/stores/data";
import type { UploadType } from "@/modules/03_recruiting/interface/index/Main";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
@ -161,14 +161,13 @@ const $q = useQuasar();
const route = useRoute();
const candidateId = ref<string>(route.params.candidateId.toString());
const uploader = ref<any>();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const edit = ref<boolean>(props.status == "checkRegister");
const name = ref<string>("");
const files = ref<UploadType[]>([]);
const file = ref<File[]>([]);
const mixin = useCounterMixin();
const { messageError } = mixin;
const { messageError, showLoader, hideLoader } = mixin;
onMounted(async () => {
await getData();
@ -180,7 +179,7 @@ const fileAdd = async (val: any) => {
};
const getData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.candidateUpload(candidateId.value))
.then((res) => {
@ -191,7 +190,7 @@ const getData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -199,7 +198,7 @@ const deleteData = async (id: string) => {
const params = {
documentId: id,
};
loaderPage(true);
showLoader();
await http
.delete(config.API.candidateUpload(candidateId.value), {
params,
@ -211,7 +210,7 @@ const deleteData = async (id: string) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
await getData();
});
};
@ -223,7 +222,7 @@ const uploadData = async () => {
});
const formData = new FormData();
formData.append("", newFile);
loaderPage(true);
showLoader();
await http
.put(config.API.candidateUpload(candidateId.value), formData)
.then((res) => {
@ -233,7 +232,7 @@ const uploadData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
name.value = "";
uploader.value.reset();
await getData();

View file

@ -193,7 +193,7 @@ import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import { useExamDataStore } from "@/modules/03_recruiting/store";
import type {
RequestItemsObject,
@ -238,9 +238,8 @@ const editRow = ref<boolean>(false); //เช็คมีการแก้ไ
const checkValidate = ref<boolean>(false); //validate data
const rows = ref<RequestItemsObject[]>([]);
const route = useRoute();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const { messageError } = mixin;
const { messageError, showLoader, hideLoader } = mixin;
const candidateId = ref<string>(route.params.candidateId.toString());
const filter = ref<string>(""); //search data table
@ -324,7 +323,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.candidateEducation(candidateId.value))
.then((res) => {
@ -343,12 +342,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetcheducationLevel = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.educationLevel)
.then((res) => {
@ -363,7 +362,7 @@ const fetcheducationLevel = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -444,7 +443,7 @@ const checkDelete = (row: RequestItemsObject) => {
*/
const clickDeleteRow = async () => {
if (rawItem.value != null) {
loaderPage(true);
showLoader();
await http
.delete(config.API.candidateAdminEducation(rawItem.value.id))
.then(() => {
@ -480,7 +479,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.candidateAdminEducation(candidateId.value), {
educationLevelId: educationLevelId.value,
@ -506,7 +505,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.candidateAdminEducation(id.value), {
educationLevelId: educationLevelId.value,

View file

@ -113,7 +113,7 @@ import { onMounted, ref } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
const props = defineProps({
@ -129,9 +129,8 @@ const props = defineProps({
const $q = useQuasar();
const mixin = useCounterMixin(); //
const { messageError, date2Thai } = mixin;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const { messageError, date2Thai, showLoader, hideLoader } = mixin;
const fullName = ref<string>("");
const examNumber = ref<string>("");
const citizenId = ref<string>("");
@ -152,7 +151,7 @@ onMounted(async () => {
});
const fetchCard = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.candidateCard(props.candidateId))
.then((res) => {
@ -194,7 +193,7 @@ const fetchCard = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
</script>

View file

@ -282,7 +282,7 @@ import {
import HeaderTop from "@/modules/03_recruiting/components/top.vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
const props = defineProps({
@ -300,10 +300,9 @@ const props = defineProps({
},
});
const $q = useQuasar();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { messageError } = mixin;
const { messageError, showLoader, hideLoader } = mixin;
const edit = ref<boolean>(true);
const myform = ref<any>({});
const route = useRoute();
@ -324,7 +323,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.candidateFamily(candidateId.value))
.then((res) => {
@ -351,7 +350,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -403,7 +403,6 @@ import HeaderTop from "@/modules/03_recruiting/components/top.vue";
import { useRoute } from "vue-router";
import keycloak from "@/plugins/keycloak";
import { useQuasar } from "quasar";
import { useDataStore } from "@/stores/data";
const props = defineProps({
prefixOptions: {
@ -438,9 +437,8 @@ const edit = ref<boolean>(true);
const myform = ref<any>({});
const img = ref<string>("");
const fileProfile = ref<File[]>([]);
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const { messageError } = mixin;
const { messageError, showLoader, hideLoader } = mixin;
const emit = defineEmits(["update:form"]);
@ -463,7 +461,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.candidateInformation(candidateId.value))
.then((res) => {
@ -494,12 +492,12 @@ const fetchData = async () => {
keycloak.tokenParsed == null ? "" : keycloak.tokenParsed.family_name;
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchImgData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.candidateProfile(candidateId.value))
.then((res) => {
@ -510,7 +508,7 @@ const fetchImgData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -542,7 +540,7 @@ const selectProvince = (val: string) => {
};
const fetchDistrict = async (id: string) => {
loaderPage(true);
showLoader();
await http
.get(config.API.listDistrict(id))
.then((res) => {
@ -557,7 +555,7 @@ const fetchDistrict = async (id: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -260,7 +260,7 @@ import {
} from "@/modules/03_recruiting/interface/index/Main";
import HeaderTop from "@/modules/03_recruiting/components/top.vue";
import { useRoute } from "vue-router";
import { useDataStore } from "@/stores/data";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
@ -280,10 +280,9 @@ const edit = ref<boolean>(true);
const myform = ref<any>({});
const route = useRoute();
const candidateId = ref<string>(route.params.candidateId.toString());
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { messageError } = mixin;
const { messageError, showLoader, hideLoader } = mixin;
const emit = defineEmits(["update:form"]);
@ -300,7 +299,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.candidateOccupation(candidateId.value))
.then((res) => {
@ -327,7 +326,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -21,7 +21,11 @@
<q-separator class="q-my-lg bg-gray" size="5px" />
<div class="q-px-sm">
<Family :prefixOptions="prefixOptions" :status="status" v-model:form="formFamily" />
<Family
:prefixOptions="prefixOptions"
:status="status"
v-model:form="formFamily"
/>
</div>
<q-separator class="q-my-lg bg-gray" size="5px" />
@ -56,7 +60,7 @@ import Occupation from "@/modules/03_recruiting/components/Occupation.vue";
import Education from "@/modules/03_recruiting/components/Education.vue";
import Career from "@/modules/03_recruiting/components/Career.vue";
import Document from "@/modules/03_recruiting/components/Document.vue";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
@ -84,8 +88,7 @@ const props = defineProps({
});
const $q = useQuasar();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const prefixOptions = ref<DataOption[]>([]);
const relationshipOptions = ref<DataOption[]>([]);
const provinceOptions = ref<DataOption[]>([]);
@ -94,7 +97,7 @@ const formAddress = ref<any>({});
const formFamily = ref<any>({});
const formOccupation = ref<any>({});
const mixin = useCounterMixin();
const { messageError } = mixin;
const { messageError, showLoader, hideLoader } = mixin;
const emit = defineEmits([
"update:formInformation",
@ -120,14 +123,14 @@ watch(formOccupation, async (count: Object, prevCount: Object) => {
});
onMounted(() => {
loaderPage(false);
hideLoader();
fetchPrefix();
fetchRelationship();
fetchProvince();
});
const fetchPrefix = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.prefix)
.then((res) => {
@ -142,12 +145,12 @@ const fetchPrefix = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchRelationship = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.relationship)
.then((res) => {
@ -162,12 +165,12 @@ const fetchRelationship = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchProvince = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.province)
.then((res) => {
@ -182,7 +185,7 @@ const fetchProvince = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
</script>

View file

@ -149,7 +149,7 @@
<script setup lang="ts">
import { ref, useAttrs } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useDataStore } from "@/stores/data";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
@ -157,8 +157,7 @@ import { useQuasar } from "quasar";
const route = useRoute();
const router = useRouter();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { dateToISO, success, modalError, dialogMessage } = mixin;
const $q = useQuasar(); // show dialog
@ -167,7 +166,7 @@ const table = ref<any>(null);
const files = ref<File[]>([]);
const filterRef = ref<any>(null);
const examId = ref<string>(route.params.examId.toString());
const { messageError } = mixin;
const { messageError, showLoader, hideLoader } = mixin;
const props = defineProps({
inputfilter: String,
inputvisible: Array,
@ -309,7 +308,7 @@ const candidateToPlacement = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
router.go(-1);
});
})
@ -318,7 +317,7 @@ const candidateToPlacement = async () => {
};
const uploadDataSeat = async () => {
loaderPage(true);
showLoader();
const formData = new FormData();
formData.append("", files.value[0]);
await http
@ -330,14 +329,14 @@ const uploadDataSeat = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
files.value = [];
props.fetchData();
});
};
const uploadDataPoint = async () => {
loaderPage(true);
showLoader();
const formData = new FormData();
formData.append("", files.value[0]);
await http
@ -350,14 +349,14 @@ const uploadDataPoint = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
files.value = [];
props.fetchData();
});
};
const downloadFile = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.periodExamDownload(examId.value), {
responseType: "blob",
@ -370,12 +369,12 @@ const downloadFile = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const downloadFileDetail = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.periodExamDownloadDetail(examId.value), {
responseType: "blob",
@ -388,7 +387,7 @@ const downloadFileDetail = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -121,19 +121,19 @@ import { ref, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import type { RecruitDetailResponse } from "@/modules/03_recruiting/interface/response/Period";
import Table from "@/modules/03_recruiting/components/Table.vue";
import { useDataStore } from "@/stores/data";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
const $q = useQuasar();
const dataStore = useDataStore();
const router = useRouter();
const route = useRoute();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { messageError, success } = mixin;
const { messageError, success, showLoader, hideLoader } = mixin;
const year = ref<string>("");
const round = ref<string>("");
const name = ref<string>("");
@ -365,7 +365,7 @@ const columns = ref<QTableProps["columns"]>([
]);
onMounted(async () => {
loaderPage(false);
hideLoader();
await fetchData();
});
@ -374,7 +374,7 @@ const clickDetail = (examID: string) => {
};
const downloadExam = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.exportExam(importId.value), {
responseType: "blob",
@ -390,12 +390,12 @@ const downloadExam = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const downloadPassExam = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.exportPassExam(importId.value), {
responseType: "blob",
@ -411,12 +411,12 @@ const downloadPassExam = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const downloadPassResultExam = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.exportPassResultExam(importId.value), {
responseType: "blob",
@ -432,12 +432,12 @@ const downloadPassResultExam = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.getExamResultById(importId.value), {
examAttribute: "",
@ -474,7 +474,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -489,7 +489,7 @@ const candidateToPlacement = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.periodRecruitToPlacement(importId.value))
.then((res) => {
@ -499,7 +499,7 @@ const candidateToPlacement = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
router.go(-1);
});
})

View file

@ -236,17 +236,17 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import { useDataStore } from "@/stores/data";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
const $q = useQuasar();
const dataStore = useDataStore();
const router = useRouter();
const route = useRoute();
const { loaderPage } = dataStore;
const profile_id = ref<string>("");
const birthdate = ref<string>("");
const gender = ref<string>("");
@ -269,7 +269,7 @@ const examOrder = ref<string>("");
const number = ref<string>("");
const score_expired = ref<string>("");
const mixin = useCounterMixin();
const { messageError } = mixin;
const { messageError, showLoader, hideLoader } = mixin;
const examID = ref<string>("62150001");
const prefix = ref<string>("นาย");
const fullname = ref<string>("เกียรติศักดิ์ บัณฑิต");
@ -281,7 +281,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.getExamDetail(importId.value, examId.value))
.then((res) => {
@ -319,12 +319,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const downloadScore = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.downloadScoreReport(importId.value, examId.value), {
responseType: "blob",
@ -340,12 +340,12 @@ const downloadScore = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const downloadCertificate = async () => {
loaderPage(true);
showLoader();
let type = degree.value.includes("บัณฑิต") ? 2 : 1;
await http
.get(config.API.downloadExamReport(importId.value, examId.value, type), {
@ -362,7 +362,7 @@ const downloadCertificate = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
</script>

File diff suppressed because it is too large Load diff

View file

@ -806,15 +806,14 @@ import type {
} from "@/modules/02_organizational/interface/index/Main";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const router = useRouter();
const route = useRoute();
const { date2Thai, success, dateToISO, notifyError } = mixin;
const { date2Thai, success, dateToISO, notifyError, showLoader, hideLoader } = mixin;
const myForm = ref<QForm | null>(null); //form data input
const name = ref<string>("");
const note = ref<string>("");
@ -925,7 +924,7 @@ watch(organizationName, (count: DataOption, prevCount: DataOption) => {
});
onMounted(async () => {
loaderPage(false);
hideLoader();
if (route.params.id != undefined) {
edit.value = true;
id.value = route.params.id.toString();
@ -940,7 +939,7 @@ const clickBack = () => {
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.getPeriodById(id.value))
.then((res) => {
@ -992,7 +991,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1019,7 +1018,7 @@ const uploadDocData = async () => {
fileDocDataUpload.value.forEach((file: any) => {
formData.append("", file);
});
loaderPage(true);
showLoader();
await http
.put(config.API.periodRecruitDoc(id.value), formData)
.then((res) => {})
@ -1027,7 +1026,7 @@ const uploadDocData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
success($q, "บันทึกข้อมูลสำเร็จ");
clickBack();
});
@ -1043,7 +1042,7 @@ const uploadImgData = async () => {
fileImgDataUpload.value.forEach((file: any) => {
formData.append("", file);
});
loaderPage(true);
showLoader();
await http
.put(config.API.periodRecruitImg(id.value), formData)
.then((res) => {})
@ -1051,7 +1050,7 @@ const uploadImgData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
}
};
@ -1132,7 +1131,7 @@ const sendData = () => {
};
const deleteDocData = async (docId: string) => {
loaderPage(true);
showLoader();
await http
.delete(config.API.periodDeleteDoc(docId))
.then(async () => {
@ -1142,12 +1141,12 @@ const deleteDocData = async (docId: string) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
const deleteImgData = async (docId: string) => {
loaderPage(true);
showLoader();
await http
.delete(config.API.periodDeleteImg(docId))
.then(async () => {
@ -1157,12 +1156,12 @@ const deleteImgData = async (docId: string) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
const addData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.savePeriod, sendData())
.then(async (res) => {
@ -1175,12 +1174,12 @@ const addData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
const editData = async (id: string) => {
loaderPage(true);
showLoader();
await http
.put(config.API.editPeriod(id), sendData())
.then(async () => {
@ -1191,7 +1190,7 @@ const editData = async (id: string) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};

View file

@ -121,15 +121,14 @@ import { ref, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import type { RecruitDetailResponse } from "@/modules/03_recruiting/interface/response/Period";
import Table from "@/modules/03_recruiting/components/Table.vue";
import { useDataStore } from "@/stores/data";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
const $q = useQuasar();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const year = ref<string>("2566");
const round = ref<string>("1");
const name = ref<string>("");
@ -140,7 +139,7 @@ const pass = ref<number>(0);
const notpass = ref<number>(0);
const importId = ref<string>(route.params.id as string); // Period Import Id
const mixin = useCounterMixin();
const { messageError, success } = mixin;
const { messageError, success, showLoader, hideLoader } = mixin;
const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([
"examID",
@ -328,12 +327,12 @@ const clickDetail = (examID: string) => {
};
onMounted(async () => {
loaderPage(false);
hideLoader();
await fetchData();
});
const downloadExam = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.exportDisableExam(importId.value), {
responseType: "blob",
@ -349,12 +348,12 @@ const downloadExam = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const downloadPassExam = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.exportDisablePassExam(importId.value), {
responseType: "blob",
@ -370,12 +369,12 @@ const downloadPassExam = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const downloadPassResultExam = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.exportDisablePassResultExam(importId.value), {
responseType: "blob",
@ -391,12 +390,12 @@ const downloadPassResultExam = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.getDisableExamResultById(importId.value), {
examAttribute: "",
@ -427,7 +426,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -442,7 +441,7 @@ const candidateToPlacement = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.periodDisableToPlacement(importId.value))
.then((res) => {
@ -452,7 +451,7 @@ const candidateToPlacement = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
router.go(-1);
});
})

View file

@ -237,19 +237,19 @@
import type { QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import { useDataStore } from "@/stores/data";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
const $q = useQuasar();
const dataStore = useDataStore();
const router = useRouter();
const route = useRoute();
const mixin = useCounterMixin();
const { messageError } = mixin;
const { loaderPage } = dataStore;
const { messageError, showLoader, hideLoader } = mixin;
const date = ref<any>();
const profile_id = ref<string>("");
const birthdate = ref<string>("");
@ -289,7 +289,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.getDisableExamDetail(importId.value, examId.value))
.then((res) => {
@ -328,12 +328,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const downloadScore = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.downloadDisableScoreReport(importId.value, examId.value), {
responseType: "blob",
@ -349,12 +349,12 @@ const downloadScore = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const downloadCertificate = async () => {
loaderPage(true);
showLoader();
await http
.get(
config.API.downloadDisableExamReport(importId.value, examId.value, 2),
@ -373,7 +373,7 @@ const downloadCertificate = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
</script>

File diff suppressed because it is too large Load diff

View file

@ -669,15 +669,20 @@ import type {
} from "@/modules/02_organizational/interface/index/Main";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const router = useRouter();
const route = useRoute();
const { date2Thai, success, dateToISO, notifyError, messageError } = mixin;
const {
date2Thai,
success,
dateToISO,
notifyError,
messageError,
showLoader,
hideLoader,
} = mixin;
const myForm = ref<QForm | null>(null); //form data input
const name = ref<string>("");
const note = ref<string>("");
@ -725,7 +730,7 @@ onMounted(async () => {
if (route.params.id != undefined) {
edit.value = true;
id.value = route.params.id.toString();
loaderPage(false);
hideLoader();
await fetchData();
} else {
edit.value = false;
@ -737,7 +742,7 @@ const clickBack = () => {
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.getDisablePeriodById(id.value))
.then((res) => {
@ -774,7 +779,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -829,7 +834,7 @@ const sendData = () => {
};
const addData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.saveDisablePeriod, sendData())
.then(async (res) => {
@ -844,12 +849,12 @@ const addData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
const editData = async (id: string) => {
loaderPage(true);
showLoader();
await http
.put(config.API.editDisablePeriod(id), sendData())
.then(async () => {
@ -862,7 +867,7 @@ const editData = async (id: string) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -889,7 +894,7 @@ const uploadImgData = async () => {
fileImgDataUpload.value.forEach((file: any) => {
formData.append("", file);
});
loaderPage(true);
showLoader();
await http
.put(config.API.periodExamImg(id.value), formData)
.then((res) => {})
@ -897,7 +902,7 @@ const uploadImgData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
}
};
@ -906,7 +911,7 @@ const deleteDocData = async (docId: string) => {
const params = {
documentId: docId,
};
loaderPage(true);
showLoader();
await http
.delete(config.API.periodExamDoc(id.value.toString()), {
params,
@ -919,7 +924,7 @@ const deleteDocData = async (docId: string) => {
})
.finally(async () => {
await fetchData();
loaderPage(false);
hideLoader();
});
};
@ -950,7 +955,7 @@ const uploadDocData = async () => {
fileDocDataUpload.value.forEach((file: any) => {
formData.append("", file);
});
loaderPage(true);
showLoader();
await http
.put(config.API.periodExamDoc(id.value), formData)
.then((res) => {})
@ -958,7 +963,7 @@ const uploadDocData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
} else {
clickBack();

View file

@ -138,14 +138,11 @@ import { useRoute, useRouter } from "vue-router";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const router = useRouter();
const $q = useQuasar();
const mixin = useCounterMixin(); //
const { success, dateToISO, messageError } = mixin;
const { success, dateToISO, messageError, showLoader, hideLoader } = mixin;
const route = useRoute();
const examId = ref<string>(route.params.examId.toString());
const candidateId = ref<string>(route.params.candidateId.toString());
@ -163,7 +160,7 @@ onMounted(async () => {
});
const fetchStatus = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.candidateId(candidateId.value))
.then((res) => {
@ -174,12 +171,12 @@ const fetchStatus = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
const confirm = async (status: boolean, reason: string) => {
loaderPage(true);
showLoader();
await http
.put(config.API.candidateCheckRegister(candidateId.value), {
status: status,
@ -190,14 +187,14 @@ const confirm = async (status: boolean, reason: string) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
success($q, "ตรวจสอบข้อมูลสำเร็จ");
router.push(`/qualify/manage/${examId.value}`);
});
};
const reject = async (reason: string) => {
loaderPage(true);
showLoader();
await http
.put(config.API.candidateRejectRegister(candidateId.value), {
reason: reason,
@ -207,7 +204,7 @@ const reject = async (reason: string) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
success($q, "ตรวจสอบข้อมูลสำเร็จ");
router.push(`/qualify/manage/${examId.value}`);
});
@ -253,7 +250,7 @@ const clickSave = async () => {
type.value = defaultOccupation.value.employee;
if (defaultOccupation.value.status == "other")
type.value = defaultOccupation.value.other;
loaderPage(true);
showLoader();
await http
.post(config.API.candidateId(candidateId.value), {
prefixId: defaultInformation.value.prefixId,
@ -329,7 +326,7 @@ const clickSave = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
}
});

View file

@ -55,17 +55,16 @@ import { useCounterMixin } from "@/stores/mixin";
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import type { RequestPeriodExam } from "@/modules/03_recruiting/interface/request/Period";
import type { ResponsePeriodExam } from "@/modules/03_recruiting/interface/response/Period";
import { useQuasar } from "quasar";
const $q = useQuasar();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const router = useRouter();
const mixin = useCounterMixin();
const { date2Thai, messageError } = mixin;
const { date2Thai, messageError, showLoader, hideLoader } = mixin;
const rows = ref<ResponsePeriodExam[]>([]);
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
@ -163,12 +162,12 @@ const columns = ref<QTableProps["columns"]>([
]);
onMounted(async () => {
loaderPage(false);
hideLoader();
await fetchData();
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.periodExamType("exam"))
.then((res) => {
@ -223,7 +222,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -278,17 +278,14 @@ import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const filePayment = ref<File[]>([]);
const bank = ref<any>([]);
const fee = ref<number>();
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin(); //
const { success, messageError } = mixin;
const { success, messageError, showLoader, hideLoader } = mixin;
const route = useRoute();
const examId = ref<string>(route.params.examId.toString());
const candidateId = ref<string>(route.params.candidateId.toString());
@ -308,13 +305,13 @@ const props = defineProps({
});
onMounted(async () => {
loaderPage(false);
hideLoader();
await fetchPaymentExam();
await fetchData();
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.candidatePayment(candidateId.value))
.then((res) => {
@ -325,12 +322,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchPaymentExam = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.periodExamPayment(examId.value))
.then((res) => {
@ -342,12 +339,12 @@ const fetchPaymentExam = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
const confirm = async (status: boolean, reason: string) => {
loaderPage(true);
showLoader();
await http
.put(config.API.candidateCheckPayment(candidateId.value), {
status: status,
@ -358,7 +355,7 @@ const confirm = async (status: boolean, reason: string) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
success($q, "ตรวจสอบข้อมูลชำระเงินสำเร็จ");
router.push(`/qualify/manage/${examId.value}`);
});

View file

@ -94,15 +94,20 @@ import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
import Table from "@/modules/03_recruiting/components/Table.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import { useRouter } from "vue-router";
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const router = useRouter();
const { date2Thai, success, typeCategoryExam, messageError } = mixin;
const {
date2Thai,
success,
typeCategoryExam,
messageError,
showLoader,
hideLoader,
} = mixin;
const filter = ref<string>(""); //search data table
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
@ -205,12 +210,12 @@ const columns = ref<QTableProps["columns"]>([
]);
onMounted(async () => {
loaderPage(false);
hideLoader();
await fetchData();
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.periodExamType("all"))
.then((res) => {
@ -292,7 +297,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -322,7 +327,7 @@ const clickAdd = () => {
};
const deleteData = async (id: string) => {
loaderPage(true);
showLoader();
await http
.delete(config.API.periodExamId(id))
.then((res) => {
@ -332,7 +337,7 @@ const deleteData = async (id: string) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
await fetchData();
});
};

View file

@ -986,16 +986,15 @@ import type {
} from "@/modules/02_organizational/interface/index/Main";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const router = useRouter();
const route = useRoute();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const myForm = ref<QForm | null>(null); //form data input
const name = ref<string>("");
const note = ref<string>("");
@ -1137,7 +1136,7 @@ watch(organizationName, (count: DataOption, prevCount: DataOption) => {
});
onMounted(async () => {
loaderPage(false);
hideLoader();
if (route.params.id != undefined) {
edit.value = true;
id.value = route.params.id.toString();
@ -1160,7 +1159,7 @@ const clickBack = () => {
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.periodExamId(id.value))
.then((res) => {
@ -1239,7 +1238,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1247,7 +1246,7 @@ const fetchData = async () => {
* get รายการ รหสหนวยงาน
*/
const fetchOrganizationShortName = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationShortName)
.then((res) => {
@ -1265,7 +1264,7 @@ const fetchOrganizationShortName = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1273,7 +1272,7 @@ const fetchOrganizationShortName = async () => {
* get รายการ หนวยงาน
*/
const fetchOrganizationOrganization = async (val: string) => {
loaderPage(true);
showLoader();
await http
.get(config.API.organization)
.then((res) => {
@ -1291,7 +1290,7 @@ const fetchOrganizationOrganization = async (val: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1299,7 +1298,7 @@ const fetchOrganizationOrganization = async (val: string) => {
* get รายการ ตำแหนงในสายงาน
*/
const fetchPositionPath = async (val: string) => {
loaderPage(true);
showLoader();
await http
.get(config.API.positionPath)
.then((res) => {
@ -1317,7 +1316,7 @@ const fetchPositionPath = async (val: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1410,7 +1409,7 @@ const sendData = () => {
};
const addData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.periodExam, sendData())
.then(async (res) => {
@ -1425,12 +1424,12 @@ const addData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
const editData = async (id: string) => {
loaderPage(true);
showLoader();
await http
.put(config.API.periodExamId(id), sendData())
.then(async (res) => {
@ -1443,7 +1442,7 @@ const editData = async (id: string) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -1470,13 +1469,13 @@ const uploadDocData = async () => {
fileDocDataUpload.value.forEach((file: any) => {
formData.append("", file);
});
loaderPage(true);
showLoader();
await http
.put(config.API.periodExamDoc(id.value), formData)
.then((res) => {})
.catch((e) => {})
.finally(async () => {
loaderPage(false);
hideLoader();
});
} else {
clickBack();
@ -1506,13 +1505,13 @@ const uploadImgData = async () => {
fileImgDataUpload.value.forEach((file: any) => {
formData.append("", file);
});
loaderPage(true);
showLoader();
await http
.put(config.API.periodExamImg(id.value), formData)
.then((res) => {})
.catch((e) => {})
.finally(async () => {
loaderPage(false);
hideLoader();
});
}
};
@ -1521,7 +1520,7 @@ const deleteDocData = async (docId: string) => {
const params = {
documentId: docId,
};
loaderPage(true);
showLoader();
await http
.delete(config.API.periodExamDoc(id.value.toString()), {
params,

View file

@ -37,7 +37,9 @@
<div class="q-pa-md row col-12 no-wrap">
<!-- การดแสดงจำนวนขอม -->
<div class="col-12 row">
<div class="text-grey-7 q-pb-sm row text-weight-medium col-12 items-center">
<div
class="text-grey-7 q-pb-sm row text-weight-medium col-12 items-center"
>
<!-- สรปจำนวนผสมครคดเลอก -->
<datepicker
v-model="dateFilter"
@ -120,7 +122,8 @@
<div class="col-12 row items-center q-pa-sm">
<div
:class="
'col-12 text-h5 text-weight-bold text-' + `${num.color}`
'col-12 text-h5 text-weight-bold text-' +
`${num.color}`
"
>
{{
@ -282,7 +285,7 @@ import { useCounterMixin } from "@/stores/mixin";
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
import http from "@/plugins/http";
import config from "@/app.config";
import { useDataStore } from "@/stores/data";
import TableCandidate from "@/modules/03_recruiting/components/TableCandidate.vue";
import ExamFinished from "@/modules/03_recruiting/components/ExamFinished.vue";
import type { DataNumObject } from "@/modules/01_metadata/interface/request/Calendar";
@ -290,9 +293,15 @@ import { useQuasar } from "quasar";
const $q = useQuasar();
const mixin = useCounterMixin(); //
const { genColor15, dateToISO, date2Thai, messageError } = mixin;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const {
genColor15,
dateToISO,
date2Thai,
messageError,
showLoader,
hideLoader,
} = mixin;
const router = useRouter();
const route = useRoute();
const status = ref<string>("all");
@ -483,7 +492,7 @@ watch(status, (count: String, prevCount: String) => {
});
onMounted(async () => {
loaderPage(false);
hideLoader();
await fetchDataCom();
});
@ -502,7 +511,7 @@ const fetchDataCom = async () => {
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.candidateOfPeriodExam(status.value, examId.value))
.then((res) => {
@ -530,12 +539,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchPeriodExam = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.periodExamStatus(examId.value))
.then((res) => {
@ -550,7 +559,7 @@ const fetchPeriodExam = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -559,7 +568,7 @@ const fetchPeriodExam = async () => {
*/
const fetchDataSummary = async () => {
dataNum.value = [];
loaderPage(true);
showLoader();
await http
.get(config.API.countDashbordPeriodExam(examId.value))
.then((res) => {
@ -577,12 +586,12 @@ const fetchDataSummary = async () => {
dataNum.value = [];
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const downloadFileDashboard = async () => {
loaderPage(true);
showLoader();
await http
.put(
config.API.periodExamDownloadDashboard(examId.value),
@ -606,7 +615,7 @@ const downloadFileDashboard = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -571,14 +571,13 @@ import http from "@/plugins/http";
import config from "@/app.config";
import HeaderTop from "@/modules/04_registry/components/Information/top.vue";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
const $q = useQuasar();
const mixin = useCounterMixin(); //
const store = useDataStore();
const { loaderPage } = store;
const { date2Thai, messageError } = mixin;
const { date2Thai, messageError, showLoader, hideLoader } = mixin;
const previous = ref<boolean>(false);
const next = ref<boolean>(false);
const addDialog = ref<boolean>(false);
@ -870,7 +869,7 @@ const saveEdit = async () => {
};
const saveDataAgency = async (data: DataLink[]) => {
loaderPage(true);
showLoader();
await http
.post(config.API.cmsAgency, data)
.then((res) => {})
@ -883,7 +882,7 @@ const saveDataAgency = async (data: DataLink[]) => {
};
const saveDataGoverment = async (data: DataLink[]) => {
loaderPage(true);
showLoader();
await http
.post(config.API.cmsGoverment, data)
@ -897,7 +896,7 @@ const saveDataGoverment = async (data: DataLink[]) => {
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.cms)
.then((res) => {
@ -952,12 +951,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const takeLogo = async () => {
loaderPage(true);
showLoader();
const formData = new FormData();
formData.append("FileData", imageFileLogo.value);
await http
@ -974,7 +973,7 @@ const takeLogo = async () => {
};
const takeBanner = async () => {
loaderPage(true);
showLoader();
const formData = new FormData();
formData.append("FileData", imageFile.value);
await http
@ -999,7 +998,7 @@ const sendDataDetail = async () => {
description: web.value.descripstion,
shortName: web.value.by,
};
loaderPage(true);
showLoader();
await http
.post(config.API.cmsDeatail, data)
.then((res) => {})
@ -1026,7 +1025,7 @@ const sendDataAbout = async () => {
zipCode: address.value.code,
telephone: address.value.tel,
};
loaderPage(true);
showLoader();
await http
.post(config.API.cmsAbout, data)
.then((res) => {})
@ -1042,7 +1041,7 @@ const sendDataAbout = async () => {
};
const fetchProvince = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.province)
.then((res) => {
@ -1057,13 +1056,13 @@ const fetchProvince = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchDistrict = async (id: string | null) => {
if (id !== null) {
loaderPage(true);
if (id !== null && id != "") {
showLoader();
await http
.get(config.API.listDistrict(id))
.then((res) => {
@ -1078,14 +1077,14 @@ const fetchDistrict = async (id: string | null) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
const fetchSubDistrict = async (id: string | null) => {
if (id !== null) {
loaderPage(true);
if (id !== null && id != "") {
showLoader();
await http
.get(config.API.listSubDistrict(id))
.then((res) => {
@ -1104,7 +1103,7 @@ const fetchSubDistrict = async (id: string | null) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};

View file

@ -308,7 +308,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -338,10 +338,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const name = ref<string>();
@ -598,7 +598,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileAssessmentId(profileId.value))
.then((res) => {
@ -624,7 +624,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -717,7 +717,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileAssessmentId(profileId.value), {
id: id.value,
@ -747,7 +747,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileAssessmentId(id.value), {
id: id.value,
@ -784,7 +784,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileAssessmentId(id.value))
.then((res) => {
@ -901,7 +901,7 @@ const clickEditRow = () => {
const clickHistory = async (row: RequestItemsObject) => {
tittleHistory.value = "ประวัติแก้ไขผลการประเมินการปฏิบัติราชการ";
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileAssessmentHisId(row.id))
.then((res) => {
@ -927,7 +927,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -264,7 +264,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -294,10 +294,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const issuer = ref<string>();
@ -490,7 +490,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileHonorId(profileId.value))
.then((res) => {
@ -514,7 +514,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -604,7 +604,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileHonorId(profileId.value), {
id: id.value,
@ -632,7 +632,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileHonorId(id.value), {
id: id.value,
@ -667,7 +667,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileHonorId(id.value))
.then((res) => {
@ -781,7 +781,7 @@ const clickHistory = async (row: RequestItemsObject) => {
? "ประวัติแก้ไขประกาศลูกจ้างดีเด่น"
: "ประวัติแก้ไขประกาศเกียรติคุณ";
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileHonorHisId(row.id))
.then((res) => {
@ -805,7 +805,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -278,7 +278,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -307,10 +307,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const level = ref<string>();
@ -590,7 +590,7 @@ const filterSelector = (val: string, update: Function, refData: string) => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileDisId(profileId.value))
.then((res) => {
@ -615,7 +615,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -706,7 +706,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileDisId(profileId.value), {
id: id.value,
@ -735,7 +735,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileDisId(id.value), {
id: id.value,
@ -771,7 +771,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileDisId(id.value))
.then((res) => {
@ -883,7 +883,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileDisHisId(row.id))
.then((res) => {
@ -908,7 +908,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -138,7 +138,7 @@ import { onMounted, computed, ref, watch } from "vue";
import { useQuasar, QForm } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRoute } from "vue-router";
import { useDataStore } from "@/stores/data";
import HeaderTop from "@/modules/04_registry/components/Information/top.vue";
import http from "@/plugins/http";
import config from "@/app.config";
@ -156,12 +156,10 @@ const props = defineProps({
});
const emit = defineEmits(["update:statusEdit"]);
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const route = useRoute();
const { success, messageError } = mixin;
const { success, messageError, showLoader, hideLoader } = mixin;
const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
@ -177,7 +175,7 @@ onMounted(async () => {
const getData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profilePaperId(profileId.value))
.then((res) => {
@ -188,13 +186,13 @@ const getData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
const deleteData = async (id: string) => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profilePaperId(id))
.then((res) => {
@ -219,7 +217,7 @@ const uploadData = async () => {
formData.append("avatar", newFile);
formData.append("moss", "newFile");
console.log(formData);
loaderPage(true);
showLoader();
await http
.post(config.API.profilePaperId(profileId.value), formData)
.then((res) => {

View file

@ -582,7 +582,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -609,10 +609,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateToISO, date2Thai, messageError } = mixin;
const { success, dateToISO, date2Thai, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const levelId = ref<string>();
@ -1047,7 +1047,7 @@ onMounted(async () => {
});
const fetchLevel = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.educationLevel)
.then((res) => {
@ -1063,12 +1063,12 @@ const fetchLevel = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchPositionPath = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.positionPath)
.then((res) => {
@ -1085,7 +1085,7 @@ const fetchPositionPath = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1113,7 +1113,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileEduId(profileId.value))
.then((res) => {
@ -1150,7 +1150,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -1258,7 +1258,7 @@ const saveData = async () => {
// (r: any) => r.id == isEducation.value
// );
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileEduId(profileId.value), {
id: id.value,
@ -1308,7 +1308,7 @@ const editData = async () => {
// const filterPositionPath = OpsFilter.value.positionPathOptions.filter(
// (r: any) => r.id == isEducation.value
// );
loaderPage(true);
showLoader();
await http
.put(config.API.profileEduId(id.value), {
id: id.value,
@ -1359,7 +1359,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileEduId(id.value))
.then((res) => {
@ -1493,7 +1493,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileEduHisId(row.id))
.then((res) => {
@ -1530,7 +1530,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -289,7 +289,7 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
@ -321,10 +321,9 @@ const emit = defineEmits(["update:statusEdit"]);
const route = useRoute();
const $q = useQuasar();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, messageError } = mixin;
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
const edit = ref<boolean>(false);
const addressData = ref<Address>(defaultAddress);
const myform = ref<any>();
@ -582,7 +581,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
*/
const clickHistory = async () => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileAdrsHisId(route.params.id.toString()))
.then((res) => {
@ -610,7 +609,7 @@ const clickHistory = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -626,13 +625,11 @@ const getNewData = async () => {
await fetchDistrict(addressData.value.provinceIdC, "2");
await fetchSubDistrict(addressData.value.districtId, "1");
await fetchSubDistrict(addressData.value.districtIdC, "2");
await selectSubDistrict(addressData.value.subdistrictId, "1");
await selectSubDistrict(addressData.value.subdistrictIdC, "2");
};
const fetchData = async () => {
if (route.params.id) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileAdrsId(route.params.id.toString()))
.then((res) => {
@ -651,7 +648,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -684,7 +681,7 @@ const editData = async () => {
createdAt: new Date(),
createdFullName: "-",
};
loaderPage(true);
showLoader();
await http
.put(config.API.profileAdrsId(route.params.id.toString()), body)
.then((res) => {
@ -701,7 +698,7 @@ const editData = async () => {
};
const addData = async () => {
// loaderPage(true);
// showLoader();
// await http
// .put(config.API.profileInforId(route.params.id.toString()), body)
// .then((res) => {
@ -776,7 +773,7 @@ const selectSubDistrict = (e: string | null, name: string) => {
};
const fetchProvince = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.province)
.then((res) => {
@ -792,13 +789,13 @@ const fetchProvince = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchDistrict = async (id: string | null, position: string) => {
if (id != null) {
loaderPage(true);
if (id != null && id != "") {
showLoader();
await http
.get(config.API.listDistrict(id))
.then((res) => {
@ -819,14 +816,14 @@ const fetchDistrict = async (id: string | null, position: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
const fetchSubDistrict = async (id: string | null, position: string) => {
if (id != null) {
loaderPage(true);
if (id != null && id != "") {
showLoader();
await http
.get(config.API.listSubDistrict(id))
.then((res) => {
@ -851,7 +848,7 @@ const fetchSubDistrict = async (id: string | null, position: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};

View file

@ -261,7 +261,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -290,8 +290,7 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const route = useRoute();
@ -487,7 +486,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileCertId(profileId.value))
.then((res) => {
@ -510,7 +509,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -599,7 +598,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.profileCertId(profileId.value), {
id: id.value,
@ -625,7 +624,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileCertId(id.value), {
id: id.value,
@ -659,7 +658,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileCertId(id.value))
.then((res) => {
@ -773,7 +772,7 @@ const clickHistory = async (row: RequestItemsObject) => {
? "ประวัติแก้ไขใบอนุญาตของลูกจ้าง"
: "ประวัติแก้ไขใบอนุญาตประกอบอาชีพ";
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileCertHisId(row.id))
.then((res) => {
@ -796,7 +795,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -1089,7 +1089,7 @@
import { ref, onMounted } from "vue";
import type { QForm } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
import type {
Family,
@ -1124,10 +1124,9 @@ const emit = defineEmits(["update:statusEdit"]);
const route = useRoute();
const $q = useQuasar();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, messageError } = mixin;
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
const edit = ref<boolean>(false);
const fix = ref<boolean>(true);
const myform = ref<QForm | null>(null);
@ -1233,7 +1232,7 @@ const refreshData = async () => {
};
const fetchPrefix = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.prefix)
.then((res) => {
@ -1249,7 +1248,7 @@ const fetchPrefix = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1279,7 +1278,7 @@ const deleteChildren = (items: childrenFamily) => {
const fetchHistory = async () => {
familyDataHistory.value = [];
loaderPage(true);
showLoader();
await http
.get(config.API.profileFamiHisId(route.params.id.toString()))
.then((res) => {
@ -1317,7 +1316,7 @@ const fetchHistory = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
if (familyDataHistory.value.length == 0) {
// modalError(
// $q,
@ -1340,7 +1339,7 @@ const fetchHistory = async () => {
const fetchData = async () => {
if (route.params.id) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileFamiId(route.params.id.toString()))
.then((res) => {
@ -1393,13 +1392,13 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
}
};
const editData = async () => {
loaderPage(true);
showLoader();
const body: ResponseObject = {
couple: familyData.value.same == "1",
couplePrefixId: familyData.value.prefixIdC,
@ -1441,7 +1440,7 @@ const editData = async () => {
};
const addData = async () => {
// loaderPage(true);
// showLoader();
// await http
// .put(config.API.profileInforId(route.params.id.toString()), body)
// .then((res) => {

View file

@ -330,7 +330,7 @@
<script setup lang="ts">
import { onMounted, ref, watch } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
import type { Goverment } from "@/modules/04_registry/components/profileType";
import { defaultGoverment } from "@/modules/04_registry/components/profileType";
@ -363,10 +363,10 @@ const emit = defineEmits(["update:statusEdit"]);
const route = useRoute();
const $q = useQuasar();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const profileStore = useProfileDataStore();
const { birthDate, retireText } = storeToRefs(profileStore);
const edit = ref<boolean>(false);
@ -611,7 +611,7 @@ watch(retireText, async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileGovId(route.params.id.toString()))
.then((res) => {
@ -637,7 +637,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -647,7 +647,7 @@ const refreshData = async () => {
};
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileGovId(route.params.id.toString()), {
dateAppoint: dateToISO(govermentData.value.containDate),
@ -682,7 +682,7 @@ const handleDate = async (modelData: Date) => {
};
const fetchCalAgeGov = async (date: Date) => {
loaderPage(true);
showLoader();
const body = {
dateAppoint: date,
};
@ -696,7 +696,7 @@ const fetchCalAgeGov = async (date: Date) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -705,7 +705,7 @@ const fetchCalAgeGov = async (date: Date) => {
*/
const clickHistory = async () => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileGovHisId(route.params.id.toString()))
.then((res) => {
@ -738,7 +738,7 @@ const clickHistory = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -409,7 +409,7 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
import type {
Information,
@ -450,9 +450,16 @@ const emit = defineEmits(["update:statusEdit"]);
const route = useRoute();
const $q = useQuasar();
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError, dialogMessage } = mixin;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const {
date2Thai,
success,
dateToISO,
messageError,
dialogMessage,
showLoader,
hideLoader,
} = mixin;
const profileStore = useProfileDataStore();
const { changeRetireText, changeBirth } = profileStore;
const edit = ref<boolean>(false);
@ -739,7 +746,7 @@ const onCancel = async () => {
* get รายการ อมลเกยวกบบคคล
*/
const fetchPerson = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.person)
.then((res) => {
@ -796,7 +803,7 @@ const fetchPerson = async () => {
})
.catch((e: any) => {})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -822,7 +829,7 @@ const changeCardID = (value: string | number | null) => {
};
const checkCitizen = async (id: string) => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileCitizenId(id))
.then((res) => {
@ -847,7 +854,7 @@ const checkCitizen = async (id: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -856,7 +863,7 @@ const checkCitizen = async (id: string) => {
*/
const clickHistory = async () => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileInforHisId(route.params.id.toString()))
.then((res) => {
@ -897,7 +904,7 @@ const clickHistory = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -973,7 +980,7 @@ const calRetire = async (birth: Date) => {
birthDate: dateToISO(birth),
};
if (dateToISO(dateBefore.value) != dateToISO(birth)) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileCalRetire, body)
.then((res: any) => {
@ -989,14 +996,14 @@ const calRetire = async (birth: Date) => {
changeRetireText(date2Thai(retire));
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
const fetchData = async () => {
if (route.params.id) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileInforId(route.params.id.toString()))
.then(async (res: any) => {
@ -1034,7 +1041,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(async () => {
// loaderPage(false);
// hideLoader();
await props.fetchDataProfile();
});
}
@ -1061,7 +1068,7 @@ const editData = async () => {
profileType: informaData.value.profileType,
createdFullName: "-",
};
loaderPage(true);
showLoader();
await http
.put(config.API.profileInforId(route.params.id.toString()), body)
.then((res) => {
@ -1079,7 +1086,7 @@ const editData = async () => {
};
const addData = async () => {
// loaderPage(true);
// showLoader();
// await http
// .put(config.API.profileInforId(route.params.id.toString()), body)
// .then((res) => {

View file

@ -296,7 +296,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -341,8 +341,7 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const {
date2Thai,
@ -351,6 +350,8 @@ const {
messageError,
typeChangeName,
dialogMessage,
showLoader,
hideLoader,
} = mixin;
const route = useRoute();
const id = ref<string>("");
@ -550,7 +551,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileChangeNameId(profileId.value))
.then((res) => {
@ -574,7 +575,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -582,7 +583,7 @@ const fetchData = async () => {
* get รายการ อมลเกยวกบบคคล
*/
const fetchPerson = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.person)
.then((res) => {
@ -599,7 +600,7 @@ const fetchPerson = async () => {
})
.catch((e: any) => {})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -701,7 +702,7 @@ const saveData = async () => {
if (lastName.value != undefined)
formData.append("lastName", lastName.value);
if (status.value != undefined) formData.append("status", status.value);
loaderPage(true);
showLoader();
await http
.post(config.API.profileChangeNameId(profileId.value), formData)
.then((res) => {
@ -747,7 +748,7 @@ const editData = async () => {
formData.append("firstName", firstName.value);
if (lastName.value != undefined) formData.append("lastName", lastName.value);
if (status.value != undefined) formData.append("status", status.value);
loaderPage(true);
showLoader();
await http
.put(config.API.profileChangeNameId(id.value), formData)
.then((res) => {
@ -775,7 +776,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileChangeNameId(id.value))
.then((res) => {
@ -885,7 +886,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileChangeNameHisId(row.id))
.then((res) => {
@ -909,7 +910,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -457,7 +457,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -488,10 +488,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const insigniaId = ref<string>("");
@ -913,7 +913,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
};
const fetchInsignia = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.insignia)
.then((res) => {
@ -934,13 +934,13 @@ const fetchInsignia = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileInsignId(profileId.value))
.then((res) => {
@ -973,7 +973,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -1071,7 +1071,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileInsignId(profileId.value), {
id: id.value,
@ -1107,7 +1107,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileInsignId(id.value), {
id: id.value,
@ -1150,7 +1150,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileInsignId(id.value))
.then((res) => {
@ -1276,7 +1276,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileInsignHisId(row.id))
.then((res) => {
@ -1309,7 +1309,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -347,7 +347,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -380,8 +380,7 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const {
date2Thai,
@ -390,6 +389,8 @@ const {
statusLeave,
dialogMessage,
dateToISO,
showLoader,
hideLoader,
} = mixin;
const route = useRoute();
@ -718,7 +719,7 @@ onMounted(async () => {
const fetchData = async () => {
rows.value = [];
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileLeaveId(profileId.value))
.then((res) => {
@ -743,7 +744,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -773,7 +774,7 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileLeaveHisId(row.id))
.then((res) => {
@ -798,7 +799,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -969,7 +970,7 @@ const saveData = async () => {
const sum = Number(numLeave.value) + Number(numUsedLeave.value);
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileLeaveId(profileId.value), {
dateStartLeave: dateToISO(dateRange.value[0]),
@ -1000,7 +1001,7 @@ const saveData = async () => {
const editData = async () => {
const sum = Number(numLeave.value) + Number(numUsedLeave.value);
loaderPage(true);
showLoader();
await http
.put(config.API.profileLeaveId(id.value), {
dateStartLeave: dateToISO(dateRange.value[0]),
@ -1025,7 +1026,7 @@ const editData = async () => {
};
const deleteData = async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileLeaveId(id.value))
.then((res) => {
@ -1192,7 +1193,7 @@ const addData = async () => {
const clickTotal = async () => {
rowsTotal.value = [];
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileLeaveTotalId(profileId.value))
.then((res) => {
@ -1211,7 +1212,7 @@ const clickTotal = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};

View file

@ -166,7 +166,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -191,10 +191,9 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, messageError } = mixin;
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
const route = useRoute();
const id = ref<string>("");
const date = ref<Date>(new Date());
@ -305,7 +304,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileOtherId(profileId.value))
.then((res) => {
@ -325,7 +324,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -412,7 +411,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileOtherId(profileId.value), {
id: id.value,
@ -436,7 +435,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileOtherId(id.value), {
id: id.value,
@ -467,7 +466,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileOtherId(id.value))
.then((res) => {
@ -571,7 +570,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileOtherHisId(row.id))
.then((res) => {
@ -591,7 +590,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -155,10 +155,6 @@
<q-space />
<q-btn round flat color="pink-5" icon="mdi-file-document">
<!-- <q-tooltip>{{
reasonStatus ? "การกลับเข้ารับราชการ" : "การออกจากราชการ"
}}</q-tooltip> -->
<q-menu transition-show="jump-down" transition-hide="jump-up">
<q-list dense style="min-width: 160px">
<q-item clickable v-close-popup @click="clickPassaway">
@ -387,38 +383,104 @@
</q-dialog>
<!-- Dialog แนบใบมรณบตร -->
<q-dialog v-model="dialogPassaway" persistent>
<q-card style="width: 100vw; max-width: 60vw">
<q-card-section class="q-py-sm row">
<div class="text-h6">แนบใบมรณบตร</div>
<q-space />
<q-btn
icon="close"
unelevated
round
dense
@click="closePassaway"
style="color: #ff8080; background-color: #ffdede"
>
<q-tooltip>ดหนาน</q-tooltip>
</q-btn>
</q-card-section>
<q-separator />
<q-card-actions align="right">
<q-file
class="col-xs-12 col-sm-12"
outlined
dense
v-model="filePassaway"
label="แนบใบมรณบัตร"
hide-bottom-space
lazy-rules
>
<template v-slot:prepend>
<q-icon name="attach_file" />
</template>
</q-file>
</q-card-actions>
</q-card>
<div class="col-12">
<q-card style="width: 100vw; max-width: 60vw">
<q-form ref="myForm">
<q-card-section class="q-py-sm row">
<DialogHeader tittle="ถึงแก่กรรม" :close="closePassaway" />
<div class="col-12 row q-pa-sm q-col-gutter-sm">
<q-file
class="col-12 col-sm-6 col-md-5"
outlined
dense
v-model="filePassaway"
label="แนบใบมรณบัตร"
hide-bottom-space
lazy-rules
>
<q-separator />
<template v-slot:prepend>
<q-icon name="attach_file" />
</template>
</q-file>
<q-input
class="col-12 col-sm-6 col-md-7"
dense
outlined
v-model="deathCertificateNo"
label="เลขที่ใบมรณบัตร"
/>
<datepicker
class="col-12 col-sm-6 col-md-5"
menu-class-name="modalfix"
v-model="dateDeath"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
class="full-width datepicker"
:model-value="
dateDeath != null ? date2Thai(dateDeath) : null
"
:label="`${'วันที่เสียชีวิต'}`"
:rules="[
(val) => !!val || `${'กรุณาเลือกวันที่เสียชีวิต'}`,
]"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<q-input
class="col-12 col-sm-6 col-md-7"
dense
outlined
v-model="placeDeathCertificate"
label="สถานที่ออกใบมรณบัตร"
/>
<q-separator />
<q-input
class="col-12"
dense
outlined
v-model="reasonDeath"
label="เหตุผลการเสีบชีวิต"
type="textarea"
/>
</div>
<q-space />
</q-card-section>
<q-separator />
<DialogFooter
:save="clickSave"
:validate="validateData"
v-model:editvisible="edit"
v-model:modalEdit="modalEdit"
/>
</q-form>
</q-card>
</div>
</q-dialog>
<!-- Dialog เลอก เกษยณ -->
<q-dialog v-model="dialogLeave" persistent>
@ -583,8 +645,10 @@ import { ref, onMounted } from "vue";
import { useDataStore } from "@/stores/data";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useQuasar, QForm } from "quasar";
import EducationVue from "@/modules/04_registry/components/Education.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
import TrainVue from "@/modules/04_registry/components/Train.vue";
import InsigniaVue from "@/modules/04_registry/components/Insignia.vue";
import CoinedVue from "@/modules/04_registry/components/Coin.vue";
@ -611,21 +675,27 @@ import config from "@/app.config";
const $q = useQuasar();
const store = useDataStore();
const { changeTab, loaderPage } = store;
const { changeTab } = store;
const reasonDeath = ref("");
const deathCertificateNo = ref("");
const placeDeathCertificate = ref("");
const mixin = useCounterMixin();
const { date2Thai, dateToISO, messageError, dialogMessage, success } = mixin;
const {
date2Thai,
dateToISO,
messageError,
dialogMessage,
success,
showLoader,
hideLoader,
} = mixin;
const route = useRoute();
const router = useRouter();
const imageUrl = ref<any>(null);
const inputImage = ref<any>(null);
const fullname = ref<string>("");
const position = ref<string>("นักจัดการงานทั่วไป");
const pdfSrc = ref<string>("");
const pdfCurrentPage = ref<number>();
const pdfTotalPage = ref<number>();
const pdfSrcShort = ref<string>("");
const pdfCurrentPageShort = ref<number>();
const pdfTotalPageShort = ref<number>();
const dateDeath = ref<Date>(new Date());
const dialog = ref<boolean>(false);
const dialogShort = ref<boolean>(false);
const dialogLeave = ref<boolean>(false);
@ -636,6 +706,11 @@ const statusEdit = ref<boolean>(false);
const activeImage = ref<any | null>(null);
const filePassaway = ref(null);
const images = ref<any>([]);
const checkValidate = ref<boolean>(false); //validate data
const myForm = ref<QForm | null>(null); //form data input
const edit = ref<boolean>(false); // dialog
const modal = ref<boolean>(false); //modal add detail
const modalEdit = ref<boolean>(false); //modal
const profileId = ref<string>(route.params.id.toString());
const profileType = ref<string>("");
const employeeClass = ref<string>("temp");
@ -692,7 +767,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileAvatarId(profileId.value))
.then((res) => {
@ -718,12 +793,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const checkProfileData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileCheckId(profileId.value))
.then((res) => {
@ -734,12 +809,12 @@ const checkProfileData = async () => {
router.push("/registry");
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchAvatarHistory = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileAvatarHistoryId(profileId.value))
.then((res) => {
@ -759,7 +834,7 @@ const fetchAvatarHistory = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -768,7 +843,7 @@ const uploadImage = async (e: any) => {
if (input.length > 0) {
const formData = new FormData();
formData.append("FileData", input[0]);
loaderPage(true);
showLoader();
await http
.post(config.API.profileAvatarId(profileId.value), formData)
.then((res) => {})
@ -784,7 +859,7 @@ const uploadImage = async (e: any) => {
};
const fetchDataDelete = async (id: string) => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileAvatarHistoryId(id))
.then((res) => {
@ -829,7 +904,7 @@ const selectAvatarHistory = async () => {
);
return;
}
loaderPage(true);
showLoader();
await http
.put(config.API.profileAvatarId(profileId.value), {
avatar: activeImage.value.avatarId,
@ -905,7 +980,7 @@ const downloadKP7Short = () => {};
const clickKp7 = async () => {
window.open(config.API.profileReportId(profileId.value));
// loaderPage(true);
// showLoader();
// await http
// .get(config.API.profileReportId(profileId.value))
// .then((res) => {
@ -918,10 +993,103 @@ const clickKp7 = async () => {
// })
// .catch((e) => {messageError($q, e);})
// .finally(() => {
// loaderPage(false);
// hideLoader();
// });
};
/**
* กดบนทกใน dialog
*/
const clickSave = async () => {
myForm.value!.validate().then(async (result: boolean) => {
if (result) {
if (modalEdit.value) {
await editData();
} else {
await saveData();
}
}
});
};
/**
* นทกแกไขขอม
*/
const editData = async () => {
// modal.value = false;
// showLoader();
// await http
// .put(config.API.getPositionMasterId(positionMasterId.value), {
// positionMasterId: positionMasterId.value,
// positionTypeId: positionTypeId.value,
// positionLineId: positionLineId.value,
// positionPathId: positionPathId.value,
// positionPathSideId: positionPathSideId.value,
// positionExecutiveId: positionExecutiveId.value,
// positionExecutiveSideId: positionExecutiveSideId.value,
// positionLevelId: positionLevelId.value,
// isDirector: isDirector.value,
// positionStatusId: positionStatusId.value,
// qualification: qualification.value,
// positionCondition: positionCondition.value,
// positionMasterUserNote: positionMasterUserNote.value,
// })
// .then((res) => {
// success($q, "");
// })
// .catch((e) => {
// statusCode.value = e.response.data.status;
// })
// .finally(async () => {
// edit.value = false;
// await fetchData();
// });
};
/**
* นทกเพมขอม
*/
const saveData = async () => {
// modal.value = false;
// showLoader();
// await http
// .post(config.API.getPositionMaster, {
// positionTypeId: positionTypeId.value,
// positionLineId: positionLineId.value,
// positionPathId: positionPathId.value,
// positionPathSideId: positionPathSideId.value,
// positionExecutiveId: positionExecutiveId.value,
// positionExecutiveSideId: positionExecutiveSideId.value,
// positionLevelId: positionLevelId.value,
// isDirector: isDirector.value,
// positionStatusId: positionStatusId.value,
// qualification: qualification.value,
// positionCondition: positionCondition.value,
// positionMasterUserNote: positionMasterUserNote.value,
// })
// .then((res) => {
// success($q, "");
// })
// .catch((e) => {
// statusCode.value = e.response.data.status;
// })
// .finally(async () => {
// modal.value = false;
// await fetchData();
// });
};
/**
* validate input ใน dialog
*/
const validateData = async () => {
checkValidate.value = true;
await myForm.value!.validate().then((result: boolean) => {
if (result == false) {
checkValidate.value = false;
}
});
};
const downloadFilePDF = async (res: string, fileName: string) => {
const link = document.createElement("a");
// link.href = window.URL.createObjectURL(new Blob([res]));
@ -937,7 +1105,7 @@ const downloadFilePDF = async (res: string, fileName: string) => {
const clickKp7Short = async () => {
window.open(config.API.profileKp7ShortId(profileId.value));
// loaderPage(true);
// showLoader();
// await http
// .get(config.API.profileKp7ShortId(profileId.value))
// .then((res) => {
@ -950,7 +1118,7 @@ const clickKp7Short = async () => {
// })
// .catch((e) => {messageError($q, e);})
// .finally(() => {
// loaderPage(false);
// hideLoader();
// });
};
@ -983,7 +1151,7 @@ const clickPassaway = async () => {
const Retire = async () => {
if (reasonStatus.value == true) {
loaderPage(true);
showLoader();
await http
.put(config.API.profileReactive(profileId.value))
.then((res) => {
@ -998,7 +1166,7 @@ const Retire = async () => {
router.push("/registry");
});
} else {
loaderPage(true);
showLoader();
await http
.put(config.API.profileDeactive(profileId.value), {
leaveDate: dateToISO(leaveDate.value),

View file

@ -258,7 +258,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -283,10 +283,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const date = ref<Date>(new Date());
@ -309,7 +309,9 @@ const tittleHistory = ref<string>(
);
const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal
const profileId = ref<string>(route.params.id ? route.params.id.toString():'');
const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const checkValidate = ref<boolean>(false); //validate data
const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table
@ -478,8 +480,8 @@ onMounted(async () => {
});
const fetchData = async () => {
if (profileId.value!='') {
loaderPage(true);
if (profileId.value != "") {
showLoader();
await http
.get(config.API.profileNopaidId(profileId.value))
.then((res) => {
@ -503,7 +505,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -593,7 +595,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileNopaidId(profileId.value), {
id: id.value,
@ -621,7 +623,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileNopaidId(id.value), {
id: id.value,
@ -656,7 +658,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileNopaidId(id.value))
.then((res) => {
@ -766,7 +768,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileNopaidHisId(row.id))
.then((res) => {
@ -790,7 +792,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -552,7 +552,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -581,10 +581,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const date = ref<Date>(new Date());
@ -1410,7 +1410,7 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
};
const nodeTree = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileOrganizRoot)
.then((res: any) => {
@ -1424,7 +1424,7 @@ const nodeTree = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1432,7 +1432,7 @@ const nodeTree = async () => {
* get รายการ ตำแหน
*/
const fetchPosition = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.position)
.then((res) => {
@ -1509,13 +1509,13 @@ const fetchPosition = async () => {
})
.catch((e: any) => {})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileSalaryId(profileId.value))
.then((res) => {
@ -1558,7 +1558,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -1569,7 +1569,7 @@ const onSelected = async (id: string) => {
const fetchOrganization = async (id: string) => {
if (selected.value != "") {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationName(id))
.then((res) => {
@ -1580,13 +1580,13 @@ const fetchOrganization = async (id: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
const fetchPositionNumber = async (id: string) => {
loaderPage(true);
showLoader();
await http
.get(config.API.getPositionNumberIdByOcId(id))
.then((res) => {
@ -1602,7 +1602,7 @@ const fetchPositionNumber = async (id: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1767,7 +1767,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileSalaryId(profileId.value), {
date: dateToISO(date.value),
@ -1804,7 +1804,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileSalaryId(id.value), {
date: dateToISO(date.value),
@ -1848,7 +1848,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileSalaryId(id.value))
.then((res) => {
@ -1992,7 +1992,7 @@ const clickEditRowRef = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileSalaryHisId(row.id))
.then((res) => {
@ -2035,7 +2035,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -563,7 +563,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -592,10 +592,17 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError, dialogMessage } = mixin;
const {
date2Thai,
success,
dateToISO,
messageError,
dialogMessage,
showLoader,
hideLoader,
} = mixin;
const route = useRoute();
const id = ref<string>("");
const date = ref<Date>(new Date());
@ -1281,14 +1288,14 @@ onMounted(async () => {
});
const fetchDataSelector = async () => {
loaderPage(true);
showLoader();
await fetchEmployeePosition();
await fetchEmployeePositionSide();
await fetchEmployeeLevel();
await fetchEmployeeGroup();
await fetchAgency();
await nodeTree();
loaderPage(false);
hideLoader();
};
//
const fetchEmployeePosition = async () => {
@ -1383,7 +1390,7 @@ const fetchAgency = async () => {
};
const nodeTree = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileOrganizRoot)
.then((res: any) => {
@ -1397,7 +1404,7 @@ const nodeTree = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1469,7 +1476,7 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileSalaryEmployeeId(profileId.value))
.then((res) => {
@ -1509,13 +1516,13 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
const fetchPositionNumber = async (id: string) => {
// loaderPage(true);
// showLoader();
if (id == null || id == "") return;
await http
.get(config.API.getPositionNumberIdByOcId(id))
@ -1532,7 +1539,7 @@ const fetchPositionNumber = async (id: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1696,7 +1703,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileSalaryEmployeeId(profileId.value), {
amount: amount.value,
@ -1731,7 +1738,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileSalaryEmployeeId(id.value), {
amount: amount.value,
@ -1765,7 +1772,7 @@ const editData = async () => {
* ลบขอม
*/
const fetchDataDelete = async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileSalaryId(id.value))
.then((res) => {
@ -1935,7 +1942,7 @@ const clickEditRowRef = () => {
*/
const clickHistory = async (row: RequestItemsEmployee) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileSalaryHisId(row.id))
.then((res) => {
@ -1974,7 +1981,7 @@ const clickHistory = async (row: RequestItemsEmployee) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -538,7 +538,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -567,10 +567,17 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError, dialogMessage } = mixin;
const {
date2Thai,
success,
dateToISO,
messageError,
dialogMessage,
showLoader,
hideLoader,
} = mixin;
const route = useRoute();
const id = ref<string>("");
const date = ref<Date>(new Date());
@ -1310,14 +1317,14 @@ onMounted(async () => {
});
const fetchDataSelector = async () => {
loaderPage(true);
showLoader();
await fetchEmployeePosition();
await fetchEmployeePositionSide();
await fetchEmployeeLevel();
await fetchEmployeeGroup();
await fetchAgency();
await nodeTree();
loaderPage(false);
hideLoader();
};
//
const fetchEmployeePosition = async () => {
@ -1412,7 +1419,7 @@ const fetchAgency = async () => {
};
const nodeTree = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileOrganizRoot)
.then((res: any) => {
@ -1426,7 +1433,7 @@ const nodeTree = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1498,7 +1505,7 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileSalaryEmployeeId(profileId.value))
.then((res) => {
@ -1537,13 +1544,13 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
const fetchPositionNumber = async (id: string) => {
// loaderPage(true);
// showLoader();
if (id == null || id == "") return;
await http
.get(config.API.getPositionNumberIdByOcId(id))
@ -1560,7 +1567,7 @@ const fetchPositionNumber = async (id: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1725,7 +1732,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileSalaryEmployeeId(profileId.value), {
amount: amount.value,
@ -1760,7 +1767,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileSalaryEmployeeId(id.value), {
amount: amount.value,
@ -1794,7 +1801,7 @@ const editData = async () => {
* ลบขอม
*/
const fetchDataDelete = async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileSalaryId(id.value))
.then((res) => {
@ -1964,7 +1971,7 @@ const clickEditRowRef = () => {
*/
const clickHistory = async (row: RequestItemsEmployee) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileSalaryHisId(row.id))
.then((res) => {
@ -2003,7 +2010,7 @@ const clickHistory = async (row: RequestItemsEmployee) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -164,7 +164,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -189,10 +189,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const field = ref<string>();
@ -355,7 +355,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileAbiliId(profileId.value))
.then((res) => {
@ -377,7 +377,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -466,7 +466,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileAbiliId(profileId.value), {
id: id.value,
@ -492,7 +492,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileAbiliId(id.value), {
id: id.value,
@ -525,7 +525,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileAbiliId(id.value))
.then((res) => {
@ -633,7 +633,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileAbiliHisId(row.id))
.then((res) => {
@ -655,7 +655,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -403,7 +403,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -428,10 +428,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const name = ref<string>();
@ -754,7 +754,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileTrainId(profileId.value))
.then((res) => {
@ -782,7 +782,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -877,7 +877,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileTrainId(profileId.value), {
id: id.value,
@ -909,7 +909,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileTrainId(id.value), {
id: id.value,
@ -948,7 +948,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileTrainId(id.value))
.then((res) => {
@ -1068,7 +1068,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileTrainHisId(row.id))
.then((res) => {
@ -1096,7 +1096,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -304,7 +304,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -329,10 +329,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const dateStart = ref<Date>(new Date());
@ -555,7 +555,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileDutyId(profileId.value))
.then((res) => {
@ -580,7 +580,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -671,7 +671,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileDutyId(profileId.value), {
id: id.value,
@ -700,7 +700,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileDutyId(id.value), {
id: id.value,
@ -736,7 +736,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileDutyId(id.value))
.then((res) => {
@ -848,7 +848,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileDutyHisId(row.id))
.then((res) => {
@ -873,7 +873,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -14,7 +14,7 @@ interface Information {
prefixId: string | null;
firstname: string | null;
lastname: string | null;
birthDate: Date;
birthDate: Date | null;
genderId: string | null;
bloodId: string | null;
nationality: string | null;
@ -135,7 +135,7 @@ const defaultInformation: Information = {
prefixId: null,
firstname: null,
lastname: null,
birthDate: new Date(),
birthDate: null,
genderId: null,
bloodId: null,
nationality: null,

Some files were not shown because too many files have changed in this diff Show more