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