ปรับ fe sprint2
This commit is contained in:
parent
8576f3c387
commit
0d6ff7be0a
83 changed files with 6932 additions and 2571 deletions
|
|
@ -97,7 +97,7 @@
|
|||
</q-form>
|
||||
<!-- popup Edit window-->
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-card style="min-width: 700px">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader
|
||||
:tittle="`${modalEdit ? 'แก้ไข' : 'สร้าง'}โครงสร้างและกรอบอัตรากำลัง`"
|
||||
|
|
@ -187,6 +187,7 @@
|
|||
<selector
|
||||
:class="getClass(edit)"
|
||||
hide-bottom-space
|
||||
multiple
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
|
|
@ -195,17 +196,14 @@
|
|||
v-model="positionPathSideId"
|
||||
:label="`${'ด้าน/สาขา'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="positionPathSideOptions"
|
||||
option-value="id"
|
||||
use-input
|
||||
hide-selected
|
||||
fill-input
|
||||
use-chips
|
||||
input-debounce="0"
|
||||
@filter="positionPathSideFilterFn"
|
||||
clearable
|
||||
color="primary"
|
||||
/>
|
||||
<!-- :rules="[(val) => !!val || `${'กรุณาเลือกด้าน/สาขา'}`]" -->
|
||||
</div>
|
||||
|
|
@ -231,7 +229,7 @@
|
|||
fill-input
|
||||
input-debounce="0"
|
||||
@filter="positionExecutiveFilterFn"
|
||||
clearable
|
||||
color="primary"
|
||||
/>
|
||||
<!-- :rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกตำแหน่งทางการบริหาร'}`,
|
||||
|
|
@ -241,6 +239,7 @@
|
|||
<selector
|
||||
:class="getClass(edit)"
|
||||
hide-bottom-space
|
||||
multiple
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
|
|
@ -249,17 +248,14 @@
|
|||
v-model="positionExecutiveSideId"
|
||||
:label="`${'ด้านทางการบริหาร'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="positionExecutiveSideOptions"
|
||||
option-value="id"
|
||||
use-input
|
||||
hide-selected
|
||||
fill-input
|
||||
use-chips
|
||||
input-debounce="0"
|
||||
@filter="positionExecutiveSideFilterFn"
|
||||
clearable
|
||||
color="primary"
|
||||
/>
|
||||
<!-- :rules="[(val) => !!val || `${'กรุณาเลือกด้านทางการบริหาร'}`]" -->
|
||||
</div>
|
||||
|
|
@ -314,6 +310,21 @@
|
|||
:rules="[(val:any) => !!val || `${'กรุณาเลือกสถานภาพของตำแหน่ง'}`]"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
hide-bottom-space
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="qualification"
|
||||
:label="`${'คุณวุฒิ'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
|
|
@ -328,7 +339,6 @@
|
|||
@update:modelValue="clickEditRow"
|
||||
type="textarea"
|
||||
/>
|
||||
<!-- :rules="[(val) => !!val || `${'กรุณากรอกเงื่อนไขตำแหน่ง'}`]" -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-input
|
||||
|
|
@ -344,7 +354,6 @@
|
|||
@update:modelValue="clickEditRow"
|
||||
type="textarea"
|
||||
/>
|
||||
<!-- :rules="[(val) => !!val || `${'กรุณากรอกเงื่อนไขตำแหน่ง'}`]" -->
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6 text-grey-9">
|
||||
<q-checkbox v-model="isDirector" label="หัวหน้า" />
|
||||
|
|
@ -431,14 +440,7 @@ const { loaderPage } = dataStore;
|
|||
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
success,
|
||||
modalConfirm,
|
||||
modalError,
|
||||
modalDelete,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
} = mixin;
|
||||
const { success, modalConfirm, modalError, modalDelete } = mixin;
|
||||
const { date2Thai } = mixin;
|
||||
const store = useOrganizationalDataStore();
|
||||
const { organizationalData, changeOrganizationalColumns } = store;
|
||||
|
|
@ -456,12 +458,13 @@ const positionTypeId = ref<string>();
|
|||
const positionMasterId = ref<string>("");
|
||||
const positionLineId = ref<string>();
|
||||
const positionPathId = ref<string>("");
|
||||
const positionPathSideId = ref<string>();
|
||||
const positionPathSideId = ref<any>();
|
||||
const positionExecutiveId = ref<string>();
|
||||
const positionExecutiveSideId = ref<string>();
|
||||
const positionExecutiveSideId = ref<any>();
|
||||
const positionStatusId = ref<string>();
|
||||
const positionLevelId = ref<string[]>([]);
|
||||
const positionCondition = ref<string>();
|
||||
const qualification = ref<string>();
|
||||
const positionMasterUserNote = ref<string>();
|
||||
const positionTypeOptions = ref<DataOption[]>([]);
|
||||
const positionLineOptions = ref<DataOption[]>([]);
|
||||
|
|
@ -519,6 +522,7 @@ organizationalData.mappingPosition.columns.length == 0
|
|||
"positionExecutiveSide",
|
||||
"positionLevel",
|
||||
"positionStatus",
|
||||
"qualification",
|
||||
"positionCondition",
|
||||
"isDirector",
|
||||
"isActive",
|
||||
|
|
@ -625,6 +629,17 @@ const columns = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "qualification",
|
||||
align: "left",
|
||||
label: "คุณวุฒิ",
|
||||
sortable: true,
|
||||
field: "qualification",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "positionCondition",
|
||||
align: "left",
|
||||
|
|
@ -749,6 +764,17 @@ const columnsHistory = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "qualification",
|
||||
align: "left",
|
||||
label: "คุณวุฒิ",
|
||||
sortable: true,
|
||||
field: "qualification",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "positionCondition",
|
||||
align: "left",
|
||||
|
|
@ -804,6 +830,7 @@ const visibleColumnsHistory = ref<String[]>([
|
|||
"positionExecutiveSide",
|
||||
"positionLevel",
|
||||
"positionStatus",
|
||||
"qualification",
|
||||
"positionCondition",
|
||||
"isDirector",
|
||||
"isActive",
|
||||
|
|
@ -816,7 +843,7 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => {
|
|||
});
|
||||
|
||||
onMounted(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
await fetchPosition();
|
||||
await fetchData();
|
||||
await fetchHistory();
|
||||
|
|
@ -826,7 +853,7 @@ onMounted(async () => {
|
|||
* ฟังก์ชัน get data ล่าสุด
|
||||
*/
|
||||
const fetchData = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getPostionMasterDraft(true))
|
||||
.then((res) => {
|
||||
|
|
@ -854,6 +881,7 @@ const fetchData = async () => {
|
|||
positionExecutiveSideId: e.positionExecutiveSideId,
|
||||
positionLevelId: e.positionLevelId,
|
||||
positionStatusId: e.positionStatusId,
|
||||
qualification: e.qualification,
|
||||
positionCondition: e.positionCondition,
|
||||
positionMasterUserNote: e.positionMasterUserNote,
|
||||
isDirector: e.isDirector,
|
||||
|
|
@ -869,7 +897,7 @@ const fetchData = async () => {
|
|||
})
|
||||
.finally(() => {
|
||||
// updateData.value = false;
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -877,7 +905,7 @@ const fetchData = async () => {
|
|||
* ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลทั้งหมด
|
||||
*/
|
||||
const fetchHistory = async () => {
|
||||
// showLoader();
|
||||
// loaderPage(true);
|
||||
// await http
|
||||
// .get(config.API.listxxxxxxxxPublishedHistory)
|
||||
// .then((res) => {
|
||||
|
|
@ -909,7 +937,7 @@ const fetchHistory = async () => {
|
|||
// statusCode.value = e.response.data.status;
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
// });
|
||||
};
|
||||
|
||||
|
|
@ -917,7 +945,7 @@ const fetchHistory = async () => {
|
|||
* get รายการ ตำแหน่ง
|
||||
*/
|
||||
const fetchPosition = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.position)
|
||||
.then((res) => {
|
||||
|
|
@ -1008,7 +1036,7 @@ const fetchPosition = async () => {
|
|||
})
|
||||
.catch((e: any) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -1157,7 +1185,7 @@ const clickSave = async () => {
|
|||
*/
|
||||
const saveData = async () => {
|
||||
modal.value = false;
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.getPositionMaster, {
|
||||
positionTypeId: positionTypeId.value,
|
||||
|
|
@ -1169,6 +1197,7 @@ const saveData = async () => {
|
|||
positionLevelId: positionLevelId.value,
|
||||
isDirector: isDirector.value,
|
||||
positionStatusId: positionStatusId.value,
|
||||
qualification: qualification.value,
|
||||
positionCondition: positionCondition.value,
|
||||
positionMasterUserNote: positionMasterUserNote.value,
|
||||
})
|
||||
|
|
@ -1189,7 +1218,7 @@ const saveData = async () => {
|
|||
*/
|
||||
const editData = async () => {
|
||||
modal.value = false;
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.getPositionMasterId(positionMasterId.value), {
|
||||
positionMasterId: positionMasterId.value,
|
||||
|
|
@ -1202,6 +1231,7 @@ const editData = async () => {
|
|||
positionLevelId: positionLevelId.value,
|
||||
isDirector: isDirector.value,
|
||||
positionStatusId: positionStatusId.value,
|
||||
qualification: qualification.value,
|
||||
positionCondition: positionCondition.value,
|
||||
positionMasterUserNote: positionMasterUserNote.value,
|
||||
})
|
||||
|
|
@ -1222,7 +1252,7 @@ const editData = async () => {
|
|||
* เมื่อเรียก api เสร็จแล้วจะ get data มาใหม่
|
||||
*/
|
||||
const clearPublishedData = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.getPositionMasterSync)
|
||||
.then((res) => {
|
||||
|
|
@ -1235,7 +1265,7 @@ const clearPublishedData = async () => {
|
|||
statusCode.value = e.response.data.status;
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
await fetchHistory();
|
||||
await fetchData();
|
||||
});
|
||||
|
|
@ -1247,7 +1277,7 @@ const clearPublishedData = async () => {
|
|||
*/
|
||||
const publishedData = async () => {
|
||||
// editvisible.value = false;
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.getPositionMasterPublish)
|
||||
.then((res) => {
|
||||
|
|
@ -1257,7 +1287,7 @@ const publishedData = async () => {
|
|||
statusCode.value = e.response.data.status;
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
};
|
||||
|
|
@ -1308,6 +1338,7 @@ const selectData = (props: RequestItemsObject) => {
|
|||
positionExecutiveSideId.value = props.positionExecutiveSideId;
|
||||
positionLevelId.value = props.positionLevelId;
|
||||
positionStatusId.value = props.positionStatusId;
|
||||
qualification.value = props.qualification;
|
||||
positionCondition.value = props.positionCondition;
|
||||
positionMasterUserNote.value = props.positionMasterUserNote;
|
||||
isDirector.value = props.isDirector;
|
||||
|
|
@ -1335,11 +1366,12 @@ const clickAdd = () => {
|
|||
positionTypeId.value = "";
|
||||
positionLineId.value = "";
|
||||
positionPathId.value = "";
|
||||
positionPathSideId.value = "";
|
||||
positionPathSideId.value = [];
|
||||
positionExecutiveId.value = "";
|
||||
positionExecutiveSideId.value = "";
|
||||
positionExecutiveSideId.value = [];
|
||||
positionLevelId.value = [];
|
||||
positionStatusId.value = positionStatusOptionsRaw.value[0].id;
|
||||
qualification.value = "";
|
||||
positionCondition.value = "";
|
||||
positionMasterUserNote.value = "";
|
||||
isDirector.value = false;
|
||||
|
|
@ -1351,7 +1383,7 @@ const clickAdd = () => {
|
|||
* @param row ข้อมูล row ที่ดูประวัติการแก้ไข
|
||||
*/
|
||||
const clickHistory = async (row: RequestItemsObject) => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getPositionMasterHistoryId(row.id))
|
||||
.then((res) => {
|
||||
|
|
@ -1380,6 +1412,7 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
positionExecutiveSideId: e.positionExecutiveSideId,
|
||||
positionLevelId: e.positionLevelId,
|
||||
positionStatusId: e.positionStatusId,
|
||||
qualification: e.qualification,
|
||||
positionCondition: e.positionCondition,
|
||||
positionMasterUserNote: e.positionMasterUserNote,
|
||||
isDirector: e.isDirector,
|
||||
|
|
@ -1394,7 +1427,7 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
})
|
||||
.finally(async () => {
|
||||
modalHistory.value = true;
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -1437,7 +1470,7 @@ const clickIsActive = async (val: string, status: boolean) => {
|
|||
})
|
||||
.onOk(async () => {
|
||||
// edit.value = false;
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.getPositionMasterId(val) + `?Id=${val}`)
|
||||
.then((res) => {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<template>
|
||||
<div v-if="isAddNew" class="row col-12 items-center q-pt-md">
|
||||
<div class="bg-white q-px-sm topCard">
|
||||
<span class="text-weight-medium">เพิ่มตำแหน่ง</span>
|
||||
<span class="text-weight-bold">เพิ่มตำแหน่ง</span>
|
||||
<q-btn
|
||||
flat
|
||||
color="primary"
|
||||
|
|
@ -47,7 +47,12 @@
|
|||
<template v-slot:option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.positionPath }}</q-item-label>
|
||||
<q-item-label>
|
||||
<span class="text-weight-bold">
|
||||
{{ scope.opt.positionPath }}</span
|
||||
>
|
||||
{{ scope.opt.positionLevel }}
|
||||
</q-item-label>
|
||||
<q-item-label caption>
|
||||
<q-icon
|
||||
class="q-mr-sm"
|
||||
|
|
@ -56,19 +61,36 @@
|
|||
name="mdi-bookmark"
|
||||
v-if="scope.opt.isDirector"
|
||||
></q-icon>
|
||||
{{ scope.opt.positionExecutive }}
|
||||
{{ scope.opt.positionExecutiveSide }}
|
||||
{{ scope.opt.positionLevel }}
|
||||
{{ scope.opt.positionLine }}
|
||||
{{ scope.opt.positionPathSide }}
|
||||
{{ scope.opt.positionType }}
|
||||
{{
|
||||
scope.opt.positionExecutive == null
|
||||
? ""
|
||||
: `ตำแหน่งทางการบริหาร: ${scope.opt.positionExecutive}`
|
||||
}}
|
||||
{{
|
||||
scope.opt.positionExecutiveSide == null
|
||||
? ""
|
||||
: `ด้านทางการบริหาร: ${scope.opt.positionExecutiveSide}`
|
||||
}}
|
||||
<!-- {{
|
||||
scope.opt.positionLevel == null
|
||||
? ""
|
||||
: `ระดับตำแหน่ง: ${scope.opt.positionLevel}`
|
||||
}} -->
|
||||
{{
|
||||
scope.opt.positionPathSide == null
|
||||
? ""
|
||||
: `ด้าน/สาขา: ${scope.opt.positionPathSide}`
|
||||
}}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
<template v-slot:selected-item="scope">
|
||||
<q-chip dense square class="q-my-none q-ml-xs q-mr-none">
|
||||
{{ scope.opt.positionPath }}
|
||||
<span class="text-weight-bold">
|
||||
{{ scope.opt.positionPath }}</span
|
||||
>
|
||||
{{ scope.opt.positionLevel }}
|
||||
</q-chip>
|
||||
<q-item-label caption>
|
||||
<q-icon
|
||||
|
|
@ -78,12 +100,31 @@
|
|||
name="mdi-bookmark"
|
||||
v-if="scope.opt.isDirector"
|
||||
></q-icon>
|
||||
{{ scope.opt.positionExecutive }}
|
||||
{{ scope.opt.positionExecutiveSide }}
|
||||
{{ scope.opt.positionLevel }}
|
||||
{{ scope.opt.positionLine }}
|
||||
{{ scope.opt.positionPathSide }}
|
||||
{{ scope.opt.positionType }}
|
||||
{{
|
||||
scope.opt.positionExecutive == null
|
||||
? ""
|
||||
: `ตำแหน่งทางการบริหาร: ${scope.opt.positionExecutive}`
|
||||
}}
|
||||
{{
|
||||
scope.opt.positionExecutiveSide == null
|
||||
? ""
|
||||
: `ด้านทางการบริหาร: ${scope.opt.positionExecutiveSide}`
|
||||
}}
|
||||
<!-- {{
|
||||
scope.opt.positionLevel == null
|
||||
? ""
|
||||
: `ระดับตำแหน่ง: ${scope.opt.positionLevel}`
|
||||
}} -->
|
||||
{{
|
||||
scope.opt.positionPathSide == null
|
||||
? ""
|
||||
: `ด้าน/สาขา: ${scope.opt.positionPathSide}`
|
||||
}}
|
||||
<!-- {{ scope.opt.positionExecutiveSide }} -->
|
||||
<!-- {{ scope.opt.positionLevel }} -->
|
||||
<!-- {{ scope.opt.positionLine }} -->
|
||||
<!-- {{ scope.opt.positionPathSide }} -->
|
||||
<!-- {{ scope.opt.positionType }} -->
|
||||
</q-item-label>
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
|
|
@ -103,7 +144,11 @@
|
|||
:label="`${'หมายเหตุ'}`"
|
||||
type="textarea"
|
||||
/>
|
||||
<!-- :rules="[(val) => !!val || `${'กรุณากรอกเงื่อนไขตำแหน่ง'}`]" -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-toggle v-model="item.isActive" dense size="34px" color="positive">
|
||||
ปกติ
|
||||
</q-toggle>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -157,7 +202,12 @@
|
|||
<template v-slot:option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.positionPath }}</q-item-label>
|
||||
<q-item-label>
|
||||
<span class="text-weight-bold">
|
||||
{{ scope.opt.positionPath }}</span
|
||||
>
|
||||
{{ scope.opt.positionLevel }}
|
||||
</q-item-label>
|
||||
<q-item-label caption>
|
||||
<q-icon
|
||||
class="q-mr-sm"
|
||||
|
|
@ -166,19 +216,36 @@
|
|||
name="mdi-bookmark"
|
||||
v-if="scope.opt.isDirector"
|
||||
></q-icon>
|
||||
{{ scope.opt.positionExecutive }}
|
||||
{{ scope.opt.positionExecutiveSide }}
|
||||
{{ scope.opt.positionLevel }}
|
||||
{{ scope.opt.positionLine }}
|
||||
{{ scope.opt.positionPathSide }}
|
||||
{{ scope.opt.positionType }}
|
||||
{{
|
||||
scope.opt.positionExecutive == null
|
||||
? ""
|
||||
: `ตำแหน่งทางการบริหาร: ${scope.opt.positionExecutive}`
|
||||
}}
|
||||
{{
|
||||
scope.opt.positionExecutiveSide == null
|
||||
? ""
|
||||
: `ด้านทางการบริหาร: ${scope.opt.positionExecutiveSide}`
|
||||
}}
|
||||
<!-- {{
|
||||
scope.opt.positionLevel == null
|
||||
? ""
|
||||
: `ระดับตำแหน่ง: ${scope.opt.positionLevel}`
|
||||
}} -->
|
||||
{{
|
||||
scope.opt.positionPathSide == null
|
||||
? ""
|
||||
: `ด้าน/สาขา: ${scope.opt.positionPathSide}`
|
||||
}}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
<template v-slot:selected-item="scope">
|
||||
<q-chip dense square class="q-my-none q-ml-xs q-mr-none">
|
||||
{{ scope.opt.positionPath }}
|
||||
<span class="text-weight-bold">
|
||||
{{ scope.opt.positionPath }}</span
|
||||
>
|
||||
{{ scope.opt.positionLevel }}
|
||||
</q-chip>
|
||||
<q-item-label caption>
|
||||
<q-icon
|
||||
|
|
@ -188,13 +255,29 @@
|
|||
name="mdi-bookmark"
|
||||
v-if="scope.opt.isDirector"
|
||||
></q-icon>
|
||||
{{ scope.opt.positionPathSide }}
|
||||
<!-- {{ scope.opt.positionPathSide }}
|
||||
{{ scope.opt.positionExecutive }}
|
||||
{{ scope.opt.positionLevel }}
|
||||
{{ scope.opt.positionLine }}
|
||||
{{ scope.opt.positionLevel }} -->
|
||||
<!-- {{ scope.opt.positionLine }} -->
|
||||
|
||||
<!-- {{ scope.opt.positionType }}
|
||||
{{ scope.opt.positionExecutiveSide }} -->
|
||||
|
||||
{{
|
||||
scope.opt.positionPathSide == null
|
||||
? ""
|
||||
: `ด้าน/สาขา: ${scope.opt.positionPathSide}`
|
||||
}}
|
||||
{{
|
||||
scope.opt.positionExecutive == null
|
||||
? ""
|
||||
: `ตำแหน่งทางการบริหาร: ${scope.opt.positionExecutive}`
|
||||
}}
|
||||
{{
|
||||
scope.opt.positionLevel == null
|
||||
? ""
|
||||
: `ระดับตำแหน่ง: ${scope.opt.positionLevel}`
|
||||
}}
|
||||
</q-item-label>
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
|
|
@ -224,7 +307,16 @@
|
|||
:label="`${'หมายเหตุ'}`"
|
||||
type="textarea"
|
||||
/>
|
||||
<!-- :rules="[(val) => !!val || `${'กรุณากรอกเงื่อนไขตำแหน่ง'}`]" -->
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-toggle
|
||||
v-model="item.isActive"
|
||||
dense
|
||||
size="34px"
|
||||
color="positive"
|
||||
>
|
||||
ปกติ
|
||||
</q-toggle>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
@ -240,14 +332,10 @@ import { useDataStore } from "@/stores/data";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import type { DataOption } from "../../interface/index/Main";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const ddNoResultMsg = defineAsyncComponent(
|
||||
() => import("@/components/DropDownNoResultMsg.vue")
|
||||
); //แสดงข้อความเมื่อ Dropdown Filter ไม่เจอข้อมูล
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader } = mixin;
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const $q = useQuasar(); // show dialog
|
||||
|
|
@ -273,6 +361,7 @@ watch(myForm, (form: QForm | null, prevForm: QForm | null) => {
|
|||
// console.log("props.editObj", props.editObj);
|
||||
positions.value[0].positionMasterId = props.editObj?.positionMasterId;
|
||||
positions.value[0].positionUserNote = props.editObj?.positionUserNote;
|
||||
positions.value[0].isActive = props.editObj?.isActive;
|
||||
}
|
||||
}
|
||||
emit("update:formprops", form);
|
||||
|
|
@ -283,6 +372,7 @@ const positionSet = ref<object>({
|
|||
count: 1, // จำนวนตำแหน่งที่จะเพิ่ม
|
||||
positionMasterId: "", // ชื่อตำแหน่ง จากระบบข้อมูลหลัก Table PositionMaster เช่น นักจัดการงานทั่วไป,พยาบาลชำนาญการ
|
||||
positionUserNote: "",
|
||||
isActive: true,
|
||||
}); //เก็บข้อมูลที่จะเลือกใน Drop Down แต่ละตัวจะต้องมี key ของมัน เพื่อส่งไปให้ API
|
||||
emit("update:positions", positions.value);
|
||||
|
||||
|
|
@ -290,12 +380,12 @@ const positionFilter = ref<Array<any>>([]); //for DropDown
|
|||
const position = ref<Array<any>>([]); //for DropDown
|
||||
|
||||
onMounted(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
await fetchPositionMaster();
|
||||
});
|
||||
|
||||
const fetchPositionMaster = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
// .get(config.API.getPostionMasterDraft(false))
|
||||
.get(config.API.getPostionMaster(false))
|
||||
|
|
@ -322,6 +412,7 @@ const fetchPositionMaster = async () => {
|
|||
positionExecutiveSideId: e.positionExecutiveSideId,
|
||||
positionLevelId: e.positionLevelId,
|
||||
positionStatusId: e.positionStatusId,
|
||||
qualification: e.qualification,
|
||||
positionCondition: e.positionCondition,
|
||||
positionMasterUserNote: e.positionMasterUserNote,
|
||||
isDirector: e.isDirector,
|
||||
|
|
@ -333,7 +424,7 @@ const fetchPositionMaster = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
v-model="item.organizationOrganizationId"
|
||||
:options="organizationOri"
|
||||
label="หน่วยงาน"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-6 col-md-6"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
v-model="item.organizationAgencyCode"
|
||||
:options="organizationAgencyCode"
|
||||
label="รหัสหน่วยงาน"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
v-model="item.organizationGovernmentCode"
|
||||
:options="item.organizationGovernmentCodeOption"
|
||||
label="รหัสส่วนราชการ"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -121,51 +121,36 @@
|
|||
outlined
|
||||
:modelValue="item.organizationShortName.toString() ?? ''"
|
||||
label="ชื่อย่อหน่วยงาน"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
/>
|
||||
|
||||
<selector
|
||||
hide-bottom-space
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="item.organizationAgencyId"
|
||||
:options="organizationAgency"
|
||||
label="หน่วยงานต้นสังกัด"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
(inputValue:any, doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn, '1')
|
||||
"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
map-options
|
||||
emit-value
|
||||
clearable
|
||||
v-model="item.agency"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
label="เลขที่หน่วยงาน"
|
||||
/>
|
||||
|
||||
<selector
|
||||
hide-bottom-space
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="item.organizationGovernmentAgencyId"
|
||||
:options="organizationGovernmentAgency"
|
||||
label="ส่วนราชการต้นสังกัด"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
(inputValue:any, doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn, '1')
|
||||
"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
map-options
|
||||
emit-value
|
||||
clearable
|
||||
v-model="item.government"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
label="เลขที่ส่วนราชการ"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="item.department"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
label="เลขที่ฝ่าย/ส่วน"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="item.pile"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
label="เลขที่กอง"
|
||||
/>
|
||||
|
||||
<selector
|
||||
hide-bottom-space
|
||||
dense
|
||||
|
|
@ -173,7 +158,7 @@
|
|||
v-model="item.organizationTypeId"
|
||||
:options="organizationType"
|
||||
label="ประเภทหน่วยงาน"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -193,7 +178,7 @@
|
|||
v-model="item.organizationLevelId"
|
||||
:options="organizationLevel"
|
||||
label="ระดับหน่วยงาน"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -207,6 +192,54 @@
|
|||
clearable
|
||||
:rules="[(val:any) => !!val || `${'กรุณาเลือกระดับหน่วยงาน'}`]"
|
||||
/>
|
||||
<selector
|
||||
hide-bottom-space
|
||||
dense
|
||||
outlined
|
||||
v-model="item.organizationAgencyId"
|
||||
:options="organizationAgency"
|
||||
label="หน่วยงานต้นสังกัด"
|
||||
class="col-xs-12 col-sm-4 col-md-4"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
(inputValue:any, doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn, '1')
|
||||
"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
map-options
|
||||
emit-value
|
||||
clearable
|
||||
/>
|
||||
<selector
|
||||
hide-bottom-space
|
||||
dense
|
||||
outlined
|
||||
v-model="item.organizationGovernmentAgencyId"
|
||||
:options="organizationGovernmentAgency"
|
||||
label="ส่วนราชการต้นสังกัด"
|
||||
class="col-xs-12 col-sm-6 col-md-6"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
(inputValue:any, doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn, '1')
|
||||
"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
map-options
|
||||
emit-value
|
||||
clearable
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="item.organizationOrder"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
type="number"
|
||||
label="ลำดับผังโครงสร้าง"
|
||||
/>
|
||||
<selector
|
||||
hide-bottom-space
|
||||
dense
|
||||
|
|
@ -214,7 +247,7 @@
|
|||
v-model="item.organizationExternalPhoneId"
|
||||
:options="organizationTelExternal"
|
||||
label="หมายเลขโทรศัพท์ติดต่อจากภายนอก"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-4 col-md-4"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -234,7 +267,7 @@
|
|||
v-model="item.organizationInternalPhoneId"
|
||||
:options="organizationTelInternal"
|
||||
label="หมายเลขโทรศัพท์ติดต่อจากภายใน"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-4 col-md-4"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -254,7 +287,7 @@
|
|||
v-model="item.organizationFaxId"
|
||||
:options="organizationFax"
|
||||
label="หมายเลขโทรสาร"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-4 col-md-4"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -267,43 +300,6 @@
|
|||
emit-value
|
||||
clearable
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="item.agency"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
label="หน่วยงาน"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="item.government"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
label="ส่วนราชการ"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="item.department"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
label="ฝ่าย/ส่วน"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="item.pile"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
label="กอง"
|
||||
/>
|
||||
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
:modelValue="Number(item.organizationOrder) ?? 0"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
type="number"
|
||||
label="ลำดับผังโครงสร้าง"
|
||||
/>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-input
|
||||
:class="getClass(true)"
|
||||
|
|
@ -317,7 +313,6 @@
|
|||
:label="`${'หน้าที่รับผิดชอบ'}`"
|
||||
type="textarea"
|
||||
/>
|
||||
<!-- :rules="[(val) => !!val || `${'กรุณากรอกเงื่อนไขตำแหน่ง'}`]" -->
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
@ -339,8 +334,6 @@ import type {
|
|||
} from "../../interface/index/Main";
|
||||
import { log } from "console";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
// import { organizationSet } from "../interface/index/Main";
|
||||
|
||||
const props = defineProps({
|
||||
|
|
@ -350,8 +343,6 @@ const props = defineProps({
|
|||
|
||||
const emit = defineEmits(["update:organizprops", "update:formprops"]);
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const {showLoader, hideLoader } = mixin;
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const $q = useQuasar(); // show dialog
|
||||
|
|
@ -390,7 +381,7 @@ const organizationAgencyCode = ref<GovermentOption[]>([]);
|
|||
const organizationAgencyCodeFilter = ref<GovermentOption[]>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
await fetchOrganizationOri();
|
||||
await fetchOrganizationAgencyCode();
|
||||
await fetchOrganizationGovernmentCode();
|
||||
|
|
@ -409,7 +400,7 @@ onMounted(async () => {
|
|||
* หน่วยงาน
|
||||
*/
|
||||
const fetchOrganizationOri = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organization)
|
||||
.then((res) => {
|
||||
|
|
@ -425,14 +416,14 @@ const fetchOrganizationOri = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* รหัสหน่วยงาน
|
||||
*/
|
||||
const fetchOrganizationAgencyCode = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationCode)
|
||||
.then((res) => {
|
||||
|
|
@ -454,14 +445,14 @@ const fetchOrganizationAgencyCode = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* รหัสส่วนราชการ
|
||||
*/
|
||||
const fetchOrganizationGovernmentCode = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationShortName)
|
||||
.then((res) => {
|
||||
|
|
@ -483,14 +474,14 @@ const fetchOrganizationGovernmentCode = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
// /**
|
||||
// * ชื่อย่อหน่วยงาน
|
||||
// */
|
||||
// const fetchOrganizationShortName = async () => {
|
||||
// showLoader();
|
||||
// loaderPage(true);
|
||||
// await http
|
||||
// .get(config.API.organizationShortName)
|
||||
// .then((res) => {
|
||||
|
|
@ -512,16 +503,16 @@ const fetchOrganizationGovernmentCode = async () => {
|
|||
// console.log(e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
// });
|
||||
// };
|
||||
/**
|
||||
* หน่วยงานต้นสังกัด
|
||||
*/
|
||||
const fetchOrganizationAgency = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.listOrganizationAgency("หน่วยงาน"))
|
||||
.get(config.API.listOrganizationHistoryAgency("หน่วยงาน"))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
|
|
@ -538,16 +529,16 @@ const fetchOrganizationAgency = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* ส่วนราชการต้นสังกัด
|
||||
*/
|
||||
const fetchOrganizationGovernmentAgency = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.listOrganizationAgency("ส่วนราชการ"))
|
||||
.get(config.API.listOrganizationHistoryAgency("ส่วนราชการ"))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
|
|
@ -564,14 +555,14 @@ const fetchOrganizationGovernmentAgency = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* ประเภทหน่วยงาน
|
||||
*/
|
||||
const fetchOrganizationType = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationType)
|
||||
.then((res) => {
|
||||
|
|
@ -587,14 +578,14 @@ const fetchOrganizationType = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* ระดับหน่วยงาน
|
||||
*/
|
||||
const fetchOrganizationLevel = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationLevel)
|
||||
.then((res) => {
|
||||
|
|
@ -610,14 +601,14 @@ const fetchOrganizationLevel = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* เบอร์ติดต่อภายใน
|
||||
*/
|
||||
const fetchOrganizationTelInternal = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationTelInternal)
|
||||
.then((res) => {
|
||||
|
|
@ -633,14 +624,14 @@ const fetchOrganizationTelInternal = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* เบอร์ติดต่อภายนอก
|
||||
*/
|
||||
const fetchOrganizationTelExternal = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationTelExternal)
|
||||
.then((res) => {
|
||||
|
|
@ -656,14 +647,14 @@ const fetchOrganizationTelExternal = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* เบอร์โทรสาร
|
||||
*/
|
||||
const fetchOrganizationFax = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationFax)
|
||||
.then((res) => {
|
||||
|
|
@ -679,7 +670,7 @@ const fetchOrganizationFax = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -771,6 +762,7 @@ const addOrganizationItem = async () => {
|
|||
organizationGovernmentCodeOption: organizationGovernmentCode.value,
|
||||
organizationGovernmentCodeOptionFilter:
|
||||
organizationGovernmentCodeFilter.value,
|
||||
isActive: true,
|
||||
});
|
||||
emit("update:organizprops", organizations.value);
|
||||
// console.log(organizations);
|
||||
|
|
@ -780,7 +772,7 @@ const addOrganizationItem = async () => {
|
|||
|
||||
const fetchAgencyCode = async (val: string, item: OrganizaOption) => {
|
||||
let option: GovermentOption[] = [];
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationGovernmentCode(val))
|
||||
.then((res) => {
|
||||
|
|
@ -800,14 +792,14 @@ const fetchAgencyCode = async (val: string, item: OrganizaOption) => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
return option;
|
||||
};
|
||||
|
||||
const fetchGovernmentCode = async (val: string, item: OrganizaOption) => {
|
||||
let option: GovermentOption[] = [];
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationAgencyCode(val))
|
||||
.then((res) => {
|
||||
|
|
@ -827,7 +819,7 @@ const fetchGovernmentCode = async (val: string, item: OrganizaOption) => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
return option;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
v-model="organization.organizationOrganizationId"
|
||||
:options="organizationOri"
|
||||
label="หน่วยงาน"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-6 col-md-6"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
v-model="organization.organizationAgencyCode"
|
||||
:options="organizationAgencyCode"
|
||||
label="รหัสหน่วยงาน"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -53,7 +53,7 @@
|
|||
v-model="organization.organizationGovernmentCode"
|
||||
:options="organization.organizationGovernmentCodeOption"
|
||||
label="รหัสส่วนราชการ"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -68,16 +68,81 @@
|
|||
clearable
|
||||
:rules="[(val:any) => !!val || `${'กรุณาเลือกรหัสส่วนราชการ'}`]"
|
||||
/>
|
||||
|
||||
<q-input
|
||||
dense
|
||||
readonly
|
||||
outlined
|
||||
:modelValue="organization.organizationShortName.toString() ?? ''"
|
||||
label="ชื่อย่อหน่วยงาน"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="organization.agency"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
label="เลขที่หน่วยงาน"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="organization.government"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
label="เลขที่ส่วนราชการ"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="organization.department"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
label="เลขที่ฝ่าย/ส่วน"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="organization.pile"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
label="เลขที่กอง"
|
||||
/>
|
||||
<selector
|
||||
dense
|
||||
outlined
|
||||
v-model="organization.organizationTypeId"
|
||||
:options="organizationType"
|
||||
label="ประเภทหน่วยงาน"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
(inputValue:any, doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn, '5')
|
||||
"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
map-options
|
||||
emit-value
|
||||
clearable
|
||||
/><!-- :rules="[(val:any) => !!val || `${'กรุณาเลือกประเภทหน่วยงาน'}`]" -->
|
||||
<selector
|
||||
dense
|
||||
outlined
|
||||
v-model="organization.organizationLevelId"
|
||||
:options="organizationLevel"
|
||||
label="ระดับหน่วยงาน"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
(inputValue:any, doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn, '6')
|
||||
"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
map-options
|
||||
emit-value
|
||||
clearable
|
||||
:rules="[(val:any) => !!val || `${'กรุณาเลือกระดับหน่วยงาน'}`]"
|
||||
/>
|
||||
|
||||
<selector
|
||||
dense
|
||||
disable
|
||||
|
|
@ -85,7 +150,7 @@
|
|||
v-model="organization.organizationAgencyId"
|
||||
:options="organizationAgency"
|
||||
label="หน่วยงานต้นสังกัด"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-4 col-md-4"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -106,7 +171,7 @@
|
|||
v-model="organization.organizationGovernmentAgencyId"
|
||||
:options="organizationGovernmentAgency"
|
||||
label="ส่วนราชการต้นสังกัด"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-6 col-md-6"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -120,44 +185,14 @@
|
|||
clearable
|
||||
/>
|
||||
<!-- :rules="[(val:any) => !!val || `${'กรุณาเลือกส่วนราชการต้นสังกัด'}`]" -->
|
||||
<selector
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="organization.organizationTypeId"
|
||||
:options="organizationType"
|
||||
label="ประเภทหน่วยงาน"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
(inputValue:any, doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn, '5')
|
||||
"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
map-options
|
||||
emit-value
|
||||
clearable
|
||||
/><!-- :rules="[(val:any) => !!val || `${'กรุณาเลือกประเภทหน่วยงาน'}`]" -->
|
||||
<selector
|
||||
dense
|
||||
outlined
|
||||
v-model="organization.organizationLevelId"
|
||||
:options="organizationLevel"
|
||||
label="ระดับหน่วยงาน"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
(inputValue:any, doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn, '6')
|
||||
"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
map-options
|
||||
emit-value
|
||||
clearable
|
||||
:rules="[(val:any) => !!val || `${'กรุณาเลือกระดับหน่วยงาน'}`]"
|
||||
:modelValue="Number(organization.organizationOrder) ?? 0"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
type="number"
|
||||
label="ลำดับ"
|
||||
@update:model-value="(value) => updateNumber(organization, value)"
|
||||
/>
|
||||
<selector
|
||||
dense
|
||||
|
|
@ -165,7 +200,7 @@
|
|||
v-model="organization.organizationExternalPhoneId"
|
||||
:options="organizationTelExternal"
|
||||
label="หมายเลขโทรศัพท์ติดต่อจากภายนอก"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-4 col-md-4"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -184,7 +219,7 @@
|
|||
v-model="organization.organizationInternalPhoneId"
|
||||
:options="organizationTelInternal"
|
||||
label="หมายเลขโทรศัพท์ติดต่อจากภายใน"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-4 col-md-4"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -203,7 +238,7 @@
|
|||
v-model="organization.organizationFaxId"
|
||||
:options="organizationFax"
|
||||
label="หมายเลขโทรสาร"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -217,23 +252,13 @@
|
|||
clearable
|
||||
/>
|
||||
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
:modelValue="Number(organization.organizationOrder) ?? 0"
|
||||
class="col-xs-12 col-sm-4 col-md-1"
|
||||
type="number"
|
||||
label="ลำดับ"
|
||||
@update:model-value="(value) => updateNumber(organization, value)"
|
||||
/>
|
||||
|
||||
<selector
|
||||
dense
|
||||
outlined
|
||||
v-model="organization.organizationStatusId"
|
||||
:options="organizationStatus"
|
||||
label="สถานะหน่วยงาน"
|
||||
class="col-xs-12 col-sm-4 col-md-2"
|
||||
class="col-xs-12 col-sm-2 col-md-2"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
@filter="
|
||||
|
|
@ -245,35 +270,6 @@
|
|||
map-options
|
||||
emit-value
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="organization.agency"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
label="หน่วยงาน"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="organization.government"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
label="ส่วนราชการ"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="organization.department"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
label="ฝ่าย/ส่วน"
|
||||
/>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="organization.pile"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
label="กอง"
|
||||
/>
|
||||
|
||||
<q-input
|
||||
:class="getClass(true)"
|
||||
hide-bottom-space
|
||||
|
|
@ -286,7 +282,6 @@
|
|||
:label="`${'หน้าที่รับผิดชอบ'}`"
|
||||
type="textarea"
|
||||
/>
|
||||
<!-- :rules="[(val) => !!val || `${'กรุณากรอกเงื่อนไขตำแหน่ง'}`]" -->
|
||||
|
||||
<!-- v-model.number="item.organizationOrder" -->
|
||||
<!--<q-select
|
||||
|
|
@ -318,7 +313,6 @@ import { log } from "console";
|
|||
import { useDataStore } from "@/stores/data";
|
||||
import type { EnumStringMember } from "@babel/types";
|
||||
// import { organizationSet } from "../interface/index/Main";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const props = defineProps({
|
||||
organizprops: Object as PropType<OrganizaOption>,
|
||||
|
|
@ -329,8 +323,6 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader } = mixin;
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const emit = defineEmits(["update:organizprops", "update:formprops"]);
|
||||
|
|
@ -396,11 +388,12 @@ const organization = ref<OrganizaOption>({
|
|||
organizationGovernmentCodeOption: organizationGovernmentCode.value,
|
||||
organizationGovernmentCodeOptionFilter:
|
||||
organizationGovernmentCodeFilter.value,
|
||||
isActive: true,
|
||||
});
|
||||
emit("update:organizprops", organization.value);
|
||||
|
||||
onMounted(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
// await fillOrgEdit(); //มาแค่ตรง selector(q-select)
|
||||
await fetchOrganizationOri();
|
||||
// await fetchOrganizationShortName();
|
||||
|
|
@ -434,7 +427,7 @@ const getClass = (val: boolean) => {
|
|||
* @param node node that you want to edit data
|
||||
*/
|
||||
const fillOrgEdit = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getOrgDraft(props.org.organizationId))
|
||||
.then((res) => {
|
||||
|
|
@ -506,7 +499,7 @@ const fillOrgEdit = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
console.log("success");
|
||||
};
|
||||
|
|
@ -515,7 +508,7 @@ const fillOrgEdit = async () => {
|
|||
* หน่วยงาน
|
||||
*/
|
||||
const fetchOrganizationOri = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organization)
|
||||
.then((res) => {
|
||||
|
|
@ -531,14 +524,14 @@ const fetchOrganizationOri = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* รหัสหน่วยงาน
|
||||
*/
|
||||
const fetchOrganizationAgencyCode = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationCode)
|
||||
.then((res) => {
|
||||
|
|
@ -560,14 +553,14 @@ const fetchOrganizationAgencyCode = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* รหัสส่วนราชการ
|
||||
*/
|
||||
const fetchOrganizationGovernmentCode = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationShortName)
|
||||
.then((res) => {
|
||||
|
|
@ -592,14 +585,14 @@ const fetchOrganizationGovernmentCode = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
// /**
|
||||
// * ชื่อย่อหน่วยงาน
|
||||
// */
|
||||
// const fetchOrganizationShortName = async () => {
|
||||
// showLoader();
|
||||
// loaderPage(true);
|
||||
// await http
|
||||
// .get(config.API.organizationShortName)
|
||||
// .then((res) => {
|
||||
|
|
@ -621,17 +614,17 @@ const fetchOrganizationGovernmentCode = async () => {
|
|||
// console.log(e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
// });
|
||||
// };
|
||||
/**
|
||||
* หน่วยงานต้นสังกัด
|
||||
*/
|
||||
const fetchOrganizationAgency = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
// .get(config.API.organizationAgency)
|
||||
.get(config.API.listOrganizationAgency("หน่วยงาน"))
|
||||
.get(config.API.listOrganizationHistoryAgency("หน่วยงาน"))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
|
|
@ -648,17 +641,17 @@ const fetchOrganizationAgency = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* ส่วนราชการต้นสังกัด
|
||||
*/
|
||||
const fetchOrganizationGovernmentAgency = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
// .get(config.API.organizationGovernmentAgency)
|
||||
.get(config.API.listOrganizationAgency("ส่วนราชการ"))
|
||||
.get(config.API.listOrganizationHistoryAgency("ส่วนราชการ"))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
|
|
@ -676,14 +669,14 @@ const fetchOrganizationGovernmentAgency = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* ประเภทหน่วยงาน
|
||||
*/
|
||||
const fetchOrganizationType = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationType)
|
||||
.then((res) => {
|
||||
|
|
@ -699,7 +692,7 @@ const fetchOrganizationType = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -707,7 +700,7 @@ const fetchOrganizationType = async () => {
|
|||
* สถานะหน่วยงาน
|
||||
*/
|
||||
const fetchOrganizationStatus = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationStatus)
|
||||
.then((res) => {
|
||||
|
|
@ -723,7 +716,7 @@ const fetchOrganizationStatus = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -731,7 +724,7 @@ const fetchOrganizationStatus = async () => {
|
|||
* ระดับหน่วยงาน
|
||||
*/
|
||||
const fetchOrganizationLevel = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationLevel)
|
||||
.then((res) => {
|
||||
|
|
@ -747,14 +740,14 @@ const fetchOrganizationLevel = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* เบอร์ติดต่อภายใน
|
||||
*/
|
||||
const fetchOrganizationTelInternal = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationTelInternal)
|
||||
.then((res) => {
|
||||
|
|
@ -770,14 +763,14 @@ const fetchOrganizationTelInternal = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* เบอร์ติดต่อภายนอก
|
||||
*/
|
||||
const fetchOrganizationTelExternal = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationTelExternal)
|
||||
.then((res) => {
|
||||
|
|
@ -793,14 +786,14 @@ const fetchOrganizationTelExternal = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* เบอร์โทรสาร
|
||||
*/
|
||||
const fetchOrganizationFax = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationFax)
|
||||
.then((res) => {
|
||||
|
|
@ -816,13 +809,13 @@ const fetchOrganizationFax = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchAgencyCode = async (val: string, item: OrganizaOption) => {
|
||||
let option: GovermentOption[] = [];
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationGovernmentCode(val))
|
||||
.then((res) => {
|
||||
|
|
@ -842,14 +835,14 @@ const fetchAgencyCode = async (val: string, item: OrganizaOption) => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
return option;
|
||||
};
|
||||
|
||||
const fetchGovernmentCode = async (val: string, item: OrganizaOption) => {
|
||||
let option: GovermentOption[] = [];
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationAgencyCode(val))
|
||||
.then((res) => {
|
||||
|
|
@ -869,7 +862,7 @@ const fetchGovernmentCode = async (val: string, item: OrganizaOption) => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
return option;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
<q-tooltip>เผยแพร่</q-tooltip>
|
||||
</q-btn>
|
||||
<!-- refresh data -->
|
||||
<q-btn
|
||||
<!-- <q-btn
|
||||
flat
|
||||
round
|
||||
icon="mdi-refresh"
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
class="q-mr-sm"
|
||||
>
|
||||
<q-tooltip>รีเฟรชข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-btn> -->
|
||||
<q-space />
|
||||
</div>
|
||||
<!-- ข้อมูลการเผยแพร่ข้อมูล -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue