Merge branch 'develop' into working
This commit is contained in:
commit
59efd8674b
34 changed files with 992 additions and 1512 deletions
|
|
@ -78,4 +78,8 @@ export default {
|
||||||
orgPosMasterListEmp: `${orgEmployeePos}/master/list`,
|
orgPosMasterListEmp: `${orgEmployeePos}/master/list`,
|
||||||
orgPosMasterEmp: `${orgEmployeePos}/master`,
|
orgPosMasterEmp: `${orgEmployeePos}/master`,
|
||||||
orgPosSortEmp: `${orgEmployeePos}/sort`,
|
orgPosSortEmp: `${orgEmployeePos}/sort`,
|
||||||
|
orgPosPositionEmpById: (id: string) => `${orgEmployeePos}/position/${id}`,
|
||||||
|
orgPosMoveEmp: `${orgEmployeePos}/move`,
|
||||||
|
orgProfileEmp: `${orgEmployeePos}/profile`,
|
||||||
|
orgSearchProfileEmp: `${orgProfile}-employee/search`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ import env from "../index";
|
||||||
const salary = `${env.API_URI}/salary`;
|
const salary = `${env.API_URI}/salary`;
|
||||||
const salaryRate = `${env.API_URI}/salary/rate`;
|
const salaryRate = `${env.API_URI}/salary/rate`;
|
||||||
const salaryPeriod = `${env.API_URI}/salary/period`;
|
const salaryPeriod = `${env.API_URI}/salary/period`;
|
||||||
|
|
||||||
const salaryOrg = `${env.API_URI}/org/employee`;
|
const salaryOrg = `${env.API_URI}/org/employee`;
|
||||||
|
const salaryFormula = `${env.API_URI}/salary/formula`;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
salaryChart: salary,
|
salaryChart: salary,
|
||||||
|
|
@ -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) =>
|
||||||
|
|
@ -45,5 +46,8 @@ export default {
|
||||||
salaryEmployeeRateListByid: (id: string) => `${salaryRate}/employee/${id}`,
|
salaryEmployeeRateListByid: (id: string) => `${salaryRate}/employee/${id}`,
|
||||||
|
|
||||||
salaryEmployeePosType:()=>`${salaryOrg}/pos/type`,
|
salaryEmployeePosType:()=>`${salaryOrg}/pos/type`,
|
||||||
salaryEmployeePositionType:(key:string)=>`${salaryOrg}/pos/position?keyword=${key}&type=positionType`
|
salaryFormula:()=>`${salaryFormula}`,
|
||||||
|
salaryFormulaById:(id:string)=>`${salaryFormula}/${id}`,
|
||||||
|
salaryEmployeePositionType:(key:string)=>`${salaryOrg}/pos/position?keyword=${key}&type=positionType`,
|
||||||
|
salaryEmployeeActive :()=>`${salary}/employee/active`
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,14 @@
|
||||||
import env from "../index";
|
import env from "../index";
|
||||||
|
|
||||||
export default {
|
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"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -216,26 +215,49 @@ async function addData() {
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData(id.value);
|
fetchData(id.value);
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, 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";
|
||||||
|
|
@ -382,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
|
||||||
|
|
@ -393,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"
|
||||||
>
|
>
|
||||||
|
|
@ -463,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,8 +95,6 @@ const visibleColumns = ref<string[]>([
|
||||||
"isActive",
|
"isActive",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// const row = ref([]);
|
|
||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ const props = defineProps({
|
||||||
type: Object,
|
type: Object,
|
||||||
defult: [],
|
defult: [],
|
||||||
},
|
},
|
||||||
|
getDataMain: Function,
|
||||||
// fetchData: {
|
// fetchData: {
|
||||||
// type: Function,
|
// type: Function,
|
||||||
// required: true,
|
// required: true,
|
||||||
|
|
@ -44,6 +45,7 @@ const props = defineProps({
|
||||||
|
|
||||||
const posTypeOp = ref<DataOptions[]>([]);
|
const posTypeOp = ref<DataOptions[]>([]);
|
||||||
const posNameOp = ref<DataOptions[]>([]);
|
const posNameOp = ref<DataOptions[]>([]);
|
||||||
|
const groupOldOp = ref<DataOptions[]>([]);
|
||||||
const posLevelOp = ref<any[]>([]);
|
const posLevelOp = ref<any[]>([]);
|
||||||
const posNameListOp = ref<DataListOptions[]>([]);
|
const posNameListOp = ref<DataListOptions[]>([]);
|
||||||
const formData = reactive<any>({
|
const formData = reactive<any>({
|
||||||
|
|
@ -53,7 +55,7 @@ const formData = reactive<any>({
|
||||||
posLevel: "", //ระดับชั้นงาน
|
posLevel: "", //ระดับชั้นงาน
|
||||||
reson: "", //หมายเหตุ
|
reson: "", //หมายเหตุ
|
||||||
rateOldMin: "", //อัตราค่าจ้าง ขั้นต่ำสุด
|
rateOldMin: "", //อัตราค่าจ้าง ขั้นต่ำสุด
|
||||||
groupOld: "", //อัตราค่าจ้าง กลุ่มบัญชีค่าจ้าง
|
groupOld: null, //อัตราค่าจ้าง กลุ่มบัญชีค่าจ้าง
|
||||||
rateMaxOld: "", //อัตราค่าจ้าง ขั้นสูงสุดเดิม
|
rateMaxOld: "", //อัตราค่าจ้าง ขั้นสูงสุดเดิม
|
||||||
groupRateHigh: "", //อัตราค่าจ้างสูงกว่าฯ กลุ่มบัญชีค่าจ่าง
|
groupRateHigh: "", //อัตราค่าจ้างสูงกว่าฯ กลุ่มบัญชีค่าจ่าง
|
||||||
rateHighMax: "", //อัตราค่าจ้างสูงกว่าฯ ขั้นสูงใหม่
|
rateHighMax: "", //อัตราค่าจ้างสูงกว่าฯ ขั้นสูงใหม่
|
||||||
|
|
@ -86,7 +88,6 @@ function closeDialog() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearFormData() {
|
function clearFormData() {
|
||||||
console.log(3);
|
|
||||||
isEdit.value = false;
|
isEdit.value = false;
|
||||||
formData.posType = "";
|
formData.posType = "";
|
||||||
formData.posName = "";
|
formData.posName = "";
|
||||||
|
|
@ -116,35 +117,39 @@ function onClickSubmit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, async () => {
|
||||||
showLoader();
|
// showLoader();
|
||||||
const body = {
|
const body = {
|
||||||
posType: formData.posType,
|
posTypeId: formData.posType.id,
|
||||||
posName: formData.posName,
|
position: formData.posName,
|
||||||
posLevel: formData.posLevel,
|
posLevelId: formData.posLevel.id,
|
||||||
reson: formData.reson,
|
details: formData.reson,
|
||||||
rateOldMin:
|
salaryMin:
|
||||||
typeof formData.rateOldMin === "string"
|
typeof formData.rateOldMin === "string"
|
||||||
? Number(formData.rateOldMin.replace(/,/g, ""))
|
? Number(formData.rateOldMin.replace(/,/g, ""))
|
||||||
: formData.rateOldMin,
|
: formData.rateOldMin,
|
||||||
groupOld: formData.groupOld,
|
salaryEmployeeMinIds: formData.groupOld.map(
|
||||||
rateMaxOld:
|
(group: DataOptions) => group.id
|
||||||
|
),
|
||||||
|
salary:
|
||||||
typeof formData.rateMaxOld === "string"
|
typeof formData.rateMaxOld === "string"
|
||||||
? Number(formData.rateMaxOld.replace(/,/g, ""))
|
? Number(formData.rateMaxOld.replace(/,/g, ""))
|
||||||
: formData.rateMaxOld,
|
: formData.rateMaxOld,
|
||||||
groupRateHigh: formData.groupRateHigh,
|
salaryEmployeeId: formData.groupRateHigh,
|
||||||
rateHighMax:
|
salaryMax:
|
||||||
typeof formData.rateHighMax === "string"
|
typeof formData.rateHighMax === "string"
|
||||||
? Number(formData.rateHighMax.replace(/,/g, ""))
|
? Number(formData.rateHighMax.replace(/,/g, ""))
|
||||||
: formData.rateHighMax,
|
: formData.rateHighMax,
|
||||||
};
|
};
|
||||||
const url = !isEdit
|
|
||||||
? config.API.salaryEmployeeRateList
|
const url = !isEdit.value
|
||||||
: config.API.salaryEmployeeRateListByid(formData.id);
|
? config.API.salaryFormula()
|
||||||
http[!isEdit ? "post" : "put"](url, body)
|
: config.API.salaryFormulaById(formData.id);
|
||||||
|
await http[!isEdit.value ? "post" : "put"](url, body)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
closeDialog();
|
closeDialog();
|
||||||
|
props.getDataMain?.();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -176,7 +181,6 @@ function getPosType() {
|
||||||
http
|
http
|
||||||
.get(config.API.salaryEmployeePosType())
|
.get(config.API.salaryEmployeePosType())
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res.data.result);
|
|
||||||
const dataOp = res.data.result;
|
const dataOp = res.data.result;
|
||||||
posTypeOp.value = dataOp.map((item: any) => ({
|
posTypeOp.value = dataOp.map((item: any) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
|
|
@ -197,15 +201,43 @@ function getPosName() {
|
||||||
formData.posLevel = "";
|
formData.posLevel = "";
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.salaryEmployeePositionType(formData.posType))
|
.get(config.API.salaryEmployeePositionType(formData.posType.name))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const dataOp = res.data.result;
|
const dataOp = res.data.result;
|
||||||
posNameListOp.value = res.data.result;
|
posNameListOp.value = res.data.result;
|
||||||
posNameOp.value = dataOp.filter((item: DataListOptions) => item.posDictName).map((i:DataListOptions)=>({
|
posNameOp.value = [
|
||||||
id:i.id,
|
...new Map(
|
||||||
name:i.posDictName
|
dataOp.map((i: DataListOptions) => [i.posDictName, i])
|
||||||
|
).values(),
|
||||||
|
].map((i: any) => ({
|
||||||
|
id: i.id,
|
||||||
|
name: i.posDictName,
|
||||||
}));
|
}));
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ดึงข้อมูล ตำแหน่ง */
|
||||||
|
function getPosNameEdit() {
|
||||||
|
showLoader();
|
||||||
|
http
|
||||||
|
.get(config.API.salaryEmployeePositionType(formData.posType.name))
|
||||||
|
.then((res) => {
|
||||||
|
const dataOp = res.data.result;
|
||||||
|
posNameListOp.value = res.data.result;
|
||||||
|
posNameOp.value = [
|
||||||
|
...new Map(
|
||||||
|
dataOp.map((i: DataListOptions) => [i.posDictName, i])
|
||||||
|
).values(),
|
||||||
|
].map((i: any) => ({
|
||||||
|
id: i.id,
|
||||||
|
name: i.posDictName,
|
||||||
|
}));
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -219,34 +251,76 @@ function getPosLevel() {
|
||||||
formData.posLevel = "";
|
formData.posLevel = "";
|
||||||
posLevelOp.value = posNameListOp.value
|
posLevelOp.value = posNameListOp.value
|
||||||
.filter((item) => item.posDictName === formData.posName)
|
.filter((item) => item.posDictName === formData.posName)
|
||||||
.map((i) => ({ id: i.id, name: i.posLevelName }));
|
.map((i) => ({ id: i.posLevelId, name: i.posLevelName }))
|
||||||
|
.sort((a, b) => a.name - b.name);
|
||||||
|
if (posLevelOp.value.length == 1) {
|
||||||
|
formData.posLevel = posLevelOp.value[0].id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** ดึงข้อมูล ระดับชั้นงาน */
|
||||||
|
function getPosLevelEdit() {
|
||||||
|
console.log(1);
|
||||||
|
console.log(posNameListOp.value);
|
||||||
|
|
||||||
|
posLevelOp.value = posNameListOp.value
|
||||||
|
.filter((item) => item.posDictName === formData.posName)
|
||||||
|
.map((i) => ({ id: i.posLevelId, name: i.posLevelName }))
|
||||||
|
.sort((a, b) => a.name - b.name);
|
||||||
|
if (posLevelOp.value.length == 1) {
|
||||||
|
formData.posLevel = posLevelOp.value[0].id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getSalaryGroup() {
|
||||||
|
http
|
||||||
|
.get(config.API.salaryEmployeeActive())
|
||||||
|
.then((res) => {
|
||||||
|
const list = res.data.result;
|
||||||
|
const data = list.sort((a: any, b: any) => a.group - b.group);
|
||||||
|
groupOldOp.value = data.map((item: any) => ({
|
||||||
|
id: item.id,
|
||||||
|
name: item.name,
|
||||||
|
}));
|
||||||
|
console.log(groupOldOp.value);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getDataEdit() {
|
||||||
|
http.get(config.API.salaryFormula() + `/${formData.id}`).then(async (res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
formData.posType = posTypeOp.value.find((a: any) => a.id == data.posTypeId);
|
||||||
|
formData.posName = data.position;
|
||||||
|
getPosNameEdit();
|
||||||
|
setTimeout(() => {
|
||||||
|
getPosLevelEdit();
|
||||||
|
formData.posLevel = posLevelOp.value.find(
|
||||||
|
(item: any) => item.id == data.posLevelId
|
||||||
|
);
|
||||||
|
formData.reson = data.details;
|
||||||
|
formData.rateOldMin = data.salaryMin;
|
||||||
|
formData.groupOld = groupOldOp.value.filter((b: any) =>
|
||||||
|
data.salaryEmployeeMinIds.includes(b.id)
|
||||||
|
);
|
||||||
|
formData.rateMaxOld = data.salary;
|
||||||
|
formData.groupRateHigh = data.salaryEmployeeId;
|
||||||
|
formData.rateHighMax = data.salaryMax;
|
||||||
|
}, 200);
|
||||||
|
});
|
||||||
|
}
|
||||||
watch(
|
watch(
|
||||||
() => modal.value,
|
() => modal.value,
|
||||||
(check) => {
|
async (check) => {
|
||||||
if (check) {
|
if (check) {
|
||||||
getPosType();
|
await getPosType();
|
||||||
|
await getSalaryGroup();
|
||||||
|
|
||||||
if (isEdit.value) {
|
if (isEdit.value) {
|
||||||
formData.id = props.data?.id ? props.data.id : null;
|
formData.id = props.data?.id ? props.data.id : null;
|
||||||
formData.posType = props.data?.posType ? props.data.posType : null;
|
getDataEdit();
|
||||||
formData.posName = props.data?.posName ? props.data.posName : null;
|
|
||||||
formData.posLevel = props.data?.posLevel ? props.data.posLevel : null;
|
|
||||||
formData.reson = props.data?.reson ? props.data.reson : null;
|
|
||||||
formData.rateOldMin = props.data?.rateOldMin
|
|
||||||
? props.data.rateOldMin
|
|
||||||
: null;
|
|
||||||
formData.groupOld = props.data?.groupOld ? props.data.groupOld : null;
|
|
||||||
formData.rateMaxOld = props.data?.rateMaxOld
|
|
||||||
? props.data.rateMaxOld
|
|
||||||
: null;
|
|
||||||
formData.groupRateHigh = props.data?.groupRateHigh
|
|
||||||
? props.data.groupRateHigh
|
|
||||||
: null;
|
|
||||||
formData.rateHighMax = props.data?.rateHighMax
|
|
||||||
? props.data.rateHighMax
|
|
||||||
: null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -275,14 +349,13 @@ watch(
|
||||||
:rules="[(val) => !!val || 'กรุณาเลือกกลุ่มงาน']"
|
:rules="[(val) => !!val || 'กรุณาเลือกกลุ่มงาน']"
|
||||||
:options="posTypeOp"
|
:options="posTypeOp"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="name"
|
option-value="id"
|
||||||
emit-value
|
map-options
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
@update:model-value="getPosName()"
|
@update:model-value="getPosName()"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<q-select
|
<q-select
|
||||||
ref="posNameRef"
|
ref="posNameRef"
|
||||||
|
|
@ -301,7 +374,6 @@ watch(
|
||||||
@update:model-value="getPosLevel()"
|
@update:model-value="getPosLevel()"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<q-select
|
<q-select
|
||||||
:readonly="formData.posName"
|
:readonly="formData.posName"
|
||||||
|
|
@ -311,8 +383,8 @@ watch(
|
||||||
v-model="formData.posLevel"
|
v-model="formData.posLevel"
|
||||||
:options="posLevelOp"
|
:options="posLevelOp"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="name"
|
option-value="id"
|
||||||
emit-value
|
map-options
|
||||||
label="ระดับชั้นงาน"
|
label="ระดับชั้นงาน"
|
||||||
:rules="[(val) => !!val || 'กรุณาเลือกระดับชั้นงาน']"
|
:rules="[(val) => !!val || 'กรุณาเลือกระดับชั้นงาน']"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
|
|
@ -351,15 +423,18 @@ watch(
|
||||||
ref="groupOldRef"
|
ref="groupOldRef"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
multiple
|
||||||
v-model="formData.groupOld"
|
v-model="formData.groupOld"
|
||||||
label="กลุ่มของผังบัญชีอัตราค่าจ้าง"
|
label="กลุ่มของผังบัญชีอัตราค่าจ้าง"
|
||||||
mask="###,###,###,###"
|
|
||||||
reverse-fill-mask
|
|
||||||
:rules="[
|
:rules="[
|
||||||
(val) =>
|
(val) =>
|
||||||
!!val ||
|
!!val ||
|
||||||
`${'กรุณาเลือกอัตราค่าจ้าง กลุ่มของผังบัญชีอัตราค่าจ้าง'}`,
|
`${'กรุณาเลือกอัตราค่าจ้าง กลุ่มของผังบัญชีอัตราค่าจ้าง'}`,
|
||||||
]"
|
]"
|
||||||
|
:options="groupOldOp"
|
||||||
|
map-options
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
/>
|
/>
|
||||||
|
|
@ -391,12 +466,15 @@ watch(
|
||||||
outlined
|
outlined
|
||||||
v-model="formData.groupRateHigh"
|
v-model="formData.groupRateHigh"
|
||||||
label="กลุ่มบัญชีค่าจ้าง"
|
label="กลุ่มบัญชีค่าจ้าง"
|
||||||
mask="###,###,###,###"
|
|
||||||
reverse-fill-mask
|
|
||||||
:rules="[
|
:rules="[
|
||||||
(val) => !!val || `${'กรุณากรอกเลือกกลุ่มบัญชีค่าจ้าง'}`,
|
(val) => !!val || `${'กรุณากรอกเลือกกลุ่มบัญชีค่าจ้าง'}`,
|
||||||
]"
|
]"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
|
:options="groupOldOp"
|
||||||
|
map-options
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
emit-value
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive } from "vue";
|
import { ref, reactive, onMounted, watch } from "vue";
|
||||||
|
|
||||||
|
import type {
|
||||||
|
ListData,
|
||||||
|
ResponseData,
|
||||||
|
} from "@/modules/13_salary/interface/index/EmployeeChart";
|
||||||
|
import type { NewPagination } from "@/modules/13_salary/interface/index/Main";
|
||||||
import DialogFormCriteria from "@/modules/13_salary/components/salaryEmployeeChart/DialogFormCriteria.vue";
|
import DialogFormCriteria from "@/modules/13_salary/components/salaryEmployeeChart/DialogFormCriteria.vue";
|
||||||
|
|
||||||
/** importType*/
|
/** importType*/
|
||||||
|
|
@ -9,7 +14,11 @@ import { useQuasar } from "quasar";
|
||||||
|
|
||||||
/** importStore*/
|
/** importStore*/
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
import { br } from "@fullcalendar/core/internal-common";
|
||||||
|
|
||||||
|
const maxPage = ref<number>(1);
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const {
|
const {
|
||||||
date2Thai,
|
date2Thai,
|
||||||
|
|
@ -127,21 +136,7 @@ const visibleColumns = ref<string[]>([
|
||||||
"reson",
|
"reson",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const rows = ref<any>([
|
const rows = ref<ListData[]>([]);
|
||||||
{
|
|
||||||
id: "1",
|
|
||||||
posType: "ช่าง",
|
|
||||||
posName: "ผู้ช่วยช่างทั่วไป",
|
|
||||||
posLevel: "ช 1",
|
|
||||||
rateOldMin: 7690,
|
|
||||||
groupOld: "กลุ่มที่ 1",
|
|
||||||
rateMaxOld: 17880,
|
|
||||||
groupRateHigh: "กลุ่มที่ 1",
|
|
||||||
rateHighMax: 20000,
|
|
||||||
reson: "",
|
|
||||||
isActive: true,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
const formFilter = reactive({
|
const formFilter = reactive({
|
||||||
page: 1,
|
page: 1,
|
||||||
|
|
@ -151,7 +146,7 @@ const formFilter = reactive({
|
||||||
|
|
||||||
function filterFn() {
|
function filterFn() {
|
||||||
formFilter.page = 1;
|
formFilter.page = 1;
|
||||||
// fetchListData();
|
getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
|
|
@ -162,27 +157,81 @@ const pagination = ref({
|
||||||
const modalForm = ref<boolean>(false);
|
const modalForm = ref<boolean>(false);
|
||||||
const isStatusEdit = ref<boolean>(false);
|
const isStatusEdit = ref<boolean>(false);
|
||||||
const dataRow = ref<any>({});
|
const dataRow = ref<any>({});
|
||||||
|
|
||||||
|
function getData() {
|
||||||
|
showLoader();
|
||||||
|
http
|
||||||
|
.get(
|
||||||
|
config.API.salaryFormula() +
|
||||||
|
`/?page=${formFilter.page}&pageSize=${formFilter.pageSize}&keyword=${formFilter.keyword}`
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res.data.result);
|
||||||
|
const data = res.data.result.data;
|
||||||
|
const total = res.data.result.total;
|
||||||
|
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
|
||||||
|
rows.value = data.map((item: ResponseData) => ({
|
||||||
|
id: item.id,
|
||||||
|
posType: item.posType,
|
||||||
|
posName: item.position,
|
||||||
|
posLevel: item.posLevel,
|
||||||
|
rateOldMin: item.salaryMin,
|
||||||
|
groupOld: item.salaryEmployeeMin.sort((a,b)=>a -b),
|
||||||
|
rateMaxOld: item.salary,
|
||||||
|
groupRateHigh: item.group,
|
||||||
|
rateHighMax: item.salaryMax,
|
||||||
|
reson: item.details,
|
||||||
|
}));
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
// messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function editPopup(params: any) {
|
function editPopup(params: any) {
|
||||||
modalForm.value = true;
|
modalForm.value = true;
|
||||||
isStatusEdit.value = true;
|
isStatusEdit.value = true;
|
||||||
console.log(params);
|
console.log(params);
|
||||||
|
|
||||||
dataRow.value = params
|
dataRow.value = params;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updatePage(val: number) {
|
||||||
|
formFilter.page = val;
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
function updatePageSize(newPagination: NewPagination) {
|
||||||
|
formFilter.page = 1;
|
||||||
|
formFilter.pageSize = newPagination.rowsPerPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClickDelete(id: string) {
|
function onClickDelete(id: string) {
|
||||||
dialogRemove($q, () => {
|
dialogRemove($q, () => {
|
||||||
// http
|
http
|
||||||
// .delete(config.API.salaryEmployeeChartByid(id))
|
.delete(config.API.salaryFormula()+`/${id}`)
|
||||||
// .then(() => {
|
.then(() => {
|
||||||
// fetchListChart();
|
getData();
|
||||||
// success($q, "ลบข้อมูลสำเร็จ");
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
// })
|
})
|
||||||
// .catch((err) => {
|
.catch((err) => {
|
||||||
// messageError($q, err);
|
messageError($q, err);
|
||||||
// });
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
watch(
|
||||||
|
() => formFilter.pageSize,
|
||||||
|
() => {
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getData();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -229,8 +278,9 @@ function onClickDelete(id: string) {
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
row-key="name"
|
row-key="name"
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
:rows-per-page-options="[10, 20, 50, 100]"
|
:rows-per-page-options="[1, 20, 50, 100]"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
|
@update:pagination="updatePageSize"
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
|
|
@ -266,8 +316,17 @@ function onClickDelete(id: string) {
|
||||||
>
|
>
|
||||||
{{ col.value ? col.value.toLocaleString() : "-" }}
|
{{ col.value ? col.value.toLocaleString() : "-" }}
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else-if="col.name == 'groupOld'">
|
||||||
|
|
||||||
|
<span v-for="item,index in col.value">
|
||||||
|
|
||||||
|
{{ item }}{{index+1 == col.value.length ?'':','}}
|
||||||
|
</span>
|
||||||
|
<!-- {{ col.value }} -->
|
||||||
|
</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>
|
||||||
<q-btn
|
<q-btn
|
||||||
flat
|
flat
|
||||||
|
|
@ -305,24 +364,26 @@ function onClickDelete(id: string) {
|
||||||
</q-td>
|
</q-td>
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<!-- <template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
<q-pagination
|
<q-pagination
|
||||||
v-model="formFilter.page"
|
v-model="formFilter.page"
|
||||||
active-color="primary"
|
active-color="primary"
|
||||||
color="dark"
|
color="dark"
|
||||||
:max="1"
|
:max="maxPage"
|
||||||
:max-pages="5"
|
:max-pages="5"
|
||||||
size="sm"
|
size="sm"
|
||||||
boundary-links
|
boundary-links
|
||||||
direction-links
|
direction-links
|
||||||
|
@update:model-value="updatePage"
|
||||||
></q-pagination>
|
></q-pagination>
|
||||||
</template> -->
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
|
|
||||||
<DialogFormCriteria
|
<DialogFormCriteria
|
||||||
v-model:modal="modalForm"
|
v-model:modal="modalForm"
|
||||||
v-model:isStatusEdit="isStatusEdit"
|
v-model:isStatusEdit="isStatusEdit"
|
||||||
:data="dataRow"
|
:data="dataRow"
|
||||||
|
:get-data-Main="getData"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,28 +6,53 @@ interface ObjectCharRef {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ObjectReteRef {
|
interface ObjectReteRef {
|
||||||
posType: object|null
|
posType: object | null
|
||||||
posName: object|null
|
posName: object | null
|
||||||
posLevel: object|null
|
posLevel: object | null
|
||||||
rateOldMin: object|null
|
rateOldMin: object | null
|
||||||
groupOld: object|null
|
groupOld: object | null
|
||||||
rateMaxOld: object|null
|
rateMaxOld: object | null
|
||||||
groupRateHigh: object|null
|
groupRateHigh: object | null
|
||||||
rateHighMax: object|null
|
rateHighMax: object | null
|
||||||
|
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DataOptions {
|
interface DataOptions {
|
||||||
id:string
|
id: string
|
||||||
name:string
|
name: string
|
||||||
}
|
}
|
||||||
interface DataListOptions {
|
interface DataListOptions {
|
||||||
id:string
|
id: string
|
||||||
posDictName:string
|
posDictName: string
|
||||||
posTypeId:string
|
posTypeId: string
|
||||||
posTypeName:string
|
posTypeName: string
|
||||||
posLevelId:string
|
posLevelId: string
|
||||||
posLevelName:number
|
posLevelName: number
|
||||||
}
|
}
|
||||||
export type { ObjectCharRef, ObjectReteRef,DataOptions,DataListOptions };
|
|
||||||
|
interface ListData {
|
||||||
|
id: string
|
||||||
|
posType: string
|
||||||
|
posName: string
|
||||||
|
posLevel: string
|
||||||
|
rateOldMin: string
|
||||||
|
groupOld: Array<number>
|
||||||
|
rateMaxOld: string
|
||||||
|
groupRateHigh: string
|
||||||
|
rateHighMax: string
|
||||||
|
reson: string
|
||||||
|
}
|
||||||
|
interface ResponseData {
|
||||||
|
id: string
|
||||||
|
posLevel: string
|
||||||
|
position: string
|
||||||
|
posType: string
|
||||||
|
details: string
|
||||||
|
salaryMin: string
|
||||||
|
salary: string
|
||||||
|
salaryMax: string
|
||||||
|
group: string
|
||||||
|
salaryEmployeeMin: Array<number>
|
||||||
|
}
|
||||||
|
export type { ObjectCharRef, ObjectReteRef, DataOptions, DataListOptions, ListData,ResponseData };
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -544,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'">
|
||||||
{{
|
{{
|
||||||
|
|
@ -592,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)"
|
||||||
|
|
@ -612,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)"
|
||||||
|
|
@ -632,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
|
||||||
|
|
@ -681,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
|
||||||
|
|
@ -178,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 &&
|
||||||
|
|
@ -226,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