ปรับ dialog บรรจุ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-08-17 11:40:46 +07:00
parent 508fb3b02b
commit 1881aa1b2f
23 changed files with 1064 additions and 1072 deletions

View file

@ -35,6 +35,7 @@ const {
hideLoader,
success,
dialogMessage,
dialogRemove,
} = mixin;
const modal = ref<boolean>(false);
@ -62,7 +63,6 @@ const resetFilter = () => {
filterRef.value.focus();
};
const rows = ref<relocationType[]>([]);
const rows2 = ref<any[]>([]);
const columns = ref<QTableProps["columns"]>([
@ -122,7 +122,6 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const columns2 = ref<QTableProps["columns"]>([
{
@ -214,7 +213,7 @@ const getData = async () => {
dateOfBirth: date2Thai(item.dateOfBirth),
gender: item.gender,
status: item.status,
statusText:statusText(item.status),
statusText: statusText(item.status),
recruitDate: item.recruitDate,
positionNumber: item.positionNumber,
positionPath: item.positionPath,
@ -289,15 +288,13 @@ const deleteData = async (id: string) => {
};
const clickDelete = async (name: string, id: string) => {
dialogMessage(
dialogRemove(
$q,
`ลบข้อมูลของ ${name}`,
`ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`,
"delete",
"ยืนยัน",
"red",
async () => await deleteData(id),
async () => await getData()
async () => {
await deleteData(id);
await getData();
},
`ลบข้อมูลของ ${name}`
);
};
const closeModalTree = async () => {
@ -413,7 +410,9 @@ onMounted(async () => {
<div class="col-4">
<div class="text-weight-medium">
{{
props.row.organizationName !== null ? props.row.organizationName : "-"
props.row.organizationName !== null
? props.row.organizationName
: "-"
}}
{{
props.row.organizationShortName !== null
@ -440,16 +439,14 @@ onMounted(async () => {
<div class="text-weight-medium">-</div>
</div>
</div>
</q-td>
</q-td>
<q-td
key="dateOfBirth"
:props="props"
@click="openDetail(props.row.id)"
>
{{
props.row.dateOfBirth !== null
? props.row.dateOfBirth
: "-"
props.row.dateOfBirth !== null ? props.row.dateOfBirth : "-"
}}
</q-td>
<q-td
@ -595,7 +592,7 @@ onMounted(async () => {
</div>
<d-table
:columns="columns2"
:columns="columns2"
:rows="rows2"
:filter="filterKeyword2"
row-key="id"
@ -610,7 +607,6 @@ onMounted(async () => {
color="primary"
dense
v-model="scope.selected"
/>
</template>
<template v-slot:body="props">
@ -621,7 +617,6 @@ onMounted(async () => {
color="primary"
dense
v-model="props.selected"
/>
</q-td>
<q-td key="no" :props="props">
@ -633,10 +628,7 @@ onMounted(async () => {
<q-td key="fullname" :props="props">
{{ props.row.fullname }}
</q-td>
<q-td
key="organizationName"
:props="props"
>
<q-td key="organizationName" :props="props">
<div
v-if="
props.row.organizationName !== null ||
@ -645,7 +637,11 @@ onMounted(async () => {
>
<div class="col-4">
<div class="text-weight-medium">
{{ props.row.organizationName !== null ? props.row.organizationName : "-" }}
{{
props.row.organizationName !== null
? props.row.organizationName
: "-"
}}
{{
props.row.organizationShortName !== null
? `(${props.row.organizationShortName})`
@ -675,7 +671,6 @@ onMounted(async () => {
<q-td key="dateOfBirth" :props="props">
{{ props.row.dateOfBirth }}
</q-td>
</q-tr>
</template>
</d-table>

View file

@ -9,7 +9,14 @@ import config from "@/app.config";
const $q = useQuasar();
const mixin = useCounterMixin(); //
const { date2Thai, hideLoader, messageError, showLoader, success } = mixin; //
const {
date2Thai,
hideLoader,
messageError,
showLoader,
success,
dialogConfirm,
} = mixin; //
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
const noData = ref<string>("ไม่พบข้อมูลผังโครงสร้าง");
@ -205,16 +212,15 @@ const clickEditRow = () => {
const closeModal = () => {
if (editDataStatus.value == true) {
$q.dialog({
title: `ข้อมูลมีการแก้ไข`,
message: `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`,
cancel: "ยกเลิก",
ok: "ยืนยัน",
persistent: true,
}).onOk(() => {
editDataStatus.value = false;
closeAndClear();
});
dialogConfirm(
$q,
() => {
editDataStatus.value = false;
closeAndClear();
},
`ข้อมูลมีการแก้ไข`,
`ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`
);
} else {
closeAndClear();
}
@ -319,7 +325,6 @@ const selectedPosition = async (data: any) => {
positionPathSideArr.length > 1 || positionPathSideArr.length == 0
? ""
: positionPathSideArr[0].value;
}
// positionType Options

View file

@ -27,6 +27,7 @@ const {
showLoader,
hideLoader,
success,
dialogConfirm,
} = mixin;
const roleAdmin = ref<boolean>(false);
@ -39,7 +40,7 @@ const id = ref<string>("");
const prefix = ref<string>("");
const prefixId = ref<string>("");
const firstname = ref<string>("");
const citizenId = ref<string>("")
const citizenId = ref<string>("");
const lastname = ref<string>("");
const position = ref<string>("");
const posNo = ref<string>("");
@ -54,14 +55,14 @@ const amount = ref<number>();
const amountOld = ref<number>();
const positionTypeOld = ref<string>("");
const positionLevelOld = ref<string>("");
const dateOfBirth = ref<Date>()
const genderId = ref<string>("")
const nationality = ref<string>("")
const race = ref<string>("")
const religionId = ref<string>("")
const bloodGroupId = ref<string>("")
const relationshipId = ref<string>("")
const telephoneNumber = ref<string>("")
const dateOfBirth = ref<Date>();
const genderId = ref<string>("");
const nationality = ref<string>("");
const race = ref<string>("");
const religionId = ref<string>("");
const bloodGroupId = ref<string>("");
const relationshipId = ref<string>("");
const telephoneNumber = ref<string>("");
const positionNumberOld = ref<string>("");
const organizationPositionOld = ref<string>("");
const isActive = ref<string>("");
@ -116,7 +117,7 @@ const getData = async () => {
.get(config.API.relocationDetail(personId))
.then((res: any) => {
const data = res.data.result;
citizenId.value = data.citizenId
citizenId.value = data.citizenId;
fullname.value = `${data.prefix}${data.firstname} ${data.lastname}`;
prefixId.value = data.prefixId;
prefix.value = data.prefix;
@ -165,31 +166,27 @@ const conditionSave = async () => {
if (myForm.value !== null) {
myForm.value.validate().then((success: any) => {
if (success) {
dialogMessage(
dialogConfirm(
$q,
"ต้องการแก้ไขข้อมูลหรือไม่?",
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย",
"mdi-help-circle-outline",
"ตกลง",
"public",
async () => await saveData(),
undefined
"ต้องการแก้ไขข้อมูลหรือไม่?",
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
);
}
});
}
};
const cancelBtn = () => {
edit.value=!edit
getData()
}
edit.value = !edit;
getData();
};
const saveData = async () => {
const body = {
educationOld: educationOld.value,
prefixId:prefixId.value,
citizenId:citizenId.value,
firstname:firstname.value,
lastname:lastname.value,
prefixId: prefixId.value,
citizenId: citizenId.value,
firstname: firstname.value,
lastname: lastname.value,
reason: reason.value,
organizationPositionOld: organizationPositionOld.value,
positionTypeOld: positionTypeOld.value,
@ -197,14 +194,14 @@ const saveData = async () => {
positionNumberOld: positionNumberOld.value,
amount: amount.value,
amountOld: amountOld.value,
dateOfBirth:dateOfBirth.value ,
genderId:genderId.value ,
nationality:nationality.value ,
race:race.value ,
religionId:religionId.value ,
bloodGroupId:bloodGroupId.value ,
relationshipId:relationshipId.value ,
telephoneNumber:telephoneNumber.value ,
dateOfBirth: dateOfBirth.value,
genderId: genderId.value,
nationality: nationality.value,
race: race.value,
religionId: religionId.value,
bloodGroupId: bloodGroupId.value,
relationshipId: relationshipId.value,
telephoneNumber: telephoneNumber.value,
};
showLoader();
await http
@ -363,22 +360,22 @@ onMounted(async () => {
<div class="row col-12 q-pa-md">
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-6 col-sm-3 row items-center">
<div class="text-weight-bold text-grey">การศกษา</div>
<div class="col-12">
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="educationOld"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
hide-bottom-space
:label="`${'วุฒิ/สาขา'}`"
/>
</div>
</div>
<div class="text-weight-bold text-grey">การศกษา</div>
<div class="col-12">
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="educationOld"
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
hide-bottom-space
:label="`${'วุฒิ/สาขา'}`"
/>
</div>
</div>
<div class="col-xs-12 row items-center">
<div class="col-12 q-pb-sm"><q-separator /></div>