api รายละเอียดบรรจุ
This commit is contained in:
parent
4854a01b7a
commit
b29c6ca262
6 changed files with 230 additions and 1128 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import env from "../index";
|
import env from "../index";
|
||||||
const placement = `${env.API_PLACEMENT_URI}/Placement/placement`;
|
// const placement = `${env.API_PLACEMENT_URI}/placement`;
|
||||||
|
const placement = `${env.API_URI}/placement`;
|
||||||
const orgTree = `${env.API_URI_ORG_TREE}`;
|
const orgTree = `${env.API_URI_ORG_TREE}`;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ const config = ref<any>({
|
||||||
API_CANDIDATE_URI: "https://bma-ehr.frappet.synology.me/api/v1",
|
API_CANDIDATE_URI: "https://bma-ehr.frappet.synology.me/api/v1",
|
||||||
// API_REPORT_URI: "https://localhost:7187/api/v1",
|
// API_REPORT_URI: "https://localhost:7187/api/v1",
|
||||||
API_REPORT_URI: "https://bma-ehr.frappet.synology.me/api/v1",
|
API_REPORT_URI: "https://bma-ehr.frappet.synology.me/api/v1",
|
||||||
API_PLACEMENT_URI: "https://localhost:7260/api",
|
API_PLACEMENT_URI: "https://localhost:7260/api/v1",
|
||||||
API_URI_ORG_TREE:
|
API_URI_ORG_TREE:
|
||||||
"https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230712_172702.json",
|
"https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230712_172702.json",
|
||||||
MEET_URI: "meet.frappet.com",
|
MEET_URI: "meet.frappet.com",
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,11 @@ import ExamResult from "@/modules/05_placement/components/PersonalDetail/ExamRes
|
||||||
import Qualification from "@/modules/05_placement/components/PersonalDetail/Qualification.vue";
|
import Qualification from "@/modules/05_placement/components/PersonalDetail/Qualification.vue";
|
||||||
import Familyvue from "@/modules/05_placement/components/PersonalDetail/Information/Family.vue";
|
import Familyvue from "@/modules/05_placement/components/PersonalDetail/Information/Family.vue";
|
||||||
|
|
||||||
|
import {
|
||||||
|
AddressDataDefualt,
|
||||||
|
FamilyDataDefualt,
|
||||||
|
} from "@/modules/05_placement/interface/index/Main";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
Property,
|
Property,
|
||||||
PointExam,
|
PointExam,
|
||||||
|
|
@ -77,43 +82,6 @@ const InformationDataDefualt: Information = {
|
||||||
religionId: "",
|
religionId: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
const FamilyDataDefualt: Family = {
|
|
||||||
couple: false,
|
|
||||||
marryPrefix: "",
|
|
||||||
marryPrefixId: "",
|
|
||||||
marryFirstName: "",
|
|
||||||
marryLastName: "",
|
|
||||||
marryOccupation: "",
|
|
||||||
fatherPrefix: "",
|
|
||||||
fatherPrefixId: "",
|
|
||||||
fatherFirstName: "",
|
|
||||||
fatherLastName: "",
|
|
||||||
fatherOccupation: "",
|
|
||||||
motherPrefix: "",
|
|
||||||
motherPrefixId: "",
|
|
||||||
motherFirstName: "",
|
|
||||||
motherLastName: "",
|
|
||||||
motherOccupation: "",
|
|
||||||
};
|
|
||||||
|
|
||||||
const AddressDataDefualt: Address = {
|
|
||||||
registSubDistrict: "",
|
|
||||||
registSubDistrictId: "",
|
|
||||||
registZipCode: "",
|
|
||||||
registDistrict: "",
|
|
||||||
registDistrictId: "",
|
|
||||||
registProvince: "",
|
|
||||||
registProvinceId: "",
|
|
||||||
currentSubDistrict: "",
|
|
||||||
currentSubDistrictId: "",
|
|
||||||
currentZipCode: "",
|
|
||||||
currentDistrict: "",
|
|
||||||
currentDistrictId: "",
|
|
||||||
currentProvince: "",
|
|
||||||
currentProvinceId: "",
|
|
||||||
registSame: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
const personalData = ref({
|
const personalData = ref({
|
||||||
id: "",
|
id: "",
|
||||||
fullName: "",
|
fullName: "",
|
||||||
|
|
@ -157,7 +125,9 @@ const fetchData = async () => {
|
||||||
InformationData.value.age = data.age;
|
InformationData.value.age = data.age;
|
||||||
InformationData.value.telephone = data.telephone;
|
InformationData.value.telephone = data.telephone;
|
||||||
|
|
||||||
AddressData.value.registSame = data.registSame ?? false;
|
AddressData.value.registAddress = data.registAddress ?? "";
|
||||||
|
AddressData.value.currentAddress = data.currentAddress ?? "";
|
||||||
|
AddressData.value.registSame = data.registSame ? "1" : "0";
|
||||||
AddressData.value.registSubDistrict = data.registSubDistrict ?? "";
|
AddressData.value.registSubDistrict = data.registSubDistrict ?? "";
|
||||||
AddressData.value.registSubDistrictId = data.registSubDistrictId ?? "";
|
AddressData.value.registSubDistrictId = data.registSubDistrictId ?? "";
|
||||||
AddressData.value.registZipCode = data.registZipCode ?? "";
|
AddressData.value.registZipCode = data.registZipCode ?? "";
|
||||||
|
|
@ -173,7 +143,7 @@ const fetchData = async () => {
|
||||||
AddressData.value.currentProvince = data.currentProvince ?? "";
|
AddressData.value.currentProvince = data.currentProvince ?? "";
|
||||||
AddressData.value.currentProvinceId = data.currentProvinceId ?? "";
|
AddressData.value.currentProvinceId = data.currentProvinceId ?? "";
|
||||||
|
|
||||||
FamilyData.value.couple = data.couple ?? false;
|
FamilyData.value.couple = data.couple ? "1" : "0";
|
||||||
FamilyData.value.marryPrefix = data.marryPrefix ?? "";
|
FamilyData.value.marryPrefix = data.marryPrefix ?? "";
|
||||||
FamilyData.value.marryPrefixId = data.marryPrefixId ?? "";
|
FamilyData.value.marryPrefixId = data.marryPrefixId ?? "";
|
||||||
FamilyData.value.marryFirstName = data.marryFirstName ?? "";
|
FamilyData.value.marryFirstName = data.marryFirstName ?? "";
|
||||||
|
|
|
||||||
|
|
@ -2,19 +2,13 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useDataStore } from "@/stores/data";
|
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import type {
|
import type { zipCodeOption } from "@/modules/05_placement/components/PersonalDetail/profileType";
|
||||||
Address,
|
|
||||||
zipCodeOption,
|
|
||||||
} from "@/modules/05_placement/components/PersonalDetail/profileType";
|
|
||||||
import { defaultAddress } from "@/modules/05_placement/components/PersonalDetail/profileType";
|
|
||||||
import HeaderTop from "@/modules/05_placement/components/PersonalDetail/Information/top.vue";
|
import HeaderTop from "@/modules/05_placement/components/PersonalDetail/Information/top.vue";
|
||||||
import type { RequestItemsHistoryObject } from "@/modules//05_placement/interface/request/Address";
|
|
||||||
import type { ResponseObject } from "@/modules//05_placement/interface/response/Address";
|
|
||||||
import HistoryTable from "@/components/TableHistory.vue";
|
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { AddressDataDefualt } from "@/modules//05_placement/interface/index/Main";
|
import { AddressDataDefualt } from "@/modules//05_placement/interface/index/Main";
|
||||||
|
|
||||||
|
|
@ -23,7 +17,6 @@ import type {
|
||||||
Address as AddressType,
|
Address as AddressType,
|
||||||
optionData,
|
optionData,
|
||||||
} from "@/modules//05_placement/interface/index/Main";
|
} from "@/modules//05_placement/interface/index/Main";
|
||||||
import type { QTableProps } from "quasar";
|
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -48,19 +41,13 @@ const emit = defineEmits(["update:statusEdit"]);
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const dataStore = useDataStore();
|
|
||||||
const { loaderPage } = dataStore;
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
|
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
|
||||||
const edit = ref<boolean>(false);
|
const edit = ref<boolean>(false);
|
||||||
const addressData = ref<Address>(defaultAddress);
|
const addressData = ref<AddressType>(props.data);
|
||||||
const myform = ref<any>();
|
const myform = ref<any>();
|
||||||
const codep = ref<string>("");
|
const codep = ref<string>("");
|
||||||
const codec = ref<string>("");
|
const codec = ref<string>("");
|
||||||
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history
|
|
||||||
const tittleHistory = ref<string>("ประวัติแก้ไขข้อมูลที่อยู่"); //
|
|
||||||
const filterHistory = ref<string>(""); //search data table history
|
|
||||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
|
||||||
const Ops = ref<AddressOps>({
|
const Ops = ref<AddressOps>({
|
||||||
provinceOps: [],
|
provinceOps: [],
|
||||||
districtOps: [],
|
districtOps: [],
|
||||||
|
|
@ -75,169 +62,9 @@ const OpsFilter = ref<AddressOps>({
|
||||||
subdistrictOps: [],
|
subdistrictOps: [],
|
||||||
subdistrictCOps: [],
|
subdistrictCOps: [],
|
||||||
});
|
});
|
||||||
const columnsHistory = ref<QTableProps["columns"]>([
|
|
||||||
{
|
|
||||||
name: "registrationAddress",
|
|
||||||
align: "left",
|
|
||||||
label: "ที่อยู่ตามทะเบียนบ้าน",
|
|
||||||
sortable: true,
|
|
||||||
field: "registrationAddress",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "registrationProvince",
|
|
||||||
align: "left",
|
|
||||||
label: "จังหวัดตามทะเบียนบ้าน",
|
|
||||||
sortable: true,
|
|
||||||
field: "registrationProvince",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "registrationDistrict",
|
|
||||||
align: "left",
|
|
||||||
label: "เขต/อำเภอตามทะเบียนบ้าน",
|
|
||||||
sortable: true,
|
|
||||||
field: "registrationDistrict",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "registrationSubDistrict",
|
|
||||||
align: "left",
|
|
||||||
label: "ตำบล/แขวงตามทะเบียนบ้าน",
|
|
||||||
sortable: true,
|
|
||||||
field: "registrationSubDistrict",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "registrationZipCode",
|
|
||||||
align: "left",
|
|
||||||
label: "รหัสไปรษณีย์ตามทะเบียนบ้าน",
|
|
||||||
sortable: true,
|
|
||||||
field: "registrationZipCode",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "registrationSame",
|
|
||||||
align: "left",
|
|
||||||
label: "ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้าน",
|
|
||||||
sortable: true,
|
|
||||||
field: "registrationSame",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "currentAddress",
|
|
||||||
align: "left",
|
|
||||||
label: "ที่อยู่ปัจจุบัน",
|
|
||||||
sortable: true,
|
|
||||||
field: "currentAddress",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "currentProvince",
|
|
||||||
align: "left",
|
|
||||||
label: "จังหวัดปัจจุบัน",
|
|
||||||
sortable: true,
|
|
||||||
field: "currentProvince",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "currentDistrict",
|
|
||||||
align: "left",
|
|
||||||
label: "เขต/อำเภอปัจจุบัน",
|
|
||||||
sortable: true,
|
|
||||||
field: "currentDistrict",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "currentSubDistrict",
|
|
||||||
align: "left",
|
|
||||||
label: "ตำบล/แขวงปัจจุบัน",
|
|
||||||
sortable: true,
|
|
||||||
field: "currentSubDistrict",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "currentZipCode",
|
|
||||||
align: "left",
|
|
||||||
label: "รหัสไปรษณีย์ปัจจุบัน",
|
|
||||||
sortable: true,
|
|
||||||
field: "currentZipCode",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "createdFullName",
|
|
||||||
align: "left",
|
|
||||||
label: "ผู้ดำเนินการ",
|
|
||||||
sortable: true,
|
|
||||||
field: "createdFullName",
|
|
||||||
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",
|
|
||||||
label: "วันที่แก้ไข",
|
|
||||||
sortable: true,
|
|
||||||
field: "createdAt",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
sort: (a: string, b: string) =>
|
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const visibleColumnsHistory = ref<String[]>([
|
|
||||||
"currentAddress",
|
|
||||||
"currentDistrict",
|
|
||||||
"currentProvince",
|
|
||||||
"currentSubDistrict",
|
|
||||||
"currentZipCode",
|
|
||||||
"registrationAddress",
|
|
||||||
"registrationDistrict",
|
|
||||||
"registrationProvince",
|
|
||||||
"registrationSame",
|
|
||||||
"registrationSubDistrict",
|
|
||||||
"registrationZipCode",
|
|
||||||
"createdFullName",
|
|
||||||
"createdAt",
|
|
||||||
]);
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// await getNewData();
|
await getNewData();
|
||||||
emit("update:statusEdit", false);
|
emit("update:statusEdit", false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -284,145 +111,85 @@ const filterSelector = (val: any, update: Function, refData: string) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลที่เลือก
|
|
||||||
*/
|
|
||||||
const clickHistory = async () => {
|
|
||||||
modalHistory.value = true;
|
|
||||||
showLoader();
|
|
||||||
await http
|
|
||||||
.get(config.API.profileAdrsHisId(route.params.id.toString()))
|
|
||||||
.then((res) => {
|
|
||||||
let data = res.data.result;
|
|
||||||
rowsHistory.value = [];
|
|
||||||
data.map((e: RequestItemsHistoryObject) => {
|
|
||||||
rowsHistory.value.push({
|
|
||||||
currentAddress: e.currentAddress,
|
|
||||||
currentDistrict: e.currentDistrict,
|
|
||||||
currentProvince: e.currentProvince,
|
|
||||||
currentSubDistrict: e.currentSubDistrict,
|
|
||||||
currentZipCode: e.currentZipCode,
|
|
||||||
registrationSame: e.registrationSame,
|
|
||||||
registrationAddress: e.registrationAddress,
|
|
||||||
registrationDistrict: e.registrationDistrict,
|
|
||||||
registrationProvince: e.registrationProvince,
|
|
||||||
registrationSubDistrict: e.registrationSubDistrict,
|
|
||||||
registrationZipCode: e.registrationZipCode,
|
|
||||||
createdFullName: e.createdFullName,
|
|
||||||
createdAt: new Date(e.createdAt),
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const refreshData = async () => {
|
const refreshData = async () => {
|
||||||
myform.value.reset();
|
myform.value.reset();
|
||||||
await getNewData();
|
await getNewData();
|
||||||
};
|
};
|
||||||
|
|
||||||
const getNewData = async () => {
|
const getNewData = async () => {
|
||||||
await fetchData();
|
await props.fetch();
|
||||||
await fetchProvince();
|
await fetchProvince();
|
||||||
await fetchDistrict(addressData.value.provinceId, "1");
|
await fetchDistrict(addressData.value.registProvinceId, "1");
|
||||||
await fetchDistrict(addressData.value.provinceIdC, "2");
|
await fetchDistrict(addressData.value.currentProvinceId, "2");
|
||||||
await fetchSubDistrict(addressData.value.districtId, "1");
|
await fetchSubDistrict(addressData.value.registDistrictId, "1");
|
||||||
await fetchSubDistrict(addressData.value.districtIdC, "2");
|
await fetchSubDistrict(addressData.value.currentDistrictId, "2");
|
||||||
await selectSubDistrict(addressData.value.subdistrictId, "1");
|
await selectSubDistrict(addressData.value.registSubDistrictId, "1");
|
||||||
await selectSubDistrict(addressData.value.subdistrictIdC, "2");
|
await selectSubDistrict(addressData.value.currentSubDistrictId, "2");
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchData = async () => {
|
const editData = async () => {
|
||||||
|
const body = {
|
||||||
|
registrationSame: addressData.value.registSame == "1",
|
||||||
|
registrationAddress: addressData.value.registAddress,
|
||||||
|
registrationSubDistrictId: addressData.value.registSubDistrictId,
|
||||||
|
registrationDistrictId: addressData.value.registDistrictId,
|
||||||
|
registrationProvinceId: addressData.value.registProvinceId,
|
||||||
|
registrationZipCode: codep.value,
|
||||||
|
currentAddress:
|
||||||
|
addressData.value.registSame == "1"
|
||||||
|
? addressData.value.registAddress
|
||||||
|
: addressData.value.currentAddress,
|
||||||
|
currentSubDistrictId:
|
||||||
|
addressData.value.registSame == "1"
|
||||||
|
? addressData.value.registSubDistrictId
|
||||||
|
: addressData.value.currentSubDistrictId,
|
||||||
|
currentDistrictId:
|
||||||
|
addressData.value.registSame == "1"
|
||||||
|
? addressData.value.registDistrict
|
||||||
|
: addressData.value.currentDistrictId,
|
||||||
|
currentProvinceId:
|
||||||
|
addressData.value.registSame == "1"
|
||||||
|
? addressData.value.registProvinceId
|
||||||
|
: addressData.value.currentProvinceId,
|
||||||
|
currentZipCode:
|
||||||
|
addressData.value.registSame == "1" ? codep.value : codec.value,
|
||||||
|
};
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileAdrsId(route.params.id.toString()))
|
.put(
|
||||||
|
config.API.placementAddressId(route.params.personalId.toString()),
|
||||||
|
body
|
||||||
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data: ResponseObject = res.data.result;
|
success($q, "แก้ไขข้อมูลสำเร็จ");
|
||||||
addressData.value.address = data.registrationAddress;
|
|
||||||
addressData.value.addressC = data.currentAddress;
|
|
||||||
addressData.value.districtId = data.registrationDistrictId;
|
|
||||||
addressData.value.districtIdC = data.currentDistrictId;
|
|
||||||
addressData.value.provinceId = data.registrationProvinceId;
|
|
||||||
addressData.value.provinceIdC = data.currentProvinceId;
|
|
||||||
addressData.value.subdistrictId = data.registrationSubDistrictId;
|
|
||||||
addressData.value.subdistrictIdC = data.currentSubDistrictId;
|
|
||||||
addressData.value.same = data.registrationSame ? "1" : "0";
|
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(async () => {
|
||||||
hideLoader();
|
edit.value = false;
|
||||||
|
emit("update:statusEdit", false);
|
||||||
|
await getNewData();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const editData = async () => {
|
|
||||||
// const body: ResponseObject = {
|
|
||||||
// registrationSame: addressData.value.same == "1",
|
|
||||||
// registrationAddress: addressData.value.address,
|
|
||||||
// registrationSubDistrictId: addressData.value.subdistrictId,
|
|
||||||
// registrationDistrictId: addressData.value.districtId,
|
|
||||||
// registrationProvinceId: addressData.value.provinceId,
|
|
||||||
// registrationZipCode: codep.value,
|
|
||||||
// currentAddress:
|
|
||||||
// addressData.value.same == "1"
|
|
||||||
// ? addressData.value.address
|
|
||||||
// : addressData.value.addressC,
|
|
||||||
// currentSubDistrictId:
|
|
||||||
// addressData.value.same == "1"
|
|
||||||
// ? addressData.value.subdistrictId
|
|
||||||
// : addressData.value.subdistrictIdC,
|
|
||||||
// currentDistrictId:
|
|
||||||
// addressData.value.same == "1"
|
|
||||||
// ? addressData.value.districtId
|
|
||||||
// : addressData.value.districtIdC,
|
|
||||||
// currentProvinceId:
|
|
||||||
// addressData.value.same == "1"
|
|
||||||
// ? addressData.value.provinceId
|
|
||||||
// : addressData.value.provinceIdC,
|
|
||||||
// currentZipCode: addressData.value.same == "1" ? codep.value : codec.value,
|
|
||||||
// createdAt: new Date(),
|
|
||||||
// createdFullName: "-",
|
|
||||||
// };
|
|
||||||
// showLoader();
|
|
||||||
// await http
|
|
||||||
// .put(config.API.profileAdrsId(route.params.id.toString()), body)
|
|
||||||
// .then((res) => {
|
|
||||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
|
||||||
// })
|
|
||||||
// .catch((e) => {
|
|
||||||
// messageError($q, e);
|
|
||||||
// })
|
|
||||||
// .finally(async () => {
|
|
||||||
// edit.value = false;
|
|
||||||
// emit("update:statusEdit", false);
|
|
||||||
// await getNewData();
|
|
||||||
// });
|
|
||||||
};
|
|
||||||
|
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
// await myform.value.validate().then(async (success: boolean) => {
|
await myform.value.validate().then(async (success: boolean) => {
|
||||||
// if (success) {
|
if (success) {
|
||||||
// await editData();
|
await editData();
|
||||||
// } else {
|
}
|
||||||
// }
|
});
|
||||||
// });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectProvince = async (e: string | null, name: string) => {
|
const selectProvince = async (e: string | null, name: string) => {
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
if (name == "1") {
|
if (name == "1") {
|
||||||
addressData.value.districtId = "";
|
addressData.value.registDistrictId = "";
|
||||||
addressData.value.subdistrictId = "";
|
addressData.value.registSubDistrictId = "";
|
||||||
codep.value = "";
|
codep.value = "";
|
||||||
} else {
|
} else {
|
||||||
addressData.value.districtIdC = "";
|
addressData.value.currentDistrictId = "";
|
||||||
addressData.value.subdistrictIdC = "";
|
addressData.value.currentSubDistrictId = "";
|
||||||
codec.value = "";
|
codec.value = "";
|
||||||
}
|
}
|
||||||
myform.value.resetValidation();
|
myform.value.resetValidation();
|
||||||
|
|
@ -433,10 +200,10 @@ const selectProvince = async (e: string | null, name: string) => {
|
||||||
const selectDistrict = async (e: string | null, name: string) => {
|
const selectDistrict = async (e: string | null, name: string) => {
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
if (name == "1") {
|
if (name == "1") {
|
||||||
addressData.value.subdistrictId = "";
|
addressData.value.registSubDistrictId = "";
|
||||||
codep.value = "";
|
codep.value = "";
|
||||||
} else {
|
} else {
|
||||||
addressData.value.subdistrictIdC = "";
|
addressData.value.currentSubDistrictId = "";
|
||||||
codec.value = "";
|
codec.value = "";
|
||||||
}
|
}
|
||||||
myform.value.resetValidation();
|
myform.value.resetValidation();
|
||||||
|
|
@ -490,13 +257,13 @@ const fetchDistrict = async (id: string | null, position: string) => {
|
||||||
data.map((r: any) => {
|
data.map((r: any) => {
|
||||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||||
});
|
});
|
||||||
// if (position == "1") {
|
if (position == "1") {
|
||||||
// Ops.value.districtOps = option;
|
Ops.value.districtOps = option;
|
||||||
// OpsFilter.value.districtOps = option;
|
OpsFilter.value.districtOps = option;
|
||||||
// } else {
|
} else {
|
||||||
// Ops.value.districtCOps = option;
|
Ops.value.districtCOps = option;
|
||||||
// OpsFilter.value.districtCOps = option;
|
OpsFilter.value.districtCOps = option;
|
||||||
// }
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -570,7 +337,6 @@ const getClass = (val: boolean) => {
|
||||||
:changeBtn="changeBtn"
|
:changeBtn="changeBtn"
|
||||||
:disable="statusEdit"
|
:disable="statusEdit"
|
||||||
:cancel="refreshData"
|
:cancel="refreshData"
|
||||||
:historyClick="clickHistory"
|
|
||||||
/>
|
/>
|
||||||
<q-form ref="myform">
|
<q-form ref="myform">
|
||||||
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
|
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||||
|
|
@ -585,7 +351,7 @@ const getClass = (val: boolean) => {
|
||||||
autogrow
|
autogrow
|
||||||
:readonly="!edit"
|
:readonly="!edit"
|
||||||
:borderless="!edit"
|
:borderless="!edit"
|
||||||
v-model="addressData.address"
|
v-model="addressData.registAddress"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณากรอก ที่อยู่ตามทะเบียนบ้าน'}`]"
|
:rules="[(val:string) => !!val || `${'กรุณากรอก ที่อยู่ตามทะเบียนบ้าน'}`]"
|
||||||
:label="`${'ที่อยู่ตามทะเบียนบ้าน'}`"
|
:label="`${'ที่อยู่ตามทะเบียนบ้าน'}`"
|
||||||
/>
|
/>
|
||||||
|
|
@ -601,7 +367,7 @@ const getClass = (val: boolean) => {
|
||||||
:outlined="edit"
|
:outlined="edit"
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
v-model="addressData.provinceId"
|
v-model="addressData.registProvinceId"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
|
@ -627,7 +393,7 @@ const getClass = (val: boolean) => {
|
||||||
:outlined="edit"
|
:outlined="edit"
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
v-model="addressData.districtId"
|
v-model="addressData.registDistrictId"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
|
@ -653,7 +419,7 @@ const getClass = (val: boolean) => {
|
||||||
:outlined="edit"
|
:outlined="edit"
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
v-model="addressData.subdistrictId"
|
v-model="addressData.registSubDistrictId"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
|
@ -687,7 +453,7 @@ const getClass = (val: boolean) => {
|
||||||
>ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้าน</label
|
>ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้าน</label
|
||||||
>
|
>
|
||||||
<q-radio
|
<q-radio
|
||||||
v-model="addressData.same"
|
v-model="addressData.registSame"
|
||||||
checked-icon="task_alt"
|
checked-icon="task_alt"
|
||||||
unchecked-icon="panorama_fish_eye"
|
unchecked-icon="panorama_fish_eye"
|
||||||
val="1"
|
val="1"
|
||||||
|
|
@ -696,7 +462,7 @@ const getClass = (val: boolean) => {
|
||||||
:disable="!edit"
|
:disable="!edit"
|
||||||
/>
|
/>
|
||||||
<q-radio
|
<q-radio
|
||||||
v-model="addressData.same"
|
v-model="addressData.registSame"
|
||||||
checked-icon="task_alt"
|
checked-icon="task_alt"
|
||||||
unchecked-icon="panorama_fish_eye"
|
unchecked-icon="panorama_fish_eye"
|
||||||
val="0"
|
val="0"
|
||||||
|
|
@ -706,7 +472,7 @@ const getClass = (val: boolean) => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-12" v-if="addressData.same == '0'">
|
<div class="col-xs-12" v-if="addressData.registSame == '0'">
|
||||||
<q-input
|
<q-input
|
||||||
:class="getClass(edit)"
|
:class="getClass(edit)"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
|
|
@ -717,12 +483,15 @@ const getClass = (val: boolean) => {
|
||||||
autogrow
|
autogrow
|
||||||
:readonly="!edit"
|
:readonly="!edit"
|
||||||
:borderless="!edit"
|
:borderless="!edit"
|
||||||
v-model="addressData.addressC"
|
v-model="addressData.currentAddress"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณากรอก ที่อยู่ปัจจุบัน'}`]"
|
:rules="[(val:string) => !!val || `${'กรุณากรอก ที่อยู่ปัจจุบัน'}`]"
|
||||||
:label="`${'ที่อยู่ปัจจุบัน'}`"
|
:label="`${'ที่อยู่ปัจจุบัน'}`"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.same == '0'">
|
<div
|
||||||
|
class="col-xs-6 col-sm-3 col-md-3"
|
||||||
|
v-if="addressData.registSame == '0'"
|
||||||
|
>
|
||||||
<selector
|
<selector
|
||||||
:hide-dropdown-icon="!edit"
|
:hide-dropdown-icon="!edit"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
|
|
@ -733,7 +502,7 @@ const getClass = (val: boolean) => {
|
||||||
:outlined="edit"
|
:outlined="edit"
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
v-model="addressData.provinceIdC"
|
v-model="addressData.currentProvinceId"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
|
@ -748,7 +517,10 @@ const getClass = (val: boolean) => {
|
||||||
) "
|
) "
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.same == '0'">
|
<div
|
||||||
|
class="col-xs-6 col-sm-3 col-md-3"
|
||||||
|
v-if="addressData.registSame == '0'"
|
||||||
|
>
|
||||||
<selector
|
<selector
|
||||||
:hide-dropdown-icon="!edit"
|
:hide-dropdown-icon="!edit"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
|
|
@ -759,7 +531,7 @@ const getClass = (val: boolean) => {
|
||||||
:outlined="edit"
|
:outlined="edit"
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
v-model="addressData.districtIdC"
|
v-model="addressData.currentDistrictId"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
|
@ -774,7 +546,10 @@ const getClass = (val: boolean) => {
|
||||||
) "
|
) "
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.same == '0'">
|
<div
|
||||||
|
class="col-xs-6 col-sm-3 col-md-3"
|
||||||
|
v-if="addressData.registSame == '0'"
|
||||||
|
>
|
||||||
<selector
|
<selector
|
||||||
:hide-dropdown-icon="!edit"
|
:hide-dropdown-icon="!edit"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
|
|
@ -785,7 +560,7 @@ const getClass = (val: boolean) => {
|
||||||
:outlined="edit"
|
:outlined="edit"
|
||||||
dense
|
dense
|
||||||
lazy-rules
|
lazy-rules
|
||||||
v-model="addressData.subdistrictIdC"
|
v-model="addressData.currentSubDistrictId"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
|
@ -800,7 +575,10 @@ const getClass = (val: boolean) => {
|
||||||
) "
|
) "
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.same == '0'">
|
<div
|
||||||
|
class="col-xs-6 col-sm-3 col-md-3"
|
||||||
|
v-if="addressData.registSame == '0'"
|
||||||
|
>
|
||||||
<q-input
|
<q-input
|
||||||
:class="getClass(edit)"
|
:class="getClass(edit)"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
|
|
@ -816,33 +594,4 @@ const getClass = (val: boolean) => {
|
||||||
</div>
|
</div>
|
||||||
</q-form>
|
</q-form>
|
||||||
</q-card>
|
</q-card>
|
||||||
<HistoryTable
|
|
||||||
:rows="rowsHistory"
|
|
||||||
:columns="columnsHistory"
|
|
||||||
:filter="filterHistory"
|
|
||||||
:visible-columns="visibleColumnsHistory"
|
|
||||||
v-model:modal="modalHistory"
|
|
||||||
v-model:inputfilter="filterHistory"
|
|
||||||
v-model:inputvisible="visibleColumnsHistory"
|
|
||||||
v-model:tittle="tittleHistory"
|
|
||||||
>
|
|
||||||
<template #columns="props">
|
|
||||||
<q-tr :props="props">
|
|
||||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
|
||||||
<div v-if="col.name == 'createdAt'" class="table_ellipsis">
|
|
||||||
{{ date2Thai(col.value) }}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-else-if="col.name == 'registrationSame'"
|
|
||||||
class="table_ellipsis"
|
|
||||||
>
|
|
||||||
{{ col.value ? "ใช่" : "ไม่" }}
|
|
||||||
</div>
|
|
||||||
<div v-else class="table_ellipsis">
|
|
||||||
{{ col.value }}
|
|
||||||
</div>
|
|
||||||
</q-td>
|
|
||||||
</q-tr>
|
|
||||||
</template>
|
|
||||||
</HistoryTable>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
||||||
import type { zipCodeOption } from "../../components/PersonalDetail/profileType";
|
import type { zipCodeOption } from "../../components/PersonalDetail/profileType";
|
||||||
interface DataOption {
|
interface DataOption {
|
||||||
id: number;
|
id: number | null;
|
||||||
name: string;
|
name: string;
|
||||||
disable?: boolean;
|
disable?: boolean;
|
||||||
}
|
}
|
||||||
|
|
@ -102,7 +102,7 @@ interface Education {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Family {
|
interface Family {
|
||||||
couple: boolean;
|
couple: string;
|
||||||
marryPrefix: string;
|
marryPrefix: string;
|
||||||
marryPrefixId: string;
|
marryPrefixId: string;
|
||||||
marryFirstName: string;
|
marryFirstName: string;
|
||||||
|
|
@ -121,6 +121,7 @@ interface Family {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Address {
|
interface Address {
|
||||||
|
registAddress: string;
|
||||||
registSubDistrict: string;
|
registSubDistrict: string;
|
||||||
registSubDistrictId: string;
|
registSubDistrictId: string;
|
||||||
registZipCode: string;
|
registZipCode: string;
|
||||||
|
|
@ -128,6 +129,7 @@ interface Address {
|
||||||
registDistrictId: string;
|
registDistrictId: string;
|
||||||
registProvince: string;
|
registProvince: string;
|
||||||
registProvinceId: string;
|
registProvinceId: string;
|
||||||
|
currentAddress: string;
|
||||||
currentSubDistrict: string;
|
currentSubDistrict: string;
|
||||||
currentSubDistrictId: string;
|
currentSubDistrictId: string;
|
||||||
currentZipCode: string;
|
currentZipCode: string;
|
||||||
|
|
@ -135,10 +137,12 @@ interface Address {
|
||||||
currentDistrictId: string;
|
currentDistrictId: string;
|
||||||
currentProvince: string;
|
currentProvince: string;
|
||||||
currentProvinceId: string;
|
currentProvinceId: string;
|
||||||
registSame: boolean;
|
registSame: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const AddressDataDefualt: Address = {
|
const AddressDataDefualt: Address = {
|
||||||
|
registAddress: "",
|
||||||
|
currentAddress: "",
|
||||||
registSubDistrict: "",
|
registSubDistrict: "",
|
||||||
registSubDistrictId: "",
|
registSubDistrictId: "",
|
||||||
registZipCode: "",
|
registZipCode: "",
|
||||||
|
|
@ -153,9 +157,27 @@ const AddressDataDefualt: Address = {
|
||||||
currentDistrictId: "",
|
currentDistrictId: "",
|
||||||
currentProvince: "",
|
currentProvince: "",
|
||||||
currentProvinceId: "",
|
currentProvinceId: "",
|
||||||
registSame: false,
|
registSame: "0",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const FamilyDataDefualt: Family = {
|
||||||
|
couple: "0",
|
||||||
|
marryPrefix: "",
|
||||||
|
marryPrefixId: "",
|
||||||
|
marryFirstName: "",
|
||||||
|
marryLastName: "",
|
||||||
|
marryOccupation: "",
|
||||||
|
fatherPrefix: "",
|
||||||
|
fatherPrefixId: "",
|
||||||
|
fatherFirstName: "",
|
||||||
|
fatherLastName: "",
|
||||||
|
fatherOccupation: "",
|
||||||
|
motherPrefix: "",
|
||||||
|
motherPrefixId: "",
|
||||||
|
motherFirstName: "",
|
||||||
|
motherLastName: "",
|
||||||
|
motherOccupation: "",
|
||||||
|
};
|
||||||
export type {
|
export type {
|
||||||
DataOption,
|
DataOption,
|
||||||
DataOptionInsignia,
|
DataOptionInsignia,
|
||||||
|
|
@ -175,4 +197,4 @@ export type {
|
||||||
optionData,
|
optionData,
|
||||||
};
|
};
|
||||||
|
|
||||||
export { AddressDataDefualt };
|
export { AddressDataDefualt, FamilyDataDefualt };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue