Merge branch 'develop' into warunee-dev
This commit is contained in:
commit
88c2368fa8
5 changed files with 295 additions and 1194 deletions
136
.github/workflows/release.yaml
vendored
136
.github/workflows/release.yaml
vendored
|
|
@ -15,72 +15,72 @@ env:
|
|||
COMPOSE_PATH: /home/frappet/docker/bma-ehr
|
||||
TOKEN_LINE: uxuK5hDzS2DsoC5piJBrWRLiz8GgY7iMZZldOWsDDF0
|
||||
jobs:
|
||||
# # act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=test-v1 -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd
|
||||
# release-test:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v3
|
||||
# # skip Set up QEMU because it fail on act and container
|
||||
# # Gen Version try to get version from tag or inut
|
||||
# - name: Gen Version
|
||||
# id: gen_ver
|
||||
# run: |
|
||||
# if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
|
||||
# IMAGE_VER='${GITHUB_REF/refs\/tags\//}'
|
||||
# else
|
||||
# IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
|
||||
# fi
|
||||
# if [[ $IMAGE_VER == '' ]]; then
|
||||
# IMAGE_VER='test-vBeta'
|
||||
# fi
|
||||
# echo '::set-output name=image_ver::'$IMAGE_VER
|
||||
# - name: Check Version
|
||||
# run: |
|
||||
# echo $GITHUB_REF
|
||||
# echo ${{ steps.gen_ver.outputs.image_ver }}
|
||||
# act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=test-v1 -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd
|
||||
release-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
# skip Set up QEMU because it fail on act and container
|
||||
# Gen Version try to get version from tag or inut
|
||||
- name: Gen Version
|
||||
id: gen_ver
|
||||
run: |
|
||||
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
|
||||
IMAGE_VER='${GITHUB_REF/refs\/tags\//}'
|
||||
else
|
||||
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
|
||||
fi
|
||||
if [[ $IMAGE_VER == '' ]]; then
|
||||
IMAGE_VER='test-vBeta'
|
||||
fi
|
||||
echo '::set-output name=image_ver::'$IMAGE_VER
|
||||
- name: Check Version
|
||||
run: |
|
||||
echo $GITHUB_REF
|
||||
echo ${{ steps.gen_ver.outputs.image_ver }}
|
||||
|
||||
# - name: Set up Docker Buildx
|
||||
# uses: docker/setup-buildx-action@v2
|
||||
# - name: Login in to registry
|
||||
# uses: docker/login-action@v2
|
||||
# with:
|
||||
# registry: ${{env.REGISTRY}}
|
||||
# username: ${{secrets.DOCKER_USER}}
|
||||
# password: ${{secrets.DOCKER_PASS}}
|
||||
# - name: Build and push docker image
|
||||
# uses: docker/build-push-action@v3
|
||||
# with:
|
||||
# context: .
|
||||
# platforms: linux/amd64
|
||||
# push: true
|
||||
# tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
|
||||
# - name: Remote Deployment
|
||||
# uses: appleboy/ssh-action@v0.1.8
|
||||
# with:
|
||||
# host: ${{env.DEPLOY_HOST}}
|
||||
# username: frappet
|
||||
# password: ${{ secrets.SSH_PASSWORD }}
|
||||
# port: 22
|
||||
# script: |
|
||||
# cd "${{env.COMPOSE_PATH}}"
|
||||
# docker-compose pull
|
||||
# docker-compose up -d
|
||||
# echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
||||
# - uses: snow-actions/line-notify@v1.1.0
|
||||
# if: success()
|
||||
# with:
|
||||
# access_token: ${{ env.TOKEN_LINE }}
|
||||
# message: |
|
||||
# -Success✅✅✅
|
||||
# Image: ${{env.IMAGE_NAME}}
|
||||
# Version: ${{ github.event.inputs.IMAGE_VER }}
|
||||
# By: ${{secrets.DOCKER_USER}}
|
||||
# - uses: snow-actions/line-notify@v1.1.0
|
||||
# if: failure()
|
||||
# with:
|
||||
# access_token: ${{ env.TOKEN_LINE }}
|
||||
# message: |
|
||||
# -Failure❌❌❌
|
||||
# Image: ${{env.IMAGE_NAME}}
|
||||
# Version: ${{ github.event.inputs.IMAGE_VER }}
|
||||
# By: ${{secrets.DOCKER_USER}}
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
- name: Login in to registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{env.REGISTRY}}
|
||||
username: ${{secrets.DOCKER_USER}}
|
||||
password: ${{secrets.DOCKER_PASS}}
|
||||
- name: Build and push docker image
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:${{ steps.gen_ver.outputs.image_ver }},${{env.REGISTRY}}/${{env.IMAGE_NAME}}:latest
|
||||
- name: Remote Deployment
|
||||
uses: appleboy/ssh-action@v0.1.8
|
||||
with:
|
||||
host: ${{env.DEPLOY_HOST}}
|
||||
username: frappet
|
||||
password: ${{ secrets.SSH_PASSWORD }}
|
||||
port: 22
|
||||
script: |
|
||||
cd "${{env.COMPOSE_PATH}}"
|
||||
docker-compose pull
|
||||
docker-compose up -d
|
||||
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
||||
- uses: snow-actions/line-notify@v1.1.0
|
||||
if: success()
|
||||
with:
|
||||
access_token: ${{ env.TOKEN_LINE }}
|
||||
message: |
|
||||
-Success✅✅✅
|
||||
Image: ${{env.IMAGE_NAME}}
|
||||
Version: ${{ github.event.inputs.IMAGE_VER }}
|
||||
By: ${{secrets.DOCKER_USER}}
|
||||
- uses: snow-actions/line-notify@v1.1.0
|
||||
if: failure()
|
||||
with:
|
||||
access_token: ${{ env.TOKEN_LINE }}
|
||||
message: |
|
||||
-Failure❌❌❌
|
||||
Image: ${{env.IMAGE_NAME}}
|
||||
Version: ${{ github.event.inputs.IMAGE_VER }}
|
||||
By: ${{secrets.DOCKER_USER}}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,11 @@ import ExamResult from "@/modules/05_placement/components/PersonalDetail/ExamRes
|
|||
import Qualification from "@/modules/05_placement/components/PersonalDetail/Qualification.vue";
|
||||
import Familyvue from "@/modules/05_placement/components/PersonalDetail/Information/Family.vue";
|
||||
|
||||
import {
|
||||
AddressDataDefualt,
|
||||
FamilyDataDefualt,
|
||||
} from "@/modules/05_placement/interface/index/Main";
|
||||
|
||||
import type {
|
||||
Property,
|
||||
PointExam,
|
||||
|
|
@ -77,43 +82,6 @@ const InformationDataDefualt: Information = {
|
|||
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({
|
||||
id: "",
|
||||
fullName: "",
|
||||
|
|
@ -157,7 +125,9 @@ const fetchData = async () => {
|
|||
InformationData.value.age = data.age;
|
||||
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.registSubDistrictId = data.registSubDistrictId ?? "";
|
||||
AddressData.value.registZipCode = data.registZipCode ?? "";
|
||||
|
|
@ -173,7 +143,7 @@ const fetchData = async () => {
|
|||
AddressData.value.currentProvince = data.currentProvince ?? "";
|
||||
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.marryPrefixId = data.marryPrefixId ?? "";
|
||||
FamilyData.value.marryFirstName = data.marryFirstName ?? "";
|
||||
|
|
|
|||
|
|
@ -2,19 +2,13 @@
|
|||
<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";
|
||||
import type {
|
||||
Address,
|
||||
zipCodeOption,
|
||||
} from "@/modules/05_placement/components/PersonalDetail/profileType";
|
||||
import { defaultAddress } from "@/modules/05_placement/components/PersonalDetail/profileType";
|
||||
import type { zipCodeOption } from "@/modules/05_placement/components/PersonalDetail/profileType";
|
||||
|
||||
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 { AddressDataDefualt } from "@/modules//05_placement/interface/index/Main";
|
||||
|
||||
|
|
@ -23,7 +17,6 @@ import type {
|
|||
Address as AddressType,
|
||||
optionData,
|
||||
} from "@/modules//05_placement/interface/index/Main";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { PropType } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
|
|
@ -48,19 +41,13 @@ const emit = defineEmits(["update:statusEdit"]);
|
|||
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
|
||||
const edit = ref<boolean>(false);
|
||||
const addressData = ref<Address>(defaultAddress);
|
||||
const addressData = ref<AddressType>(props.data);
|
||||
const myform = ref<any>();
|
||||
const codep = 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>({
|
||||
provinceOps: [],
|
||||
districtOps: [],
|
||||
|
|
@ -75,169 +62,9 @@ const OpsFilter = ref<AddressOps>({
|
|||
subdistrictOps: [],
|
||||
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 () => {
|
||||
// await getNewData();
|
||||
await getNewData();
|
||||
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 () => {
|
||||
myform.value.reset();
|
||||
await getNewData();
|
||||
};
|
||||
|
||||
const getNewData = async () => {
|
||||
await fetchData();
|
||||
await props.fetch();
|
||||
await fetchProvince();
|
||||
await fetchDistrict(addressData.value.provinceId, "1");
|
||||
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");
|
||||
await fetchDistrict(addressData.value.registProvinceId, "1");
|
||||
await fetchDistrict(addressData.value.currentProvinceId, "2");
|
||||
await fetchSubDistrict(addressData.value.registDistrictId, "1");
|
||||
await fetchSubDistrict(addressData.value.currentDistrictId, "2");
|
||||
await selectSubDistrict(addressData.value.registSubDistrictId, "1");
|
||||
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();
|
||||
await http
|
||||
.get(config.API.profileAdrsId(route.params.id.toString()))
|
||||
.put(
|
||||
config.API.placementAddressId(route.params.personalId.toString()),
|
||||
body
|
||||
)
|
||||
.then((res) => {
|
||||
const data: ResponseObject = res.data.result;
|
||||
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";
|
||||
success($q, "แก้ไขข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
.finally(async () => {
|
||||
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 () => {
|
||||
// await myform.value.validate().then(async (success: boolean) => {
|
||||
// if (success) {
|
||||
// await editData();
|
||||
// } else {
|
||||
// }
|
||||
// });
|
||||
await myform.value.validate().then(async (success: boolean) => {
|
||||
if (success) {
|
||||
await editData();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const selectProvince = async (e: string | null, name: string) => {
|
||||
if (e != null) {
|
||||
if (name == "1") {
|
||||
addressData.value.districtId = "";
|
||||
addressData.value.subdistrictId = "";
|
||||
addressData.value.registDistrictId = "";
|
||||
addressData.value.registSubDistrictId = "";
|
||||
codep.value = "";
|
||||
} else {
|
||||
addressData.value.districtIdC = "";
|
||||
addressData.value.subdistrictIdC = "";
|
||||
addressData.value.currentDistrictId = "";
|
||||
addressData.value.currentSubDistrictId = "";
|
||||
codec.value = "";
|
||||
}
|
||||
myform.value.resetValidation();
|
||||
|
|
@ -433,10 +200,10 @@ const selectProvince = async (e: string | null, name: string) => {
|
|||
const selectDistrict = async (e: string | null, name: string) => {
|
||||
if (e != null) {
|
||||
if (name == "1") {
|
||||
addressData.value.subdistrictId = "";
|
||||
addressData.value.registSubDistrictId = "";
|
||||
codep.value = "";
|
||||
} else {
|
||||
addressData.value.subdistrictIdC = "";
|
||||
addressData.value.currentSubDistrictId = "";
|
||||
codec.value = "";
|
||||
}
|
||||
myform.value.resetValidation();
|
||||
|
|
@ -490,13 +257,13 @@ const fetchDistrict = async (id: string | null, position: string) => {
|
|||
data.map((r: any) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
});
|
||||
// if (position == "1") {
|
||||
// Ops.value.districtOps = option;
|
||||
// OpsFilter.value.districtOps = option;
|
||||
// } else {
|
||||
// Ops.value.districtCOps = option;
|
||||
// OpsFilter.value.districtCOps = option;
|
||||
// }
|
||||
if (position == "1") {
|
||||
Ops.value.districtOps = option;
|
||||
OpsFilter.value.districtOps = option;
|
||||
} else {
|
||||
Ops.value.districtCOps = option;
|
||||
OpsFilter.value.districtCOps = option;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -570,7 +337,6 @@ const getClass = (val: boolean) => {
|
|||
:changeBtn="changeBtn"
|
||||
:disable="statusEdit"
|
||||
:cancel="refreshData"
|
||||
:historyClick="clickHistory"
|
||||
/>
|
||||
<q-form ref="myform">
|
||||
<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
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="addressData.address"
|
||||
v-model="addressData.registAddress"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอก ที่อยู่ตามทะเบียนบ้าน'}`]"
|
||||
:label="`${'ที่อยู่ตามทะเบียนบ้าน'}`"
|
||||
/>
|
||||
|
|
@ -601,7 +367,7 @@ const getClass = (val: boolean) => {
|
|||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="addressData.provinceId"
|
||||
v-model="addressData.registProvinceId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
|
|
@ -627,7 +393,7 @@ const getClass = (val: boolean) => {
|
|||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="addressData.districtId"
|
||||
v-model="addressData.registDistrictId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
|
|
@ -653,7 +419,7 @@ const getClass = (val: boolean) => {
|
|||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="addressData.subdistrictId"
|
||||
v-model="addressData.registSubDistrictId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
|
|
@ -687,7 +453,7 @@ const getClass = (val: boolean) => {
|
|||
>ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้าน</label
|
||||
>
|
||||
<q-radio
|
||||
v-model="addressData.same"
|
||||
v-model="addressData.registSame"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="1"
|
||||
|
|
@ -696,7 +462,7 @@ const getClass = (val: boolean) => {
|
|||
:disable="!edit"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="addressData.same"
|
||||
v-model="addressData.registSame"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="0"
|
||||
|
|
@ -706,7 +472,7 @@ const getClass = (val: boolean) => {
|
|||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12" v-if="addressData.same == '0'">
|
||||
<div class="col-xs-12" v-if="addressData.registSame == '0'">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
hide-bottom-space
|
||||
|
|
@ -717,12 +483,15 @@ const getClass = (val: boolean) => {
|
|||
autogrow
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="addressData.addressC"
|
||||
v-model="addressData.currentAddress"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอก ที่อยู่ปัจจุบัน'}`]"
|
||||
:label="`${'ที่อยู่ปัจจุบัน'}`"
|
||||
/>
|
||||
</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
|
||||
:hide-dropdown-icon="!edit"
|
||||
hide-bottom-space
|
||||
|
|
@ -733,7 +502,7 @@ const getClass = (val: boolean) => {
|
|||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="addressData.provinceIdC"
|
||||
v-model="addressData.currentProvinceId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
|
|
@ -748,7 +517,10 @@ const getClass = (val: boolean) => {
|
|||
) "
|
||||
/>
|
||||
</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
|
||||
:hide-dropdown-icon="!edit"
|
||||
hide-bottom-space
|
||||
|
|
@ -759,7 +531,7 @@ const getClass = (val: boolean) => {
|
|||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="addressData.districtIdC"
|
||||
v-model="addressData.currentDistrictId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
|
|
@ -774,7 +546,10 @@ const getClass = (val: boolean) => {
|
|||
) "
|
||||
/>
|
||||
</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
|
||||
:hide-dropdown-icon="!edit"
|
||||
hide-bottom-space
|
||||
|
|
@ -785,7 +560,7 @@ const getClass = (val: boolean) => {
|
|||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="addressData.subdistrictIdC"
|
||||
v-model="addressData.currentSubDistrictId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
|
|
@ -800,7 +575,10 @@ const getClass = (val: boolean) => {
|
|||
) "
|
||||
/>
|
||||
</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
|
||||
:class="getClass(edit)"
|
||||
hide-bottom-space
|
||||
|
|
@ -816,33 +594,4 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
</q-form>
|
||||
</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>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
|||
import type { zipCodeOption } from "../../components/PersonalDetail/profileType";
|
||||
interface DataOption {
|
||||
id: number;
|
||||
id: number | null;
|
||||
name: string;
|
||||
disable?: boolean;
|
||||
}
|
||||
|
|
@ -102,7 +102,7 @@ interface Education {
|
|||
}
|
||||
|
||||
interface Family {
|
||||
couple: boolean;
|
||||
couple: string;
|
||||
marryPrefix: string;
|
||||
marryPrefixId: string;
|
||||
marryFirstName: string;
|
||||
|
|
@ -121,6 +121,7 @@ interface Family {
|
|||
}
|
||||
|
||||
interface Address {
|
||||
registAddress: string;
|
||||
registSubDistrict: string;
|
||||
registSubDistrictId: string;
|
||||
registZipCode: string;
|
||||
|
|
@ -128,6 +129,7 @@ interface Address {
|
|||
registDistrictId: string;
|
||||
registProvince: string;
|
||||
registProvinceId: string;
|
||||
currentAddress: string;
|
||||
currentSubDistrict: string;
|
||||
currentSubDistrictId: string;
|
||||
currentZipCode: string;
|
||||
|
|
@ -135,10 +137,12 @@ interface Address {
|
|||
currentDistrictId: string;
|
||||
currentProvince: string;
|
||||
currentProvinceId: string;
|
||||
registSame: boolean;
|
||||
registSame: string;
|
||||
}
|
||||
|
||||
const AddressDataDefualt: Address = {
|
||||
registAddress: "",
|
||||
currentAddress: "",
|
||||
registSubDistrict: "",
|
||||
registSubDistrictId: "",
|
||||
registZipCode: "",
|
||||
|
|
@ -153,9 +157,27 @@ const AddressDataDefualt: Address = {
|
|||
currentDistrictId: "",
|
||||
currentProvince: "",
|
||||
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 {
|
||||
DataOption,
|
||||
DataOptionInsignia,
|
||||
|
|
@ -175,4 +197,4 @@ export type {
|
|||
optionData,
|
||||
};
|
||||
|
||||
export { AddressDataDefualt };
|
||||
export { AddressDataDefualt, FamilyDataDefualt };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue