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

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

View file

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

View file

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