ปรับ 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>
|
||||
<!-- ข้อมูลการเผยแพร่ข้อมูล -->
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ interface OrganizaOption {
|
|||
organizationInternalPhoneId: string; //เบอร์ติดต่อภายใน
|
||||
organizationExternalPhoneId: string; //เบอร์ติดต่อภายนอก
|
||||
organizationFaxId: string; //เบอร์โทรสาร
|
||||
organizationOrder: Number; // ลำดับผังโครงสร้าง
|
||||
organizationOrder: number; // ลำดับผังโครงสร้าง
|
||||
organizationUserNote: string; // User Note
|
||||
organizationStatusId: string; //status
|
||||
organizationGovernmentCodeOption: GovermentOption[];
|
||||
|
|
@ -38,6 +38,7 @@ interface OrganizaOption {
|
|||
government: string; // ส่วนราชการ
|
||||
department: string; // ฝ่าย/ส่วน
|
||||
pile: string; // กอง
|
||||
isActive: boolean; //
|
||||
// organizationAgencyCodeOption: GovermentOption[];
|
||||
// organizationAgencyCodeOptionFilter: GovermentOption[];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ interface RequestItemsObject {
|
|||
positionExecutiveId: string;
|
||||
positionExecutiveSideId: string;
|
||||
positionStatusId: string; //สถานภาพของตำแหน่ง ไม่แน่ใจ DB
|
||||
qualification: string; //เหตุผล
|
||||
positionCondition: string; //เงื่อนไขตำแหน่ง
|
||||
positionMasterUserNote: string; //หมายเหตุ
|
||||
positionLevelId: any; //ระดับ array id
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ interface ResponseTree {
|
|||
posiNumNew: string | null;
|
||||
posiOld: string | null;
|
||||
posiNew: string | null;
|
||||
levelOld: string | null;
|
||||
levelNew: string | null;
|
||||
levelOld: any;
|
||||
levelNew: any;
|
||||
change: string | null;
|
||||
statusPosition: Boolean;
|
||||
report2Id: string | null;
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ const $q = useQuasar(); // show dialog
|
|||
const mixin = useCounterMixin();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { date2Thai, success, dateToISO, showLoader, hideLoader } = mixin;
|
||||
const { date2Thai, success, dateToISO } = mixin;
|
||||
|
||||
const govermentOP = ref<DataOption[]>([]);
|
||||
const govermentOPfilter = ref<DataOption[]>([]);
|
||||
|
|
@ -166,7 +166,7 @@ const clickAccount3 = async () => {
|
|||
};
|
||||
|
||||
const fetchOrganizationAgency = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
// .get(config.API.organizationAgency)
|
||||
.get(config.API.getOCType)
|
||||
|
|
@ -186,12 +186,12 @@ const fetchOrganizationAgency = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
await fetchOrganizationAgency();
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -73,13 +73,13 @@
|
|||
{{ personDetail ? personDetail.positionNum : "" }}
|
||||
</div>
|
||||
|
||||
<div class="text-weight-medium q-pt-md row items-center">
|
||||
<!-- <div class="text-weight-medium q-pt-md row items-center">
|
||||
<q-icon size="10px" color="grey-4" name="mdi-circle" />
|
||||
<div class="q-pl-sm">ตำแหน่งในการบริหารงาน</div>
|
||||
</div>
|
||||
<div class="text-grey-7 q-pl-lg">
|
||||
{{ personDetail ? personDetail.executivePosition : "" }}
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="text-weight-medium q-pt-md row items-center">
|
||||
<q-icon size="10px" color="grey-4" name="mdi-circle" />
|
||||
|
|
@ -170,10 +170,44 @@
|
|||
>
|
||||
<!--organization บรรทัดแสดงชื่อหน่วยงาน -->
|
||||
<template v-slot:header-organization="prop">
|
||||
<div class="row items-center q-gutter-sm q-pa-xs">
|
||||
<div class="row items-center q-px-xs q-pt-xs q-gutter-sm">
|
||||
<!--แสดงชื่อแผนก พิมพ์ตัวหนา คลิกแล้วกาง/หุบ Tree-->
|
||||
<div>
|
||||
{{ prop.node.organizationName }}
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.organizationName }}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{
|
||||
prop.node.organizationParentId == null
|
||||
? null
|
||||
: prop.node.governmentCode
|
||||
}}
|
||||
{{
|
||||
prop.node.organizationParentId == null
|
||||
? null
|
||||
: prop.node.agency
|
||||
}}
|
||||
{{
|
||||
prop.node.organizationParentId == null
|
||||
? null
|
||||
: prop.node.government
|
||||
}}
|
||||
{{
|
||||
prop.node.organizationParentId == null
|
||||
? null
|
||||
: prop.node.department
|
||||
}}
|
||||
{{
|
||||
prop.node.organizationParentId == null
|
||||
? null
|
||||
: prop.node.pile
|
||||
}}
|
||||
{{
|
||||
prop.node.organizationParentId == null
|
||||
? null
|
||||
: prop.node.organizationShortName
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<!--แสดง Total Count PositionNum-->
|
||||
<q-badge
|
||||
|
|
@ -286,8 +320,42 @@
|
|||
<template v-slot:header-organization="prop">
|
||||
<div class="row items-center q-px-xs q-pt-xs q-gutter-sm">
|
||||
<!--แสดงชื่อแผนก พิมพ์ตัวหนา คลิกแล้วกาง/หุบ Tree-->
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.organizationName }}
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.organizationName }}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{
|
||||
prop.node.organizationParentId == null
|
||||
? null
|
||||
: prop.node.governmentCode
|
||||
}}
|
||||
{{
|
||||
prop.node.organizationParentId == null
|
||||
? null
|
||||
: prop.node.agency
|
||||
}}
|
||||
{{
|
||||
prop.node.organizationParentId == null
|
||||
? null
|
||||
: prop.node.government
|
||||
}}
|
||||
{{
|
||||
prop.node.organizationParentId == null
|
||||
? null
|
||||
: prop.node.department
|
||||
}}
|
||||
{{
|
||||
prop.node.organizationParentId == null
|
||||
? null
|
||||
: prop.node.pile
|
||||
}}
|
||||
{{
|
||||
prop.node.organizationParentId == null
|
||||
? null
|
||||
: prop.node.organizationShortName
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<!--แสดง Total Count PositionNum-->
|
||||
<q-badge
|
||||
|
|
@ -310,7 +378,9 @@
|
|||
@click.stop="
|
||||
(popupAddOrganization = true),
|
||||
(modalHeaderName = prop.node.organizationName),
|
||||
(rowClickTree = prop.node)
|
||||
(rowClickTree = prop.node),
|
||||
(modalHeaderPosition =
|
||||
prop.node.keyId.search('-') > 0 ? true : false)
|
||||
"
|
||||
size="10px"
|
||||
icon="mdi-plus"
|
||||
|
|
@ -331,7 +401,9 @@
|
|||
@click.stop="
|
||||
(popupEditSelectedOrganization = true),
|
||||
(modalHeaderName = prop.node.organizationName),
|
||||
(rowClickTree = prop.node)
|
||||
(rowClickTree = prop.node),
|
||||
(modalHeaderPosition =
|
||||
prop.node.keyId.search('-') > 0 ? true : false)
|
||||
"
|
||||
size="10px"
|
||||
icon="mdi-pencil-outline"
|
||||
|
|
@ -359,59 +431,81 @@
|
|||
</template>
|
||||
<!--person บรรทัดแถวแสดงชื่อพนักงานอย่างเดียว-->
|
||||
<template v-slot:header-person="prop">
|
||||
<div
|
||||
class="row items-center text-dark col-12 q-py-xs q-pl-sm rounded-borders"
|
||||
style="width: 100%"
|
||||
>
|
||||
<img
|
||||
v-if="
|
||||
prop.node.avatar == '' ||
|
||||
prop.node.avatar ==
|
||||
'https://cdn.quasar.dev/img/boy-avatar.png'
|
||||
"
|
||||
src="@/assets/avatar_user.jpg"
|
||||
class="col-xs-1 col-sm-2"
|
||||
style="width: 28px; height: 28px; border-radius: 50%"
|
||||
/>
|
||||
<img
|
||||
v-else
|
||||
:src="prop.node.avatar"
|
||||
class="col-xs-1 col-sm-2"
|
||||
style="width: 28px; height: 28px; border-radius: 50%"
|
||||
/>
|
||||
<!--=====ตำแหน่งว่าง สีแดง=====-->
|
||||
<div class="row items-center q-px-xs q-pt-xs q-gutter-sm">
|
||||
<div
|
||||
v-if="
|
||||
prop.node.name == `ว่าง` ||
|
||||
prop.node.name == `N/A` ||
|
||||
prop.node.name == null
|
||||
rounded
|
||||
:style="
|
||||
!prop.node.isActive ? 'filter: grayscale(60%);' : ''
|
||||
"
|
||||
class="q-px-sm text-weight-medium text-red"
|
||||
>
|
||||
ว่าง
|
||||
<img
|
||||
v-if="
|
||||
prop.node.avatar == '' ||
|
||||
prop.node.avatar ==
|
||||
'https://cdn.quasar.dev/img/boy-avatar.png'
|
||||
"
|
||||
src="@/assets/avatar_user.jpg"
|
||||
class="col-xs-1 col-sm-2"
|
||||
style="width: 28px; height: 28px; border-radius: 50%"
|
||||
/>
|
||||
<img
|
||||
v-else
|
||||
:src="prop.node.avatar"
|
||||
class="col-xs-1 col-sm-2"
|
||||
style="width: 28px; height: 28px; border-radius: 50%"
|
||||
/>
|
||||
</div>
|
||||
<!--=====หัวหน้า สีเขียว=====-->
|
||||
<div v-else-if="prop.node.positionLeaderFlag">
|
||||
<div class="q-px-sm text-weight-medium text-primary">
|
||||
{{ prop.node.name }}
|
||||
|
||||
<div
|
||||
rounded
|
||||
:class="
|
||||
!prop.node.isActive ? 'text-grey-6' : 'text-black'
|
||||
"
|
||||
>
|
||||
<!--=====ตำแหน่งว่าง สีแดง=====-->
|
||||
<div class="row">
|
||||
<div
|
||||
v-if="
|
||||
prop.node.name == `ว่าง` ||
|
||||
prop.node.name == `N/A` ||
|
||||
prop.node.name == null
|
||||
"
|
||||
class="q-px-sm text-weight-medium"
|
||||
:class="
|
||||
!prop.node.isActive ? 'text-grey-6' : 'text-red'
|
||||
"
|
||||
>
|
||||
ว่าง
|
||||
</div>
|
||||
<!--=====หัวหน้า สีเขียว=====-->
|
||||
<div v-else-if="prop.node.positionLeaderFlag">
|
||||
<div class="q-px-sm text-weight-medium text-primary">
|
||||
{{ prop.node.name }}
|
||||
</div>
|
||||
</div>
|
||||
<!--=====ลูกน้อง สีปกติ=====-->
|
||||
<div v-else>
|
||||
<div class="q-px-sm text-weight-medium">
|
||||
{{ prop.node.name }}
|
||||
</div>
|
||||
</div>
|
||||
<!--ต่อท้ายชื่อคน แสดงสีปกติ-->
|
||||
<div class="q-pr-sm">
|
||||
{{ prop.node.positionName }}
|
||||
</div>
|
||||
<div class="q-pr-sm">
|
||||
{{ prop.node.positionNum }}
|
||||
</div>
|
||||
<div class="q-pr-sm">
|
||||
{{ prop.node.positionLevel }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--=====ลูกน้อง สีปกติ=====-->
|
||||
<div v-else>
|
||||
<div class="q-px-sm text-weight-medium">
|
||||
{{ prop.node.name }}
|
||||
<div class="q-pl-sm text-weight-light">
|
||||
{{ prop.node.positionSideName }}
|
||||
<!-- {{ prop.node.executivePosition }} -->
|
||||
{{ prop.node.executivePositionSide }}
|
||||
</div>
|
||||
</div>
|
||||
<!--ต่อท้ายชื่อคน แสดงสีปกติ-->
|
||||
<div class="q-pr-sm">
|
||||
{{ prop.node.positionName }}
|
||||
</div>
|
||||
<div class="q-pr-sm">
|
||||
{{ prop.node.positionNum }}
|
||||
</div>
|
||||
<div class="q-pr-sm">
|
||||
{{ prop.node.positionLevel }}
|
||||
</div>
|
||||
<q-icon
|
||||
v-if="prop.node.positionLeaderFlag"
|
||||
class="q-mr-sm"
|
||||
|
|
@ -431,7 +525,9 @@
|
|||
@click.stop="
|
||||
(popupEditSelectedPosition = true),
|
||||
(modalHeaderName = prop.node.positionName),
|
||||
(rowClickTree = prop.node)
|
||||
(rowClickTree = prop.node),
|
||||
(modalHeaderPosition =
|
||||
prop.node.keyId.search('-') > 0 ? true : false)
|
||||
"
|
||||
size="10px"
|
||||
icon="mdi-pencil-outline"
|
||||
|
|
@ -468,8 +564,8 @@
|
|||
</q-page>
|
||||
</q-page-container>
|
||||
<!-- popup Add Organizations & Positions -->
|
||||
<q-dialog v-model="popupAddOrganization" persistent full-width>
|
||||
<q-card class="text-dark">
|
||||
<q-dialog v-model="popupAddOrganization" persistent>
|
||||
<q-card class="text-dark" style="min-width: 950px">
|
||||
<q-card-section class="row items-center q-py-sm">
|
||||
<div class="text-bold">เพิ่มโครงสร้างอัตรากำลังภายใต้</div>
|
||||
<strong class="text-primary q-pl-sm">{{
|
||||
|
|
@ -502,6 +598,7 @@
|
|||
v-model:positions="positionData"
|
||||
v-model:formprops="positionForm"
|
||||
:is-add-new="true"
|
||||
v-if="modalHeaderPosition"
|
||||
/>
|
||||
</q-card-section>
|
||||
|
||||
|
|
@ -706,7 +803,7 @@ const store = useDataStore();
|
|||
const mixin = useCounterMixin();
|
||||
|
||||
const { loaderPage } = store; //แสดง load windows ขณะเรียก api
|
||||
const { success, messageError, dialogMessage, showLoader, hideLoader } = mixin;
|
||||
const { success, messageError, dialogMessage } = mixin;
|
||||
|
||||
//Notification Component Variable
|
||||
const $q = useQuasar(); // show dialog
|
||||
|
|
@ -722,6 +819,7 @@ const popupAddOrganization = ref<boolean>(false); //แสดง pop-up เพ
|
|||
const popupEditSelectedOrganization = ref<boolean>(false); //แสดง pop-up Edit หน่วยงานที่เลือก
|
||||
const popupEditSelectedPosition = ref<boolean>(false); //แสดง pop-up Edit ตำแหน่งที่เลือก
|
||||
const modalHeaderName = ref<string>("กรุงเทพมหานคร/สำนักงาน ก.ก."); //show name of click node on modal
|
||||
const modalHeaderPosition = ref<boolean>(true);
|
||||
|
||||
//ButtonSet Variable
|
||||
const version = ref<string>("published"); // คำอื่นจะเปิดปุ่มให้กดได้ :publicData="version === 'published'" (True = Disable Buttons) -->
|
||||
|
|
@ -809,16 +907,17 @@ watch(isShowEditTree, (count, prevCount) => {
|
|||
onMounted(async () => {
|
||||
console.log("onMounted");
|
||||
await fetchTreeRoot(true); //fetch Root Edit Tree level 1
|
||||
await loadViewTree();
|
||||
// await loadViewTree();
|
||||
expandedNodeView.value = [`1`];
|
||||
|
||||
// // setTimeout(() => {
|
||||
// //delay เพื่อให้หน้า editTree แตก level 2 ให้เสร็จก่อน จึงค่อยมา render หน้า viewTree
|
||||
// // isShowEditTree.value = false; //show View Tree สั่งแสดงหน้า viewTree
|
||||
// await fetchTreeRoot(false); //fetch View Tree
|
||||
// // *** viewTree จะเปลี่ยนจาก โหลดทีละ level ตามที่ user click เป็น load file ที่มีข้อมูลครบทั้ง DB แล้วมาทีเดียว
|
||||
// // *** น่าจะเปลี่ยนจาก v-if เป็น v-show เฉพาะ viewTree
|
||||
// // }, 600);
|
||||
setTimeout(async () => {
|
||||
// //delay เพื่อให้หน้า editTree แตก level 2 ให้เสร็จก่อน จึงค่อยมา render หน้า viewTree
|
||||
// // isShowEditTree.value = false; //show View Tree สั่งแสดงหน้า viewTree
|
||||
// await fetchTreeRoot(false); //fetch View Tree
|
||||
await loadViewTree();
|
||||
// // *** viewTree จะเปลี่ยนจาก โหลดทีละ level ตามที่ user click เป็น load file ที่มีข้อมูลครบทั้ง DB แล้วมาทีเดียว
|
||||
// // *** น่าจะเปลี่ยนจาก v-if เป็น v-show เฉพาะ viewTree
|
||||
}, 600);
|
||||
await isTreeHasDraft();
|
||||
});
|
||||
|
||||
|
|
@ -868,12 +967,12 @@ const loadFileServer = async (node: any) => {
|
|||
manageApiErrorMsg(e);
|
||||
})
|
||||
.finally(() => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const isTreeHasDraft = async () => {
|
||||
// showLoader();
|
||||
// loaderPage(true);
|
||||
let orgHasDraft = false;
|
||||
let orgPoHasDraft = false;
|
||||
await http
|
||||
|
|
@ -889,7 +988,7 @@ const isTreeHasDraft = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
});
|
||||
|
||||
await http
|
||||
|
|
@ -905,7 +1004,7 @@ const isTreeHasDraft = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
});
|
||||
|
||||
if (orgHasDraft || orgPoHasDraft) {
|
||||
|
|
@ -920,7 +1019,7 @@ const isTreeHasDraft = async () => {
|
|||
*/
|
||||
const fetchTreeRoot = async (isDraft: boolean) => {
|
||||
// console.log(isDraft);
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
console.log("Call API14 GetTreeRoot");
|
||||
isShowEditTree.value = isDraft; // to show same tree that we fetch
|
||||
let request = "";
|
||||
|
|
@ -947,14 +1046,15 @@ const fetchTreeRoot = async (isDraft: boolean) => {
|
|||
// messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
// if (isDraft) {
|
||||
// ถ้าไม่ต้องการให้แตก node root on first load ก็ไม่ต้องใส่
|
||||
// ต้องอยู่ตรงนี้ ถ้าอยู่ตรง .then จะ error คาดว่ามันทำงานก่อนที่ tree จะ render เสร็จ แต่ก็อาจจะไม่ใช่
|
||||
// qtreeEdit.value.setExpanded(dataTreeDraft.value[0].keyId, true);
|
||||
// } else {
|
||||
// qtreeView.value.setExpanded(dataTree.value[0].keyId, true);
|
||||
// }
|
||||
loaderPage(false);
|
||||
if (isDraft) {
|
||||
// ถ้าไม่ต้องการให้แตก node root on first load ก็ไม่ต้องใส่
|
||||
// ต้องอยู่ตรงนี้ ถ้าอยู่ตรง .then จะ error คาดว่ามันทำงานก่อนที่ tree จะ render เสร็จ แต่ก็อาจจะไม่ใช่
|
||||
qtreeEdit.value.setExpanded(dataTreeDraft.value[0].keyId, true);
|
||||
expandedNodeEdit.value = [dataTreeDraft.value[0].keyId];
|
||||
} else {
|
||||
qtreeView.value.setExpanded(dataTree.value[0].keyId, true);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -964,7 +1064,7 @@ const fetchTreeRoot = async (isDraft: boolean) => {
|
|||
const fetchChildrenByParentId = async (node: any) => {
|
||||
// console.log(isDraft);
|
||||
console.log("Call API4");
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
let request = "";
|
||||
if (isShowEditTree.value) {
|
||||
request = config.API.getDraftTreeNode(node.organizationId, node.keyId);
|
||||
|
|
@ -984,7 +1084,7 @@ const fetchChildrenByParentId = async (node: any) => {
|
|||
manageApiErrorMsg(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -1000,7 +1100,7 @@ const onLazyLoad = (node: any) => {
|
|||
*/
|
||||
console.log("Call LazyLoad");
|
||||
await fetchChildrenByParentId(node.node);
|
||||
/** showLoader();
|
||||
/** loaderPage(true);
|
||||
let request = "";
|
||||
if (isShowEditTree.value) {
|
||||
request = config.API.getDraftTreeNode(
|
||||
|
|
@ -1037,7 +1137,7 @@ const onLazyLoad = (node: any) => {
|
|||
// messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});*/
|
||||
|
||||
node.done(node.node.children); //return ค่าให้ q-tree generate children
|
||||
|
|
@ -1092,7 +1192,7 @@ const apiDeleteOrg = () => {
|
|||
// console.log("isShowEditTree", isShowEditTree.value);
|
||||
setTimeout(async () => {
|
||||
//delay for lazyLoad to be able to tricker again
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
isShowEditTree.value = true;
|
||||
await http
|
||||
.delete(config.API.delTreeOrgDraft(delStructureId.value))
|
||||
|
|
@ -1111,7 +1211,7 @@ const apiDeleteOrg = () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
await isTreeHasDraft();
|
||||
});
|
||||
}, 20);
|
||||
|
|
@ -1140,7 +1240,7 @@ const apiDeletePosition = () => {
|
|||
isShowEditTree.value = false;
|
||||
setTimeout(async () => {
|
||||
//delay for lazyLoad to be able to tricker again
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
isShowEditTree.value = true;
|
||||
await http
|
||||
.delete(config.API.delTreePositionDraft(delStructureId.value))
|
||||
|
|
@ -1157,7 +1257,7 @@ const apiDeletePosition = () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
await isTreeHasDraft();
|
||||
});
|
||||
}, 20);
|
||||
|
|
@ -1170,7 +1270,7 @@ const apiDeletePosition = () => {
|
|||
* ฟังก์ชัน clear data แบบร่าง
|
||||
*/
|
||||
const deleteDraft = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.delTreeOrgPoDraft)
|
||||
.then((res) => {
|
||||
|
|
@ -1182,7 +1282,7 @@ const deleteDraft = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
router.go(0);
|
||||
await isTreeHasDraft();
|
||||
});
|
||||
|
|
@ -1192,7 +1292,7 @@ const deleteDraft = async () => {
|
|||
* ฟังก์ชันเผยแพร่แบบร่าง
|
||||
*/
|
||||
const publishDraft = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.publishOrgPoDraft)
|
||||
.then((res) => {
|
||||
|
|
@ -1218,7 +1318,7 @@ const publishDraft = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
await isTreeHasDraft();
|
||||
});
|
||||
};
|
||||
|
|
@ -1267,6 +1367,18 @@ const treeFilterMethod = (node: any, filter: string) => {
|
|||
(node.positionNum && node.positionNum.indexOf(filt) > -1) ||
|
||||
(node.name && node.name.indexOf(filt) > -1) ||
|
||||
(node.positionName && node.positionName.indexOf(filt) > -1) ||
|
||||
(node.governmentCode &&
|
||||
node.governmentCode.toString().indexOf(filt) > -1) ||
|
||||
(node.agency && node.agency.indexOf(filt) > -1) ||
|
||||
(node.government && node.government.indexOf(filt) > -1) ||
|
||||
(node.department && node.department.indexOf(filt) > -1) ||
|
||||
(node.pile && node.pile.indexOf(filt) > -1) ||
|
||||
(node.organizationShortName &&
|
||||
node.organizationShortName.indexOf(filt) > -1) ||
|
||||
(node.positionSideName && node.positionSideName.indexOf(filt) > -1) ||
|
||||
(node.executivePosition && node.executivePosition.indexOf(filt) > -1) ||
|
||||
(node.executivePositionSide &&
|
||||
node.executivePositionSide.indexOf(filt) > -1) ||
|
||||
(node.positionLevel && node.positionLevel.indexOf(filt) > -1);
|
||||
|
||||
//hasMatch จะได้เป็น keyId ของ node ที่หาเจอโดย q-tree จะวนเรียก treeFilterMethod ทีละ node
|
||||
|
|
@ -1304,7 +1416,7 @@ const addStructure = async (node: any) => {
|
|||
// } // no data to add close pop-up no message show when click save
|
||||
if (
|
||||
organizCheck == true &&
|
||||
positionCheck == true &&
|
||||
(positionCheck == true || modalHeaderPosition.value == false) &&
|
||||
(positionData.value.length > 0 || organizationData.value.length > 0)
|
||||
) {
|
||||
let reqOrgAr: Array<any> = JSON.parse(
|
||||
|
|
@ -1317,7 +1429,7 @@ const addStructure = async (node: any) => {
|
|||
});
|
||||
// console.log(node.organizationId);
|
||||
console.log("Call API1");
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
isShowEditTree.value = true; //ต้องกลับมาแสดง editTree อีกครั้ง & trigger lazyLoad โดย setExpanded
|
||||
await http
|
||||
.post(config.API.addTreeDraft, {
|
||||
|
|
@ -1338,7 +1450,7 @@ const addStructure = async (node: any) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
|
||||
popupAddOrganization.value = false;
|
||||
await isTreeHasDraft();
|
||||
|
|
@ -1370,7 +1482,7 @@ const editOrgStructure = async (node: any) => {
|
|||
if (organizCheck == true) {
|
||||
// console.log(node.organizationId);
|
||||
console.log("Call API13");
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
isShowEditTree.value = true; //end prepare for tricker LazyLoad
|
||||
await http
|
||||
.put(config.API.editTreeOrgDraft(node.organizationId), {
|
||||
|
|
@ -1393,6 +1505,7 @@ const editOrgStructure = async (node: any) => {
|
|||
department: organizationDataEdit.value?.department,
|
||||
pile: organizationDataEdit.value?.pile,
|
||||
organizationStatusId: organizationDataEdit.value?.organizationStatusId,
|
||||
isActive: organizationDataEdit.value?.isActive,
|
||||
})
|
||||
.then(async (res) => {
|
||||
success($q, "บันทึกข้อมูลร่างสำเร็จ");
|
||||
|
|
@ -1409,7 +1522,7 @@ const editOrgStructure = async (node: any) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
popupEditSelectedOrganization.value = false;
|
||||
await isTreeHasDraft();
|
||||
});
|
||||
|
|
@ -1435,12 +1548,13 @@ const editPositionStructure = async (node: any) => {
|
|||
|
||||
if (positionCheck == true) {
|
||||
console.log("Call API3");
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
isShowEditTree.value = true; //end prepare for tricker LazyLoad
|
||||
await http
|
||||
.put(config.API.editTreePositionDraft(node.organizationPositionId), {
|
||||
positionMasterId: positionData.value[0].positionMasterId,
|
||||
positionUserNote: positionData.value[0].positionUserNote,
|
||||
isActive: positionData.value[0].isActive,
|
||||
})
|
||||
.then(async (res) => {
|
||||
success($q, "บันทึกข้อมูลร่างสำเร็จ");
|
||||
|
|
@ -1457,7 +1571,7 @@ const editPositionStructure = async (node: any) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
popupEditSelectedPosition.value = false;
|
||||
await isTreeHasDraft();
|
||||
});
|
||||
|
|
@ -1473,7 +1587,7 @@ const clickHistory = async () => {
|
|||
modalHistory.value = true;
|
||||
// rowsHistory.value = rawHistory.value.filter((f: any) => f.id == row.id);
|
||||
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getTreeHistory)
|
||||
.then((res) => {
|
||||
|
|
@ -1499,7 +1613,7 @@ const clickHistory = async () => {
|
|||
// messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,11 @@
|
|||
<div v-else-if="col.name == 'statusPosition'">
|
||||
{{ col.value ? "ถือครอง" : "ว่าง" }}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.name == 'levelOld' || col.name == 'levelNew'"
|
||||
>
|
||||
{{ String(col.value) }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
|
|
@ -120,8 +125,7 @@ const $q = useQuasar(); // show dialog
|
|||
const mixin = useCounterMixin();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { date2Thai, success, dateToISO, modalError, showLoader, hideLoader } =
|
||||
mixin;
|
||||
const { date2Thai, success, dateToISO, modalError } = mixin;
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
||||
|
|
@ -259,203 +263,6 @@ const columns = ref<any>([
|
|||
},
|
||||
]);
|
||||
const rows = ref<ResponseTree[]>([]);
|
||||
const mockdata = ref<ResponseTree[]>([
|
||||
{
|
||||
no: 1,
|
||||
report2Id: "1",
|
||||
profilePositionId: "1",
|
||||
name: "นายกนก ลายมาก",
|
||||
edu: "ศศ.บ. (รัฐศาสตร์)",
|
||||
posiNumOld: "กบห.1",
|
||||
posiNumNew: "กบห.1",
|
||||
posiOld: "ผู้อำนวยการ",
|
||||
posiNew: "ผู้อำนวยการ",
|
||||
levelOld: "ต้น",
|
||||
levelNew: "ต้น",
|
||||
change: "-",
|
||||
statusPosition: true,
|
||||
},
|
||||
{
|
||||
no: 2,
|
||||
report2Id: "2",
|
||||
profilePositionId: "2",
|
||||
name: "นายกน ลามา",
|
||||
edu: "ศศ.บ. (การจัดการทั่วไป)",
|
||||
posiNumOld: "กบห.2",
|
||||
posiNumNew: "กบห.2",
|
||||
posiOld: "นักจัดการงานทั่วไป",
|
||||
posiNew: "นักจัดการงานทั่วไป",
|
||||
levelOld: "ปฏิบัติการ",
|
||||
levelNew: "ปฏิบัติการ",
|
||||
change: "-",
|
||||
statusPosition: true,
|
||||
},
|
||||
{
|
||||
no: 3,
|
||||
report2Id: "3",
|
||||
profilePositionId: "3",
|
||||
name: "นายกก ลายดี",
|
||||
edu: "ศศ.บ. (การจัดการทั่วไป)",
|
||||
posiNumOld: "กบห.3",
|
||||
posiNumNew: "กบห.3",
|
||||
posiOld: "นักจัดการงานทั่วไป",
|
||||
posiNew: "นักจัดการงานทั่วไป",
|
||||
levelOld: "ปฏิบัติการ",
|
||||
levelNew: "ปฏิบัติการ",
|
||||
change: "-",
|
||||
statusPosition: true,
|
||||
},
|
||||
{
|
||||
no: 4,
|
||||
report2Id: "4",
|
||||
profilePositionId: "4",
|
||||
name: "นายนก มากหลาย",
|
||||
edu: "ศศ.บ. (การจัดการทั่วไป)",
|
||||
posiNumOld: "กบห.4",
|
||||
posiNumNew: "กบห.4",
|
||||
posiOld: "นักจัดการงานทั่วไป",
|
||||
posiNew: "นักจัดการงานทั่วไป",
|
||||
levelOld: "ปฏิบัติการ",
|
||||
levelNew: "ปฏิบัติการ",
|
||||
change: "-",
|
||||
statusPosition: true,
|
||||
},
|
||||
{
|
||||
no: 5,
|
||||
report2Id: "5",
|
||||
profilePositionId: "5",
|
||||
name: "นางสมพร เพชรเหลือ",
|
||||
edu: "ศศ.บ. (การจัดการทั่วไป)",
|
||||
posiNumOld: "กบห.5",
|
||||
posiNumNew: "กบห.5",
|
||||
posiOld: "นักจัดการงานทั่วไป",
|
||||
posiNew: "นักจัดการงานทั่วไป",
|
||||
levelOld: "ชำนาญการ",
|
||||
levelNew: "ชำนาญการพิเศษ",
|
||||
change: "เลื่อนระดับ",
|
||||
statusPosition: true,
|
||||
},
|
||||
{
|
||||
no: 6,
|
||||
report2Id: "6",
|
||||
profilePositionId: "6",
|
||||
name: "นางพร ลายกนก",
|
||||
edu: "ศศ.บ. (การบริหารการศึกษา)",
|
||||
posiNumOld: "กบห.6",
|
||||
posiNumNew: "กบห.6",
|
||||
posiOld: "นักจัดการงานทั่วไป",
|
||||
posiNew: "นักจัดการงานทั่วไป",
|
||||
levelOld: "ปฏิบัติการ",
|
||||
levelNew: "ชำนาญการ",
|
||||
change: "เลื่อนระดับ",
|
||||
statusPosition: true,
|
||||
},
|
||||
{
|
||||
no: 7,
|
||||
report2Id: "7",
|
||||
profilePositionId: "7",
|
||||
name: "นางสาวสวย มากมาย",
|
||||
edu: "ศศ.บ. (การบริหารการศึกษา)",
|
||||
posiNumOld: "กบห.7",
|
||||
posiNumNew: "กบห.7",
|
||||
posiOld: "นักจัดการงานทั่วไป",
|
||||
posiNew: "นักจัดการงานทั่วไป",
|
||||
levelOld: "ปฏิบัติการ",
|
||||
levelNew: "ปฏิบัติการ",
|
||||
change: "-",
|
||||
statusPosition: true,
|
||||
},
|
||||
{
|
||||
no: 8,
|
||||
report2Id: "8",
|
||||
profilePositionId: "8",
|
||||
name: "นายหล่อ ขั้นเทพ",
|
||||
edu: "ศศ.บ. (การบริหารการศึกษา)",
|
||||
posiNumOld: "กบห.8",
|
||||
posiNumNew: "กบห.8",
|
||||
posiOld: "นักจัดการงานทั่วไป",
|
||||
posiNew: "นักจัดการงานทั่วไป",
|
||||
levelOld: "ปฏิบัติการ",
|
||||
levelNew: "ชำนาญการ",
|
||||
change: "เลื่อนระดับ",
|
||||
statusPosition: true,
|
||||
},
|
||||
{
|
||||
no: 9,
|
||||
report2Id: "9",
|
||||
profilePositionId: "9",
|
||||
name: "นางแม้นศรี บางแค",
|
||||
edu: "ศศ.บ. (การบริหารการศึกษา)",
|
||||
posiNumOld: "กบห.9",
|
||||
posiNumNew: "กบห.9",
|
||||
posiOld: "เจ้าพนักงานธุรการ",
|
||||
posiNew: "เจ้าพนักงานธุรการ",
|
||||
levelOld: "ปฏิบัติงาน",
|
||||
levelNew: "ชำนาญงาน",
|
||||
change: "เลื่อนระดับ",
|
||||
statusPosition: true,
|
||||
},
|
||||
{
|
||||
no: 10,
|
||||
report2Id: "10",
|
||||
profilePositionId: "10",
|
||||
name: "นายมั่น มากทอง",
|
||||
edu: "ศศ.บ. (การบริหารการศึกษา)",
|
||||
posiNumOld: "กบห.10",
|
||||
posiNumNew: "กบห.10",
|
||||
posiOld: "นักวิชาการเงินและบัญชี",
|
||||
posiNew: "นักวิชาการเงินและบัญชี",
|
||||
levelOld: "ชำนาญการ",
|
||||
levelNew: "ชำนาญการพิเศษ",
|
||||
change: "เลื่อนระดับ",
|
||||
statusPosition: true,
|
||||
},
|
||||
{
|
||||
no: 11,
|
||||
report2Id: "11",
|
||||
profilePositionId: "11",
|
||||
name: "นายผดุง ทองมาก",
|
||||
edu: "ศศ.บ. (รัฐศาสตร์)",
|
||||
posiNumOld: "กบห.11",
|
||||
posiNumNew: "กบห.11",
|
||||
posiOld: "นักวิชาการเงินและบัญชี",
|
||||
posiNew: "นักวิชาการเงินและบัญชี",
|
||||
levelOld: "ชำนาญการ",
|
||||
levelNew: "ชำนาญการ",
|
||||
change: "-",
|
||||
statusPosition: true,
|
||||
},
|
||||
{
|
||||
no: 12,
|
||||
report2Id: "12",
|
||||
profilePositionId: "12",
|
||||
name: "นางสาวเปรี้ยว เข็ดฟัน",
|
||||
edu: "ศศ.บ. (รัฐศาสตร์)",
|
||||
posiNumOld: "กบห.13",
|
||||
posiNumNew: "กบห.12",
|
||||
posiOld: "นักวิชาการเงินและบัญชี",
|
||||
posiNew: "นักวิชาการเงินและบัญชี",
|
||||
levelOld: "ปฏิบัติการ",
|
||||
levelNew: "ปฏิบัติการ",
|
||||
change: "เปลี่ยนตำแหน่งเลขที่",
|
||||
statusPosition: true,
|
||||
},
|
||||
{
|
||||
no: 13,
|
||||
report2Id: "13",
|
||||
profilePositionId: "13",
|
||||
name: "",
|
||||
edu: "",
|
||||
posiNumOld: "กบห.12",
|
||||
posiNumNew: "กบห.13",
|
||||
posiOld: "นักวิชาการเงินและบัญชี",
|
||||
posiNew: "นักวิชาการเงินและบัญชี",
|
||||
levelOld: "ชำนาญงาน",
|
||||
levelNew: "ชำนาญงาน",
|
||||
change: "เปลี่ยนตำแหน่งเลขที่",
|
||||
statusPosition: false,
|
||||
},
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
let arVisible: string[] = [];
|
||||
|
|
@ -469,7 +276,7 @@ onMounted(async () => {
|
|||
});
|
||||
|
||||
const nodeTree = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.profileOrganizRoot)
|
||||
.then((res: any) => {
|
||||
|
|
@ -488,7 +295,7 @@ const nodeTree = async () => {
|
|||
})
|
||||
.catch((e: any) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -502,7 +309,7 @@ const clickTree = () => {
|
|||
};
|
||||
|
||||
const onHistory = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.report2HistoryId(selected.value))
|
||||
.then((res) => {
|
||||
|
|
@ -525,13 +332,13 @@ const onHistory = async () => {
|
|||
);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const doSearch = async () => {
|
||||
//ทำไว้แล้ว เหลือ ใส่ type
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.report2TreeId(selected.value))
|
||||
.then((res) => {
|
||||
|
|
@ -552,7 +359,10 @@ const doSearch = async () => {
|
|||
posiNew: e.posiNew ?? "-",
|
||||
levelOld: e.levelOld ?? "-",
|
||||
levelNew: e.levelNew ?? "-",
|
||||
change: e.change ?? "-",
|
||||
change:
|
||||
e.report2Id == "00000000-0000-0000-0000-000000000000"
|
||||
? "ไม่เปลี่ยนแปลง"
|
||||
: "เปลี่ยนแปลง",
|
||||
statusPosition: e.statusPosition,
|
||||
});
|
||||
});
|
||||
|
|
@ -561,7 +371,7 @@ const doSearch = async () => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -577,7 +387,7 @@ const onConfirm = async () => {
|
|||
ok: "ยืนยัน",
|
||||
persistent: true,
|
||||
}).onOk(async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.report2DoneId(selected.value))
|
||||
.then((res) => {
|
||||
|
|
@ -585,7 +395,7 @@ const onConfirm = async () => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
await doSearch();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -591,7 +591,7 @@ const $q = useQuasar(); // show dialog
|
|||
const mixin = useCounterMixin();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { date2Thai, success, dateToISO, showLoader, hideLoader } = mixin;
|
||||
const { date2Thai, success, dateToISO } = mixin;
|
||||
const id = ref<string>("");
|
||||
const myForm = ref<QForm | null>(null); //form data input
|
||||
|
||||
|
|
@ -669,10 +669,10 @@ const sideWorkOPfilter = ref<DataOption[]>([]);
|
|||
const levelOPfilter = ref<DataOption[]>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
if (route.params.id != undefined) {
|
||||
id.value = route.params.id.toString();
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
|
||||
await fetchGoverment();
|
||||
// await fetchAgency();
|
||||
|
|
@ -685,12 +685,12 @@ onMounted(async () => {
|
|||
await fetchLevel();
|
||||
|
||||
await fetchData();
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
}
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.report2Id(id.value))
|
||||
.then(async (res) => {
|
||||
|
|
@ -723,7 +723,7 @@ const fetchData = async () => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -739,7 +739,7 @@ const checkSave = async () => {
|
|||
|
||||
const saveData = async () => {
|
||||
// console.log(myData.value);
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
const body: RequestReport2 = {
|
||||
organizationShortNameId: myData.value.goverment2,
|
||||
organizationOrganizationId: myData.value.agency2,
|
||||
|
|
@ -760,7 +760,7 @@ const saveData = async () => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -770,7 +770,7 @@ const clickBack = () => {
|
|||
|
||||
//รหัสส่วนราชการ
|
||||
const fetchGoverment = async () => {
|
||||
// showLoader();
|
||||
// loaderPage(true);
|
||||
await http
|
||||
.get(config.API.organizationShortName)
|
||||
.then((res) => {
|
||||
|
|
@ -796,12 +796,12 @@ const fetchGoverment = async () => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const updateGoverment = async (id: string) => {
|
||||
// showLoader();
|
||||
// loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getPositionMasterPositionNumberId(id))
|
||||
.then((res) => {
|
||||
|
|
@ -890,13 +890,13 @@ const updateGoverment = async (id: string) => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
// //ตำแหน่งเลขที่
|
||||
const fetchPositionNum = async () => {
|
||||
// showLoader();
|
||||
// loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getPositionMasterPositionNumber)
|
||||
.then((res) => {
|
||||
|
|
@ -910,13 +910,13 @@ const fetchPositionNum = async () => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
//ประเภทตำแหน่ง
|
||||
const fetchCategory = async () => {
|
||||
// showLoader();
|
||||
// loaderPage(true);
|
||||
await http
|
||||
.get(config.API.positionType)
|
||||
.then((res) => {
|
||||
|
|
@ -930,13 +930,13 @@ const fetchCategory = async () => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
//ตำแหน่งทางการบริหาร
|
||||
const fetchPositionManage = async () => {
|
||||
// showLoader();
|
||||
// loaderPage(true);
|
||||
await http
|
||||
.get(config.API.positionExecutive)
|
||||
.then((res) => {
|
||||
|
|
@ -950,13 +950,13 @@ const fetchPositionManage = async () => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
//ด้านทางบริหาร
|
||||
const fetchSideManage = async () => {
|
||||
// showLoader();
|
||||
// loaderPage(true);
|
||||
await http
|
||||
.get(config.API.positionExecutiveSide)
|
||||
.then((res) => {
|
||||
|
|
@ -970,13 +970,13 @@ const fetchSideManage = async () => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
//ตำแหน่งในสายงาน
|
||||
const fetchPositionWork = async () => {
|
||||
// showLoader();
|
||||
// loaderPage(true);
|
||||
await http
|
||||
.get(config.API.positionPath)
|
||||
.then((res) => {
|
||||
|
|
@ -990,13 +990,13 @@ const fetchPositionWork = async () => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
//ด้าน/สาขา
|
||||
const fetchSideWork = async () => {
|
||||
// showLoader();
|
||||
// loaderPage(true);
|
||||
await http
|
||||
.get(config.API.positionSide)
|
||||
.then((res) => {
|
||||
|
|
@ -1010,13 +1010,13 @@ const fetchSideWork = async () => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
//ระดับตำแหน่ง
|
||||
const fetchLevel = async () => {
|
||||
// showLoader();
|
||||
// loaderPage(true);
|
||||
await http
|
||||
.get(config.API.positionLevel)
|
||||
.then((res) => {
|
||||
|
|
@ -1030,7 +1030,7 @@ const fetchLevel = async () => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
// hideLoader();
|
||||
// loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ const router = useRouter();
|
|||
const route = useRoute();
|
||||
|
||||
const { loaderPage } = dataStore;
|
||||
const { date2Thai, success, dateToISO, showLoader, hideLoader } = mixin;
|
||||
const { date2Thai, success, dateToISO } = mixin;
|
||||
const id = ref<string>("");
|
||||
const previous = ref<boolean>(false);
|
||||
const next = ref<boolean>(false);
|
||||
|
|
@ -360,7 +360,7 @@ const historyHead = ref<ResponseHistoryHead[]>([]);
|
|||
const historyData = ref<ResponseHistory[]>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
if (route.params.id != undefined) {
|
||||
id.value = route.params.id.toString();
|
||||
|
||||
|
|
@ -386,7 +386,7 @@ const clickPreviousNext = async (page: string) => {
|
|||
};
|
||||
|
||||
const fetchHistory = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.report2HistoryId(id.value))
|
||||
.then((res) => {
|
||||
|
|
@ -402,7 +402,7 @@ const fetchHistory = async () => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
if (historyHead.value.length > 1) {
|
||||
next.value = true;
|
||||
previous.value = false;
|
||||
|
|
@ -414,7 +414,7 @@ const fetchHistory = async () => {
|
|||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(
|
||||
config.API.report2HistoryDetailId(
|
||||
|
|
@ -455,7 +455,7 @@ const fetchData = async () => {
|
|||
})
|
||||
.catch((e) => {})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ const $q = useQuasar(); // show dialog
|
|||
const mixin = useCounterMixin();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { date2Thai, success, dateToISO, showLoader, hideLoader } = mixin;
|
||||
const { date2Thai, success, dateToISO } = mixin;
|
||||
|
||||
const govermentOP = ref<DataOption[]>([]);
|
||||
const govermentOPfilter = ref<DataOption[]>([]);
|
||||
|
|
@ -117,7 +117,7 @@ const goverment = ref<string>("");
|
|||
const tab = ref<string>("audit1");
|
||||
|
||||
const fetchOrganizationAgency = async () => {
|
||||
showLoader();
|
||||
loaderPage(true);
|
||||
await http
|
||||
// .get(config.API.organizationAgency)
|
||||
.get(config.API.listOrganizationAgency("หน่วยงาน"))
|
||||
|
|
@ -137,12 +137,12 @@ const fetchOrganizationAgency = async () => {
|
|||
console.log(e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
hideLoader();
|
||||
loaderPage(false);
|
||||
await fetchOrganizationAgency();
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue