แก้ไขโครงสร้าง
This commit is contained in:
parent
533ed31bc8
commit
f07044b41a
4 changed files with 53 additions and 83 deletions
|
|
@ -60,9 +60,9 @@ const orgLevelOption = ref<DataOption[]>([]);
|
|||
const orgNameRef = ref<Object | null>(null);
|
||||
const orgShortNameRef = ref<Object | null>(null);
|
||||
const orgCodeRef = ref<Object | null>(null);
|
||||
const orgPhoneExRef = ref<Object | null>(null);
|
||||
const orgPhoneInRef = ref<Object | null>(null);
|
||||
const orgFaxRef = ref<Object | null>(null);
|
||||
// const orgPhoneExRef = ref<Object | null>(null);
|
||||
// const orgPhoneInRef = ref<Object | null>(null);
|
||||
// const orgFaxRef = ref<Object | null>(null);
|
||||
const orgLevelRef = ref<Object | null>(null);
|
||||
|
||||
const formData = reactive<FormDataAgency>({
|
||||
|
|
@ -80,9 +80,9 @@ const objectComplaintsRef: FormAgencyRef = {
|
|||
orgName: orgNameRef,
|
||||
orgShortName: orgShortNameRef,
|
||||
orgCode: orgCodeRef,
|
||||
orgPhoneEx: orgPhoneExRef,
|
||||
orgPhoneIn: orgPhoneInRef,
|
||||
orgFax: orgFaxRef,
|
||||
// orgPhoneEx: orgPhoneExRef,
|
||||
// orgPhoneIn: orgPhoneInRef,
|
||||
// orgFax: orgFaxRef,
|
||||
orgLevel: orgLevelRef,
|
||||
};
|
||||
|
||||
|
|
@ -334,11 +334,6 @@ const tittleName = computed(() => {
|
|||
for="#telOut"
|
||||
label="หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก"
|
||||
hide-bottom-space
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val ||
|
||||
`${'กรุณากรอกหมายเลขโทรศัพท์ที่ติดต่อจากภายนอก'}`,
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
|
|
@ -350,10 +345,6 @@ const tittleName = computed(() => {
|
|||
for="#telIn"
|
||||
label="หมายเลขโทรศัพท์ที่ติดต่อจากภายใน"
|
||||
hide-bottom-space
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val || `${'กรุณากรอกหมายเลขโทรศัพท์ที่ติดต่อจากภายใน'}`,
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
|
|
@ -365,7 +356,6 @@ const tittleName = computed(() => {
|
|||
for="#tel"
|
||||
label="หมายเลขโทรสาร"
|
||||
hide-bottom-space
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกหมายเลขโทรสาร'}`]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -308,16 +308,17 @@ watch(
|
|||
);
|
||||
|
||||
function addPosition(data: RowDetailPositions) {
|
||||
const isIdExist = rows.value.some(item => item.positionId === data.positionId);
|
||||
const isIdExist = rows.value.some(
|
||||
(item) => item.positionId === data.positionId
|
||||
);
|
||||
|
||||
if (!isIdExist) {
|
||||
rows.value = [data, ...rows.value];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function deleteData(id:string){
|
||||
const dataRow = rows.value
|
||||
function deleteData(id: string) {
|
||||
const dataRow = rows.value;
|
||||
const updatedRows = dataRow.filter((item: any) => item.positionId !== id);
|
||||
rows.value = updatedRows;
|
||||
}
|
||||
|
|
@ -326,7 +327,7 @@ function deleteData(id:string){
|
|||
<template>
|
||||
<q-dialog v-model="props.modal" persistent>
|
||||
<q-card style="min-width: 96vw">
|
||||
<DialogHeader :tittle="`เพิ่มตำแหน่ง`" :close="props.close" />
|
||||
<DialogHeader tittle="เพิ่มอัตรากำลัง" :close="props.close" />
|
||||
<q-separator />
|
||||
|
||||
<q-card-section class="q-pa-sm">
|
||||
|
|
@ -341,7 +342,7 @@ function deleteData(id:string){
|
|||
<div
|
||||
class="col-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
|
||||
>
|
||||
เลขที่ตำแหน่ง
|
||||
ข้อมูลอัตรากำลัง
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row q-col-gutter-sm col-12 q-pa-sm">
|
||||
|
|
@ -443,8 +444,8 @@ function deleteData(id:string){
|
|||
color="red"
|
||||
@click="deleteData(props.row.positionId)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -38,10 +38,17 @@ async function fetchDetailTree(id: string, type: string) {
|
|||
.get(config.API.orgLevelByid(type.toLocaleLowerCase(), id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
formData.orgName = data[`org${type}Name`];
|
||||
formData.agencyName = data[`org${type}Name`];
|
||||
formData.orgType = data[`org${type}Name`];
|
||||
formData.orgLevel = store.convertType(data[`org${type}Rank`]);
|
||||
const range = data[`org${type}Rank`];
|
||||
formData.orgName =
|
||||
range == "DEPARTMENT"
|
||||
? data[`org${type}Name`] + ` (${data[`org${type}ShortName`]})`
|
||||
: "-";
|
||||
formData.agencyName =
|
||||
range != "DEPARTMENT"
|
||||
? data[`org${type}Name`] + ` (${data[`org${type}ShortName`]})`
|
||||
: "-";
|
||||
formData.orgType = range != "DEPARTMENT" ? "ส่วนราชการ" : "หน่วยงาน";
|
||||
formData.orgLevel = store.convertType(range);
|
||||
formData.status =
|
||||
store.typeOrganizational === "current" ? "ปัจจุบัน" : "แบบร่าง";
|
||||
formData.orgPhoneEx = data[`org${type}PhoneEx`];
|
||||
|
|
@ -80,88 +87,60 @@ watch(
|
|||
<q-card-section>
|
||||
<div class="q-px-md">
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
<div>
|
||||
<p>หน่วยงาน</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-bold">หน่วยงาน</div>
|
||||
<div class="col-8 text-grey-8">
|
||||
<p>{{ formData.orgName }} ({{ formData.orgShortName }})</p>
|
||||
<p>{{ formData.orgName }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
<div>
|
||||
<p>ส่วนราชการ</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-bold">ส่วนราชการ</div>
|
||||
<div class="col-8 text-grey-8">
|
||||
<p>{{ formData.agencyName }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
<div>
|
||||
<p>ประเภท</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-bold">ประเภท</div>
|
||||
<div class="col-8 text-grey-8">
|
||||
<p>{{ formData.orgType }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
<div>
|
||||
<p>ระดับ</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-bold">ระดับ</div>
|
||||
<div class="col-8 text-grey-8">
|
||||
<p>{{ formData.orgLevel }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
<div>
|
||||
<p>สถานะ</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-bold">สถานะ</div>
|
||||
<div class="col-8 text-grey-8">
|
||||
<p>{{ formData.status }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
<div>
|
||||
<p class="q-ma-none">เบอร์โทร</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8 text-grey-8">
|
||||
<p class="q-ma-none">
|
||||
{{
|
||||
formData.orgPhoneEx ? `ภายนอก ${formData.orgPhoneEx}` : ""
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="offset-4 col-8 text-grey-8">
|
||||
<p>
|
||||
{{
|
||||
formData.orgPhoneIn ? `ภายใน ${formData.orgPhoneIn}` : ""
|
||||
}}
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">เบอร์โทร</div>
|
||||
<div class="col-8 text-grey-8">
|
||||
<p v-if="formData.orgPhoneEx != ''">
|
||||
{{ `ภายนอก ${formData.orgPhoneEx}` }}
|
||||
</p>
|
||||
<p v-if="formData.orgPhoneIn != ''">
|
||||
{{ `ภายใน ${formData.orgPhoneIn}` }}
|
||||
</p>
|
||||
<p
|
||||
v-show="
|
||||
formData.orgPhoneEx == '' && formData.orgPhoneIn == ''
|
||||
"
|
||||
>
|
||||
-
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
<div>
|
||||
<p>Fax</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-bold">Fax</div>
|
||||
<div class="col-8 text-grey-8">
|
||||
<p>{{ formData.orgFax }}</p>
|
||||
<p v-if="formData.orgFax != ''">{{ formData.orgFax }}</p>
|
||||
<p v-else>-</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ interface FormAgencyRef {
|
|||
orgName: object | null;
|
||||
orgShortName: object | null;
|
||||
orgCode: object | null;
|
||||
orgPhoneEx: object | null;
|
||||
orgPhoneIn: object | null;
|
||||
orgFax: object | null;
|
||||
// orgPhoneEx: object | null;
|
||||
// orgPhoneIn: object | null;
|
||||
// orgFax: object | null;
|
||||
orgLevel: object | null;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue