แก้ไขข้อความโครงสร้างอัตรากำลัง

This commit is contained in:
Warunee Tamkoo 2024-01-31 09:06:50 +07:00
parent 3afdf26171
commit 7e46a7e984
3 changed files with 43 additions and 15 deletions

View file

@ -227,10 +227,7 @@ watch(
const tittleName = computed(() => { const tittleName = computed(() => {
let name = ""; let name = "";
if (actionType.value === "ADD") { if (actionType.value === "ADD") {
name = name = level.value === 0 ? "เพิ่มหน่วยงาน" : "เพิ่มส่วนราชการ";
level.value === 0 || level.value === 1
? "เพิ่มหน่วยงาน"
: "เพิ่มส่วนราชการ";
} else { } else {
name = level.value === 0 ? "แก้ไขหน่วยงาน" : "แก้ไขเพิ่มส่วนราชการ"; name = level.value === 0 ? "แก้ไขหน่วยงาน" : "แก้ไขเพิ่มส่วนราชการ";
} }
@ -241,7 +238,7 @@ const tittleName = computed(() => {
<template> <template>
<template> <template>
<q-dialog v-model="props.modal" persistent> <q-dialog v-model="props.modal" persistent>
<q-card style="min-width: 50vw"> <q-card style="min-width: 60vw">
<form @submit.prevent="validateForm"> <form @submit.prevent="validateForm">
<DialogHeader :tittle="tittleName" :close="closeClear" /> <DialogHeader :tittle="tittleName" :close="closeClear" />
<q-separator /> <q-separator />
@ -254,9 +251,17 @@ const tittleName = computed(() => {
dense dense
outlined outlined
for="#ocName" for="#ocName"
label="ชื่อหน่วยงาน" :label="level == 0 ? 'ชื่อหน่วยงาน' : 'ชื่อส่วนราชการ'"
hide-bottom-space hide-bottom-space
:rules="[(val) => !!val || `${'กรุณากรอกชื่อหน่วยงาน'}`]" :rules="[
(val) =>
!!val ||
`${
level == 0
? 'กรุณากรอกชื่อหน่วยงาน'
: 'กรุณากรอกชื่อส่วนราชการ'
}`,
]"
/> />
</div> </div>
<div class="col-2"> <div class="col-2">
@ -278,9 +283,17 @@ const tittleName = computed(() => {
dense dense
outlined outlined
for="#ocNo" for="#ocNo"
label="รหัสหน่วยงาน" :label="level == 0 ? 'รหัสหน่วยงาน' : 'รหัสส่วนราชการ'"
hide-bottom-space hide-bottom-space
:rules="[(val) => !!val || `${'กรุณากรอกรหัสหน่วยงาน'}`]" :rules="[
(val) =>
!!val ||
`${
level == 0
? 'กรุณากรอกรหัสหน่วยงาน'
: 'กรุณากรอกรหัสส่วนราชการ'
}`,
]"
/> />
</div> </div>
<div class="col-4"> <div class="col-4">
@ -297,8 +310,18 @@ const tittleName = computed(() => {
map-options map-options
v-model="formData.orgLevel" v-model="formData.orgLevel"
:options="orgLevelOption" :options="orgLevelOption"
label="ระดับของหน่วยงาน" :label="
:rules="[(val) => !!val || `${'กรุณาเลือกระดับของหน่วยงาน'}`]" level == 0 ? 'ระดับของหน่วยงาน' : 'ระดับของส่วนราชการ'
"
:rules="[
(val) =>
!!val ||
`${
level == 0
? 'กรุณาเลือกระดับของหน่วยงาน'
: 'กรุณาเลือกระดับของส่วนราชการ'
}`,
]"
lazy-rules lazy-rules
/> />
</div> </div>

View file

@ -352,7 +352,7 @@ function deleteData(id:string){
outlined outlined
readonly readonly
for="#shortName" for="#shortName"
label="ชื่อย่อหน่วยงาน" label="อักษรย่อ"
/> />
</div> </div>
<div class="col-3"> <div class="col-3">

View file

@ -53,7 +53,7 @@ const listAdd = ref<ListMenu[]>([
// color: "blue", // color: "blue",
// }, // },
{ {
label: "ดูประวัติหน่วยงาน", label: "ประวัติ",
icon: "history", icon: "history",
type: "HISTORY", type: "HISTORY",
color: "purple", color: "purple",
@ -322,7 +322,11 @@ onMounted(async () => {});
</q-item-section> </q-item-section>
<div v-if="prop.node.orgLevel === 0"> <div v-if="prop.node.orgLevel === 0">
<q-item-section <q-item-section
v-if="item.type === 'EDIT' || item.type === 'DEL'" v-if="
item.type === 'EDIT' ||
item.type === 'DEL' ||
item.type === 'HISTORY'
"
>{{ item.label }}หนวยงาน</q-item-section >{{ item.label }}หนวยงาน</q-item-section
> >
<q-item-section v-else-if="item.type === 'ADD'" <q-item-section v-else-if="item.type === 'ADD'"
@ -336,7 +340,8 @@ onMounted(async () => {});
v-if=" v-if="
item.type === 'ADD' || item.type === 'ADD' ||
item.type === 'EDIT' || item.type === 'EDIT' ||
item.type === 'DEL' item.type === 'DEL' ||
item.type === 'HISTORY'
" "
>{{ item.label }}วนราชการ</q-item-section >{{ item.label }}วนราชการ</q-item-section
> >