Merge branch 'develop' into devTee
# Conflicts: # src/api/13_salary/api.salary.ts
This commit is contained in:
commit
490fa72f34
34 changed files with 749 additions and 1429 deletions
|
|
@ -77,4 +77,9 @@ export default {
|
||||||
orgPosMasterByIdEmp: (id: string) => `${orgEmployeePos}/master/${id}`,
|
orgPosMasterByIdEmp: (id: string) => `${orgEmployeePos}/master/${id}`,
|
||||||
orgPosMasterListEmp: `${orgEmployeePos}/master/list`,
|
orgPosMasterListEmp: `${orgEmployeePos}/master/list`,
|
||||||
orgPosMasterEmp: `${orgEmployeePos}/master`,
|
orgPosMasterEmp: `${orgEmployeePos}/master`,
|
||||||
|
orgPosSortEmp: `${orgEmployeePos}/sort`,
|
||||||
|
orgPosPositionEmpById: (id: string) => `${orgEmployeePos}/position/${id}`,
|
||||||
|
orgPosMoveEmp: `${orgEmployeePos}/move`,
|
||||||
|
orgProfileEmp: `${orgEmployeePos}/profile`,
|
||||||
|
orgSearchProfileEmp: `${orgProfile}-employee/search`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ export default {
|
||||||
salaryRateListByid: (id: string) => `${salaryRate}/${id}`,
|
salaryRateListByid: (id: string) => `${salaryRate}/${id}`,
|
||||||
salaryReportByid: (id: string) => `${salary}/report/${id}`,
|
salaryReportByid: (id: string) => `${salary}/report/${id}`,
|
||||||
salaryPeriod: () => `${salary}/period`,
|
salaryPeriod: () => `${salary}/period`,
|
||||||
|
salaryPeriodActive: () => `${salary}/period/active`,
|
||||||
|
|
||||||
/** รายการเงินเดือน*/
|
/** รายการเงินเดือน*/
|
||||||
keycloakPositionByid: (id: string) =>
|
keycloakPositionByid: (id: string) =>
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ export default {
|
||||||
insigniaOrg,
|
insigniaOrg,
|
||||||
insigniaTypeOrg,
|
insigniaTypeOrg,
|
||||||
insigniaTypeNewOrg: `${insigniaOrg}`,
|
insigniaTypeNewOrg: `${insigniaOrg}`,
|
||||||
insigniaTypeNewIdOrg: (id: string) => `${insigniaOrg}${id}`,
|
insigniaTypeNewIdOrg: (id: string) => `${insigniaTypeOrg}${id}`,
|
||||||
insigniaNewIdOrg: (id: string) => `${insigniaOrg}${id}`,
|
insigniaNewIdOrg: (id: string) => `${insigniaOrg}${id}`,
|
||||||
insigniaSortOrg: (id: string) => `${insigniaOrg}sort/${id}`,
|
insigniaSortOrg: (id: string) => `${insigniaOrg}sort/${id}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
14
src/api/registry/api.registry.ts
Normal file
14
src/api/registry/api.registry.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
import env from "../index";
|
||||||
|
|
||||||
|
const registryNew = `${env.API_URI}/org/profile/`;
|
||||||
|
|
||||||
|
export default {
|
||||||
|
registryNew,
|
||||||
|
profileNewInsign: `${registryNew}insignia`,
|
||||||
|
profileNewInsignByProfileId: (profileId: string) =>
|
||||||
|
`${registryNew}insignia/${profileId}`,
|
||||||
|
profileNewInsignByInsignId: (insignId: string) =>
|
||||||
|
`${registryNew}insignia/${insignId}`,
|
||||||
|
profileNewInsignHisByInsignId: (insignId: string) =>
|
||||||
|
`${registryNew}insignia/history/${insignId}`,
|
||||||
|
};
|
||||||
|
|
@ -23,6 +23,7 @@ import recruit from "./api/recruiting/api.recruit";
|
||||||
|
|
||||||
/** API Profile List */
|
/** API Profile List */
|
||||||
import profile from "./api/registry/api.profile";
|
import profile from "./api/registry/api.profile";
|
||||||
|
import registry from "./api/registry/api.registry";
|
||||||
|
|
||||||
/** API Report2 List */
|
/** API Report2 List */
|
||||||
import report2 from "./api/recruiting/api.report2";
|
import report2 from "./api/recruiting/api.report2";
|
||||||
|
|
@ -98,6 +99,7 @@ const API = {
|
||||||
|
|
||||||
//profile
|
//profile
|
||||||
...profile,
|
...profile,
|
||||||
|
...registry,
|
||||||
|
|
||||||
//report2
|
//report2
|
||||||
...report2,
|
...report2,
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { useInsigniaDataStore } from "@/modules/01_metadataNew/stores/InsigniaStore";
|
import { useInsigniaDataStore } from "@/modules/01_metadataNew/stores/InsigniaStore";
|
||||||
import dialogHeader from "@/components/DialogHeader.vue";
|
import dialogHeader from "@/components/DialogHeader.vue";
|
||||||
import TableDraggable from "@/modules/01_metadataNew/components/insignia/TableDraggable.vue";
|
import TableDraggable from "@/modules/01_metadataNew/components/insignia/TableDraggable.vue";
|
||||||
|
|
@ -10,21 +10,20 @@ import { useQuasar } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
const store = useInsigniaDataStore();
|
const store = useInsigniaDataStore();
|
||||||
const router = useRouter();
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
|
||||||
// const props = defineProps({
|
|
||||||
// fetchData: {
|
|
||||||
// type: Function,
|
|
||||||
// default: () => "",
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
const insigniaTypeName = defineModel<string>("insigniaTypeName", {
|
const insigniaTypeName = defineModel<string>("insigniaTypeName", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { dialogRemove, dialogConfirm, showLoader, hideLoader, messageError } =
|
const {
|
||||||
mixin;
|
dialogRemove,
|
||||||
|
dialogConfirm,
|
||||||
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
success,
|
||||||
|
} = mixin;
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -206,30 +205,59 @@ async function onSubmit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addData() {
|
async function addData() {
|
||||||
await http.post(config.API.insigniaOrg, {
|
await http
|
||||||
name: name.value,
|
.post(config.API.insigniaOrg, {
|
||||||
isActive: isActive.value,
|
name: name.value,
|
||||||
shortName: shortName.value,
|
isActive: isActive.value,
|
||||||
note: note.value == "" ? "-" : note.value,
|
shortName: shortName.value,
|
||||||
insigniaTypeId: id.value,
|
note: note.value == "" ? "-" : note.value,
|
||||||
});
|
insigniaTypeId: id.value,
|
||||||
fetchData(id.value);
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData(id.value);
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function editData(idData: string) {
|
async function editData(idData: string) {
|
||||||
await http.put(config.API.insigniaNewIdOrg(idData), {
|
await http
|
||||||
name: name.value,
|
.put(config.API.insigniaNewIdOrg(idData), {
|
||||||
isActive: isActive.value,
|
name: name.value,
|
||||||
shortName: shortName.value,
|
isActive: isActive.value,
|
||||||
note: note.value == "" ? "-" : note.value,
|
shortName: shortName.value,
|
||||||
insigniaTypeId: id.value,
|
note: note.value == "" ? "-" : note.value,
|
||||||
});
|
insigniaTypeId: id.value,
|
||||||
fetchData(id.value);
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData(id.value);
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteData(idData: string) {
|
async function deleteData(idData: string) {
|
||||||
await http.delete(config.API.insigniaNewIdOrg(idData));
|
await http
|
||||||
fetchData(id.value);
|
.delete(config.API.insigniaNewIdOrg(idData))
|
||||||
|
.then(() => {
|
||||||
|
fetchData(id.value);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
import { defineEmits } from "vue";
|
import { defineEmits } from "vue";
|
||||||
|
|
@ -256,6 +284,7 @@ const dialogOrder = ref<boolean>(false);
|
||||||
<q-tooltip> เพิ่มข้อมูล </q-tooltip>
|
<q-tooltip> เพิ่มข้อมูล </q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="store.row.length > 0"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
color="blue-6"
|
color="blue-6"
|
||||||
|
|
@ -375,7 +404,7 @@ const dialogOrder = ref<boolean>(false);
|
||||||
</d-table>
|
</d-table>
|
||||||
|
|
||||||
<q-dialog v-model="dialog" class="dialog" persistent>
|
<q-dialog v-model="dialog" class="dialog" persistent>
|
||||||
<q-card style="min-width: 350px" class="bg-grey-11">
|
<q-card style="min-width: 350px">
|
||||||
<form @submit.prevent="validateForm">
|
<form @submit.prevent="validateForm">
|
||||||
<q-card-section class="flex justify-between" style="padding: 0">
|
<q-card-section class="flex justify-between" style="padding: 0">
|
||||||
<dialog-header
|
<dialog-header
|
||||||
|
|
@ -386,55 +415,59 @@ const dialogOrder = ref<boolean>(false);
|
||||||
|
|
||||||
<q-separator color="grey-4" />
|
<q-separator color="grey-4" />
|
||||||
<q-card-section class="q-pa-none">
|
<q-card-section class="q-pa-none">
|
||||||
<q-input
|
<div class="col-12 q-ma-md">
|
||||||
outlined
|
<q-input
|
||||||
:model-value="insigniaTypeId"
|
outlined
|
||||||
label="ลำดับชั้นเครื่องราชฯ"
|
:model-value="insigniaTypeId"
|
||||||
dense
|
label="ลำดับชั้นเครื่องราชฯ"
|
||||||
lazy-rules
|
dense
|
||||||
borderless
|
lazy-rules
|
||||||
class="col-12 bg-white q-ma-md"
|
borderless
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
readonly
|
readonly
|
||||||
/>
|
/>
|
||||||
<q-input
|
</div>
|
||||||
ref="nameRef"
|
<div class="col-12 q-ma-md">
|
||||||
outlined
|
<q-input
|
||||||
v-model="name"
|
ref="nameRef"
|
||||||
label="ชื่อเครื่องราชฯ"
|
outlined
|
||||||
dense
|
v-model="name"
|
||||||
lazy-rules
|
label="ชื่อเครื่องราชฯ"
|
||||||
borderless
|
dense
|
||||||
class="col-12 bg-white q-ma-md"
|
lazy-rules
|
||||||
:rules="[
|
borderless
|
||||||
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
:rules="[
|
||||||
]"
|
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
||||||
hide-bottom-space
|
]"
|
||||||
/>
|
hide-bottom-space
|
||||||
<q-input
|
/>
|
||||||
ref="shortNameRef"
|
</div>
|
||||||
outlined
|
<div class="col-12 q-ma-md">
|
||||||
v-model="shortName"
|
<q-input
|
||||||
label="ชื่อย่อ"
|
ref="shortNameRef"
|
||||||
dense
|
outlined
|
||||||
lazy-rules
|
v-model="shortName"
|
||||||
borderless
|
label="ชื่อย่อ"
|
||||||
class="col-12 bg-white q-ma-md"
|
dense
|
||||||
:rules="[
|
lazy-rules
|
||||||
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
borderless
|
||||||
]"
|
:rules="[
|
||||||
hide-bottom-space
|
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
||||||
/>
|
]"
|
||||||
<q-input
|
hide-bottom-space
|
||||||
outlined
|
/>
|
||||||
v-model="note"
|
</div>
|
||||||
label="หมายเหตุ"
|
<div class="col-12 q-ma-md">
|
||||||
dense
|
<q-input
|
||||||
type="textarea"
|
outlined
|
||||||
borderless
|
v-model="note"
|
||||||
class="col-12 bg-white q-ma-md"
|
label="หมายเหตุ"
|
||||||
hide-bottom-space
|
dense
|
||||||
/>
|
type="textarea"
|
||||||
|
borderless
|
||||||
|
hide-bottom-space
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium"
|
class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium"
|
||||||
>
|
>
|
||||||
|
|
@ -456,7 +489,6 @@ const dialogOrder = ref<boolean>(false);
|
||||||
unelevated
|
unelevated
|
||||||
label="บันทึก"
|
label="บันทึก"
|
||||||
color="public"
|
color="public"
|
||||||
class="q-px-md"
|
|
||||||
>
|
>
|
||||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
|
||||||
|
|
@ -95,12 +95,10 @@ const visibleColumns = ref<string[]>([
|
||||||
"isActive",
|
"isActive",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// const row = ref([]);
|
|
||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.insigniaTypeNewOrg)
|
.get(config.API.insigniaTypeOrg)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
store.fetchData(res.data.result);
|
store.fetchData(res.data.result);
|
||||||
})
|
})
|
||||||
|
|
@ -125,24 +123,53 @@ function onclickDetail(id: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addData() {
|
async function addData() {
|
||||||
await http.post(config.API.insigniaTypeOrg, {
|
await http
|
||||||
name: name.value,
|
.post(config.API.insigniaTypeOrg, {
|
||||||
isActive: isActive.value,
|
name: name.value,
|
||||||
});
|
isActive: isActive.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function editData(id: string) {
|
async function editData(id: string) {
|
||||||
await http.put(config.API.insigniaTypeNewIdOrg(id), {
|
await http
|
||||||
name: name.value,
|
.put(config.API.insigniaTypeNewIdOrg(id), {
|
||||||
isActive: isActive.value,
|
name: name.value,
|
||||||
});
|
isActive: isActive.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteData(id: string) {
|
async function deleteData(id: string) {
|
||||||
await http.delete(config.API.insigniaTypeNewIdOrg(id));
|
await http
|
||||||
fetchData();
|
.delete(config.API.insigniaTypeNewIdOrg(id))
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateForm() {
|
function validateForm() {
|
||||||
|
|
@ -287,7 +314,7 @@ async function onSubmit() {
|
||||||
</d-table>
|
</d-table>
|
||||||
|
|
||||||
<q-dialog v-model="dialog" class="dialog" persistent>
|
<q-dialog v-model="dialog" class="dialog" persistent>
|
||||||
<q-card style="min-width: 350px" class="bg-grey-11">
|
<q-card style="min-width: 350px">
|
||||||
<form @submit.prevent="validateForm">
|
<form @submit.prevent="validateForm">
|
||||||
<q-card-section class="flex justify-between" style="padding: 0">
|
<q-card-section class="flex justify-between" style="padding: 0">
|
||||||
<dialog-header
|
<dialog-header
|
||||||
|
|
@ -298,20 +325,21 @@ async function onSubmit() {
|
||||||
|
|
||||||
<q-separator color="grey-4" />
|
<q-separator color="grey-4" />
|
||||||
<q-card-section class="q-pa-none">
|
<q-card-section class="q-pa-none">
|
||||||
<q-input
|
<div class="col-12 q-ma-md">
|
||||||
ref="nameRef"
|
<q-input
|
||||||
outlined
|
ref="nameRef"
|
||||||
v-model="name"
|
outlined
|
||||||
label="ลำดับชั้นเครื่องราชฯ"
|
v-model="name"
|
||||||
dense
|
label="ลำดับชั้นเครื่องราชฯ"
|
||||||
lazy-rules
|
dense
|
||||||
borderless
|
lazy-rules
|
||||||
class="col-12 bg-white q-ma-md"
|
borderless
|
||||||
:rules="[
|
:rules="[
|
||||||
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
||||||
]"
|
]"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium"
|
class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium"
|
||||||
>
|
>
|
||||||
|
|
@ -333,7 +361,6 @@ async function onSubmit() {
|
||||||
unelevated
|
unelevated
|
||||||
label="บันทึก"
|
label="บันทึก"
|
||||||
color="public"
|
color="public"
|
||||||
class="q-px-md"
|
|
||||||
>
|
>
|
||||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ const TABLE_COLUMNS = [
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const store = usePersonalDataStore();
|
const store = usePersonalDataStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogRemove, messageError, showLoader, hideLoader } = mixin;
|
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||||
|
|
||||||
const filterKeyword = ref<string>("");
|
const filterKeyword = ref<string>("");
|
||||||
const dialog = ref<boolean>(false);
|
const dialog = ref<boolean>(false);
|
||||||
|
|
@ -72,36 +72,11 @@ const visibleColumns = ref<string[]>([
|
||||||
"lastUpdateFullName",
|
"lastUpdateFullName",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const data = [
|
|
||||||
{
|
|
||||||
id: "1",
|
|
||||||
name: "ว่าที่ร้อยตรี",
|
|
||||||
createdAt: new Date(),
|
|
||||||
lastUpdatedAt: new Date(),
|
|
||||||
lastUpdateFullName: "สาวิตรี ศรีสมัย",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "2",
|
|
||||||
name: "นางสาว",
|
|
||||||
createdAt: new Date(),
|
|
||||||
lastUpdatedAt: new Date(),
|
|
||||||
lastUpdateFullName: "System Administrator",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "3",
|
|
||||||
name: "นาย",
|
|
||||||
createdAt: new Date(),
|
|
||||||
lastUpdatedAt: new Date(),
|
|
||||||
lastUpdateFullName: "คณะกรรมการ ตรวจรับ",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.orgPrefix)
|
.get(config.API.orgPrefix)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
console.log(res.data.result);
|
|
||||||
store.save(res.data.result);
|
store.save(res.data.result);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -113,22 +88,51 @@ async function fetchData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addData() {
|
async function addData() {
|
||||||
await http.post(config.API.orgPrefix, {
|
await http
|
||||||
name: prefix.value,
|
.post(config.API.orgPrefix, {
|
||||||
});
|
name: prefix.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function editData(id: string) {
|
async function editData(id: string) {
|
||||||
await http.put(config.API.orgPrefixId(id), {
|
await http
|
||||||
name: prefix.value,
|
.put(config.API.orgPrefixId(id), {
|
||||||
});
|
name: prefix.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteData(id: string) {
|
async function deleteData(id: string) {
|
||||||
await http.delete(config.API.orgPrefixId(id));
|
await http
|
||||||
fetchData();
|
.delete(config.API.orgPrefixId(id))
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ const columns = [
|
||||||
const store = usePersonalDataStore();
|
const store = usePersonalDataStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogRemove, messageError, showLoader, hideLoader } = mixin;
|
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
||||||
|
|
@ -81,7 +81,6 @@ async function fetchData() {
|
||||||
await http
|
await http
|
||||||
.get(config.API.orgRank)
|
.get(config.API.orgRank)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
console.log(res.data.result);
|
|
||||||
store.save(res.data.result);
|
store.save(res.data.result);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -93,22 +92,51 @@ async function fetchData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addData() {
|
async function addData() {
|
||||||
await http.post(config.API.orgRank, {
|
await http
|
||||||
name: rank.value,
|
.post(config.API.orgRank, {
|
||||||
});
|
name: rank.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function editData(id: string) {
|
async function editData(id: string) {
|
||||||
await http.put(config.API.orgRankId(id), {
|
await http
|
||||||
name: rank.value,
|
.put(config.API.orgRankId(id), {
|
||||||
});
|
name: rank.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteData(id: string) {
|
async function deleteData(id: string) {
|
||||||
await http.delete(config.API.orgRankId(id));
|
await http
|
||||||
fetchData();
|
.delete(config.API.orgRankId(id))
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import config from "@/app.config";
|
||||||
const store = usePersonalDataStore();
|
const store = usePersonalDataStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogRemove, messageError, showLoader, hideLoader } = mixin;
|
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
name: "bloodGroup",
|
name: "bloodGroup",
|
||||||
|
|
@ -81,7 +81,6 @@ async function fetchData() {
|
||||||
await http
|
await http
|
||||||
.get(config.API.orgBloodGroup)
|
.get(config.API.orgBloodGroup)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
console.log(res.data.result);
|
|
||||||
store.save(res.data.result);
|
store.save(res.data.result);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -93,22 +92,51 @@ async function fetchData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addData() {
|
async function addData() {
|
||||||
await http.post(config.API.orgBloodGroup, {
|
await http
|
||||||
name: bloodGroup.value,
|
.post(config.API.orgBloodGroup, {
|
||||||
});
|
name: bloodGroup.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function editData(id: string) {
|
async function editData(id: string) {
|
||||||
await http.put(config.API.orgBloodGroupId(id), {
|
await http
|
||||||
name: bloodGroup.value,
|
.put(config.API.orgBloodGroupId(id), {
|
||||||
});
|
name: bloodGroup.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteData(id: string) {
|
async function deleteData(id: string) {
|
||||||
await http.delete(config.API.orgBloodGroupId(id));
|
await http
|
||||||
fetchData();
|
.delete(config.API.orgBloodGroupId(id))
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import config from "@/app.config";
|
||||||
const store = usePersonalDataStore();
|
const store = usePersonalDataStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogRemove, messageError, showLoader, hideLoader } = mixin;
|
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
name: "gender",
|
name: "gender",
|
||||||
|
|
@ -81,7 +81,6 @@ async function fetchData() {
|
||||||
await http
|
await http
|
||||||
.get(config.API.orgGender)
|
.get(config.API.orgGender)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
console.log(res.data.result);
|
|
||||||
store.save(res.data.result);
|
store.save(res.data.result);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -93,22 +92,51 @@ async function fetchData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addData() {
|
async function addData() {
|
||||||
await http.post(config.API.orgGender, {
|
await http
|
||||||
name: gender.value,
|
.post(config.API.orgGender, {
|
||||||
});
|
name: gender.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function editData(id: string) {
|
async function editData(id: string) {
|
||||||
await http.put(config.API.orgGenderId(id), {
|
await http
|
||||||
name: gender.value,
|
.put(config.API.orgGenderId(id), {
|
||||||
});
|
name: gender.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteData(id: string) {
|
async function deleteData(id: string) {
|
||||||
await http.delete(config.API.orgGenderId(id));
|
await http
|
||||||
fetchData();
|
.delete(config.API.orgGenderId(id))
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import config from "@/app.config";
|
||||||
const store = usePersonalDataStore();
|
const store = usePersonalDataStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogRemove, messageError, showLoader, hideLoader } = mixin;
|
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
name: "religion",
|
name: "religion",
|
||||||
|
|
@ -81,7 +81,6 @@ async function fetchData() {
|
||||||
await http
|
await http
|
||||||
.get(config.API.orgReligion)
|
.get(config.API.orgReligion)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
console.log(res.data.result);
|
|
||||||
store.save(res.data.result);
|
store.save(res.data.result);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -93,22 +92,51 @@ async function fetchData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addData() {
|
async function addData() {
|
||||||
await http.post(config.API.orgReligion, {
|
await http
|
||||||
name: religion.value,
|
.post(config.API.orgReligion, {
|
||||||
});
|
name: religion.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function editData(id: string) {
|
async function editData(id: string) {
|
||||||
await http.put(config.API.orgReligionId(id), {
|
await http
|
||||||
name: religion.value,
|
.put(config.API.orgReligionId(id), {
|
||||||
});
|
name: religion.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteData(id: string) {
|
async function deleteData(id: string) {
|
||||||
await http.delete(config.API.orgReligionId(id));
|
await http
|
||||||
fetchData();
|
.delete(config.API.orgReligionId(id))
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import config from "@/app.config";
|
||||||
const store = usePersonalDataStore();
|
const store = usePersonalDataStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogRemove, messageError, showLoader, hideLoader } = mixin;
|
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
name: "relationship",
|
name: "relationship",
|
||||||
|
|
@ -110,7 +110,6 @@ async function fetchData() {
|
||||||
await http
|
await http
|
||||||
.get(config.API.orgRelationship)
|
.get(config.API.orgRelationship)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
console.log(res.data.result);
|
|
||||||
store.save(res.data.result);
|
store.save(res.data.result);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -122,22 +121,50 @@ async function fetchData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addData() {
|
async function addData() {
|
||||||
await http.post(config.API.orgRelationship, {
|
await http
|
||||||
name: relationship.value,
|
.post(config.API.orgRelationship, {
|
||||||
});
|
name: relationship.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function editData(id: string) {
|
async function editData(id: string) {
|
||||||
await http.put(config.API.orgRelationshipId(id), {
|
await http
|
||||||
name: relationship.value,
|
.put(config.API.orgRelationshipId(id), {
|
||||||
});
|
name: relationship.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteData(id: string) {
|
async function deleteData(id: string) {
|
||||||
await http.delete(config.API.orgRelationshipId(id));
|
await http
|
||||||
fetchData();
|
.delete(config.API.orgRelationshipId(id))
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import config from "@/app.config";
|
||||||
|
|
||||||
const store = usePersonalDataStore();
|
const store = usePersonalDataStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogRemove, messageError, showLoader, hideLoader } = mixin;
|
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
name: "name",
|
name: "name",
|
||||||
|
|
@ -91,7 +91,6 @@ async function fetchData() {
|
||||||
await http
|
await http
|
||||||
.get(config.API.orgEducationLevel)
|
.get(config.API.orgEducationLevel)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
console.log(res.data.result);
|
|
||||||
store.save(res.data.result);
|
store.save(res.data.result);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -103,24 +102,53 @@ async function fetchData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addData() {
|
async function addData() {
|
||||||
await http.post(config.API.orgEducationLevel, {
|
await http
|
||||||
name: educationLevel.value,
|
.post(config.API.orgEducationLevel, {
|
||||||
rank: educationRank.value,
|
name: educationLevel.value,
|
||||||
});
|
rank: educationRank.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function editData(id: string) {
|
async function editData(id: string) {
|
||||||
await http.put(config.API.orgEducationLevelId(id), {
|
await http
|
||||||
name: educationLevel.value,
|
.put(config.API.orgEducationLevelId(id), {
|
||||||
rank: educationRank.value,
|
name: educationLevel.value,
|
||||||
});
|
rank: educationRank.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteData(id: string) {
|
async function deleteData(id: string) {
|
||||||
await http.delete(config.API.orgEducationLevelId(id));
|
await http
|
||||||
fetchData();
|
.delete(config.API.orgEducationLevelId(id))
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ async function onSubmit() {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<q-dialog v-model="dialog" class="dialog" persistent>
|
<q-dialog v-model="dialog" class="dialog" persistent>
|
||||||
<q-card style="min-width: 350px" class="bg-grey-11">
|
<q-card style="min-width: 350px">
|
||||||
<form @submit.prevent="validateForm">
|
<form @submit.prevent="validateForm">
|
||||||
<q-card-section class="flex justify-between" style="padding: 0">
|
<q-card-section class="flex justify-between" style="padding: 0">
|
||||||
<dialog-header
|
<dialog-header
|
||||||
|
|
@ -74,37 +74,39 @@ async function onSubmit() {
|
||||||
|
|
||||||
<q-separator color="grey-4" />
|
<q-separator color="grey-4" />
|
||||||
<q-card-section class="q-pa-none">
|
<q-card-section class="q-pa-none">
|
||||||
<q-input
|
<div class="col-12 q-ma-md">
|
||||||
ref="dataRef"
|
<q-input
|
||||||
outlined
|
ref="dataRef"
|
||||||
v-model="data"
|
outlined
|
||||||
:label="personalName"
|
v-model="data"
|
||||||
dense
|
:label="personalName"
|
||||||
lazy-rules
|
dense
|
||||||
borderless
|
lazy-rules
|
||||||
class="col-12 bg-white q-ma-md"
|
borderless
|
||||||
:rules="[(val) => val.length > 0 || 'กรุณากรอก' + personalName]"
|
:rules="[(val) => val.length > 0 || 'กรุณากรอก' + personalName]"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-card-section
|
<q-card-section
|
||||||
class="q-pa-none"
|
class="q-pa-none"
|
||||||
v-if="personalName === 'ระดับการศึกษา'"
|
v-if="personalName === 'ระดับการศึกษา'"
|
||||||
>
|
>
|
||||||
<q-input
|
<div class="col-12 q-ma-md">
|
||||||
ref="educationRankRef"
|
<q-input
|
||||||
outlined
|
ref="educationRankRef"
|
||||||
v-model="educationRank"
|
outlined
|
||||||
label="ลำดับ"
|
v-model="educationRank"
|
||||||
dense
|
label="ลำดับ"
|
||||||
type="number"
|
dense
|
||||||
lazy-rules
|
type="number"
|
||||||
borderless
|
lazy-rules
|
||||||
min="1"
|
borderless
|
||||||
class="col-12 bg-white q-ma-md"
|
min="1"
|
||||||
:rules="[(val) => val != undefined || 'กรุณากรอกลำดับ']"
|
:rules="[(val) => val != undefined || 'กรุณากรอกลำดับ']"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
|
||||||
<q-card-actions align="right">
|
<q-card-actions align="right">
|
||||||
|
|
@ -115,7 +117,6 @@ async function onSubmit() {
|
||||||
unelevated
|
unelevated
|
||||||
label="บันทึก"
|
label="บันทึก"
|
||||||
color="public"
|
color="public"
|
||||||
class="q-px-md"
|
|
||||||
>
|
>
|
||||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
|
||||||
|
|
@ -103,33 +103,19 @@ const objectLevelRef: ObjectLevelRef = {
|
||||||
posLevelAuthority: commanderRef,
|
posLevelAuthority: commanderRef,
|
||||||
};
|
};
|
||||||
|
|
||||||
function fetchPosGroup() {
|
const id = ref<string>(route.params.id.toString());
|
||||||
|
|
||||||
|
function fetchData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.orgEmployeeType)
|
.get(config.API.orgEmployeeTypeById(id.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data: ResGroup[] = res.data.result;
|
titleName.value = res.data.result.posTypeName ?? null;
|
||||||
const group = data.find((e: ResGroup) => e.id === posTypeId.value);
|
formDataLevel.posTypeName = res.data.result.posTypeName;
|
||||||
|
rows.value = res.data.result.posLevels.map((x: any) => ({
|
||||||
titleName.value = group?.posTypeName ?? null;
|
...x,
|
||||||
})
|
posTypeName: res.data.result.posTypeName,
|
||||||
.catch((err) => {
|
}));
|
||||||
messageError($q, err);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function fetchData(id: string) {
|
|
||||||
showLoader();
|
|
||||||
http
|
|
||||||
.get(config.API.orgEmployeelevel)
|
|
||||||
.then((res) => {
|
|
||||||
const data: ResLevel[] = res.data.result;
|
|
||||||
const list = data.filter((e: ResLevel) => e.posTypeId === id);
|
|
||||||
|
|
||||||
rows.value = list ? list : [];
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -148,7 +134,7 @@ function onClickOpenDialog(statusEdit: boolean = false, data: any = []) {
|
||||||
if (statusEdit) {
|
if (statusEdit) {
|
||||||
levelId.value = data.id;
|
levelId.value = data.id;
|
||||||
formDataLevel.posLevelName = data.posLevelName;
|
formDataLevel.posLevelName = data.posLevelName;
|
||||||
formDataLevel.posTypeName = data.posTypeName;
|
formDataLevel.posTypeName = titleName.value;
|
||||||
formDataLevel.posLevelAuthority = data.posLevelAuthority;
|
formDataLevel.posLevelAuthority = data.posLevelAuthority;
|
||||||
} else {
|
} else {
|
||||||
formDataLevel.posTypeName = titleName.value ? titleName.value : "";
|
formDataLevel.posTypeName = titleName.value ? titleName.value : "";
|
||||||
|
|
@ -194,7 +180,7 @@ async function submit() {
|
||||||
: config.API.orgEmployeelevelById(levelId.value);
|
: config.API.orgEmployeelevelById(levelId.value);
|
||||||
await http[!isStatusEdit.value ? "post" : "put"](url, body);
|
await http[!isStatusEdit.value ? "post" : "put"](url, body);
|
||||||
success($q, "บันทีกข้อมูลสำเร็จ");
|
success($q, "บันทีกข้อมูลสำเร็จ");
|
||||||
fetchData(posTypeId.value);
|
fetchData();
|
||||||
onClickCloseDialog();
|
onClickCloseDialog();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -209,7 +195,7 @@ function onClickDelete(id: string) {
|
||||||
.delete(config.API.orgEmployeelevelById(id))
|
.delete(config.API.orgEmployeelevelById(id))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
success($q, "ลบข้อมูลสำเร็จ");
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
fetchData(posTypeId.value);
|
fetchData();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -223,8 +209,7 @@ function convertPosLevelAuthority(val: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
posTypeId.value && fetchData(posTypeId.value);
|
posTypeId.value && fetchData();
|
||||||
fetchPosGroup();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,16 +85,10 @@ const filterKeyword = ref<string>("");
|
||||||
const dialog = ref<boolean>(false);
|
const dialog = ref<boolean>(false);
|
||||||
const posTypeName = ref<string>("");
|
const posTypeName = ref<string>("");
|
||||||
const posTypeNameRef = ref<QInput | null>(null);
|
const posTypeNameRef = ref<QInput | null>(null);
|
||||||
const posTypeRank = ref<number | undefined>();
|
const posTypeRank = ref<number | null>(null);
|
||||||
const posTypeRankRef = ref<QInput | null>(null);
|
const posTypeRankRef = ref<QInput | null>(null);
|
||||||
const dialogStatus = ref<string>("");
|
const dialogStatus = ref<string>("");
|
||||||
const visibleColumns = ref<string[]>([
|
const visibleColumns = ref<string[]>(["posTypeName", "posTypeRank"]);
|
||||||
"posTypeName",
|
|
||||||
"posTypeRank",
|
|
||||||
// "createdAt",
|
|
||||||
// "lastUpdatedAt",
|
|
||||||
// "lastUpdateFullName",
|
|
||||||
]);
|
|
||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -112,24 +106,53 @@ async function fetchData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addData() {
|
async function addData() {
|
||||||
await http.post(config.API.orgPosType, {
|
await http
|
||||||
posTypeName: posTypeName.value,
|
.post(config.API.orgPosType, {
|
||||||
posTypeRank: posTypeRank.value,
|
posTypeName: posTypeName.value,
|
||||||
});
|
posTypeRank: posTypeRank.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function editData(id: string) {
|
async function editData(id: string) {
|
||||||
await http.put(config.API.orgPosTypeId(id), {
|
await http
|
||||||
posTypeName: posTypeName.value,
|
.put(config.API.orgPosTypeId(id), {
|
||||||
posTypeRank: posTypeRank.value,
|
posTypeName: posTypeName.value,
|
||||||
});
|
posTypeRank: posTypeRank.value,
|
||||||
fetchData();
|
})
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteData(id: string) {
|
async function deleteData(id: string) {
|
||||||
await http.delete(config.API.orgPosTypeId(id));
|
await http
|
||||||
fetchData();
|
.delete(config.API.orgPosTypeId(id))
|
||||||
|
.then(() => {
|
||||||
|
fetchData();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
@ -151,14 +174,14 @@ function validateForm() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
if (posTypeName.value.length > 0) {
|
if (posTypeName.value.length > 0 && posTypeRank.value !== null) {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
async () => {
|
async () => {
|
||||||
dialogStatus.value === "create" ? addData() : editData(editId.value);
|
dialogStatus.value === "create" ? addData() : editData(editId.value);
|
||||||
closeDialog();
|
closeDialog();
|
||||||
posTypeName.value = "";
|
posTypeName.value = "";
|
||||||
posTypeRank.value = undefined;
|
posTypeRank.value = null;
|
||||||
},
|
},
|
||||||
"ยืนยันการบันทึกข้อมูล",
|
"ยืนยันการบันทึกข้อมูล",
|
||||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||||
|
|
@ -276,7 +299,7 @@ async function onSubmit() {
|
||||||
</d-table>
|
</d-table>
|
||||||
|
|
||||||
<q-dialog v-model="dialog" class="dialog" persistent>
|
<q-dialog v-model="dialog" class="dialog" persistent>
|
||||||
<q-card style="min-width: 350px" class="bg-grey-11">
|
<q-card style="min-width: 350px">
|
||||||
<form @submit.prevent="validateForm">
|
<form @submit.prevent="validateForm">
|
||||||
<q-card-section class="flex justify-between" style="padding: 0">
|
<q-card-section class="flex justify-between" style="padding: 0">
|
||||||
<dialog-header
|
<dialog-header
|
||||||
|
|
@ -287,32 +310,34 @@ async function onSubmit() {
|
||||||
|
|
||||||
<q-separator color="grey-4" />
|
<q-separator color="grey-4" />
|
||||||
<q-card-section class="q-pa-none">
|
<q-card-section class="q-pa-none">
|
||||||
<q-input
|
<div class="col-12 q-ma-md">
|
||||||
ref="posTypeNameRef"
|
<q-input
|
||||||
outlined
|
ref="posTypeNameRef"
|
||||||
v-model="posTypeName"
|
outlined
|
||||||
label="ประเภทตำแหน่ง"
|
v-model="posTypeName"
|
||||||
dense
|
label="ประเภทตำแหน่ง"
|
||||||
lazy-rules
|
dense
|
||||||
borderless
|
lazy-rules
|
||||||
class="col-12 bg-white q-ma-md"
|
borderless
|
||||||
:rules="[(val) => val.length > 0 || 'กรุณากรอกประเภทตำแหน่ง']"
|
:rules="[(val) => val.length > 0 || 'กรุณากรอกประเภทตำแหน่ง']"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
/>
|
/>
|
||||||
<q-input
|
</div>
|
||||||
ref="posTypeRankRef"
|
<div class="col-12 q-ma-md">
|
||||||
outlined
|
<q-input
|
||||||
v-model="posTypeRank"
|
ref="posTypeRankRef"
|
||||||
label="ระดับ"
|
outlined
|
||||||
dense
|
v-model="posTypeRank"
|
||||||
type="number"
|
label="ระดับ"
|
||||||
lazy-rules
|
dense
|
||||||
borderless
|
lazy-rules
|
||||||
min="1"
|
borderless
|
||||||
class="col-12 bg-white q-ma-md"
|
min="1"
|
||||||
:rules="[(val) => val != undefined || 'กรุณากรอกระดับ']"
|
:rules="[(val) => val != undefined || 'กรุณากรอกระดับ']"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
/>
|
mask="############"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
|
||||||
<q-card-actions align="right">
|
<q-card-actions align="right">
|
||||||
|
|
|
||||||
|
|
@ -13,16 +13,23 @@ import config from "@/app.config";
|
||||||
const store = usePositionDataStore();
|
const store = usePositionDataStore();
|
||||||
const storeOption = useMainOptionDataStore();
|
const storeOption = useMainOptionDataStore();
|
||||||
const storeName = usePositionTypeDataStore();
|
const storeName = usePositionTypeDataStore();
|
||||||
const router = useRouter();
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
|
||||||
const posName = defineModel<string>("posName", {
|
const posName = defineModel<string>("posName", {
|
||||||
required: true,
|
required: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { dialogRemove, dialogConfirm, showLoader, hideLoader, messageError } =
|
const {
|
||||||
mixin;
|
dialogRemove,
|
||||||
|
dialogConfirm,
|
||||||
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
success,
|
||||||
|
} = mixin;
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
name: "no",
|
name: "no",
|
||||||
|
|
@ -123,20 +130,15 @@ const editId = ref<string>("");
|
||||||
const posLevelName = ref<string>("");
|
const posLevelName = ref<string>("");
|
||||||
const posLevelRank = ref<number>();
|
const posLevelRank = ref<number>();
|
||||||
const posLevelAuthority = ref<string>("");
|
const posLevelAuthority = ref<string>("");
|
||||||
const posTypeId = ref<null>();
|
|
||||||
const posLevelNameRef = ref<QInput | null>(null);
|
const posLevelNameRef = ref<QInput | null>(null);
|
||||||
const posLevelRankRef = ref<QInput | null>(null);
|
const posLevelRankRef = ref<QInput | null>(null);
|
||||||
const posTypeIdRef = ref<QInput | null>(null);
|
const posTypeIdRef = ref<QInput | null>(null);
|
||||||
const name = ref<string>("");
|
|
||||||
const visibleColumns = ref<string[]>([
|
const visibleColumns = ref<string[]>([
|
||||||
"no",
|
"no",
|
||||||
"posTypeName",
|
"posTypeName",
|
||||||
"posLevelName",
|
"posLevelName",
|
||||||
"posLevelRank",
|
"posLevelRank",
|
||||||
"posLevelAuthority",
|
"posLevelAuthority",
|
||||||
// "createdAt",
|
|
||||||
// "lastUpdatedAt",
|
|
||||||
// "lastUpdateFullName",
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
|
|
@ -165,9 +167,13 @@ async function addData() {
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -182,9 +188,13 @@ async function editData(editId: string) {
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -196,19 +206,12 @@ async function deleteData(id: string) {
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
fetchName();
|
|
||||||
storeName.row.forEach((e) => {
|
|
||||||
if (e.id === id.value) {
|
|
||||||
posName.value = e.posTypeName ? e.posTypeName : "";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
fetchData();
|
|
||||||
});
|
|
||||||
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
dialog.value = false;
|
dialog.value = false;
|
||||||
}
|
}
|
||||||
|
|
@ -240,6 +243,11 @@ async function fetchName() {
|
||||||
.get(config.API.orgPosType)
|
.get(config.API.orgPosType)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
storeName.save(res.data.result);
|
storeName.save(res.data.result);
|
||||||
|
storeName.row.forEach((e) => {
|
||||||
|
if (e.id === id.value) {
|
||||||
|
posName.value = e.posTypeName ? e.posTypeName : "";
|
||||||
|
}
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -248,6 +256,11 @@ async function fetchName() {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
fetchName();
|
||||||
|
fetchData();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -398,13 +411,13 @@ async function fetchName() {
|
||||||
v-model="posLevelRank"
|
v-model="posLevelRank"
|
||||||
label="ระดับ"
|
label="ระดับ"
|
||||||
dense
|
dense
|
||||||
type="number"
|
|
||||||
lazy-rules
|
lazy-rules
|
||||||
borderless
|
borderless
|
||||||
min="1"
|
min="1"
|
||||||
bg-color="white"
|
bg-color="white"
|
||||||
:rules="[(val) => val != undefined || 'กรุณากรอกระดับ']"
|
:rules="[(val) => val != null || 'กรุณากรอกระดับ']"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
|
mask="############"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ interface FrmDataGroup {
|
||||||
|
|
||||||
interface FormDataLevel {
|
interface FormDataLevel {
|
||||||
posLevelName: number | null;
|
posLevelName: number | null;
|
||||||
posTypeName: string | undefined;
|
posTypeName: string | null;
|
||||||
posLevelAuthority: string;
|
posLevelAuthority: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -640,7 +640,7 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-card class="my-card bg-grey-1 q-pa-md">
|
<q-card bordered class="my-card bg-grey-1 q-pa-md">
|
||||||
<div :class="$q.screen.gt.xs ? 'row' : 'column'">
|
<div :class="$q.screen.gt.xs ? 'row' : 'column'">
|
||||||
<!-- column 1 -->
|
<!-- column 1 -->
|
||||||
<div class="col-md-6 col-12 row">
|
<div class="col-md-6 col-12 row">
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ function getRound() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(
|
.get(
|
||||||
config.API.salaryPeriod() +
|
config.API.salaryPeriodActive() +
|
||||||
`?page=${page.value}&pageSize=${pageSize.value}&keyword=&year=0`
|
`?page=${page.value}&pageSize=${pageSize.value}&keyword=&year=0`
|
||||||
)
|
)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ const itemMenu = ref<ItemsMenu[]>([
|
||||||
|
|
||||||
const formFilter = reactive<FormFilter>({
|
const formFilter = reactive<FormFilter>({
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 10,
|
pageSize: 100,
|
||||||
keyword: "",
|
keyword: "",
|
||||||
});
|
});
|
||||||
const maxPage = ref<number>(1);
|
const maxPage = ref<number>(1);
|
||||||
|
|
@ -90,6 +90,17 @@ const pagination = ref({
|
||||||
page: formFilter.page,
|
page: formFilter.page,
|
||||||
rowsPerPage: formFilter.pageSize,
|
rowsPerPage: formFilter.pageSize,
|
||||||
});
|
});
|
||||||
|
const isActive = ref<boolean>(false);
|
||||||
|
|
||||||
|
function fetchDataDetail() {
|
||||||
|
http
|
||||||
|
.get(config.API.salaryEmployeeChartByid(salaryEmployeeId.value))
|
||||||
|
.then((res) => {
|
||||||
|
isActive.value = res.data.result.isActive;
|
||||||
|
})
|
||||||
|
.catch((e) => {})
|
||||||
|
.finally(() => {});
|
||||||
|
}
|
||||||
|
|
||||||
function fetchSalalyEmployeeRate() {
|
function fetchSalalyEmployeeRate() {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -179,6 +190,7 @@ watch(
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchSalalyEmployeeRate();
|
fetchSalalyEmployeeRate();
|
||||||
|
fetchDataDetail();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -199,7 +211,7 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
<q-card flat bordered class="q-pa-md">
|
<q-card flat bordered class="q-pa-md">
|
||||||
<q-toolbar class="text-primary" style="padding: 0px">
|
<q-toolbar class="text-primary" style="padding: 0px">
|
||||||
<q-btn flat round dense icon="add" @click="onClickAdd">
|
<q-btn v-if="!isActive" flat round dense icon="add" @click="onClickAdd">
|
||||||
<q-tooltip>เพิ่ม </q-tooltip>
|
<q-tooltip>เพิ่ม </q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
@ -243,13 +255,14 @@ onMounted(() => {
|
||||||
:rows-per-page-options="[10, 20, 50, 100]"
|
:rows-per-page-options="[10, 20, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
@update:pagination="updatePageSize"
|
@update:pagination="updatePageSize"
|
||||||
|
v-model:pagination="pagination"
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
</q-th>
|
</q-th>
|
||||||
<q-th auto-width />
|
<q-th auto-width v-if="!isActive" />
|
||||||
</q-tr>
|
</q-tr>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -264,7 +277,7 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
<div v-else>{{ col.value ? col.value : "-" }}</div>
|
<div v-else>{{ col.value ? col.value : "-" }}</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td>
|
<q-td v-if="!isActive">
|
||||||
<q-btn
|
<q-btn
|
||||||
flat
|
flat
|
||||||
dense
|
dense
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ function getRound() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(
|
.get(
|
||||||
config.API.salaryPeriod() +
|
config.API.salaryPeriodActive() +
|
||||||
`?page=${page.value}&pageSize=${pageSize.value}&keyword=&year=0`
|
`?page=${page.value}&pageSize=${pageSize.value}&keyword=&year=0`
|
||||||
)
|
)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
|
|
|
||||||
|
|
@ -154,13 +154,17 @@ const visibleColumns = ref<string[]>([
|
||||||
async function fetchPosition(id: string) {
|
async function fetchPosition(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.orgPosPositionById(id))
|
.get(config.API.orgPosPositionEmpById(id))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
||||||
formData.prefixNo = data.posMasterNoPrefix;
|
formData.prefixNo = data.posMasterNoPrefix;
|
||||||
formData.positionNo = data.posMasterNo;
|
formData.positionNo = data.posMasterNo;
|
||||||
formData.suffixNo = data.posMasterNoSuffix;
|
formData.suffixNo = data.posMasterNoSuffix;
|
||||||
rows.value = data.positions;
|
rows.value = data.positions.map((e: any) => ({
|
||||||
|
...e,
|
||||||
|
posDictName: e.positionName,
|
||||||
|
}));
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -306,6 +310,8 @@ function deletePos(id: string) {
|
||||||
|
|
||||||
function clearFormPositionSelect() {
|
function clearFormPositionSelect() {
|
||||||
isDisValidate.value = true;
|
isDisValidate.value = true;
|
||||||
|
search.value = "";
|
||||||
|
type.value = "positionName";
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
isDisValidate.value = false;
|
isDisValidate.value = false;
|
||||||
|
|
@ -315,12 +321,12 @@ function clearFormPositionSelect() {
|
||||||
function close() {
|
function close() {
|
||||||
props.close?.();
|
props.close?.();
|
||||||
isPosition.value = false;
|
isPosition.value = false;
|
||||||
|
clearFormPositionSelect();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function emitSearch(keyword: string, typeSelect: string) {
|
async function emitSearch(keyword: string, typeSelect: string) {
|
||||||
search.value = await keyword;
|
search.value = keyword;
|
||||||
type.value = await typeSelect;
|
type.value = typeSelect;
|
||||||
|
|
||||||
await searchInput();
|
await searchInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,10 +84,8 @@ const isDisable = computed(() => {
|
||||||
|
|
||||||
function onClickMovePos() {
|
function onClickMovePos() {
|
||||||
if (selectedTree.value === "" || selectedTree.value === null) {
|
if (selectedTree.value === "" || selectedTree.value === null) {
|
||||||
console.log("เลือกหน่วยงาน");
|
|
||||||
dialogMessageNotify($q, "กรุณาเลือกหน่วยงานที่จะย้ายไป");
|
dialogMessageNotify($q, "กรุณาเลือกหน่วยงานที่จะย้ายไป");
|
||||||
} else if (selectedFilter.value.length === 0) {
|
} else if (selectedFilter.value.length === 0) {
|
||||||
console.log("เลือกตำแห่นง");
|
|
||||||
dialogMessageNotify($q, "กรุณาเลือกตำแห่นงที่จะย้าย");
|
dialogMessageNotify($q, "กรุณาเลือกตำแห่นงที่จะย้าย");
|
||||||
} else {
|
} else {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
|
|
@ -101,9 +99,9 @@ function onClickMovePos() {
|
||||||
};
|
};
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.post(config.API.orgPosMove, body)
|
.post(config.API.orgPosMoveEmp, body)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
props.fetchDataTree?.(store.draftId);
|
props.fetchDataTree?.(store.activeId);
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
success($q, "ย้ายตำแหน่งสำเร็จ");
|
success($q, "ย้ายตำแหน่งสำเร็จ");
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,11 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, watch } from "vue";
|
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import http from "@/plugins/http";
|
|
||||||
import config from "@/app.config";
|
|
||||||
|
|
||||||
/** import type*/
|
|
||||||
import type { QTableProps } from "quasar";
|
|
||||||
import type {
|
|
||||||
FormDetailPosition,
|
|
||||||
Position,
|
|
||||||
} from "@/modules/16_positionEmployee/interface/index/organizational";
|
|
||||||
|
|
||||||
/** importComponents*/
|
/** importComponents*/
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
/** importStore*/
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
|
||||||
import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational";
|
|
||||||
|
|
||||||
/**use*/
|
/**use*/
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
|
||||||
const store = usePositionEmp();
|
|
||||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
|
||||||
|
|
||||||
/**Props*/
|
/**Props*/
|
||||||
const modal = defineModel<boolean>("positionDetail", { required: true });
|
const modal = defineModel<boolean>("positionDetail", { required: true });
|
||||||
|
|
@ -30,144 +13,10 @@ const prosp = defineProps({
|
||||||
dataDetailPos: { type: Object, require: true },
|
dataDetailPos: { type: Object, require: true },
|
||||||
});
|
});
|
||||||
|
|
||||||
/** formData*/
|
|
||||||
const formData = reactive<FormDetailPosition>({
|
|
||||||
positionNo: "", //*เลขที่ตำแหน่ง
|
|
||||||
positionType: "", //*ตำแหน่งประเภท
|
|
||||||
positionPathSide: "", //*ตำแหน่งในสายงาน
|
|
||||||
positionLine: "", //*สายงาน
|
|
||||||
positionSide: "", //*ด้าน/สาขา
|
|
||||||
positionLevel: "", //*ระดับตำแหน่ง
|
|
||||||
positionExecutive: "", //*ตำแหน่งทางการบริหาร
|
|
||||||
positionExecutiveSide: "", //*ด้านทางการบริหาร
|
|
||||||
status: "", //*สถานะตำแหน่ง
|
|
||||||
});
|
|
||||||
|
|
||||||
// const columns = ref<QTableProps["columns"]>([
|
|
||||||
// {
|
|
||||||
// name: "no",
|
|
||||||
// align: "left",
|
|
||||||
// label: "ลำดับ",
|
|
||||||
// sortable: false,
|
|
||||||
// field: "no",
|
|
||||||
// headerStyle: "font-size: 14px",
|
|
||||||
// style: "font-size: 14px",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// name: "positionName",
|
|
||||||
// align: "left",
|
|
||||||
// label: "ตำแหน่งในสายงาน",
|
|
||||||
// sortable: true,
|
|
||||||
// field: "positionName",
|
|
||||||
// headerStyle: "font-size: 14px",
|
|
||||||
// style: "font-size: 14px",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// name: "positionField",
|
|
||||||
// align: "left",
|
|
||||||
// label: "สายงาน",
|
|
||||||
// sortable: true,
|
|
||||||
// field: "positionField",
|
|
||||||
// headerStyle: "font-size: 14px",
|
|
||||||
// style: "font-size: 14px",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// name: "posTypeName",
|
|
||||||
// align: "left",
|
|
||||||
// label: "ประเภทตำเเหน่ง",
|
|
||||||
// sortable: true,
|
|
||||||
// field: "posTypeName",
|
|
||||||
// headerStyle: "font-size: 14px",
|
|
||||||
// style: "font-size: 14px",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// name: "posLevelName",
|
|
||||||
// align: "left",
|
|
||||||
// label: "ระดับตำแหน่ง",
|
|
||||||
// sortable: true,
|
|
||||||
// field: "posLevelName",
|
|
||||||
// headerStyle: "font-size: 14px",
|
|
||||||
// style: "font-size: 14px",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// name: "posExecutiveName",
|
|
||||||
// align: "left",
|
|
||||||
// label: "ตำแหน่งทางการบริหาร",
|
|
||||||
// sortable: true,
|
|
||||||
// field: "posExecutiveName",
|
|
||||||
// headerStyle: "font-size: 14px",
|
|
||||||
// style: "font-size: 14px",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// name: "positionExecutiveField",
|
|
||||||
// align: "left",
|
|
||||||
// label: "ด้านทางการบริหาร",
|
|
||||||
// sortable: true,
|
|
||||||
// field: "positionExecutiveField",
|
|
||||||
// headerStyle: "font-size: 14px",
|
|
||||||
// style: "font-size: 14px",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// name: "positionArea",
|
|
||||||
// align: "left",
|
|
||||||
// label: "ด้าน/สาขา",
|
|
||||||
// sortable: true,
|
|
||||||
// field: "positionArea",
|
|
||||||
// headerStyle: "font-size: 14px",
|
|
||||||
// style: "font-size: 14px",
|
|
||||||
// },
|
|
||||||
// ]);
|
|
||||||
// const row = ref<Position[]>([]);
|
|
||||||
|
|
||||||
/** function ปิด popup*/
|
/** function ปิด popup*/
|
||||||
function close() {
|
function close() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** callblack function ทำเมื่อเปิด popup set เลขที่ตำแหน่ง และสถานะตำแหน่ง */
|
|
||||||
watch(
|
|
||||||
() => modal.value,
|
|
||||||
() => {
|
|
||||||
if (modal.value == true) {
|
|
||||||
if (prosp.dataDetailPos) {
|
|
||||||
formData.positionNo = prosp.dataDetailPos.posMasterNo;
|
|
||||||
formData.status =
|
|
||||||
store.typeOrganizational === "current"
|
|
||||||
? "ปกติ"
|
|
||||||
: store.typeOrganizational === "draft"
|
|
||||||
? "แบบร่าง"
|
|
||||||
: "ยุบเลิก";
|
|
||||||
formData.positionType = prosp.dataDetailPos.posTypeName;
|
|
||||||
formData.positionPathSide = prosp.dataDetailPos.positionName;
|
|
||||||
formData.positionLine = prosp.dataDetailPos.positionField;
|
|
||||||
formData.positionSide = prosp.dataDetailPos.positionArea
|
|
||||||
? prosp.dataDetailPos.positionArea
|
|
||||||
: "-";
|
|
||||||
formData.positionLevel = prosp.dataDetailPos.posLevelName;
|
|
||||||
formData.positionExecutive = prosp.dataDetailPos.posExecutiveName
|
|
||||||
? prosp.dataDetailPos.posExecutiveName
|
|
||||||
: "-";
|
|
||||||
formData.positionExecutiveSide = prosp.dataDetailPos
|
|
||||||
.positionExecutiveField
|
|
||||||
? prosp.dataDetailPos.positionExecutiveField
|
|
||||||
: "-";
|
|
||||||
|
|
||||||
// row.value = prosp.dataDetailPos.positions.map((e: Position) => ({
|
|
||||||
// ...e,
|
|
||||||
// positionName: e.positionName ? e.positionName : "-",
|
|
||||||
// positionField: e.positionField ? e.positionField : "-",
|
|
||||||
// posTypeName: e.posTypeName ? e.posTypeName : "-",
|
|
||||||
// posLevelName: e.posLevelName ? e.posLevelName : "-",
|
|
||||||
// posExecutiveName: e.posExecutiveName ? e.posExecutiveName : "-",
|
|
||||||
// positionExecutiveField: e.positionExecutiveField
|
|
||||||
// ? e.positionExecutiveField
|
|
||||||
// : "-",
|
|
||||||
// positionArea: e.positionArea ? e.positionArea : "-",
|
|
||||||
// }));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -177,146 +26,48 @@ watch(
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
<div class="q-px-md">
|
<div class="q-px-md">
|
||||||
<div class="row q-col-gutter-sm q-mb-xs">
|
<!-- <div class="row q-col-gutter-sm q-mb-xs">
|
||||||
<div class="col-4 text-bold">
|
<div class="col-4 text-bold">
|
||||||
<div>
|
<div>
|
||||||
<p>เลขที่ตำแหน่ง</p>
|
<p>เลขที่ตำแหน่ง</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8 text-grey-8">
|
<div class="col-8 text-grey-8">
|
||||||
<p>{{ formData.positionNo }}</p>
|
<p>{{ prosp?.dataDetailPos?.posMasterNo }}</p>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row q-col-gutter-sm q-mb-xs">
|
|
||||||
<div class="col-4 text-bold">
|
|
||||||
<div>
|
|
||||||
<p>ตำแหน่งประเภท</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-8 text-grey-8">
|
|
||||||
<p>{{ formData.positionType }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row q-col-gutter-sm q-mb-xs">
|
|
||||||
<div class="col-4 text-bold">
|
|
||||||
<div>
|
|
||||||
<p>ตำแหน่งในสายงาน</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-8 text-grey-8">
|
|
||||||
<p>{{ formData.positionPathSide }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row q-col-gutter-sm q-mb-xs">
|
|
||||||
<div class="col-4 text-bold">
|
|
||||||
<div>
|
|
||||||
<p>สายงาน</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-8 text-grey-8">
|
|
||||||
<p>{{ formData.positionLine }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row q-col-gutter-sm q-mb-xs">
|
|
||||||
<div class="col-4 text-bold">
|
|
||||||
<div>
|
|
||||||
<p>ด้าน/สาขา</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-8 text-grey-8">
|
|
||||||
<p>{{ formData.positionSide }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row q-col-gutter-sm q-mb-xs">
|
|
||||||
<div class="col-4 text-bold">
|
|
||||||
<div>
|
|
||||||
<p>ระดับตำแหน่ง</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-8 text-grey-8">
|
|
||||||
<p>{{ formData.positionLevel }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row q-col-gutter-sm q-mb-xs">
|
|
||||||
<div class="col-4 text-bold">
|
|
||||||
<div>
|
|
||||||
<p>ตำแหน่งทางการบริหาร</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-8 text-grey-8">
|
|
||||||
<p>{{ formData.positionExecutive }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row q-col-gutter-sm q-mb-xs">
|
|
||||||
<div class="col-4 text-bold">
|
|
||||||
<div>
|
|
||||||
<p>ด้านทางการบริหาร</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-8 text-grey-8">
|
|
||||||
<p>{{ formData.positionExecutiveSide }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row q-col-gutter-sm q-mb-xs">
|
|
||||||
<div class="col-4 text-bold">
|
|
||||||
<div>
|
|
||||||
<p>สถานะตำแหน่ง</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-8 text-grey-8">
|
|
||||||
<p>{{ formData.status }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- <div class="row q-col-gutter-sm q-mb-xs">
|
|
||||||
<div class="col-12">
|
|
||||||
<d-table
|
|
||||||
flat
|
|
||||||
:columns="columns"
|
|
||||||
:rows="row"
|
|
||||||
row-key="id"
|
|
||||||
dense
|
|
||||||
hide-bottom
|
|
||||||
class="custom-header-table-expand"
|
|
||||||
>
|
|
||||||
<template v-slot:header="props">
|
|
||||||
<q-tr :props="props">
|
|
||||||
<q-th
|
|
||||||
v-for="col in props.cols"
|
|
||||||
:key="col.name"
|
|
||||||
:props="props"
|
|
||||||
>
|
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
|
||||||
</q-th>
|
|
||||||
</q-tr>
|
|
||||||
</template>
|
|
||||||
<template v-slot:body="props">
|
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
|
||||||
<q-td
|
|
||||||
v-for="col in props.cols"
|
|
||||||
:key="col.name"
|
|
||||||
:props="props"
|
|
||||||
>
|
|
||||||
<div v-if="col.name == 'no'">
|
|
||||||
{{ props.rowIndex + 1 }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-else>
|
|
||||||
{{ col.value }}
|
|
||||||
</div>
|
|
||||||
</q-td>
|
|
||||||
</q-tr>
|
|
||||||
</template>
|
|
||||||
</d-table>
|
|
||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
<div class="row q-col-gutter-sm q-mb-xs">
|
||||||
|
<div class="col-4 text-bold">
|
||||||
|
<div>
|
||||||
|
<p>กลุ่มงาน</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-8 text-grey-8">
|
||||||
|
<p>{{ prosp?.dataDetailPos?.posTypeName }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row q-col-gutter-sm q-mb-xs">
|
||||||
|
<div class="col-4 text-bold">
|
||||||
|
<div>
|
||||||
|
<p>ตำแหน่ง</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-8 text-grey-8">
|
||||||
|
<p>{{ prosp?.dataDetailPos?.positionName }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row q-col-gutter-sm q-mb-xs">
|
||||||
|
<div class="col-4 text-bold">
|
||||||
|
<div>
|
||||||
|
<p>ระดับชั้นงาน</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-8 text-grey-8">
|
||||||
|
<p>{{ prosp?.dataDetailPos?.posLevelName }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
|
||||||
|
|
@ -99,25 +99,17 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "positionName",
|
name: "positionName",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ตำแหน่งในสายงาน",
|
label: "ตำแหน่ง",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "positionName",
|
field: "positionName",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "positionField",
|
|
||||||
align: "left",
|
|
||||||
label: "สายงาน",
|
|
||||||
sortable: true,
|
|
||||||
field: "positionField",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "posTypeName",
|
name: "posTypeName",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ประเภทตำเเหน่ง",
|
label: "กลุ่มงาน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "posTypeName",
|
field: "posTypeName",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
|
|
@ -126,39 +118,12 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "posLevelName",
|
name: "posLevelName",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ระดับตำแหน่ง",
|
label: "ระดับชั้นงาน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "posLevelName",
|
field: "posLevelName",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "posExecutiveName",
|
|
||||||
align: "left",
|
|
||||||
label: "ตำแหน่งทางการบริหาร",
|
|
||||||
sortable: true,
|
|
||||||
field: "posExecutiveName",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "positionExecutiveField",
|
|
||||||
align: "left",
|
|
||||||
label: "ด้านทางการบริหาร",
|
|
||||||
sortable: true,
|
|
||||||
field: "positionExecutiveField",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "positionArea",
|
|
||||||
align: "left",
|
|
||||||
label: "ด้าน/สาขา",
|
|
||||||
sortable: true,
|
|
||||||
field: "positionArea",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
const columnsResult = ref<QTableProps["columns"]>([
|
const columnsResult = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -188,28 +153,29 @@ const columnsResult = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "posTypeName",
|
|
||||||
align: "left",
|
|
||||||
label: "ประเภทตำเเหน่ง",
|
|
||||||
sortable: true,
|
|
||||||
field: "posTypeName",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "positionName",
|
name: "positionName",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ตำแหน่งในสายงาน",
|
label: "ตำแหน่ง",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "positionName",
|
field: "positionName",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "posTypeName",
|
||||||
|
align: "left",
|
||||||
|
label: "กลุ่มงาน",
|
||||||
|
sortable: true,
|
||||||
|
field: "posTypeName",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "posLevelName",
|
name: "posLevelName",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ระดับตำแหน่ง",
|
label: "ระดับชั้นงาน",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "posLevelName",
|
field: "posLevelName",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
|
|
@ -228,7 +194,7 @@ function close() {
|
||||||
async function fetchType() {
|
async function fetchType() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.orgPosType)
|
.get(config.API.orgEmployeeType)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
dataLevel.value = res.data.result;
|
dataLevel.value = res.data.result;
|
||||||
typeOpsMain.value = res.data.result.map((e: OptionType) => ({
|
typeOpsMain.value = res.data.result.map((e: OptionType) => ({
|
||||||
|
|
@ -291,7 +257,7 @@ function onSubmit() {
|
||||||
};
|
};
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.post(config.API.orgProfile, body)
|
.post(config.API.orgProfileEmp, body)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
props.fetchDataTable?.(store.treeId, store.level, false);
|
props.fetchDataTable?.(store.treeId, store.level, false);
|
||||||
props.getSummary();
|
props.getSummary();
|
||||||
|
|
@ -327,7 +293,7 @@ async function searchData() {
|
||||||
keyword: formData.personal, //นามสกุล ชื่อ สกุล เลขบัตร
|
keyword: formData.personal, //นามสกุล ชื่อ สกุล เลขบัตร
|
||||||
};
|
};
|
||||||
await http
|
await http
|
||||||
.post(config.API.orgSearchProfile, reqBody)
|
.post(config.API.orgSearchProfileEmp, reqBody)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
totalPage.value = Math.ceil(res.data.result.total / pageSize.value);
|
totalPage.value = Math.ceil(res.data.result.total / pageSize.value);
|
||||||
const list = res.data.result.data.map((e: SelectPerson) => ({
|
const list = res.data.result.data.map((e: SelectPerson) => ({
|
||||||
|
|
@ -543,7 +509,7 @@ watch([() => page.value, () => pageSize.value], () => {
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
for="#position"
|
for="#position"
|
||||||
label="ตำแหน่งในสายงาน"
|
label="ตำแหน่ง"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
/>
|
/>
|
||||||
|
|
@ -552,7 +518,7 @@ watch([() => page.value, () => pageSize.value], () => {
|
||||||
<q-select
|
<q-select
|
||||||
ref="positionTypeRef"
|
ref="positionTypeRef"
|
||||||
:class="inputEdit(isReadonly)"
|
:class="inputEdit(isReadonly)"
|
||||||
label="ประเภทตำแหน่ง"
|
label="กลุ่มงาน"
|
||||||
v-model="formData.positionType"
|
v-model="formData.positionType"
|
||||||
:options="typeOps"
|
:options="typeOps"
|
||||||
emit-value
|
emit-value
|
||||||
|
|
@ -576,7 +542,7 @@ watch([() => page.value, () => pageSize.value], () => {
|
||||||
<q-select
|
<q-select
|
||||||
ref="positionLevelRef"
|
ref="positionLevelRef"
|
||||||
:class="inputEdit(isReadonly)"
|
:class="inputEdit(isReadonly)"
|
||||||
label="ระดับตำแหน่ง"
|
label="ระดับชั่นงาน"
|
||||||
v-model="formData.positionLevel"
|
v-model="formData.positionLevel"
|
||||||
:disable="formData.positionType == ''"
|
:disable="formData.positionType == ''"
|
||||||
:options="levelOps"
|
:options="levelOps"
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ function save() {
|
||||||
const dataId = data.map((item: any) => item.id);
|
const dataId = data.map((item: any) => item.id);
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.post(config.API.orgPosSort, {
|
.post(config.API.orgPosSortEmp, {
|
||||||
id: store.treeId,
|
id: store.treeId,
|
||||||
type: store.level,
|
type: store.level,
|
||||||
sortId: dataId,
|
sortId: dataId,
|
||||||
|
|
@ -68,14 +68,14 @@ function save() {
|
||||||
function getData() {
|
function getData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.post(config.API.orgPosMasterList, {
|
.post(config.API.orgPosMasterListEmp, {
|
||||||
id: store.treeId,
|
id: store.treeId,
|
||||||
type: store.level,
|
type: store.level,
|
||||||
isAll: false,
|
isAll: false,
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
keyword: "",
|
keyword: "",
|
||||||
revisionId: store.draftId,
|
revisionId: store.activeId,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const dataList = res.data.result.data;
|
const dataList = res.data.result.data;
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,6 @@ async function fetchTree() {
|
||||||
await http
|
await http
|
||||||
.get(config.API.orgByid(id))
|
.get(config.API.orgByid(id))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res);
|
|
||||||
nodeTree.value = res.data.result;
|
nodeTree.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -163,7 +162,6 @@ function onClickConfirm() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
async () => {
|
async () => {
|
||||||
console.log(props.rowId, selectedPos.value[0].id);
|
|
||||||
const body: Inherit = {
|
const body: Inherit = {
|
||||||
draftPositionId: props.rowId,
|
draftPositionId: props.rowId,
|
||||||
publishPositionId: selectedPos.value[0].id,
|
publishPositionId: selectedPos.value[0].id,
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
/** importType*/
|
/** importType*/
|
||||||
import type { ListMenu } from "@/modules/16_positionEmployee/interface/index/Main";
|
|
||||||
import type { OrgTree } from "@/modules/16_positionEmployee/interface/response/organizational";
|
import type { OrgTree } from "@/modules/16_positionEmployee/interface/response/organizational";
|
||||||
import type { DataTree } from "@/modules/16_positionEmployee/interface/index/organizational";
|
import type { DataTree } from "@/modules/16_positionEmployee/interface/index/organizational";
|
||||||
|
|
||||||
|
|
@ -16,14 +16,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
/** use*/
|
/** use*/
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const store = usePositionEmp();
|
const store = usePositionEmp();
|
||||||
const {
|
const {} = useCounterMixin();
|
||||||
dialogRemove,
|
|
||||||
showLoader,
|
|
||||||
hideLoader,
|
|
||||||
messageError,
|
|
||||||
success,
|
|
||||||
date2Thai,
|
|
||||||
} = useCounterMixin();
|
|
||||||
|
|
||||||
/** props*/
|
/** props*/
|
||||||
const nodeTEST = defineModel<OrgTree[]>("nodeTree", { default: [] });
|
const nodeTEST = defineModel<OrgTree[]>("nodeTree", { default: [] });
|
||||||
|
|
@ -40,57 +33,12 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/** ListMenuTree*/
|
|
||||||
const listAdd = ref<ListMenu[]>([
|
|
||||||
{
|
|
||||||
label: "เพิ่ม",
|
|
||||||
icon: "add",
|
|
||||||
type: "ADD",
|
|
||||||
color: "primary",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "แก้ไข",
|
|
||||||
icon: "edit",
|
|
||||||
type: "EDIT",
|
|
||||||
color: "edit",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "ลบ",
|
|
||||||
icon: "delete",
|
|
||||||
type: "DEL",
|
|
||||||
color: "red",
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
label: "ประวัติ",
|
|
||||||
icon: "history",
|
|
||||||
type: "HISTORY",
|
|
||||||
color: "purple",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "จัดลำดับ",
|
|
||||||
icon: "mdi-sort",
|
|
||||||
type: "SORT",
|
|
||||||
color: "blue-6",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "ดูรายละเอียด",
|
|
||||||
icon: "mdi-eye",
|
|
||||||
type: "DETAIL",
|
|
||||||
color: "blue-9",
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
const filter = ref<string>("");
|
const filter = ref<string>("");
|
||||||
const nodes = ref<Array<OrgTree>>([]);
|
const nodes = ref<Array<OrgTree>>([]);
|
||||||
const dataSort = ref<Array<any>>([]);
|
|
||||||
const lazy = ref(nodes);
|
const lazy = ref(nodes);
|
||||||
const expanded = ref<Array<any>>([]);
|
const expanded = ref<Array<any>>([]);
|
||||||
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
||||||
const noData = ref<string>("ไม่มีข้อมูล");
|
const noData = ref<string>("ไม่มีข้อมูล");
|
||||||
const orgLevel = ref<number>(0);
|
|
||||||
const type = ref<number>(0);
|
|
||||||
const orgId = ref<string>("");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* funtion เลือกข้อมูล Tree
|
* funtion เลือกข้อมูล Tree
|
||||||
|
|
@ -134,236 +82,6 @@ function updateSelected(data: DataTree) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const breakLoop = ref<boolean>(false);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function แก้ไขโครสร้าง
|
|
||||||
* @param id ID โครงสร้าง
|
|
||||||
* @param type ละดับโครงสร้าง
|
|
||||||
* @param data ข้อมูลโครงสร้าง
|
|
||||||
* @param orgRootCode
|
|
||||||
*/
|
|
||||||
async function edit(id: string, type: string, data: any, orgRootCode: string) {
|
|
||||||
breakLoop.value = false;
|
|
||||||
const targetNodeId = id;
|
|
||||||
|
|
||||||
for (let index = 0; index < nodes.value.length; index++) {
|
|
||||||
const element = nodes.value[index];
|
|
||||||
|
|
||||||
searchAndReplace(element, targetNodeId, data, type, orgRootCode);
|
|
||||||
|
|
||||||
if (breakLoop.value) break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function แก้ไขโครสร้าง
|
|
||||||
* @param treeNode
|
|
||||||
* @param organizationId ID โครงสร้าง
|
|
||||||
* @param data ข้อมูลโครงสร้าง
|
|
||||||
* @param type ละดับโครงสร้าง
|
|
||||||
* @param orgRootCode
|
|
||||||
*/
|
|
||||||
function searchAndReplace(
|
|
||||||
treeNode: any,
|
|
||||||
organizationId: string,
|
|
||||||
data: any,
|
|
||||||
type: string,
|
|
||||||
orgRootCode: string
|
|
||||||
) {
|
|
||||||
if (treeNode.orgTreeId === organizationId) {
|
|
||||||
let newData = {
|
|
||||||
...treeNode,
|
|
||||||
orgTreeName: data[`org${type}Name`],
|
|
||||||
orgTreeShortName: data[`org${type}ShortName`],
|
|
||||||
orgCode:
|
|
||||||
data.orgRootRank == "DEPARTMENT"
|
|
||||||
? data[`org${type}Code`] + "00"
|
|
||||||
: orgRootCode + data[`org${type}Code`],
|
|
||||||
orgTreeCode: data[`org${type}Code`],
|
|
||||||
orgTreePhoneEx: data[`org${type}PhoneEx`],
|
|
||||||
orgTreePhoneIn: data[`org${type}PhoneIn`],
|
|
||||||
orgTreeFax: data[`org${type}Fax`],
|
|
||||||
orgTreeRank: data[`org${type}Rank`],
|
|
||||||
};
|
|
||||||
|
|
||||||
Object.assign(treeNode, newData);
|
|
||||||
breakLoop.value = true;
|
|
||||||
} else if (treeNode.children) {
|
|
||||||
for (const child of treeNode.children) {
|
|
||||||
searchAndReplace(child, organizationId, data, type, orgRootCode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function ลบข้อมูลโครงสร้าง
|
|
||||||
* @param rootId RootID
|
|
||||||
* @param treeId TreeID
|
|
||||||
*/
|
|
||||||
async function deleteUpdate(rootId: string, treeId: string) {
|
|
||||||
breakLoop.value = false;
|
|
||||||
if (rootId) {
|
|
||||||
for (let index = 0; index < nodes.value.length; index++) {
|
|
||||||
const element = nodes.value[index];
|
|
||||||
deleteNode(element, rootId, treeId);
|
|
||||||
|
|
||||||
if (breakLoop.value) break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
nodes.value = nodes.value.filter((x: any) => x.orgTreeId != treeId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function ลบข้อมูลโครงสร้าง
|
|
||||||
* @param treeNode ข้อมูล Tree
|
|
||||||
* @param rootId RootID
|
|
||||||
* @param treeId TreeID
|
|
||||||
*/
|
|
||||||
function deleteNode(treeNode: any, rootId: string, treeId: string): boolean {
|
|
||||||
if (treeNode.orgTreeId === rootId) {
|
|
||||||
const childrenNew = treeNode.children.filter(
|
|
||||||
(x: any) => x.orgTreeId != treeId
|
|
||||||
);
|
|
||||||
let newData = {
|
|
||||||
...treeNode,
|
|
||||||
children: childrenNew,
|
|
||||||
};
|
|
||||||
Object.assign(treeNode, newData);
|
|
||||||
|
|
||||||
breakLoop.value = true;
|
|
||||||
} else if (treeNode.children) {
|
|
||||||
for (const child of treeNode.children) {
|
|
||||||
deleteNode(child, rootId, treeId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const modalHistory = ref<boolean>(false);
|
|
||||||
const modalSortAgency = ref<boolean>(false);
|
|
||||||
const dialogAgency = ref<boolean>(false);
|
|
||||||
const actionType = ref<string>("");
|
|
||||||
const dataNode = ref<any>();
|
|
||||||
const treeId = ref<string>("");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* funcion openPopup เพิ่มหน่วยงาน
|
|
||||||
* @param level ระดับโครงสร้าง
|
|
||||||
* @param node ข้อมูล โครงสร้าง
|
|
||||||
*/
|
|
||||||
function onClickAgency(level: number, node: OrgTree | {}) {
|
|
||||||
dialogAgency.value = !dialogAgency.value;
|
|
||||||
orgLevel.value = level;
|
|
||||||
dataNode.value = node;
|
|
||||||
actionType.value = "ADD";
|
|
||||||
}
|
|
||||||
|
|
||||||
const dialogDetail = ref<boolean>(false);
|
|
||||||
/**
|
|
||||||
* funtion ดูรายละเอียดโครงสร้าง
|
|
||||||
* @param id ID โครงสร้าง
|
|
||||||
* @param level ระดับโครงสร้าง
|
|
||||||
*/
|
|
||||||
function onClickDetail(id: string, level: number) {
|
|
||||||
showLoader();
|
|
||||||
treeId.value = id;
|
|
||||||
dialogDetail.value = !dialogDetail.value;
|
|
||||||
orgLevel.value = level;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function openPopup แก้ไขข้อมูลโครงสร้าง
|
|
||||||
* @param node ข้อมูล โครงสร้าง
|
|
||||||
*/
|
|
||||||
async function onClickEdit(node: OrgTree) {
|
|
||||||
console.log(node);
|
|
||||||
|
|
||||||
dialogAgency.value = !dialogAgency.value;
|
|
||||||
actionType.value = "EDIT";
|
|
||||||
orgLevel.value = node.orgLevel;
|
|
||||||
dataNode.value = node;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function ยื่นยันการลบโครงสร้าง
|
|
||||||
* @param type ระดับโครงสร้าง
|
|
||||||
* @param id ID โครงสร้าง
|
|
||||||
* @param rootId RootID
|
|
||||||
*/
|
|
||||||
async function onClickDel(type: number, id: string, rootId: string) {
|
|
||||||
const level = store.checkLevel(type);
|
|
||||||
dialogRemove($q, async () => {
|
|
||||||
showLoader();
|
|
||||||
await http
|
|
||||||
.delete(config.API.orgLevelByid(level.toLocaleLowerCase(), id))
|
|
||||||
.then(() => {
|
|
||||||
success($q, "ลบข้อมูลสำเร็จ");
|
|
||||||
deleteUpdate(rootId, id);
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
messageError($q, err);
|
|
||||||
})
|
|
||||||
.finally(async () => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function การจัดลำดับโครงสร้าง
|
|
||||||
* @param id ID โครงสร้าง
|
|
||||||
* @param level ระดับโครงสร้าง
|
|
||||||
*/
|
|
||||||
async function onClickSort(id: string, level: number) {
|
|
||||||
type.value = level;
|
|
||||||
modalSortAgency.value = true;
|
|
||||||
if (id) {
|
|
||||||
breakLoop.value = false;
|
|
||||||
const orgId = id;
|
|
||||||
for (let index = 0; index < nodes.value.length; index++) {
|
|
||||||
const data = nodes.value[index];
|
|
||||||
searchAndReplace(data, orgId);
|
|
||||||
if (breakLoop.value) break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
const dataList = nodes.value;
|
|
||||||
const dataMap = dataList.map((item: any) => ({
|
|
||||||
orgTreeId: item.orgTreeId,
|
|
||||||
orgLevel: item.orgLevel,
|
|
||||||
orgTreeName: item.orgTreeName,
|
|
||||||
orgTreeShortName: item.orgTreeShortName,
|
|
||||||
orgRevisionId: item.orgRevisionId,
|
|
||||||
}));
|
|
||||||
|
|
||||||
dataSort.value = dataMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
function searchAndReplace(data: any, id: string) {
|
|
||||||
if (data.orgTreeId === id) {
|
|
||||||
dataSort.value = data.children;
|
|
||||||
breakLoop.value = true;
|
|
||||||
} else if (data.children) {
|
|
||||||
for (const child of data.children) {
|
|
||||||
searchAndReplace(child, id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function ดูประวัดโครงสร้าง
|
|
||||||
* @param level ระดับโครงสร้าง
|
|
||||||
* @param id ID โครงสร้าง
|
|
||||||
*/
|
|
||||||
function onClickHistory(level: number, id: string) {
|
|
||||||
type.value = level;
|
|
||||||
orgId.value = id;
|
|
||||||
modalHistory.value = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => nodeTEST.value,
|
() => nodeTEST.value,
|
||||||
() => {
|
() => {
|
||||||
|
|
@ -376,22 +94,7 @@ watch(
|
||||||
<div class="col-12 q-py-sm q-px-sm">
|
<div class="col-12 q-py-sm q-px-sm">
|
||||||
<div class="q-gutter-sm">
|
<div class="q-gutter-sm">
|
||||||
<div class="row q-col-gutter-sm q-pl-sm">
|
<div class="row q-col-gutter-sm q-pl-sm">
|
||||||
<div class="col-2" v-if="store.typeOrganizational === 'draft'">
|
<div class="col-12">
|
||||||
<q-btn
|
|
||||||
dense
|
|
||||||
flat
|
|
||||||
round
|
|
||||||
color="primary"
|
|
||||||
icon="add"
|
|
||||||
@click="onClickAgency(0, {})"
|
|
||||||
>
|
|
||||||
<q-tooltip>เพิ่มหน่วยงาน</q-tooltip>
|
|
||||||
</q-btn>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
:class="store.typeOrganizational === 'draft' ? 'col-10' : 'col-12'"
|
|
||||||
>
|
|
||||||
<q-input dense outlined v-model="filter" label="ค้นหา">
|
<q-input dense outlined v-model="filter" label="ค้นหา">
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon
|
<q-icon
|
||||||
|
|
@ -439,172 +142,12 @@ watch(
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-btn
|
|
||||||
v-if="store.typeOrganizational === 'draft'"
|
|
||||||
flat
|
|
||||||
dense
|
|
||||||
icon="mdi-dots-vertical"
|
|
||||||
class="q-ml-xs"
|
|
||||||
color="grey-13"
|
|
||||||
size="12px"
|
|
||||||
round
|
|
||||||
>
|
|
||||||
<q-menu>
|
|
||||||
<q-list
|
|
||||||
dense
|
|
||||||
v-for="(item, index) in prop.node.orgLevel === 4
|
|
||||||
? listAdd.slice(1, 6)
|
|
||||||
: listAdd"
|
|
||||||
:key="index"
|
|
||||||
style="min-width: 100px"
|
|
||||||
>
|
|
||||||
<q-item
|
|
||||||
clickable
|
|
||||||
v-close-popup
|
|
||||||
@click="
|
|
||||||
item.type === 'EDIT'
|
|
||||||
? onClickEdit(prop.node)
|
|
||||||
: item.type === 'ADD'
|
|
||||||
? onClickAgency(prop.node.orgLevel + 1, prop.node)
|
|
||||||
: item.type === 'DETAIL'
|
|
||||||
? onClickDetail(
|
|
||||||
prop.node.orgTreeId,
|
|
||||||
prop.node.orgLevel
|
|
||||||
)
|
|
||||||
: item.type === 'DEL'
|
|
||||||
? onClickDel(
|
|
||||||
prop.node.orgLevel,
|
|
||||||
prop.node.orgTreeId,
|
|
||||||
prop.node.orgRootId
|
|
||||||
)
|
|
||||||
: item.type === 'SORT'
|
|
||||||
? onClickSort(prop.node.orgRootId, prop.node.orgLevel)
|
|
||||||
: item.type === 'HISTORY'
|
|
||||||
? onClickHistory(
|
|
||||||
prop.node.orgLevel,
|
|
||||||
prop.node.orgTreeId
|
|
||||||
)
|
|
||||||
: null
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<q-item-section avatar style="min-width: 20px">
|
|
||||||
<q-icon
|
|
||||||
size="17px"
|
|
||||||
:color="item.color"
|
|
||||||
:name="item.icon"
|
|
||||||
/>
|
|
||||||
</q-item-section>
|
|
||||||
<div v-if="prop.node.orgLevel === 0">
|
|
||||||
<q-item-section
|
|
||||||
v-if="
|
|
||||||
item.type === 'EDIT' ||
|
|
||||||
item.type === 'DEL' ||
|
|
||||||
item.type === 'HISTORY' ||
|
|
||||||
item.type === 'SORT'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
{{ item.label }}หน่วยงาน
|
|
||||||
</q-item-section>
|
|
||||||
<q-item-section v-else-if="item.type === 'ADD'">
|
|
||||||
{{ item.label }}ส่วนราชการ
|
|
||||||
</q-item-section>
|
|
||||||
<q-item-section v-else>
|
|
||||||
{{ item.label }}
|
|
||||||
</q-item-section>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-else>
|
|
||||||
<q-item-section
|
|
||||||
v-if="
|
|
||||||
item.type === 'ADD' ||
|
|
||||||
item.type === 'EDIT' ||
|
|
||||||
item.type === 'DEL' ||
|
|
||||||
item.type === 'HISTORY' ||
|
|
||||||
item.type === 'SORT'
|
|
||||||
"
|
|
||||||
>{{ item.label }}ส่วนราชการ</q-item-section
|
|
||||||
>
|
|
||||||
<q-item-section v-else>{{ item.label }}</q-item-section>
|
|
||||||
</div>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
</q-menu>
|
|
||||||
</q-btn>
|
|
||||||
|
|
||||||
<q-btn
|
|
||||||
v-else
|
|
||||||
flat
|
|
||||||
dense
|
|
||||||
icon="mdi-dots-vertical"
|
|
||||||
class="q-pa-none q-ml-xs"
|
|
||||||
color="grey-13"
|
|
||||||
size="12px"
|
|
||||||
round
|
|
||||||
>
|
|
||||||
<q-menu>
|
|
||||||
<q-list
|
|
||||||
dense
|
|
||||||
v-for="(item, index) in listAdd.slice(5, 6)"
|
|
||||||
:key="index"
|
|
||||||
style="min-width: 100px"
|
|
||||||
>
|
|
||||||
<q-item
|
|
||||||
clickable
|
|
||||||
v-close-popup
|
|
||||||
@click="
|
|
||||||
onClickDetail(prop.node.orgTreeId, prop.node.orgLevel)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<q-item-section avatar style="min-width: 20px">
|
|
||||||
<q-icon
|
|
||||||
size="17px"
|
|
||||||
:color="item.color"
|
|
||||||
:name="item.icon"
|
|
||||||
/>
|
|
||||||
</q-item-section>
|
|
||||||
<q-item-section>{{ item.label }}</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</q-list>
|
|
||||||
</q-menu>
|
|
||||||
</q-btn>
|
|
||||||
</q-item>
|
</q-item>
|
||||||
</template>
|
</template>
|
||||||
</q-tree>
|
</q-tree>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- เพิ่มหน่วยงาน -->
|
|
||||||
<DialogAgency
|
|
||||||
:modal="dialogAgency"
|
|
||||||
:close="onClickAgency"
|
|
||||||
v-model:orgLevel="orgLevel"
|
|
||||||
:fetchDataTree="props.fetchDataTree"
|
|
||||||
:fetchDataTable="props.fetchDataTable"
|
|
||||||
v-model:actionType="actionType"
|
|
||||||
:dataNode="dataNode"
|
|
||||||
:edit="edit"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- รายละเอียดโครงสร้าง -->
|
|
||||||
<DialogStructureDetail
|
|
||||||
v-model:structure-detail="dialogDetail"
|
|
||||||
v-model:treeId="treeId"
|
|
||||||
v-model:orgLevel="orgLevel"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<DialogSortAgency
|
|
||||||
v-model:sort-agency="modalSortAgency"
|
|
||||||
v-model:data="dataSort"
|
|
||||||
:fetchDataTree="props.fetchDataTree"
|
|
||||||
v-model:type="type"
|
|
||||||
/>
|
|
||||||
<DialogHistory
|
|
||||||
v-model:history="modalHistory"
|
|
||||||
v-model:type="type"
|
|
||||||
v-model:org-id="orgId"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
|
||||||
|
|
@ -86,18 +86,18 @@ const listMenu = ref<ListMenu[]>([
|
||||||
type: "MOVE",
|
type: "MOVE",
|
||||||
color: "blue-10",
|
color: "blue-10",
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
label: "สืบทอดตำแหน่ง",
|
// label: "สืบทอดตำแหน่ง",
|
||||||
icon: "mdi-account-multiple-outline",
|
// icon: "mdi-account-multiple-outline",
|
||||||
type: "INHERIT",
|
// type: "INHERIT",
|
||||||
color: "deep-orange",
|
// color: "deep-orange",
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
label: "ประวัติตำแหน่ง",
|
// label: "ประวัติตำแหน่ง",
|
||||||
icon: "history",
|
// icon: "history",
|
||||||
type: "HISTORY",
|
// type: "HISTORY",
|
||||||
color: "deep-purple",
|
// color: "deep-purple",
|
||||||
},
|
// },
|
||||||
]);
|
]);
|
||||||
const document = ref<any>([
|
const document = ref<any>([
|
||||||
{
|
{
|
||||||
|
|
@ -137,7 +137,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "positionName",
|
name: "positionName",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ตำแหน่งในสายงาน",
|
label: "ตำแหน่ง",
|
||||||
field: "positionName",
|
field: "positionName",
|
||||||
sortable: false,
|
sortable: false,
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
|
|
@ -146,7 +146,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "posTypeName",
|
name: "posTypeName",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ประเภทตำแหน่ง",
|
label: "กลุ่มงาน",
|
||||||
sortable: false,
|
sortable: false,
|
||||||
field: "posTypeName",
|
field: "posTypeName",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
|
|
@ -155,7 +155,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "posLevelName",
|
name: "posLevelName",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ระดับตำแหน่ง",
|
label: "ระดับชั้นงาน",
|
||||||
sortable: false,
|
sortable: false,
|
||||||
field: "posLevelName",
|
field: "posLevelName",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
|
|
@ -172,81 +172,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const columnsExpand = ref<QTableProps["columns"]>([
|
|
||||||
{
|
|
||||||
name: "no",
|
|
||||||
align: "left",
|
|
||||||
label: "ลำดับ",
|
|
||||||
sortable: false,
|
|
||||||
field: "no",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "positionName",
|
|
||||||
align: "left",
|
|
||||||
label: "ตำแหน่งในสายงาน",
|
|
||||||
sortable: true,
|
|
||||||
field: "positionName",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "positionField",
|
|
||||||
align: "left",
|
|
||||||
label: "สายงาน",
|
|
||||||
sortable: true,
|
|
||||||
field: "positionField",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "posTypeName",
|
|
||||||
align: "left",
|
|
||||||
label: "ประเภทตำเเหน่ง",
|
|
||||||
sortable: true,
|
|
||||||
field: "posTypeName",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "posLevelName",
|
|
||||||
align: "left",
|
|
||||||
label: "ระดับตำแหน่ง",
|
|
||||||
sortable: true,
|
|
||||||
field: "posLevelName",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "posExecutiveName",
|
|
||||||
align: "left",
|
|
||||||
label: "ตำแหน่งทางการบริหาร",
|
|
||||||
sortable: true,
|
|
||||||
field: "posExecutiveName",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "positionExecutiveField",
|
|
||||||
align: "left",
|
|
||||||
label: "ด้านทางการบริหาร",
|
|
||||||
sortable: true,
|
|
||||||
field: "positionExecutiveField",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "positionArea",
|
|
||||||
align: "left",
|
|
||||||
label: "ด้าน/สาขา",
|
|
||||||
sortable: true,
|
|
||||||
field: "positionArea",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
const dialogPosition = ref<boolean>(false);
|
const dialogPosition = ref<boolean>(false);
|
||||||
/**
|
/**
|
||||||
* function openPopup เพิ่มอัตรากำลัง
|
* function openPopup เพิ่มอัตรากำลัง
|
||||||
|
|
@ -462,7 +387,7 @@ async function onClickDownloadReport(val: string, name: string) {
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-btn
|
<!-- <q-btn
|
||||||
v-if="store.typeOrganizational === 'draft'"
|
v-if="store.typeOrganizational === 'draft'"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
|
|
@ -487,7 +412,7 @@ async function onClickDownloadReport(val: string, name: string) {
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-menu>
|
</q-menu>
|
||||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||||
</q-btn>
|
</q-btn> -->
|
||||||
<q-space />
|
<q-space />
|
||||||
<div class="row q-gutter-md">
|
<div class="row q-gutter-md">
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -536,7 +461,6 @@ async function onClickDownloadReport(val: string, name: string) {
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
<q-th auto-width></q-th>
|
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
</q-th>
|
</q-th>
|
||||||
|
|
@ -545,17 +469,6 @@ async function onClickDownloadReport(val: string, name: string) {
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td>
|
|
||||||
<q-btn
|
|
||||||
flat
|
|
||||||
size="14px"
|
|
||||||
color="primary"
|
|
||||||
round
|
|
||||||
dense
|
|
||||||
@click="props.expand = !props.expand"
|
|
||||||
:icon="props.expand ? 'mdi-menu-down' : 'mdi-menu-right'"
|
|
||||||
/>
|
|
||||||
</q-td>
|
|
||||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
{{
|
{{
|
||||||
|
|
@ -593,10 +506,7 @@ async function onClickDownloadReport(val: string, name: string) {
|
||||||
<q-list dense style="min-width: 150px">
|
<q-list dense style="min-width: 150px">
|
||||||
<!-- เลือกคนครอง -->
|
<!-- เลือกคนครอง -->
|
||||||
<q-item
|
<q-item
|
||||||
v-if="
|
v-if="props.row.positionIsSelected == 'ว่าง'"
|
||||||
props.row.positionIsSelected == 'ว่าง' &&
|
|
||||||
store.typeOrganizational === 'draft'
|
|
||||||
"
|
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click="openSelectPerson(props.row)"
|
@click="openSelectPerson(props.row)"
|
||||||
|
|
@ -613,10 +523,7 @@ async function onClickDownloadReport(val: string, name: string) {
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item
|
<q-item
|
||||||
v-else-if="
|
v-else-if="props.row.positionIsSelected != 'ว่าง'"
|
||||||
props.row.positionIsSelected != 'ว่าง' &&
|
|
||||||
store.typeOrganizational === 'draft'
|
|
||||||
"
|
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click="removePerson(props.row.id)"
|
@click="removePerson(props.row.id)"
|
||||||
|
|
@ -633,9 +540,7 @@ async function onClickDownloadReport(val: string, name: string) {
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item
|
<q-item
|
||||||
v-for="(item, index) in store.typeOrganizational === 'draft'
|
v-for="(item, index) in listMenu"
|
||||||
? listMenu
|
|
||||||
: listMenu.filter((e) => e.type === 'HISTORY')"
|
|
||||||
:key="index"
|
:key="index"
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
|
|
@ -682,76 +587,6 @@ async function onClickDownloadReport(val: string, name: string) {
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</q-td>
|
</q-td>
|
||||||
</q-tr>
|
</q-tr>
|
||||||
|
|
||||||
<q-tr v-show="props.expand" :props="props">
|
|
||||||
<q-td colspan="100%" class="bg-grey-1">
|
|
||||||
<q-card flat bordered class="text-left q-ma-sm">
|
|
||||||
<d-table
|
|
||||||
flat
|
|
||||||
:columns="columnsExpand"
|
|
||||||
:rows="props.row.positions"
|
|
||||||
table-class="text-grey-9"
|
|
||||||
row-key="id"
|
|
||||||
dense
|
|
||||||
hide-bottom
|
|
||||||
bordered
|
|
||||||
separator="vertical"
|
|
||||||
class="custom-header-table-expand"
|
|
||||||
>
|
|
||||||
<template v-slot:header="props">
|
|
||||||
<q-tr :props="props" class="bg-grey-2">
|
|
||||||
<q-th
|
|
||||||
v-for="col in props.cols"
|
|
||||||
:key="col.name"
|
|
||||||
:props="props"
|
|
||||||
>
|
|
||||||
<span class="q-px-sm text-body2 text-black">{{
|
|
||||||
col.label
|
|
||||||
}}</span>
|
|
||||||
</q-th>
|
|
||||||
</q-tr>
|
|
||||||
</template>
|
|
||||||
<template v-slot:body="props">
|
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
|
||||||
<q-td
|
|
||||||
v-for="col in props.cols"
|
|
||||||
:key="col.name"
|
|
||||||
:props="props"
|
|
||||||
>
|
|
||||||
<div v-if="col.name == 'no'" class="text-body2">
|
|
||||||
{{ props.rowIndex + 1 }}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-else-if="col.name === 'posExecutiveName'"
|
|
||||||
class="text-body2"
|
|
||||||
>
|
|
||||||
{{ col.value ? col.value : "-" }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
v-else-if="col.name === 'positionExecutiveField'"
|
|
||||||
class="text-body2"
|
|
||||||
>
|
|
||||||
{{ col.value ? col.value : "-" }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
v-else-if="col.name === 'positionArea'"
|
|
||||||
class="text-body2"
|
|
||||||
>
|
|
||||||
{{ col.value ? col.value : "-" }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-else class="text-body2">
|
|
||||||
{{ col.value }}
|
|
||||||
</div>
|
|
||||||
</q-td>
|
|
||||||
</q-tr>
|
|
||||||
</template>
|
|
||||||
</d-table>
|
|
||||||
</q-card>
|
|
||||||
</q-td>
|
|
||||||
</q-tr>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
<q-pagination
|
<q-pagination
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,6 @@ const store = usePositionEmp();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||||
|
|
||||||
/** props*/
|
|
||||||
const historyId = defineModel<string>("historyId", { required: true }); // id ประวัติโครงสร้าง
|
|
||||||
const count = defineModel<number>("count", { required: true });
|
|
||||||
|
|
||||||
const nodeTree = ref<OrgTree[]>(); // ข้อมูล Tree
|
const nodeTree = ref<OrgTree[]>(); // ข้อมูล Tree
|
||||||
const nodeId = ref<string>(""); // id ของ Tree
|
const nodeId = ref<string>(""); // id ของ Tree
|
||||||
const orgLevel = ref<number>(0); // levelTree
|
const orgLevel = ref<number>(0); // levelTree
|
||||||
|
|
@ -97,12 +93,7 @@ async function fetchDataTable(id: string, level: number, action: boolean) {
|
||||||
reqMaster.page = 1;
|
reqMaster.page = 1;
|
||||||
reqMaster.pageSize = 10;
|
reqMaster.pageSize = 10;
|
||||||
reqMaster.keyword = "";
|
reqMaster.keyword = "";
|
||||||
reqMaster.revisionId =
|
reqMaster.revisionId = store.activeId;
|
||||||
store.typeOrganizational == "draft"
|
|
||||||
? store.draftId
|
|
||||||
: store.typeOrganizational == "current"
|
|
||||||
? store.activeId
|
|
||||||
: store.historyId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action === true) {
|
if (action === true) {
|
||||||
|
|
@ -183,36 +174,12 @@ function searchAndReplaceOrgName(data: any, targetId: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**lifecycle Hook*/
|
/**lifecycle Hook*/
|
||||||
onMounted(async () => {
|
onMounted(() => {
|
||||||
const id =
|
setTimeout(async () => {
|
||||||
store.typeOrganizational === "current"
|
store.activeId && (await fetchDataTree(store.activeId));
|
||||||
? store.activeId
|
}, 200);
|
||||||
: store.typeOrganizational === "draft"
|
|
||||||
? store.draftId
|
|
||||||
: historyId.value;
|
|
||||||
id && (await fetchDataTree(id));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/** callback function ทำงาน ทำการ fetch ข้อมูล Tree เมื่อมีการเลือกประวัติโครงสร้าง*/
|
|
||||||
watch(
|
|
||||||
() => count.value,
|
|
||||||
() => {
|
|
||||||
fetchDataTree(historyId.value);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
/** callblck function ทำการ fetch ข้อมูล Tree เมื่อมีการเปลี่ยนโครงสร้าง*/
|
|
||||||
watch(
|
|
||||||
() => store.typeOrganizational,
|
|
||||||
() => {
|
|
||||||
const id =
|
|
||||||
store.typeOrganizational === "current" ? store.activeId : store.draftId;
|
|
||||||
id && store.typeOrganizational !== "old" && fetchDataTree(id);
|
|
||||||
nodeId.value = "";
|
|
||||||
store.treeId = "";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
/** callblck function ทำการ fetch ข้อมูล Table เมื่อมีการเปลี่ยนหน้า*/
|
/** callblck function ทำการ fetch ข้อมูล Table เมื่อมีการเปลี่ยนหน้า*/
|
||||||
watch([() => reqMaster.page, () => reqMaster.pageSize], () => {
|
watch([() => reqMaster.page, () => reqMaster.pageSize], () => {
|
||||||
action1.value === false &&
|
action1.value === false &&
|
||||||
|
|
@ -231,13 +198,6 @@ watch(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
|
||||||
() => store.draftId,
|
|
||||||
() => {
|
|
||||||
store.draftId && fetchDataTree(store.draftId?.toString());
|
|
||||||
}
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -67,13 +67,9 @@ export const usePositionEmp = defineStore("positionEmpStore", () => {
|
||||||
function fetchPosMaster(data: PosMaster[]) {
|
function fetchPosMaster(data: PosMaster[]) {
|
||||||
const newPosMaster = data.map((e: PosMaster) => ({
|
const newPosMaster = data.map((e: PosMaster) => ({
|
||||||
...e,
|
...e,
|
||||||
positionIsSelected:
|
positionIsSelected: e.fullNameCurrentHolder
|
||||||
typeOrganizational.value === "draft" && e.fullNameNextHolder !== null
|
? e.fullNameCurrentHolder
|
||||||
? e.fullNameNextHolder
|
: "ว่าง",
|
||||||
: typeOrganizational.value !== "draft" &&
|
|
||||||
e.fullNameCurrentHolder !== null
|
|
||||||
? e.fullNameCurrentHolder
|
|
||||||
: "ว่าง",
|
|
||||||
posMasterNo:
|
posMasterNo:
|
||||||
e.orgShortname +
|
e.orgShortname +
|
||||||
e.posMasterNoPrefix +
|
e.posMasterNoPrefix +
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,6 @@ const $q = useQuasar();
|
||||||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||||
const store = usePositionEmp();
|
const store = usePositionEmp();
|
||||||
|
|
||||||
/** สถานะ*/
|
|
||||||
const isStatusData = ref<boolean>(false); // แสดงตั้งเวลาเผยแพร่
|
|
||||||
|
|
||||||
/** ประวัติโครงสร้าง*/
|
|
||||||
const historyId = ref<string>(""); // ID ประวัติโครงสร้าง
|
|
||||||
const count = ref<number>(0);
|
|
||||||
|
|
||||||
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง*/
|
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง*/
|
||||||
async function fetchOrganizationActive() {
|
async function fetchOrganizationActive() {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -32,20 +25,6 @@ async function fetchOrganizationActive() {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
if (data) {
|
if (data) {
|
||||||
store.fetchDataActive(data);
|
store.fetchDataActive(data);
|
||||||
if (data.activeName === null && data.draftName === null) {
|
|
||||||
isStatusData.value = false;
|
|
||||||
} else {
|
|
||||||
isStatusData.value = true;
|
|
||||||
if (isStatusData.value) {
|
|
||||||
if (data.activeName === null) {
|
|
||||||
// ishasActive.value = true;
|
|
||||||
store.typeOrganizational = "draft";
|
|
||||||
} else if (data.draftName === null) {
|
|
||||||
// ishasDraft.value = true;
|
|
||||||
store.typeOrganizational = "current";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -58,7 +37,6 @@ async function fetchOrganizationActive() {
|
||||||
|
|
||||||
/** lifecycleHook */
|
/** lifecycleHook */
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
store.typeOrganizational = "current";
|
|
||||||
await fetchOrganizationActive();
|
await fetchOrganizationActive();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -73,7 +51,7 @@ onMounted(async () => {
|
||||||
<q-card flat bordered>
|
<q-card flat bordered>
|
||||||
<q-card class="my-card">
|
<q-card class="my-card">
|
||||||
<q-card-section style="padding: 0px">
|
<q-card-section style="padding: 0px">
|
||||||
<TreeView v-model:historyId="historyId" v-model:count="count" />
|
<TreeView />
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue