fix bug competency
This commit is contained in:
parent
c90d2a4f70
commit
ce4b8e1c4a
10 changed files with 50 additions and 52 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive,watch } from "vue";
|
||||
import { ref, onMounted, reactive, watch } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
|
@ -14,11 +14,9 @@ import { useKPIDataStore } from "@/modules/14_KPI/store/KPIStore";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type {
|
||||
NewPagination,
|
||||
} from "@/modules/14_KPI/interface/index/Main";
|
||||
import type { NewPagination } from "@/modules/14_KPI/interface/index/Main";
|
||||
|
||||
const total = ref<number>()
|
||||
const total = ref<number>();
|
||||
const store = useKPIDataStore();
|
||||
const router = useRouter();
|
||||
const $q = useQuasar();
|
||||
|
|
@ -76,10 +74,10 @@ async function fetchList() {
|
|||
await http
|
||||
.get(
|
||||
config.API.kpiCapacity +
|
||||
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&type=${store.competencyType}`
|
||||
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&type=${store.competencyTypeVal}`
|
||||
)
|
||||
.then(async (res) => {
|
||||
total.value = res.data.result.total
|
||||
total.value = res.data.result.total;
|
||||
const data: ResDataCapacity[] = res.data.result.data;
|
||||
totalList.value = Math.ceil(res.data.result.total / formQuery.pageSize);
|
||||
rows.value = data;
|
||||
|
|
@ -127,7 +125,7 @@ function fetchNewList() {
|
|||
* function updatePagination
|
||||
* @param newPagination ข้อมูล Pagination ใหม่
|
||||
*/
|
||||
function updatePagination(newPagination: NewPagination) {
|
||||
function updatePagination(newPagination: NewPagination) {
|
||||
formQuery.page = 1;
|
||||
formQuery.pageSize = newPagination.rowsPerPage;
|
||||
}
|
||||
|
|
@ -147,7 +145,7 @@ onMounted(() => {
|
|||
<template>
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-select
|
||||
v-model="store.competencyType"
|
||||
v-model="store.competencyTypeVal"
|
||||
outlined
|
||||
label="ประเภทสมรรถนะ"
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ function onSubmit() {
|
|||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-select
|
||||
v-model="store.competencyType"
|
||||
v-model="store.competencyTypeVal"
|
||||
outlined
|
||||
label="เลือกประเภทสมรรถนะ"
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ function ocClickAdd() {
|
|||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
const body = {
|
||||
competencyType: store.competencyType,
|
||||
competencyType: store.competencyTypeVal,
|
||||
competencyName: formData.competencyName,
|
||||
definition: formData.definition,
|
||||
levels: formData.levels,
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ const formData = reactive<FormGroup>({
|
|||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
const body = {
|
||||
competencyType: store.competencyType,
|
||||
competencyType: store.competencyTypeVal,
|
||||
competencyName: formData.definition,
|
||||
definition: formData.definition,
|
||||
levels1: formScore.score1,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ const $q = useQuasar();
|
|||
const { dialogConfirm, showLoader, success, hideLoader, messageError } =
|
||||
useCounterMixin();
|
||||
|
||||
const router = useRouter
|
||||
const router = useRouter;
|
||||
const store = useKPIDataStore();
|
||||
const formData = reactive({
|
||||
competencyType: "",
|
||||
|
|
@ -80,30 +80,28 @@ function updateSelectType(val: string, index: number) {
|
|||
formData.form[index].posLevel = "";
|
||||
}
|
||||
|
||||
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
const body = {
|
||||
competencyType:store.competencyType,
|
||||
competencyName:formData.competencyName,
|
||||
definition:formData.definition,
|
||||
postype:formData.form,
|
||||
evaluation:formData.evaluation,
|
||||
}
|
||||
// showLoader()
|
||||
// http
|
||||
// .put(config.API.???,body)
|
||||
// .then((res)=>{
|
||||
// success($q,'บันทึกสำเร็จ')
|
||||
// router.push(`/KPI-competency`)
|
||||
// }).catch((e)=>{
|
||||
// messageError($q,e)
|
||||
// }).finally(()=>{
|
||||
// hideLoader()
|
||||
// })
|
||||
console.log(body)
|
||||
})
|
||||
|
||||
competencyType: store.competencyTypeVal,
|
||||
competencyName: formData.competencyName,
|
||||
definition: formData.definition,
|
||||
postype: formData.form,
|
||||
evaluation: formData.evaluation,
|
||||
};
|
||||
// showLoader()
|
||||
// http
|
||||
// .put(config.API.???,body)
|
||||
// .then((res)=>{
|
||||
// success($q,'บันทึกสำเร็จ')
|
||||
// router.push(`/KPI-competency`)
|
||||
// }).catch((e)=>{
|
||||
// messageError($q,e)
|
||||
// }).finally(()=>{
|
||||
// hideLoader()
|
||||
// })
|
||||
console.log(body);
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ const formData = reactive({
|
|||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
const body = {
|
||||
competencyType: store.competencyType,
|
||||
competencyType: store.competencyTypeVal,
|
||||
competencyName: formData.competencyName,
|
||||
definition: formData.definition,
|
||||
levels1: formData.level1,
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ const formData = reactive({
|
|||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
const body = {
|
||||
competencyType: store.competencyType,
|
||||
competencyType: store.competencyTypeVal,
|
||||
competencyName: formData.competencyName,
|
||||
definition: formData.definition,
|
||||
levels1: formData.level1,
|
||||
|
|
@ -74,7 +74,7 @@ function onSubmit() {
|
|||
<q-card-section class="col-12 q-px-none">
|
||||
<div>
|
||||
<q-field
|
||||
class="q_field_p_none"
|
||||
class="q_field_p_none"
|
||||
ref="fieldRef"
|
||||
v-model="formData.definition"
|
||||
label-slot
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ function onClickAddLevels() {
|
|||
const levelName = formData.levels.length + 1;
|
||||
const data = {
|
||||
level:
|
||||
(store.competencyType === "HEAD" || store.competencyType === "GROUP") &&
|
||||
(store.competencyTypeVal === "HEAD" ||
|
||||
store.competencyTypeVal === "GROUP") &&
|
||||
levelName <= 6
|
||||
? levelName.toString()
|
||||
: "",
|
||||
|
|
@ -69,7 +70,7 @@ function onClickAddLevels() {
|
|||
function onSubmit() {
|
||||
dialogConfirm($q, async () => {
|
||||
const formBody = {
|
||||
type: store.competencyType,
|
||||
type: store.competencyTypeVal,
|
||||
name: formData.competencyName,
|
||||
description: formData.definition,
|
||||
capacityDetails: formData.levels,
|
||||
|
|
@ -201,8 +202,8 @@ onMounted(() => {
|
|||
<div class="col-3 align-center q-pr-lg">
|
||||
<q-input
|
||||
:readonly="
|
||||
store.competencyType === 'HEAD' ||
|
||||
store.competencyType === 'GROUP'
|
||||
store.competencyTypeVal === 'HEAD' ||
|
||||
store.competencyTypeVal === 'GROUP'
|
||||
"
|
||||
v-model="formData.levels[index].level"
|
||||
dense
|
||||
|
|
@ -257,11 +258,11 @@ onMounted(() => {
|
|||
icon="delete"
|
||||
@click="onDeleteLevels(index)"
|
||||
v-if="
|
||||
(store.competencyType === 'HEAD' && index > 4) ||
|
||||
(store.competencyType === 'GROUP' && index > 4) ||
|
||||
((store.competencyType === 'EXECUTIVE' ||
|
||||
store.competencyType === 'DIRECTOR' ||
|
||||
store.competencyType === 'INSPECTOR') &&
|
||||
(store.competencyTypeVal === 'HEAD' && index > 4) ||
|
||||
(store.competencyTypeVal === 'GROUP' && index > 4) ||
|
||||
((store.competencyTypeVal === 'EXECUTIVE' ||
|
||||
store.competencyTypeVal === 'DIRECTOR' ||
|
||||
store.competencyTypeVal === 'INSPECTOR') &&
|
||||
index > 0)
|
||||
"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<script setup lang="ts">
|
||||
<!-- <script setup lang="ts">
|
||||
import { ref, reactive, onMounted, watch } from "vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import type { DataOptions } from "@/modules/08_KPI/interface/index/Main";
|
||||
|
|
@ -169,7 +169,7 @@ function onSubmit() {
|
|||
function getData() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.KpiCapacity + `?type=${type.value}`)
|
||||
.get(config.API.kpiCapacity + `?type=${type.value}`)
|
||||
.then((res) => {
|
||||
const data = res.data.result.data;
|
||||
listTarget.value = data;
|
||||
|
|
@ -428,8 +428,8 @@ watch(
|
|||
</div>
|
||||
<div
|
||||
v-if="dataListCapacityDetails.length == 0"
|
||||
class="q-pa-md text-weight-bold col-12 text-center "
|
||||
style="border: 2px solid #f5f5f5;"
|
||||
class="q-pa-md text-weight-bold col-12 text-center"
|
||||
style="border: 2px solid #f5f5f5"
|
||||
>
|
||||
<span>ไม่พบข้อมูลสมรรถนะ</span>
|
||||
</div>
|
||||
|
|
@ -483,4 +483,4 @@ watch(
|
|||
border: 1px solid #ededed !important;
|
||||
border-radius: 8px;
|
||||
}
|
||||
</style>
|
||||
</style> -->
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import type { DataOption } from "@/modules/14_KPI/interface/index/Main";
|
|||
|
||||
// store
|
||||
export const useKPIDataStore = defineStore("KPIDataStore", () => {
|
||||
// const competencyType = ref<string>("HEAD");
|
||||
const competencyTypeVal = ref<string>("HEAD");
|
||||
|
||||
const tabMain = ref<string>("1");
|
||||
const dataProfile = ref<any>();
|
||||
|
|
@ -175,6 +175,7 @@ export const useKPIDataStore = defineStore("KPIDataStore", () => {
|
|||
}
|
||||
|
||||
return {
|
||||
competencyTypeVal,
|
||||
competencyType,
|
||||
convertStatus,
|
||||
convertResults,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue