ปรับการแสดงผลฟอร์มเพิ่ม/แก้ไขตำแหน่งของข้าราชการ
This commit is contained in:
parent
ee22aa6f6f
commit
6d253b54dd
3 changed files with 101 additions and 40 deletions
|
|
@ -20,6 +20,7 @@ export default {
|
|||
/** position*/
|
||||
orgPosPosition: `${orgPos}/position`,
|
||||
orgPosPositionById: (id: string) => `${orgPos}/position/${id}`,
|
||||
orgPosPositionExecutive : () => `${orgPos}/position/executive`,
|
||||
orgPosExecutive: `${orgPos}/executive`,
|
||||
orgPosType: `${orgPos}/type`,
|
||||
orgPosLevel: `${orgPos}/level`,
|
||||
|
|
|
|||
|
|
@ -288,19 +288,6 @@ function close() {
|
|||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งในสายงาน'}`]"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
ref="positionExecutiveFieldRef"
|
||||
v-model="formPositionSelect.positionExecutiveField"
|
||||
:class="inputEdit(isReadonly)"
|
||||
dense
|
||||
outlined
|
||||
for="#positionExecutiveField"
|
||||
label="ด้านทางการบริหาร"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
ref="positionAreaRef"
|
||||
|
|
@ -314,7 +301,6 @@ function close() {
|
|||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
ref="positionFieldRef"
|
||||
|
|
@ -329,7 +315,6 @@ function close() {
|
|||
:rules="[(val) => !!val || `${'กรุณากรอกสายงาน'}`]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<q-select
|
||||
ref="positionTypeRef"
|
||||
|
|
@ -386,9 +371,22 @@ function close() {
|
|||
clearable
|
||||
/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
ref="positionExecutiveFieldRef"
|
||||
v-model="formPositionSelect.positionExecutiveField"
|
||||
:class="inputEdit(isReadonly)"
|
||||
dense
|
||||
outlined
|
||||
for="#positionExecutiveField"
|
||||
label="ด้านทางการบริหาร"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-6 self-center">
|
||||
<q-checkbox size="md" v-model="isSpecial" label="ฉ" />
|
||||
<q-checkbox size="md" v-model="isSpecial" label="เฉพาะสายงานที่กำหนด" />
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ import type {
|
|||
DataPosition,
|
||||
} from "@/modules/02_organizationalNew/interface/response/organizational";
|
||||
|
||||
const posExecutive = ref<string>("");
|
||||
const isSpecial = ref<boolean>(false);
|
||||
const shape = ref<string>("false");
|
||||
const props = defineProps({
|
||||
emitSearch: Function,
|
||||
getData: Function,
|
||||
|
|
@ -109,19 +111,33 @@ function saveSelectEdit() {
|
|||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const dataExecutive = shape.value == "false" ? formPositionSelect.positionExecutive:posExecutive.value
|
||||
const url =
|
||||
shape.value == "false"
|
||||
? config.API.orgPosPositionById(formPositionSelect.positionId)
|
||||
: config.API.orgPosPositionExecutive()+`/${formPositionSelect.positionId}`;
|
||||
showLoader();
|
||||
const body = {
|
||||
const body = shape.value == "false" ?{
|
||||
posDictName: formPositionSelect.positionName,
|
||||
posDictField: formPositionSelect.positionField, //สายงาน
|
||||
posTypeId: formPositionSelect.positionType, //*ประเภทตำแหน่ง
|
||||
posLevelId: formPositionSelect.positionLevel, //*ระดับตำแหน่ง
|
||||
posExecutiveId: formPositionSelect.positionExecutive, //ตำแหน่งทางการบริหาร
|
||||
posExecutiveId: dataExecutive, //ตำแหน่งทางการบริหาร
|
||||
posDictExecutiveField: formPositionSelect.positionExecutiveField, //ด้านทางการบริหาร
|
||||
posDictArea: formPositionSelect.positionArea, //ด้าน/สาขา
|
||||
isSpecial: isSpecial.value,
|
||||
};
|
||||
}:{
|
||||
posDictName: formPositionSelect.positionName,
|
||||
posDictField: formPositionSelect.positionField, //สายงาน
|
||||
posTypeId: formPositionSelect.positionType, //*ประเภทตำแหน่ง
|
||||
posLevelId: formPositionSelect.positionLevel, //*ระดับตำแหน่ง
|
||||
posExecutive: dataExecutive, //ตำแหน่งทางการบริหาร
|
||||
posDictExecutiveField: formPositionSelect.positionExecutiveField, //ด้านทางการบริหาร
|
||||
posDictArea: formPositionSelect.positionArea, //ด้าน/สาขา
|
||||
isSpecial: isSpecial.value,
|
||||
}
|
||||
await http
|
||||
.put(config.API.orgPosPositionById(formPositionSelect.positionId), body)
|
||||
.put(url, body)
|
||||
.then(() => {
|
||||
success($q, "เพิ่มข้อมูลสำเร็จ");
|
||||
|
||||
|
|
@ -145,19 +161,33 @@ function onSubmitSelectEdit() {
|
|||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const dataExecutive = shape.value == "false" ? formPositionSelect.positionExecutive:posExecutive.value
|
||||
const url =
|
||||
shape.value == "false"
|
||||
? config.API.orgPosPosition
|
||||
: config.API.orgPosPositionExecutive();
|
||||
showLoader();
|
||||
const body = {
|
||||
const body = shape.value == "false" ?{
|
||||
posDictName: formPositionSelect.positionName,
|
||||
posDictField: formPositionSelect.positionField, //สายงาน
|
||||
posTypeId: formPositionSelect.positionType, //*ประเภทตำแหน่ง
|
||||
posLevelId: formPositionSelect.positionLevel, //*ระดับตำแหน่ง
|
||||
posExecutiveId: formPositionSelect.positionExecutive, //ตำแหน่งทางการบริหาร
|
||||
posExecutiveId: dataExecutive, //ตำแหน่งทางการบริหาร
|
||||
posDictExecutiveField: formPositionSelect.positionExecutiveField, //ด้านทางการบริหาร
|
||||
posDictArea: formPositionSelect.positionArea, //ด้าน/สาขา
|
||||
isSpecial: isSpecial.value,
|
||||
};
|
||||
}:{
|
||||
posDictName: formPositionSelect.positionName,
|
||||
posDictField: formPositionSelect.positionField, //สายงาน
|
||||
posTypeId: formPositionSelect.positionType, //*ประเภทตำแหน่ง
|
||||
posLevelId: formPositionSelect.positionLevel, //*ระดับตำแหน่ง
|
||||
posExecutive: dataExecutive, //ตำแหน่งทางการบริหาร
|
||||
posDictExecutiveField: formPositionSelect.positionExecutiveField, //ด้านทางการบริหาร
|
||||
posDictArea: formPositionSelect.positionArea, //ด้าน/สาขา
|
||||
isSpecial: isSpecial.value,
|
||||
}
|
||||
await http
|
||||
.post(config.API.orgPosPosition, body)
|
||||
.post(url, body)
|
||||
.then(() => {
|
||||
success($q, "เพิ่มข้อมูลสำเร็จ");
|
||||
|
||||
|
|
@ -314,20 +344,6 @@ watch(
|
|||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
ref="positionExecutiveFieldRef"
|
||||
v-model="formPositionSelect.positionExecutiveField"
|
||||
:class="inputEdit(isReadonly)"
|
||||
dense
|
||||
outlined
|
||||
for="#positionExecutiveField"
|
||||
label="ด้านทางการบริหาร"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
ref="positionAreaRef"
|
||||
|
|
@ -359,7 +375,6 @@ watch(
|
|||
"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<q-select
|
||||
ref="positionTypeRef"
|
||||
|
|
@ -406,8 +421,26 @@ watch(
|
|||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 self-center">
|
||||
<q-radio
|
||||
v-model="shape"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="false"
|
||||
label="เลือกจากรายการ"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="shape"
|
||||
checked-icon="task_alt"
|
||||
w
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="true"
|
||||
label="เพิ่มใหม่"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<q-select
|
||||
v-if="shape == 'false'"
|
||||
ref="positionExecutiveRef"
|
||||
:class="inputEdit(isReadonly)"
|
||||
label="ตำแหน่งทางการบริหาร"
|
||||
|
|
@ -423,10 +456,39 @@ watch(
|
|||
hide-bottom-space
|
||||
clearable
|
||||
/>
|
||||
<q-input
|
||||
v-else
|
||||
ref="positionExecutiveFieldRef"
|
||||
v-model="posExecutive"
|
||||
:class="inputEdit(isReadonly)"
|
||||
dense
|
||||
outlined
|
||||
for="#positionExecutiveField"
|
||||
label="เพิ่มตำแหน่งทางการบริหาร"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
ref="positionExecutiveFieldRef"
|
||||
v-model="formPositionSelect.positionExecutiveField"
|
||||
:class="inputEdit(isReadonly)"
|
||||
dense
|
||||
outlined
|
||||
for="#positionExecutiveField"
|
||||
label="ด้านทางการบริหาร"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-6 self-center">
|
||||
<q-checkbox size="md" v-model="isSpecial" label="ฉ" />
|
||||
<q-checkbox
|
||||
size="md"
|
||||
v-model="isSpecial"
|
||||
label="เฉพาะสายงานที่กำหนด"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue