ระดับการศึกษา: เพิ่ม Tab ระดับการศึกษา
This commit is contained in:
parent
01f89066a0
commit
6212e743de
2 changed files with 283 additions and 0 deletions
|
|
@ -14,7 +14,22 @@ const data = defineModel<string>("data", {
|
|||
});
|
||||
const personalName = defineModel<string>("personalName");
|
||||
const dialogStatus = defineModel<string>("dialogStatus");
|
||||
const editId = defineModel<string>("editId");
|
||||
const dialog = defineModel<boolean>("dialog");
|
||||
const educationRank = defineModel<any>("rank");
|
||||
const props = defineProps({
|
||||
fetchData: {
|
||||
type: Function,
|
||||
},
|
||||
addData: {
|
||||
type: Function,
|
||||
default: () => {},
|
||||
},
|
||||
editData: {
|
||||
type: Function,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
|
||||
function closeDialog() {
|
||||
dialog.value = false;
|
||||
|
|
@ -22,6 +37,7 @@ function closeDialog() {
|
|||
|
||||
function validateForm() {
|
||||
dataRef.value.validate();
|
||||
educationRank.value.validate();
|
||||
onSubmit();
|
||||
}
|
||||
|
||||
|
|
@ -30,6 +46,9 @@ async function onSubmit() {
|
|||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
dialogStatus.value === "create"
|
||||
? props.addData()
|
||||
: props.editData(editId.value);
|
||||
closeDialog();
|
||||
data.value = "";
|
||||
},
|
||||
|
|
@ -66,6 +85,24 @@ async function onSubmit() {
|
|||
hide-bottom-space
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-card-section
|
||||
class="q-pa-none"
|
||||
v-if="personalName === 'ระดับการศึกษา'"
|
||||
>
|
||||
<q-input
|
||||
ref="educationRankRef"
|
||||
outlined
|
||||
v-model="educationRank"
|
||||
label="ลำดับ"
|
||||
dense
|
||||
type="number"
|
||||
lazy-rules
|
||||
borderless
|
||||
class="col-12 bg-white q-ma-md"
|
||||
:rules="[(val) => val != undefined || 'กรุณากรอกลำดับ']"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue