From 5895bbc9f2b043fbfb8f59fa885deb952fa5823f Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Tue, 14 May 2024 18:13:03 +0700 Subject: [PATCH] no message --- src/api/manage/api.person.ts | 8 + .../components/personal/08ListProvince.vue | 48 +-- .../components/personal/DialogForm.vue | 3 +- .../personal/province/01_District.vue | 307 ++++++++++++++++++ .../personal/province/02_SubDistrict.vue | 297 +++++++++++++++++ .../interface/response/personal/personal.ts | 19 +- src/modules/01_metadataNew/router.ts | 24 ++ 7 files changed, 674 insertions(+), 32 deletions(-) create mode 100644 src/modules/01_metadataNew/components/personal/province/01_District.vue create mode 100644 src/modules/01_metadataNew/components/personal/province/02_SubDistrict.vue diff --git a/src/api/manage/api.person.ts b/src/api/manage/api.person.ts index 048c08977..26f48d0eb 100644 --- a/src/api/manage/api.person.ts +++ b/src/api/manage/api.person.ts @@ -22,6 +22,10 @@ const orgGender = `${env.API_URI}/org/metadata/gender/`; const orgReligion = `${env.API_URI}/org/metadata/religion/`; const orgEducationLevel = `${env.API_URI}/org/metadata/educationLevel/`; +const orgProvince = `${env.API_URI}/org/metadata/province/`; +const orgDistrict = `${env.API_URI}/org/metadata/district/`; +const orgSubDistrict = `${env.API_URI}/org/metadata/subDistrict/`; + export default { person: `${person}person`, @@ -129,4 +133,8 @@ export default { orgReligionId: (id: string) => `${orgReligion}${id}`, orgEducationLevel, orgEducationLevelId: (id: string) => `${orgEducationLevel}${id}`, + + orgProvince, + orgDistrict, + orgSubDistrict, }; diff --git a/src/modules/01_metadataNew/components/personal/08ListProvince.vue b/src/modules/01_metadataNew/components/personal/08ListProvince.vue index 8016e7c20..c21ad28ed 100644 --- a/src/modules/01_metadataNew/components/personal/08ListProvince.vue +++ b/src/modules/01_metadataNew/components/personal/08ListProvince.vue @@ -9,6 +9,7 @@ import DialogForm from "@/modules/01_metadataNew/components/personal/DialogForm. import http from "@/plugins/http"; import config from "@/app.config"; +const router = useRouter() const store = usePersonalDataStore(); const mixin = useCounterMixin(); const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin; @@ -24,17 +25,6 @@ const columns = [ sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, - { - name: "rank", - align: "left", - label: "ลำดับ", - sortable: true, - field: "rank", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, { name: "createdAt", align: "left", @@ -74,13 +64,12 @@ const $q = useQuasar(); const editId = ref(""); const filterKeyword = ref(""); const dialog = ref(false); -const educationLevel = ref(""); -const educationRank = ref(); +const province = ref(""); + const dialogStatus = ref(""); -const personalName = ref("ระดับการศึกษา"); +const personalName = ref("จังหวัด"); const visibleColumns = ref([ "name", - "rank", "createdAt", "lastUpdatedAt", "lastUpdateFullName", @@ -89,7 +78,7 @@ const visibleColumns = ref([ async function fetchData() { showLoader(); await http - .get(config.API.orgEducationLevel) + .get(config.API.orgProvince) .then(async (res) => { store.save(res.data.result); }) @@ -103,9 +92,8 @@ async function fetchData() { async function addData() { await http - .post(config.API.orgEducationLevel, { - name: educationLevel.value, - rank: educationRank.value, + .post(config.API.orgProvince, { + name: province.value, }) .then(() => { fetchData(); @@ -121,9 +109,8 @@ async function addData() { async function editData(id: string) { await http - .put(config.API.orgEducationLevelId(id), { - name: educationLevel.value, - rank: educationRank.value, + .put(config.API.orgProvince+`${id}`, { + name: province.value, }) .then(() => { fetchData(); @@ -139,7 +126,7 @@ async function editData(id: string) { async function deleteData(id: string) { await http - .delete(config.API.orgEducationLevelId(id)) + .delete(config.API.orgProvince+`${id}`) .then(() => { fetchData(); success($q, "ลบข้อมูลสำเร็จ"); @@ -152,6 +139,10 @@ async function deleteData(id: string) { }); } +function nextPage(id:string){ + router.push(`/master-data/personal/district/${id}`) +} + onMounted(async () => { fetchData(); }); @@ -168,8 +159,7 @@ onMounted(async () => { () => { dialogStatus = 'create'; dialog = true; - educationLevel = ''; - educationRank = undefined; + province = ''; } " > @@ -218,7 +208,7 @@ onMounted(async () => {