ปรับ UI
This commit is contained in:
parent
30d342728b
commit
0612820928
45 changed files with 93 additions and 76 deletions
|
|
@ -16,7 +16,7 @@ const dataLabel = {
|
|||
registrationAddress: "ที่อยู่ตามทะเบียนบ้าน",
|
||||
registrationProvince: "จังหวัด",
|
||||
registrationDistrict: "เขต/อำเภอ",
|
||||
registrationSubDistrict: "แขวง / ตำบล",
|
||||
registrationSubDistrict: "แขวง/ตำบล",
|
||||
registrationZipCode: "รหัสไปรษณีย์",
|
||||
};
|
||||
|
||||
|
|
@ -51,8 +51,8 @@ async function selectDistrict(e: string | null, name: string) {
|
|||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันเลือก แขวง / ตำบล
|
||||
* @param e แขวง / ตำบล ที่เลือก
|
||||
* ฟังก์ชันเลือก แขวง/ตำบล
|
||||
* @param e แขวง/ตำบล ที่เลือก
|
||||
* @param name 1 คือ ที่อยู่ตามทะเบียนบ้าน 2 คือ ที่อยู่ปัจจุบัน
|
||||
*/
|
||||
function selectSubDistrict(e: string | null, name: string) {
|
||||
|
|
@ -162,7 +162,7 @@ watch(
|
|||
v-model="formDataAddress.registrationSubDistrictId"
|
||||
:options="storeLinkCenter.OpsAddress.subdistrictOps"
|
||||
:label="dataLabel.registrationSubDistrict"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก แขวง / ตำบล'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก แขวง/ตำบล'}`]"
|
||||
@update:model-value="(value:string) => selectSubDistrict(value, '1')"
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => storeLinkCenter.filterSelector(inputValue, doneFn,'subdistrictOps'
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ const formInformations = reactive<RequestObject>({
|
|||
firstName: "",
|
||||
prefix: "",
|
||||
rank: null,
|
||||
prefixMain: "",
|
||||
});
|
||||
|
||||
const formDataAddress = reactive<RequestregistrationAddressObject>({
|
||||
|
|
@ -257,7 +258,7 @@ async function amiRequest() {
|
|||
formInformations.nationality = data.value.nationalityDesc;
|
||||
|
||||
// แปลง dateOfBirth เป็น format 1989-01-01
|
||||
formInformations.birthDate = conventDateOfBirth(`${data.value.dateOfBirth}`);
|
||||
formInformations.birthDate = data.value.dateOfBirth ? conventDateOfBirth(`${data.value.dateOfBirth}`) : null;
|
||||
age.value = storeLinkCenter.calculateAge(data.value.age);
|
||||
formInformations.gender = data.value.genderDesc;
|
||||
|
||||
|
|
@ -327,15 +328,15 @@ async function convertDistrict(val: string) {
|
|||
const id = storeLinkCenter.OpsAddress.districtOps.find(
|
||||
(e: DataOption) => e.name === val
|
||||
)?.id;
|
||||
// เรียกฟังก์ชันดึงข้อมูล แขวง / ตำบล
|
||||
// เรียกฟังก์ชันดึงข้อมูล แขวง/ตำบล
|
||||
await storeLinkCenter.fetchSubDistrict(id ? id : null, "1", false);
|
||||
|
||||
return id ? id : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันแปลงชื่อแขวง / ตำบล เป็น ID
|
||||
* @param val ชื่อแขวง / ตำบล
|
||||
* ฟังก์ชันแปลงชื่อแขวง/ตำบล เป็น ID
|
||||
* @param val ชื่อแขวง/ตำบล
|
||||
*/
|
||||
async function convertSubdistrict(val: string) {
|
||||
const result = storeLinkCenter.OpsAddress.subdistrictOps.find(
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ - นามสกุล",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "fullName",
|
||||
align: "left",
|
||||
label: "ชื่อ - นามสกุล",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
sortable: true,
|
||||
field: "fullName",
|
||||
headerStyle: "font-size: 14px; min-width: 200px",
|
||||
|
|
|
|||
|
|
@ -215,6 +215,8 @@ async function getData() {
|
|||
.get(config.API.profileNewGovernmentById(profileId.value, empType.value))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
console.log(data);
|
||||
|
||||
formMain.ocId = data.org ?? "-"; //สังกัด
|
||||
formMain.positionId = data.position ?? "-"; //ตำแหน่ง
|
||||
formMain.positionLine = data.positionField ?? "-"; //สายงาน
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
|||
/**
|
||||
* props
|
||||
*/
|
||||
const isLeave = defineModel<boolean>("isLeave", {
|
||||
const isLeave = defineModel<boolean>("isLeave", {
|
||||
required: true,
|
||||
});
|
||||
|
||||
|
|
@ -230,7 +230,7 @@ function openDialogAdd() {
|
|||
/**
|
||||
* function fetch ข้อมูลรายการวินัย
|
||||
*/
|
||||
function fetchData(id: string) {
|
||||
async function fetchData(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.profileNewDisciplineByProfileId(id, empType.value))
|
||||
|
|
@ -398,7 +398,6 @@ onMounted(() => {
|
|||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
|
||||
style="min-width: 140px"
|
||||
/>
|
||||
<q-btn-toggle
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ const columnsHistory = ref<QTableProps["columns"]>([
|
|||
/**
|
||||
* ฟังก์ชันดึงข้อมูลที่อยู่
|
||||
*
|
||||
* ดึงข้อมูลที่อยู่ ข้อมูลจังหวัด ข้อมูล เขต / อำเภอ และข้อมูล แขวง / ตำบล
|
||||
* ดึงข้อมูลที่อยู่ ข้อมูลจังหวัด ข้อมูล เขต / อำเภอ และข้อมูล แขวง/ตำบล
|
||||
*/
|
||||
async function getData() {
|
||||
showLoader();
|
||||
|
|
@ -337,8 +337,8 @@ async function selectDistrict(e: string | null, name: string) {
|
|||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันเลือก แขวง / ตำบล
|
||||
* @param e แขวง / ตำบล ที่เลือก
|
||||
* ฟังก์ชันเลือก แขวง/ตำบล
|
||||
* @param e แขวง/ตำบล ที่เลือก
|
||||
* @param name 1 คือ ที่อยู่ตามทะเบียนบ้าน 2 คือ ที่อยู่ปัจจุบัน
|
||||
*/
|
||||
function selectSubDistrict(e: string | null, name: string) {
|
||||
|
|
@ -743,7 +743,7 @@ onMounted(async () => {
|
|||
v-model="formData.registrationSubDistrictId"
|
||||
:options="store.Ops.subdistrictOps"
|
||||
:label="dataLabel.registrationSubDistrict"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก แขวง / ตำบล'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก แขวง/ตำบล'}`]"
|
||||
@update:model-value="(value:string) => selectSubDistrict(value, '1')"
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'subdistrictOps'
|
||||
|
|
@ -864,7 +864,7 @@ onMounted(async () => {
|
|||
v-model="formData.currentSubDistrictId"
|
||||
:options="store.Ops.subdistrictCOps"
|
||||
:label="dataLabel.currentSubDistrict"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก แขวง / ตำบล'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก แขวง/ตำบล'}`]"
|
||||
@update:model-value="(value:string) => selectSubDistrict(value, '2')"
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'subdistrictCOps'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue