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`,
|
||||
orgPosMasterEmp: `${orgEmployeePos}/master`,
|
||||
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 salaryRate = `${env.API_URI}/salary/rate`;
|
||||
const salaryPeriod = `${env.API_URI}/salary/period`;
|
||||
|
||||
const salaryOrg = `${env.API_URI}/org/employee`;
|
||||
const salaryFormula = `${env.API_URI}/salary/formula`;
|
||||
|
||||
export default {
|
||||
salaryChart: salary,
|
||||
|
|
@ -20,6 +20,7 @@ export default {
|
|||
salaryRateListByid: (id: string) => `${salaryRate}/${id}`,
|
||||
salaryReportByid: (id: string) => `${salary}/report/${id}`,
|
||||
salaryPeriod: () => `${salary}/period`,
|
||||
salaryPeriodActive: () => `${salary}/period/active`,
|
||||
|
||||
/** รายการเงินเดือน*/
|
||||
keycloakPositionByid: (id: string) =>
|
||||
|
|
@ -45,5 +46,8 @@ export default {
|
|||
salaryEmployeeRateListByid: (id: string) => `${salaryRate}/employee/${id}`,
|
||||
|
||||
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";
|
||||
|
||||
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 */
|
||||
import profile from "./api/registry/api.profile";
|
||||
import registry from "./api/registry/api.registry";
|
||||
|
||||
/** API Report2 List */
|
||||
import report2 from "./api/recruiting/api.report2";
|
||||
|
|
@ -98,6 +99,7 @@ const API = {
|
|||
|
||||
//profile
|
||||
...profile,
|
||||
...registry,
|
||||
|
||||
//report2
|
||||
...report2,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { ref, onMounted } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
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 dialogHeader from "@/components/DialogHeader.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 config from "@/app.config";
|
||||
const store = useInsigniaDataStore();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
// const props = defineProps({
|
||||
// fetchData: {
|
||||
// type: Function,
|
||||
// default: () => "",
|
||||
// },
|
||||
// });
|
||||
const insigniaTypeName = defineModel<string>("insigniaTypeName", {
|
||||
required: true,
|
||||
});
|
||||
|
||||
const { dialogRemove, dialogConfirm, showLoader, hideLoader, messageError } =
|
||||
mixin;
|
||||
const {
|
||||
dialogRemove,
|
||||
dialogConfirm,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
} = mixin;
|
||||
const $q = useQuasar();
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
@ -216,26 +215,49 @@ async function addData() {
|
|||
})
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function editData(idData: string) {
|
||||
await http.put(config.API.insigniaNewIdOrg(idData), {
|
||||
name: name.value,
|
||||
isActive: isActive.value,
|
||||
shortName: shortName.value,
|
||||
note: note.value == "" ? "-" : note.value,
|
||||
insigniaTypeId: id.value,
|
||||
});
|
||||
fetchData(id.value);
|
||||
await http
|
||||
.put(config.API.insigniaNewIdOrg(idData), {
|
||||
name: name.value,
|
||||
isActive: isActive.value,
|
||||
shortName: shortName.value,
|
||||
note: note.value == "" ? "-" : note.value,
|
||||
insigniaTypeId: id.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteData(idData: string) {
|
||||
await http.delete(config.API.insigniaNewIdOrg(idData));
|
||||
fetchData(id.value);
|
||||
await http
|
||||
.delete(config.API.insigniaNewIdOrg(idData))
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
import { defineEmits } from "vue";
|
||||
|
|
@ -382,7 +404,7 @@ const dialogOrder = ref<boolean>(false);
|
|||
</d-table>
|
||||
|
||||
<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">
|
||||
<q-card-section class="flex justify-between" style="padding: 0">
|
||||
<dialog-header
|
||||
|
|
@ -393,55 +415,59 @@ const dialogOrder = ref<boolean>(false);
|
|||
|
||||
<q-separator color="grey-4" />
|
||||
<q-card-section class="q-pa-none">
|
||||
<q-input
|
||||
outlined
|
||||
:model-value="insigniaTypeId"
|
||||
label="ลำดับชั้นเครื่องราชฯ"
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
class="col-12 bg-white q-ma-md"
|
||||
hide-bottom-space
|
||||
readonly
|
||||
/>
|
||||
<q-input
|
||||
ref="nameRef"
|
||||
outlined
|
||||
v-model="name"
|
||||
label="ชื่อเครื่องราชฯ"
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
class="col-12 bg-white q-ma-md"
|
||||
:rules="[
|
||||
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
||||
]"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<q-input
|
||||
ref="shortNameRef"
|
||||
outlined
|
||||
v-model="shortName"
|
||||
label="ชื่อย่อ"
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
class="col-12 bg-white q-ma-md"
|
||||
:rules="[
|
||||
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
||||
]"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<q-input
|
||||
outlined
|
||||
v-model="note"
|
||||
label="หมายเหตุ"
|
||||
dense
|
||||
type="textarea"
|
||||
borderless
|
||||
class="col-12 bg-white q-ma-md"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<div class="col-12 q-ma-md">
|
||||
<q-input
|
||||
outlined
|
||||
:model-value="insigniaTypeId"
|
||||
label="ลำดับชั้นเครื่องราชฯ"
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
hide-bottom-space
|
||||
readonly
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 q-ma-md">
|
||||
<q-input
|
||||
ref="nameRef"
|
||||
outlined
|
||||
v-model="name"
|
||||
label="ชื่อเครื่องราชฯ"
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
:rules="[
|
||||
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
||||
]"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 q-ma-md">
|
||||
<q-input
|
||||
ref="shortNameRef"
|
||||
outlined
|
||||
v-model="shortName"
|
||||
label="ชื่อย่อ"
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
:rules="[
|
||||
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
||||
]"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 q-ma-md">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="note"
|
||||
label="หมายเหตุ"
|
||||
dense
|
||||
type="textarea"
|
||||
borderless
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
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
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
class="q-px-md"
|
||||
>
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
|
|
@ -95,8 +95,6 @@ const visibleColumns = ref<string[]>([
|
|||
"isActive",
|
||||
]);
|
||||
|
||||
// const row = ref([]);
|
||||
|
||||
async function fetchData() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -125,24 +123,53 @@ function onclickDetail(id: string) {
|
|||
}
|
||||
|
||||
async function addData() {
|
||||
await http.post(config.API.insigniaTypeOrg, {
|
||||
name: name.value,
|
||||
isActive: isActive.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.post(config.API.insigniaTypeOrg, {
|
||||
name: name.value,
|
||||
isActive: isActive.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function editData(id: string) {
|
||||
await http.put(config.API.insigniaTypeNewIdOrg(id), {
|
||||
name: name.value,
|
||||
isActive: isActive.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.put(config.API.insigniaTypeNewIdOrg(id), {
|
||||
name: name.value,
|
||||
isActive: isActive.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteData(id: string) {
|
||||
await http.delete(config.API.insigniaTypeNewIdOrg(id));
|
||||
fetchData();
|
||||
await http
|
||||
.delete(config.API.insigniaTypeNewIdOrg(id))
|
||||
.then(() => {
|
||||
fetchData();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function validateForm() {
|
||||
|
|
@ -287,7 +314,7 @@ async function onSubmit() {
|
|||
</d-table>
|
||||
|
||||
<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">
|
||||
<q-card-section class="flex justify-between" style="padding: 0">
|
||||
<dialog-header
|
||||
|
|
@ -298,20 +325,21 @@ async function onSubmit() {
|
|||
|
||||
<q-separator color="grey-4" />
|
||||
<q-card-section class="q-pa-none">
|
||||
<q-input
|
||||
ref="nameRef"
|
||||
outlined
|
||||
v-model="name"
|
||||
label="ลำดับชั้นเครื่องราชฯ"
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
class="col-12 bg-white q-ma-md"
|
||||
:rules="[
|
||||
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
||||
]"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<div class="col-12 q-ma-md">
|
||||
<q-input
|
||||
ref="nameRef"
|
||||
outlined
|
||||
v-model="name"
|
||||
label="ลำดับชั้นเครื่องราชฯ"
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
:rules="[
|
||||
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
|
||||
]"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium"
|
||||
>
|
||||
|
|
@ -333,7 +361,6 @@ async function onSubmit() {
|
|||
unelevated
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
class="q-px-md"
|
||||
>
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ const TABLE_COLUMNS = [
|
|||
const $q = useQuasar();
|
||||
const store = usePersonalDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogRemove, messageError, showLoader, hideLoader } = mixin;
|
||||
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||
|
||||
const filterKeyword = ref<string>("");
|
||||
const dialog = ref<boolean>(false);
|
||||
|
|
@ -72,36 +72,11 @@ const visibleColumns = ref<string[]>([
|
|||
"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() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgPrefix)
|
||||
.then(async (res) => {
|
||||
console.log(res.data.result);
|
||||
store.save(res.data.result);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -113,22 +88,51 @@ async function fetchData() {
|
|||
}
|
||||
|
||||
async function addData() {
|
||||
await http.post(config.API.orgPrefix, {
|
||||
name: prefix.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.post(config.API.orgPrefix, {
|
||||
name: prefix.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function editData(id: string) {
|
||||
await http.put(config.API.orgPrefixId(id), {
|
||||
name: prefix.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.put(config.API.orgPrefixId(id), {
|
||||
name: prefix.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteData(id: string) {
|
||||
await http.delete(config.API.orgPrefixId(id));
|
||||
fetchData();
|
||||
await http
|
||||
.delete(config.API.orgPrefixId(id))
|
||||
.then(() => {
|
||||
fetchData();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ const columns = [
|
|||
const store = usePersonalDataStore();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogRemove, messageError, showLoader, hideLoader } = mixin;
|
||||
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||
|
||||
const $q = useQuasar();
|
||||
|
||||
|
|
@ -81,7 +81,6 @@ async function fetchData() {
|
|||
await http
|
||||
.get(config.API.orgRank)
|
||||
.then(async (res) => {
|
||||
console.log(res.data.result);
|
||||
store.save(res.data.result);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -93,22 +92,51 @@ async function fetchData() {
|
|||
}
|
||||
|
||||
async function addData() {
|
||||
await http.post(config.API.orgRank, {
|
||||
name: rank.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.post(config.API.orgRank, {
|
||||
name: rank.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function editData(id: string) {
|
||||
await http.put(config.API.orgRankId(id), {
|
||||
name: rank.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.put(config.API.orgRankId(id), {
|
||||
name: rank.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteData(id: string) {
|
||||
await http.delete(config.API.orgRankId(id));
|
||||
fetchData();
|
||||
await http
|
||||
.delete(config.API.orgRankId(id))
|
||||
.then(() => {
|
||||
fetchData();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import config from "@/app.config";
|
|||
const store = usePersonalDataStore();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogRemove, messageError, showLoader, hideLoader } = mixin;
|
||||
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||
const columns = [
|
||||
{
|
||||
name: "bloodGroup",
|
||||
|
|
@ -81,7 +81,6 @@ async function fetchData() {
|
|||
await http
|
||||
.get(config.API.orgBloodGroup)
|
||||
.then(async (res) => {
|
||||
console.log(res.data.result);
|
||||
store.save(res.data.result);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -93,22 +92,51 @@ async function fetchData() {
|
|||
}
|
||||
|
||||
async function addData() {
|
||||
await http.post(config.API.orgBloodGroup, {
|
||||
name: bloodGroup.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.post(config.API.orgBloodGroup, {
|
||||
name: bloodGroup.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function editData(id: string) {
|
||||
await http.put(config.API.orgBloodGroupId(id), {
|
||||
name: bloodGroup.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.put(config.API.orgBloodGroupId(id), {
|
||||
name: bloodGroup.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteData(id: string) {
|
||||
await http.delete(config.API.orgBloodGroupId(id));
|
||||
fetchData();
|
||||
await http
|
||||
.delete(config.API.orgBloodGroupId(id))
|
||||
.then(() => {
|
||||
fetchData();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import config from "@/app.config";
|
|||
const store = usePersonalDataStore();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogRemove, messageError, showLoader, hideLoader } = mixin;
|
||||
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||
const columns = [
|
||||
{
|
||||
name: "gender",
|
||||
|
|
@ -81,7 +81,6 @@ async function fetchData() {
|
|||
await http
|
||||
.get(config.API.orgGender)
|
||||
.then(async (res) => {
|
||||
console.log(res.data.result);
|
||||
store.save(res.data.result);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -93,22 +92,51 @@ async function fetchData() {
|
|||
}
|
||||
|
||||
async function addData() {
|
||||
await http.post(config.API.orgGender, {
|
||||
name: gender.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.post(config.API.orgGender, {
|
||||
name: gender.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function editData(id: string) {
|
||||
await http.put(config.API.orgGenderId(id), {
|
||||
name: gender.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.put(config.API.orgGenderId(id), {
|
||||
name: gender.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteData(id: string) {
|
||||
await http.delete(config.API.orgGenderId(id));
|
||||
fetchData();
|
||||
await http
|
||||
.delete(config.API.orgGenderId(id))
|
||||
.then(() => {
|
||||
fetchData();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import config from "@/app.config";
|
|||
const store = usePersonalDataStore();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogRemove, messageError, showLoader, hideLoader } = mixin;
|
||||
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||
const columns = [
|
||||
{
|
||||
name: "religion",
|
||||
|
|
@ -81,7 +81,6 @@ async function fetchData() {
|
|||
await http
|
||||
.get(config.API.orgReligion)
|
||||
.then(async (res) => {
|
||||
console.log(res.data.result);
|
||||
store.save(res.data.result);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -93,22 +92,51 @@ async function fetchData() {
|
|||
}
|
||||
|
||||
async function addData() {
|
||||
await http.post(config.API.orgReligion, {
|
||||
name: religion.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.post(config.API.orgReligion, {
|
||||
name: religion.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function editData(id: string) {
|
||||
await http.put(config.API.orgReligionId(id), {
|
||||
name: religion.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.put(config.API.orgReligionId(id), {
|
||||
name: religion.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteData(id: string) {
|
||||
await http.delete(config.API.orgReligionId(id));
|
||||
fetchData();
|
||||
await http
|
||||
.delete(config.API.orgReligionId(id))
|
||||
.then(() => {
|
||||
fetchData();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import config from "@/app.config";
|
|||
const store = usePersonalDataStore();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogRemove, messageError, showLoader, hideLoader } = mixin;
|
||||
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||
const columns = [
|
||||
{
|
||||
name: "relationship",
|
||||
|
|
@ -110,7 +110,6 @@ async function fetchData() {
|
|||
await http
|
||||
.get(config.API.orgRelationship)
|
||||
.then(async (res) => {
|
||||
console.log(res.data.result);
|
||||
store.save(res.data.result);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -122,22 +121,50 @@ async function fetchData() {
|
|||
}
|
||||
|
||||
async function addData() {
|
||||
await http.post(config.API.orgRelationship, {
|
||||
name: relationship.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.post(config.API.orgRelationship, {
|
||||
name: relationship.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function editData(id: string) {
|
||||
await http.put(config.API.orgRelationshipId(id), {
|
||||
name: relationship.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.put(config.API.orgRelationshipId(id), {
|
||||
name: relationship.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteData(id: string) {
|
||||
await http.delete(config.API.orgRelationshipId(id));
|
||||
fetchData();
|
||||
await http
|
||||
.delete(config.API.orgRelationshipId(id))
|
||||
.then(() => {
|
||||
fetchData();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import config from "@/app.config";
|
|||
|
||||
const store = usePersonalDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogRemove, messageError, showLoader, hideLoader } = mixin;
|
||||
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||
const columns = [
|
||||
{
|
||||
name: "name",
|
||||
|
|
@ -91,7 +91,6 @@ async function fetchData() {
|
|||
await http
|
||||
.get(config.API.orgEducationLevel)
|
||||
.then(async (res) => {
|
||||
console.log(res.data.result);
|
||||
store.save(res.data.result);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -103,24 +102,53 @@ async function fetchData() {
|
|||
}
|
||||
|
||||
async function addData() {
|
||||
await http.post(config.API.orgEducationLevel, {
|
||||
name: educationLevel.value,
|
||||
rank: educationRank.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.post(config.API.orgEducationLevel, {
|
||||
name: educationLevel.value,
|
||||
rank: educationRank.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function editData(id: string) {
|
||||
await http.put(config.API.orgEducationLevelId(id), {
|
||||
name: educationLevel.value,
|
||||
rank: educationRank.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.put(config.API.orgEducationLevelId(id), {
|
||||
name: educationLevel.value,
|
||||
rank: educationRank.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteData(id: string) {
|
||||
await http.delete(config.API.orgEducationLevelId(id));
|
||||
fetchData();
|
||||
await http
|
||||
.delete(config.API.orgEducationLevelId(id))
|
||||
.then(() => {
|
||||
fetchData();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ async function onSubmit() {
|
|||
|
||||
<template>
|
||||
<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">
|
||||
<q-card-section class="flex justify-between" style="padding: 0">
|
||||
<dialog-header
|
||||
|
|
@ -74,37 +74,39 @@ async function onSubmit() {
|
|||
|
||||
<q-separator color="grey-4" />
|
||||
<q-card-section class="q-pa-none">
|
||||
<q-input
|
||||
ref="dataRef"
|
||||
outlined
|
||||
v-model="data"
|
||||
:label="personalName"
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
class="col-12 bg-white q-ma-md"
|
||||
:rules="[(val) => val.length > 0 || 'กรุณากรอก' + personalName]"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<div class="col-12 q-ma-md">
|
||||
<q-input
|
||||
ref="dataRef"
|
||||
outlined
|
||||
v-model="data"
|
||||
:label="personalName"
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
:rules="[(val) => val.length > 0 || 'กรุณากรอก' + personalName]"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-card-section
|
||||
class="q-pa-none"
|
||||
v-if="personalName === 'ระดับการศึกษา'"
|
||||
>
|
||||
<q-input
|
||||
ref="educationRankRef"
|
||||
outlined
|
||||
v-model="educationRank"
|
||||
label="ลำดับ"
|
||||
dense
|
||||
type="number"
|
||||
lazy-rules
|
||||
borderless
|
||||
min="1"
|
||||
class="col-12 bg-white q-ma-md"
|
||||
:rules="[(val) => val != undefined || 'กรุณากรอกลำดับ']"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<div class="col-12 q-ma-md">
|
||||
<q-input
|
||||
ref="educationRankRef"
|
||||
outlined
|
||||
v-model="educationRank"
|
||||
label="ลำดับ"
|
||||
dense
|
||||
type="number"
|
||||
lazy-rules
|
||||
borderless
|
||||
min="1"
|
||||
:rules="[(val) => val != undefined || 'กรุณากรอกลำดับ']"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right">
|
||||
|
|
@ -115,7 +117,6 @@ async function onSubmit() {
|
|||
unelevated
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
class="q-px-md"
|
||||
>
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
|
|
@ -103,33 +103,19 @@ const objectLevelRef: ObjectLevelRef = {
|
|||
posLevelAuthority: commanderRef,
|
||||
};
|
||||
|
||||
function fetchPosGroup() {
|
||||
const id = ref<string>(route.params.id.toString());
|
||||
|
||||
function fetchData() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgEmployeeType)
|
||||
.get(config.API.orgEmployeeTypeById(id.value))
|
||||
.then((res) => {
|
||||
const data: ResGroup[] = res.data.result;
|
||||
const group = data.find((e: ResGroup) => e.id === posTypeId.value);
|
||||
|
||||
titleName.value = group?.posTypeName ?? null;
|
||||
})
|
||||
.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 : [];
|
||||
titleName.value = res.data.result.posTypeName ?? null;
|
||||
formDataLevel.posTypeName = res.data.result.posTypeName;
|
||||
rows.value = res.data.result.posLevels.map((x: any) => ({
|
||||
...x,
|
||||
posTypeName: res.data.result.posTypeName,
|
||||
}));
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -148,7 +134,7 @@ function onClickOpenDialog(statusEdit: boolean = false, data: any = []) {
|
|||
if (statusEdit) {
|
||||
levelId.value = data.id;
|
||||
formDataLevel.posLevelName = data.posLevelName;
|
||||
formDataLevel.posTypeName = data.posTypeName;
|
||||
formDataLevel.posTypeName = titleName.value;
|
||||
formDataLevel.posLevelAuthority = data.posLevelAuthority;
|
||||
} else {
|
||||
formDataLevel.posTypeName = titleName.value ? titleName.value : "";
|
||||
|
|
@ -194,7 +180,7 @@ async function submit() {
|
|||
: config.API.orgEmployeelevelById(levelId.value);
|
||||
await http[!isStatusEdit.value ? "post" : "put"](url, body);
|
||||
success($q, "บันทีกข้อมูลสำเร็จ");
|
||||
fetchData(posTypeId.value);
|
||||
fetchData();
|
||||
onClickCloseDialog();
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
|
|
@ -209,7 +195,7 @@ function onClickDelete(id: string) {
|
|||
.delete(config.API.orgEmployeelevelById(id))
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
fetchData(posTypeId.value);
|
||||
fetchData();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -223,8 +209,7 @@ function convertPosLevelAuthority(val: string) {
|
|||
}
|
||||
|
||||
onMounted(() => {
|
||||
posTypeId.value && fetchData(posTypeId.value);
|
||||
fetchPosGroup();
|
||||
posTypeId.value && fetchData();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -85,16 +85,10 @@ const filterKeyword = ref<string>("");
|
|||
const dialog = ref<boolean>(false);
|
||||
const posTypeName = ref<string>("");
|
||||
const posTypeNameRef = ref<QInput | null>(null);
|
||||
const posTypeRank = ref<number | undefined>();
|
||||
const posTypeRank = ref<number | null>(null);
|
||||
const posTypeRankRef = ref<QInput | null>(null);
|
||||
const dialogStatus = ref<string>("");
|
||||
const visibleColumns = ref<string[]>([
|
||||
"posTypeName",
|
||||
"posTypeRank",
|
||||
// "createdAt",
|
||||
// "lastUpdatedAt",
|
||||
// "lastUpdateFullName",
|
||||
]);
|
||||
const visibleColumns = ref<string[]>(["posTypeName", "posTypeRank"]);
|
||||
|
||||
async function fetchData() {
|
||||
showLoader();
|
||||
|
|
@ -112,24 +106,53 @@ async function fetchData() {
|
|||
}
|
||||
|
||||
async function addData() {
|
||||
await http.post(config.API.orgPosType, {
|
||||
posTypeName: posTypeName.value,
|
||||
posTypeRank: posTypeRank.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.post(config.API.orgPosType, {
|
||||
posTypeName: posTypeName.value,
|
||||
posTypeRank: posTypeRank.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function editData(id: string) {
|
||||
await http.put(config.API.orgPosTypeId(id), {
|
||||
posTypeName: posTypeName.value,
|
||||
posTypeRank: posTypeRank.value,
|
||||
});
|
||||
fetchData();
|
||||
await http
|
||||
.put(config.API.orgPosTypeId(id), {
|
||||
posTypeName: posTypeName.value,
|
||||
posTypeRank: posTypeRank.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteData(id: string) {
|
||||
await http.delete(config.API.orgPosTypeId(id));
|
||||
fetchData();
|
||||
await http
|
||||
.delete(config.API.orgPosTypeId(id))
|
||||
.then(() => {
|
||||
fetchData();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
@ -151,14 +174,14 @@ function validateForm() {
|
|||
}
|
||||
|
||||
async function onSubmit() {
|
||||
if (posTypeName.value.length > 0) {
|
||||
if (posTypeName.value.length > 0 && posTypeRank.value !== null) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
dialogStatus.value === "create" ? addData() : editData(editId.value);
|
||||
closeDialog();
|
||||
posTypeName.value = "";
|
||||
posTypeRank.value = undefined;
|
||||
posTypeRank.value = null;
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||
|
|
@ -276,7 +299,7 @@ async function onSubmit() {
|
|||
</d-table>
|
||||
|
||||
<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">
|
||||
<q-card-section class="flex justify-between" style="padding: 0">
|
||||
<dialog-header
|
||||
|
|
@ -287,32 +310,34 @@ async function onSubmit() {
|
|||
|
||||
<q-separator color="grey-4" />
|
||||
<q-card-section class="q-pa-none">
|
||||
<q-input
|
||||
ref="posTypeNameRef"
|
||||
outlined
|
||||
v-model="posTypeName"
|
||||
label="ประเภทตำแหน่ง"
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
class="col-12 bg-white q-ma-md"
|
||||
:rules="[(val) => val.length > 0 || 'กรุณากรอกประเภทตำแหน่ง']"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<q-input
|
||||
ref="posTypeRankRef"
|
||||
outlined
|
||||
v-model="posTypeRank"
|
||||
label="ระดับ"
|
||||
dense
|
||||
type="number"
|
||||
lazy-rules
|
||||
borderless
|
||||
min="1"
|
||||
class="col-12 bg-white q-ma-md"
|
||||
:rules="[(val) => val != undefined || 'กรุณากรอกระดับ']"
|
||||
hide-bottom-space
|
||||
/>
|
||||
<div class="col-12 q-ma-md">
|
||||
<q-input
|
||||
ref="posTypeNameRef"
|
||||
outlined
|
||||
v-model="posTypeName"
|
||||
label="ประเภทตำแหน่ง"
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
:rules="[(val) => val.length > 0 || 'กรุณากรอกประเภทตำแหน่ง']"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 q-ma-md">
|
||||
<q-input
|
||||
ref="posTypeRankRef"
|
||||
outlined
|
||||
v-model="posTypeRank"
|
||||
label="ระดับ"
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
min="1"
|
||||
:rules="[(val) => val != undefined || 'กรุณากรอกระดับ']"
|
||||
hide-bottom-space
|
||||
mask="############"
|
||||
/>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right">
|
||||
|
|
|
|||
|
|
@ -13,16 +13,23 @@ import config from "@/app.config";
|
|||
const store = usePositionDataStore();
|
||||
const storeOption = useMainOptionDataStore();
|
||||
const storeName = usePositionTypeDataStore();
|
||||
const router = useRouter();
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
const posName = defineModel<string>("posName", {
|
||||
required: true,
|
||||
});
|
||||
|
||||
const { dialogRemove, dialogConfirm, showLoader, hideLoader, messageError } =
|
||||
mixin;
|
||||
const {
|
||||
dialogRemove,
|
||||
dialogConfirm,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
} = mixin;
|
||||
const $q = useQuasar();
|
||||
|
||||
const columns = [
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -123,20 +130,15 @@ const editId = ref<string>("");
|
|||
const posLevelName = ref<string>("");
|
||||
const posLevelRank = ref<number>();
|
||||
const posLevelAuthority = ref<string>("");
|
||||
const posTypeId = ref<null>();
|
||||
const posLevelNameRef = ref<QInput | null>(null);
|
||||
const posLevelRankRef = ref<QInput | null>(null);
|
||||
const posTypeIdRef = ref<QInput | null>(null);
|
||||
const name = ref<string>("");
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"posTypeName",
|
||||
"posLevelName",
|
||||
"posLevelRank",
|
||||
"posLevelAuthority",
|
||||
// "createdAt",
|
||||
// "lastUpdatedAt",
|
||||
// "lastUpdateFullName",
|
||||
]);
|
||||
|
||||
async function fetchData() {
|
||||
|
|
@ -165,9 +167,13 @@ async function addData() {
|
|||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -182,9 +188,13 @@ async function editData(editId: string) {
|
|||
})
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -196,19 +206,12 @@ async function deleteData(id: string) {
|
|||
})
|
||||
.catch((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() {
|
||||
dialog.value = false;
|
||||
}
|
||||
|
|
@ -240,6 +243,11 @@ async function fetchName() {
|
|||
.get(config.API.orgPosType)
|
||||
.then(async (res) => {
|
||||
storeName.save(res.data.result);
|
||||
storeName.row.forEach((e) => {
|
||||
if (e.id === id.value) {
|
||||
posName.value = e.posTypeName ? e.posTypeName : "";
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -248,6 +256,11 @@ async function fetchName() {
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
fetchName();
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -398,13 +411,13 @@ async function fetchName() {
|
|||
v-model="posLevelRank"
|
||||
label="ระดับ"
|
||||
dense
|
||||
type="number"
|
||||
lazy-rules
|
||||
borderless
|
||||
min="1"
|
||||
bg-color="white"
|
||||
:rules="[(val) => val != undefined || 'กรุณากรอกระดับ']"
|
||||
:rules="[(val) => val != null || 'กรุณากรอกระดับ']"
|
||||
hide-bottom-space
|
||||
mask="############"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ interface FrmDataGroup {
|
|||
|
||||
interface FormDataLevel {
|
||||
posLevelName: number | null;
|
||||
posTypeName: string | undefined;
|
||||
posTypeName: string | null;
|
||||
posLevelAuthority: string;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ const props = defineProps({
|
|||
type: Object,
|
||||
defult: [],
|
||||
},
|
||||
getDataMain: Function,
|
||||
// fetchData: {
|
||||
// type: Function,
|
||||
// required: true,
|
||||
|
|
@ -44,6 +45,7 @@ const props = defineProps({
|
|||
|
||||
const posTypeOp = ref<DataOptions[]>([]);
|
||||
const posNameOp = ref<DataOptions[]>([]);
|
||||
const groupOldOp = ref<DataOptions[]>([]);
|
||||
const posLevelOp = ref<any[]>([]);
|
||||
const posNameListOp = ref<DataListOptions[]>([]);
|
||||
const formData = reactive<any>({
|
||||
|
|
@ -53,7 +55,7 @@ const formData = reactive<any>({
|
|||
posLevel: "", //ระดับชั้นงาน
|
||||
reson: "", //หมายเหตุ
|
||||
rateOldMin: "", //อัตราค่าจ้าง ขั้นต่ำสุด
|
||||
groupOld: "", //อัตราค่าจ้าง กลุ่มบัญชีค่าจ้าง
|
||||
groupOld: null, //อัตราค่าจ้าง กลุ่มบัญชีค่าจ้าง
|
||||
rateMaxOld: "", //อัตราค่าจ้าง ขั้นสูงสุดเดิม
|
||||
groupRateHigh: "", //อัตราค่าจ้างสูงกว่าฯ กลุ่มบัญชีค่าจ่าง
|
||||
rateHighMax: "", //อัตราค่าจ้างสูงกว่าฯ ขั้นสูงใหม่
|
||||
|
|
@ -86,7 +88,6 @@ function closeDialog() {
|
|||
}
|
||||
|
||||
function clearFormData() {
|
||||
console.log(3);
|
||||
isEdit.value = false;
|
||||
formData.posType = "";
|
||||
formData.posName = "";
|
||||
|
|
@ -116,35 +117,39 @@ function onClickSubmit() {
|
|||
}
|
||||
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
showLoader();
|
||||
dialogConfirm($q, async () => {
|
||||
// showLoader();
|
||||
const body = {
|
||||
posType: formData.posType,
|
||||
posName: formData.posName,
|
||||
posLevel: formData.posLevel,
|
||||
reson: formData.reson,
|
||||
rateOldMin:
|
||||
posTypeId: formData.posType.id,
|
||||
position: formData.posName,
|
||||
posLevelId: formData.posLevel.id,
|
||||
details: formData.reson,
|
||||
salaryMin:
|
||||
typeof formData.rateOldMin === "string"
|
||||
? Number(formData.rateOldMin.replace(/,/g, ""))
|
||||
: formData.rateOldMin,
|
||||
groupOld: formData.groupOld,
|
||||
rateMaxOld:
|
||||
salaryEmployeeMinIds: formData.groupOld.map(
|
||||
(group: DataOptions) => group.id
|
||||
),
|
||||
salary:
|
||||
typeof formData.rateMaxOld === "string"
|
||||
? Number(formData.rateMaxOld.replace(/,/g, ""))
|
||||
: formData.rateMaxOld,
|
||||
groupRateHigh: formData.groupRateHigh,
|
||||
rateHighMax:
|
||||
salaryEmployeeId: formData.groupRateHigh,
|
||||
salaryMax:
|
||||
typeof formData.rateHighMax === "string"
|
||||
? Number(formData.rateHighMax.replace(/,/g, ""))
|
||||
: formData.rateHighMax,
|
||||
};
|
||||
const url = !isEdit
|
||||
? config.API.salaryEmployeeRateList
|
||||
: config.API.salaryEmployeeRateListByid(formData.id);
|
||||
http[!isEdit ? "post" : "put"](url, body)
|
||||
|
||||
const url = !isEdit.value
|
||||
? config.API.salaryFormula()
|
||||
: config.API.salaryFormulaById(formData.id);
|
||||
await http[!isEdit.value ? "post" : "put"](url, body)
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
props.getDataMain?.();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -176,7 +181,6 @@ function getPosType() {
|
|||
http
|
||||
.get(config.API.salaryEmployeePosType())
|
||||
.then((res) => {
|
||||
console.log(res.data.result);
|
||||
const dataOp = res.data.result;
|
||||
posTypeOp.value = dataOp.map((item: any) => ({
|
||||
id: item.id,
|
||||
|
|
@ -197,15 +201,43 @@ function getPosName() {
|
|||
formData.posLevel = "";
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.salaryEmployeePositionType(formData.posType))
|
||||
.get(config.API.salaryEmployeePositionType(formData.posType.name))
|
||||
.then((res) => {
|
||||
const dataOp = res.data.result;
|
||||
posNameListOp.value = res.data.result;
|
||||
posNameOp.value = dataOp.filter((item: DataListOptions) => item.posDictName).map((i:DataListOptions)=>({
|
||||
id:i.id,
|
||||
name:i.posDictName
|
||||
posNameOp.value = [
|
||||
...new Map(
|
||||
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) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -219,34 +251,76 @@ function getPosLevel() {
|
|||
formData.posLevel = "";
|
||||
posLevelOp.value = posNameListOp.value
|
||||
.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(
|
||||
() => modal.value,
|
||||
(check) => {
|
||||
async (check) => {
|
||||
if (check) {
|
||||
getPosType();
|
||||
await getPosType();
|
||||
await getSalaryGroup();
|
||||
|
||||
if (isEdit.value) {
|
||||
formData.id = props.data?.id ? props.data.id : null;
|
||||
formData.posType = props.data?.posType ? props.data.posType : null;
|
||||
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;
|
||||
getDataEdit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -275,14 +349,13 @@ watch(
|
|||
:rules="[(val) => !!val || 'กรุณาเลือกกลุ่มงาน']"
|
||||
:options="posTypeOp"
|
||||
option-label="name"
|
||||
option-value="name"
|
||||
emit-value
|
||||
option-value="id"
|
||||
map-options
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
@update:model-value="getPosName()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<q-select
|
||||
ref="posNameRef"
|
||||
|
|
@ -301,7 +374,6 @@ watch(
|
|||
@update:model-value="getPosLevel()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<q-select
|
||||
:readonly="formData.posName"
|
||||
|
|
@ -311,8 +383,8 @@ watch(
|
|||
v-model="formData.posLevel"
|
||||
:options="posLevelOp"
|
||||
option-label="name"
|
||||
option-value="name"
|
||||
emit-value
|
||||
option-value="id"
|
||||
map-options
|
||||
label="ระดับชั้นงาน"
|
||||
:rules="[(val) => !!val || 'กรุณาเลือกระดับชั้นงาน']"
|
||||
lazy-rules
|
||||
|
|
@ -351,15 +423,18 @@ watch(
|
|||
ref="groupOldRef"
|
||||
dense
|
||||
outlined
|
||||
multiple
|
||||
v-model="formData.groupOld"
|
||||
label="กลุ่มของผังบัญชีอัตราค่าจ้าง"
|
||||
mask="###,###,###,###"
|
||||
reverse-fill-mask
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val ||
|
||||
`${'กรุณาเลือกอัตราค่าจ้าง กลุ่มของผังบัญชีอัตราค่าจ้าง'}`,
|
||||
]"
|
||||
:options="groupOldOp"
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
/>
|
||||
|
|
@ -391,12 +466,15 @@ watch(
|
|||
outlined
|
||||
v-model="formData.groupRateHigh"
|
||||
label="กลุ่มบัญชีค่าจ้าง"
|
||||
mask="###,###,###,###"
|
||||
reverse-fill-mask
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณากรอกเลือกกลุ่มบัญชีค่าจ้าง'}`,
|
||||
]"
|
||||
lazy-rules
|
||||
:options="groupOldOp"
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
emit-value
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
<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";
|
||||
|
||||
/** importType*/
|
||||
|
|
@ -9,7 +14,11 @@ import { useQuasar } from "quasar";
|
|||
|
||||
/** importStore*/
|
||||
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 {
|
||||
date2Thai,
|
||||
|
|
@ -127,21 +136,7 @@ const visibleColumns = ref<string[]>([
|
|||
"reson",
|
||||
]);
|
||||
|
||||
const rows = ref<any>([
|
||||
{
|
||||
id: "1",
|
||||
posType: "ช่าง",
|
||||
posName: "ผู้ช่วยช่างทั่วไป",
|
||||
posLevel: "ช 1",
|
||||
rateOldMin: 7690,
|
||||
groupOld: "กลุ่มที่ 1",
|
||||
rateMaxOld: 17880,
|
||||
groupRateHigh: "กลุ่มที่ 1",
|
||||
rateHighMax: 20000,
|
||||
reson: "",
|
||||
isActive: true,
|
||||
},
|
||||
]);
|
||||
const rows = ref<ListData[]>([]);
|
||||
|
||||
const formFilter = reactive({
|
||||
page: 1,
|
||||
|
|
@ -151,7 +146,7 @@ const formFilter = reactive({
|
|||
|
||||
function filterFn() {
|
||||
formFilter.page = 1;
|
||||
// fetchListData();
|
||||
getData();
|
||||
}
|
||||
|
||||
const pagination = ref({
|
||||
|
|
@ -162,27 +157,81 @@ const pagination = ref({
|
|||
const modalForm = ref<boolean>(false);
|
||||
const isStatusEdit = ref<boolean>(false);
|
||||
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) {
|
||||
modalForm.value = true;
|
||||
isStatusEdit.value = true;
|
||||
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) {
|
||||
dialogRemove($q, () => {
|
||||
// http
|
||||
// .delete(config.API.salaryEmployeeChartByid(id))
|
||||
// .then(() => {
|
||||
// fetchListChart();
|
||||
// success($q, "ลบข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// messageError($q, err);
|
||||
// });
|
||||
http
|
||||
.delete(config.API.salaryFormula()+`/${id}`)
|
||||
.then(() => {
|
||||
getData();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
});
|
||||
}
|
||||
watch(
|
||||
() => formFilter.pageSize,
|
||||
() => {
|
||||
getData();
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -229,8 +278,9 @@ function onClickDelete(id: string) {
|
|||
:columns="columns"
|
||||
row-key="name"
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[10, 20, 50, 100]"
|
||||
:rows-per-page-options="[1, 20, 50, 100]"
|
||||
:visible-columns="visibleColumns"
|
||||
@update:pagination="updatePageSize"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
|
|
@ -266,8 +316,17 @@ function onClickDelete(id: string) {
|
|||
>
|
||||
{{ col.value ? col.value.toLocaleString() : "-" }}
|
||||
</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>
|
||||
</q-td>
|
||||
|
||||
<q-td>
|
||||
<q-btn
|
||||
flat
|
||||
|
|
@ -305,24 +364,26 @@ function onClickDelete(id: string) {
|
|||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<!-- <template v-slot:pagination="scope">
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="formFilter.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="1"
|
||||
:max="maxPage"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
@update:model-value="updatePage"
|
||||
></q-pagination>
|
||||
</template> -->
|
||||
</template>
|
||||
</d-table>
|
||||
|
||||
<DialogFormCriteria
|
||||
v-model:modal="modalForm"
|
||||
v-model:isStatusEdit="isStatusEdit"
|
||||
:data="dataRow"
|
||||
:get-data-Main="getData"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,28 +6,53 @@ interface ObjectCharRef {
|
|||
}
|
||||
|
||||
interface ObjectReteRef {
|
||||
posType: object|null
|
||||
posName: object|null
|
||||
posLevel: object|null
|
||||
rateOldMin: object|null
|
||||
groupOld: object|null
|
||||
rateMaxOld: object|null
|
||||
groupRateHigh: object|null
|
||||
rateHighMax: object|null
|
||||
posType: object | null
|
||||
posName: object | null
|
||||
posLevel: object | null
|
||||
rateOldMin: object | null
|
||||
groupOld: object | null
|
||||
rateMaxOld: object | null
|
||||
groupRateHigh: object | null
|
||||
rateHighMax: object | null
|
||||
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface DataOptions {
|
||||
id:string
|
||||
name:string
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
interface DataListOptions {
|
||||
id:string
|
||||
posDictName:string
|
||||
posTypeId:string
|
||||
posTypeName:string
|
||||
posLevelId:string
|
||||
posLevelName:number
|
||||
id: string
|
||||
posDictName: string
|
||||
posTypeId: string
|
||||
posTypeName: string
|
||||
posLevelId: string
|
||||
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();
|
||||
http
|
||||
.get(
|
||||
config.API.salaryPeriod() +
|
||||
config.API.salaryPeriodActive() +
|
||||
`?page=${page.value}&pageSize=${pageSize.value}&keyword=&year=0`
|
||||
)
|
||||
.then(async (res) => {
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ const itemMenu = ref<ItemsMenu[]>([
|
|||
|
||||
const formFilter = reactive<FormFilter>({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 100,
|
||||
keyword: "",
|
||||
});
|
||||
const maxPage = ref<number>(1);
|
||||
|
|
@ -90,6 +90,17 @@ const pagination = ref({
|
|||
page: formFilter.page,
|
||||
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() {
|
||||
showLoader();
|
||||
|
|
@ -179,6 +190,7 @@ watch(
|
|||
|
||||
onMounted(() => {
|
||||
fetchSalalyEmployeeRate();
|
||||
fetchDataDetail();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
|
@ -199,7 +211,7 @@ onMounted(() => {
|
|||
</div>
|
||||
<q-card flat bordered class="q-pa-md">
|
||||
<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-btn>
|
||||
<q-space />
|
||||
|
|
@ -243,13 +255,14 @@ onMounted(() => {
|
|||
:rows-per-page-options="[10, 20, 50, 100]"
|
||||
:visible-columns="visibleColumns"
|
||||
@update:pagination="updatePageSize"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<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-th auto-width />
|
||||
<q-th auto-width v-if="!isActive" />
|
||||
</q-tr>
|
||||
<q-separator />
|
||||
</template>
|
||||
|
|
@ -264,7 +277,7 @@ onMounted(() => {
|
|||
</div>
|
||||
<div v-else>{{ col.value ? col.value : "-" }}</div>
|
||||
</q-td>
|
||||
<q-td>
|
||||
<q-td v-if="!isActive">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ function getRound() {
|
|||
showLoader();
|
||||
http
|
||||
.get(
|
||||
config.API.salaryPeriod() +
|
||||
config.API.salaryPeriodActive() +
|
||||
`?page=${page.value}&pageSize=${pageSize.value}&keyword=&year=0`
|
||||
)
|
||||
.then(async (res) => {
|
||||
|
|
|
|||
|
|
@ -154,13 +154,17 @@ const visibleColumns = ref<string[]>([
|
|||
async function fetchPosition(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgPosPositionById(id))
|
||||
.get(config.API.orgPosPositionEmpById(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
|
||||
formData.prefixNo = data.posMasterNoPrefix;
|
||||
formData.positionNo = data.posMasterNo;
|
||||
formData.suffixNo = data.posMasterNoSuffix;
|
||||
rows.value = data.positions;
|
||||
rows.value = data.positions.map((e: any) => ({
|
||||
...e,
|
||||
posDictName: e.positionName,
|
||||
}));
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -306,6 +310,8 @@ function deletePos(id: string) {
|
|||
|
||||
function clearFormPositionSelect() {
|
||||
isDisValidate.value = true;
|
||||
search.value = "";
|
||||
type.value = "positionName";
|
||||
|
||||
setTimeout(() => {
|
||||
isDisValidate.value = false;
|
||||
|
|
@ -315,12 +321,12 @@ function clearFormPositionSelect() {
|
|||
function close() {
|
||||
props.close?.();
|
||||
isPosition.value = false;
|
||||
clearFormPositionSelect();
|
||||
}
|
||||
|
||||
async function emitSearch(keyword: string, typeSelect: string) {
|
||||
search.value = await keyword;
|
||||
type.value = await typeSelect;
|
||||
|
||||
search.value = keyword;
|
||||
type.value = typeSelect;
|
||||
await searchInput();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,10 +84,8 @@ const isDisable = computed(() => {
|
|||
|
||||
function onClickMovePos() {
|
||||
if (selectedTree.value === "" || selectedTree.value === null) {
|
||||
console.log("เลือกหน่วยงาน");
|
||||
dialogMessageNotify($q, "กรุณาเลือกหน่วยงานที่จะย้ายไป");
|
||||
} else if (selectedFilter.value.length === 0) {
|
||||
console.log("เลือกตำแห่นง");
|
||||
dialogMessageNotify($q, "กรุณาเลือกตำแห่นงที่จะย้าย");
|
||||
} else {
|
||||
dialogConfirm(
|
||||
|
|
@ -101,9 +99,9 @@ function onClickMovePos() {
|
|||
};
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.orgPosMove, body)
|
||||
.post(config.API.orgPosMoveEmp, body)
|
||||
.then(() => {
|
||||
props.fetchDataTree?.(store.draftId);
|
||||
props.fetchDataTree?.(store.activeId);
|
||||
modal.value = false;
|
||||
success($q, "ย้ายตำแหน่งสำเร็จ");
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,28 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from "vue";
|
||||
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*/
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational";
|
||||
|
||||
/**use*/
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const store = usePositionEmp();
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
|
||||
/**Props*/
|
||||
const modal = defineModel<boolean>("positionDetail", { required: true });
|
||||
|
|
@ -30,144 +13,10 @@ const prosp = defineProps({
|
|||
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 close() {
|
||||
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>
|
||||
<template>
|
||||
<template>
|
||||
|
|
@ -177,146 +26,48 @@ watch(
|
|||
<q-separator />
|
||||
<q-card-section>
|
||||
<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>
|
||||
<p>เลขที่ตำแหน่ง</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-8 text-grey-8">
|
||||
<p>{{ formData.positionNo }}</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>
|
||||
<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>{{ 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>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
|
|
|
|||
|
|
@ -99,25 +99,17 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "positionName",
|
||||
align: "left",
|
||||
label: "ตำแหน่งในสายงาน",
|
||||
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: "ประเภทตำเเหน่ง",
|
||||
label: "กลุ่มงาน",
|
||||
sortable: true,
|
||||
field: "posTypeName",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -126,39 +118,12 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "posLevelName",
|
||||
align: "left",
|
||||
label: "ระดับตำแหน่ง",
|
||||
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 columnsResult = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
@ -188,28 +153,29 @@ const columnsResult = ref<QTableProps["columns"]>([
|
|||
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: "positionName",
|
||||
align: "left",
|
||||
label: "ตำแหน่งในสายงาน",
|
||||
label: "ตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "positionName",
|
||||
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: "ระดับตำแหน่ง",
|
||||
label: "ระดับชั้นงาน",
|
||||
sortable: true,
|
||||
field: "posLevelName",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -228,7 +194,7 @@ function close() {
|
|||
async function fetchType() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgPosType)
|
||||
.get(config.API.orgEmployeeType)
|
||||
.then((res) => {
|
||||
dataLevel.value = res.data.result;
|
||||
typeOpsMain.value = res.data.result.map((e: OptionType) => ({
|
||||
|
|
@ -291,7 +257,7 @@ function onSubmit() {
|
|||
};
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.orgProfile, body)
|
||||
.post(config.API.orgProfileEmp, body)
|
||||
.then(() => {
|
||||
props.fetchDataTable?.(store.treeId, store.level, false);
|
||||
props.getSummary();
|
||||
|
|
@ -327,7 +293,7 @@ async function searchData() {
|
|||
keyword: formData.personal, //นามสกุล ชื่อ สกุล เลขบัตร
|
||||
};
|
||||
await http
|
||||
.post(config.API.orgSearchProfile, reqBody)
|
||||
.post(config.API.orgSearchProfileEmp, reqBody)
|
||||
.then((res) => {
|
||||
totalPage.value = Math.ceil(res.data.result.total / pageSize.value);
|
||||
const list = res.data.result.data.map((e: SelectPerson) => ({
|
||||
|
|
@ -543,7 +509,7 @@ watch([() => page.value, () => pageSize.value], () => {
|
|||
dense
|
||||
outlined
|
||||
for="#position"
|
||||
label="ตำแหน่งในสายงาน"
|
||||
label="ตำแหน่ง"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
/>
|
||||
|
|
@ -552,7 +518,7 @@ watch([() => page.value, () => pageSize.value], () => {
|
|||
<q-select
|
||||
ref="positionTypeRef"
|
||||
:class="inputEdit(isReadonly)"
|
||||
label="ประเภทตำแหน่ง"
|
||||
label="กลุ่มงาน"
|
||||
v-model="formData.positionType"
|
||||
:options="typeOps"
|
||||
emit-value
|
||||
|
|
@ -576,7 +542,7 @@ watch([() => page.value, () => pageSize.value], () => {
|
|||
<q-select
|
||||
ref="positionLevelRef"
|
||||
:class="inputEdit(isReadonly)"
|
||||
label="ระดับตำแหน่ง"
|
||||
label="ระดับชั่นงาน"
|
||||
v-model="formData.positionLevel"
|
||||
:disable="formData.positionType == ''"
|
||||
:options="levelOps"
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ async function fetchTree() {
|
|||
await http
|
||||
.get(config.API.orgByid(id))
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
nodeTree.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -163,7 +162,6 @@ function onClickConfirm() {
|
|||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
console.log(props.rowId, selectedPos.value[0].id);
|
||||
const body: Inherit = {
|
||||
draftPositionId: props.rowId,
|
||||
publishPositionId: selectedPos.value[0].id,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
|
||||
/** importType*/
|
||||
import type { ListMenu } from "@/modules/16_positionEmployee/interface/index/Main";
|
||||
|
||||
import type { OrgTree } from "@/modules/16_positionEmployee/interface/response/organizational";
|
||||
import type { DataTree } from "@/modules/16_positionEmployee/interface/index/organizational";
|
||||
|
||||
|
|
@ -16,14 +16,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
/** use*/
|
||||
const $q = useQuasar();
|
||||
const store = usePositionEmp();
|
||||
const {
|
||||
dialogRemove,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
date2Thai,
|
||||
} = useCounterMixin();
|
||||
const {} = useCounterMixin();
|
||||
|
||||
/** props*/
|
||||
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 nodes = ref<Array<OrgTree>>([]);
|
||||
const dataSort = ref<Array<any>>([]);
|
||||
const lazy = ref(nodes);
|
||||
const expanded = ref<Array<any>>([]);
|
||||
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
||||
const noData = ref<string>("ไม่มีข้อมูล");
|
||||
const orgLevel = ref<number>(0);
|
||||
const type = ref<number>(0);
|
||||
const orgId = ref<string>("");
|
||||
|
||||
/**
|
||||
* 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(
|
||||
() => nodeTEST.value,
|
||||
() => {
|
||||
|
|
@ -376,22 +94,7 @@ watch(
|
|||
<div class="col-12 q-py-sm q-px-sm">
|
||||
<div class="q-gutter-sm">
|
||||
<div class="row q-col-gutter-sm q-pl-sm">
|
||||
<div class="col-2" v-if="store.typeOrganizational === 'draft'">
|
||||
<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'"
|
||||
>
|
||||
<div class="col-12">
|
||||
<q-input dense outlined v-model="filter" label="ค้นหา">
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
|
|
@ -439,172 +142,12 @@ watch(
|
|||
}}
|
||||
</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>
|
||||
</template>
|
||||
</q-tree>
|
||||
</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>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
|||
|
|
@ -86,18 +86,18 @@ const listMenu = ref<ListMenu[]>([
|
|||
type: "MOVE",
|
||||
color: "blue-10",
|
||||
},
|
||||
{
|
||||
label: "สืบทอดตำแหน่ง",
|
||||
icon: "mdi-account-multiple-outline",
|
||||
type: "INHERIT",
|
||||
color: "deep-orange",
|
||||
},
|
||||
{
|
||||
label: "ประวัติตำแหน่ง",
|
||||
icon: "history",
|
||||
type: "HISTORY",
|
||||
color: "deep-purple",
|
||||
},
|
||||
// {
|
||||
// label: "สืบทอดตำแหน่ง",
|
||||
// icon: "mdi-account-multiple-outline",
|
||||
// type: "INHERIT",
|
||||
// color: "deep-orange",
|
||||
// },
|
||||
// {
|
||||
// label: "ประวัติตำแหน่ง",
|
||||
// icon: "history",
|
||||
// type: "HISTORY",
|
||||
// color: "deep-purple",
|
||||
// },
|
||||
]);
|
||||
const document = ref<any>([
|
||||
{
|
||||
|
|
@ -137,7 +137,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "positionName",
|
||||
align: "left",
|
||||
label: "ตำแหน่งในสายงาน",
|
||||
label: "ตำแหน่ง",
|
||||
field: "positionName",
|
||||
sortable: false,
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -146,7 +146,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "posTypeName",
|
||||
align: "left",
|
||||
label: "ประเภทตำแหน่ง",
|
||||
label: "กลุ่มงาน",
|
||||
sortable: false,
|
||||
field: "posTypeName",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -155,7 +155,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "posLevelName",
|
||||
align: "left",
|
||||
label: "ระดับตำแหน่ง",
|
||||
label: "ระดับชั้นงาน",
|
||||
sortable: false,
|
||||
field: "posLevelName",
|
||||
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);
|
||||
/**
|
||||
* function openPopup เพิ่มอัตรากำลัง
|
||||
|
|
@ -462,7 +387,7 @@ async function onClickDownloadReport(val: string, name: string) {
|
|||
</q-btn>
|
||||
</div>
|
||||
|
||||
<q-btn
|
||||
<!-- <q-btn
|
||||
v-if="store.typeOrganizational === 'draft'"
|
||||
flat
|
||||
round
|
||||
|
|
@ -487,7 +412,7 @@ async function onClickDownloadReport(val: string, name: string) {
|
|||
</q-list>
|
||||
</q-menu>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
</q-btn> -->
|
||||
<q-space />
|
||||
<div class="row q-gutter-md">
|
||||
<div>
|
||||
|
|
@ -544,17 +469,6 @@ async function onClickDownloadReport(val: string, name: string) {
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<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">
|
||||
<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-item
|
||||
v-if="
|
||||
props.row.positionIsSelected == 'ว่าง' &&
|
||||
store.typeOrganizational === 'draft'
|
||||
"
|
||||
v-if="props.row.positionIsSelected == 'ว่าง'"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openSelectPerson(props.row)"
|
||||
|
|
@ -612,10 +523,7 @@ async function onClickDownloadReport(val: string, name: string) {
|
|||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-else-if="
|
||||
props.row.positionIsSelected != 'ว่าง' &&
|
||||
store.typeOrganizational === 'draft'
|
||||
"
|
||||
v-else-if="props.row.positionIsSelected != 'ว่าง'"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="removePerson(props.row.id)"
|
||||
|
|
@ -632,9 +540,7 @@ async function onClickDownloadReport(val: string, name: string) {
|
|||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-for="(item, index) in store.typeOrganizational === 'draft'
|
||||
? listMenu
|
||||
: listMenu.filter((e) => e.type === 'HISTORY')"
|
||||
v-for="(item, index) in listMenu"
|
||||
:key="index"
|
||||
clickable
|
||||
v-close-popup
|
||||
|
|
@ -681,76 +587,6 @@ async function onClickDownloadReport(val: string, name: string) {
|
|||
</q-btn>
|
||||
</q-td>
|
||||
</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 v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
|
|
|
|||
|
|
@ -26,10 +26,6 @@ const store = usePositionEmp();
|
|||
const $q = useQuasar();
|
||||
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 nodeId = ref<string>(""); // id ของ Tree
|
||||
const orgLevel = ref<number>(0); // levelTree
|
||||
|
|
@ -178,36 +174,12 @@ function searchAndReplaceOrgName(data: any, targetId: string) {
|
|||
}
|
||||
|
||||
/**lifecycle Hook*/
|
||||
onMounted(async () => {
|
||||
const id =
|
||||
store.typeOrganizational === "current"
|
||||
? store.activeId
|
||||
: store.typeOrganizational === "draft"
|
||||
? store.draftId
|
||||
: historyId.value;
|
||||
id && (await fetchDataTree(id));
|
||||
onMounted(() => {
|
||||
setTimeout(async () => {
|
||||
store.activeId && (await fetchDataTree(store.activeId));
|
||||
}, 200);
|
||||
});
|
||||
|
||||
/** 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 เมื่อมีการเปลี่ยนหน้า*/
|
||||
watch([() => reqMaster.page, () => reqMaster.pageSize], () => {
|
||||
action1.value === false &&
|
||||
|
|
@ -226,13 +198,6 @@ watch(
|
|||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => store.draftId,
|
||||
() => {
|
||||
store.draftId && fetchDataTree(store.draftId?.toString());
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -67,13 +67,9 @@ export const usePositionEmp = defineStore("positionEmpStore", () => {
|
|||
function fetchPosMaster(data: PosMaster[]) {
|
||||
const newPosMaster = data.map((e: PosMaster) => ({
|
||||
...e,
|
||||
positionIsSelected:
|
||||
typeOrganizational.value === "draft" && e.fullNameNextHolder !== null
|
||||
? e.fullNameNextHolder
|
||||
: typeOrganizational.value !== "draft" &&
|
||||
e.fullNameCurrentHolder !== null
|
||||
? e.fullNameCurrentHolder
|
||||
: "ว่าง",
|
||||
positionIsSelected: e.fullNameCurrentHolder
|
||||
? e.fullNameCurrentHolder
|
||||
: "ว่าง",
|
||||
posMasterNo:
|
||||
e.orgShortname +
|
||||
e.posMasterNoPrefix +
|
||||
|
|
|
|||
|
|
@ -16,13 +16,6 @@ const $q = useQuasar();
|
|||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||
const store = usePositionEmp();
|
||||
|
||||
/** สถานะ*/
|
||||
const isStatusData = ref<boolean>(false); // แสดงตั้งเวลาเผยแพร่
|
||||
|
||||
/** ประวัติโครงสร้าง*/
|
||||
const historyId = ref<string>(""); // ID ประวัติโครงสร้าง
|
||||
const count = ref<number>(0);
|
||||
|
||||
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง*/
|
||||
async function fetchOrganizationActive() {
|
||||
showLoader();
|
||||
|
|
@ -32,20 +25,6 @@ async function fetchOrganizationActive() {
|
|||
const data = res.data.result;
|
||||
if (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) => {
|
||||
|
|
@ -58,7 +37,6 @@ async function fetchOrganizationActive() {
|
|||
|
||||
/** lifecycleHook */
|
||||
onMounted(async () => {
|
||||
store.typeOrganizational = "current";
|
||||
await fetchOrganizationActive();
|
||||
});
|
||||
</script>
|
||||
|
|
@ -73,7 +51,7 @@ onMounted(async () => {
|
|||
<q-card flat bordered>
|
||||
<q-card class="my-card">
|
||||
<q-card-section style="padding: 0px">
|
||||
<TreeView v-model:historyId="historyId" v-model:count="count" />
|
||||
<TreeView />
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-card>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue