Merge branch 'develop' into devTee
# Conflicts: # src/modules/14_KPI/views/02_kpiLists.vue
This commit is contained in:
commit
33b9051f78
18 changed files with 210 additions and 252 deletions
|
|
@ -108,6 +108,7 @@ function fetchListPlan() {
|
|||
formFilter.nodeId = store.dataProfile.nodeId;
|
||||
formFilter.node = store.dataProfile.node;
|
||||
formFilter.year = formFilter?.year ? formFilter.year.toString() : "";
|
||||
formFilter.keyword = formFilter.keyword.trim();
|
||||
// const kpiPeriodId = store.dataEvaluation.kpiPeriodId;
|
||||
|
||||
showLoader();
|
||||
|
|
@ -164,6 +165,8 @@ function fetchListRole() {
|
|||
formFilter.node = store.dataProfile.node;
|
||||
formFilter.year = formFilter?.year ? formFilter.year.toString() : "";
|
||||
formFilter.position = store.dataProfile.position;
|
||||
formFilter.keyword = formFilter.keyword.trim();
|
||||
showLoader();
|
||||
|
||||
http
|
||||
.post(config.API.kpiRole + `/search-kpi-role`, formFilter)
|
||||
|
|
@ -218,8 +221,10 @@ function fetchListSpecial() {
|
|||
formFilter.node = store.dataProfile.node;
|
||||
formFilter.year = formFilter?.year ? formFilter.year.toString() : "";
|
||||
|
||||
showLoader();
|
||||
|
||||
const body = {
|
||||
keyword: formFilter.keyword,
|
||||
keyword: formFilter.keyword.trim(),
|
||||
period: formFilter.period,
|
||||
year: formFilter.year,
|
||||
pageSize: formFilter.pageSize,
|
||||
|
|
@ -575,13 +580,7 @@ watch(
|
|||
@keydown.enter.prevent="fetchNewList()"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="formFilter.keyword == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="formFilter.keyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="(formFilter.keyword = ''), fetchNewList()"
|
||||
/>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ function getData() {
|
|||
}
|
||||
|
||||
/** ฟิลเตอร์ */
|
||||
function filterTxt(val: any) {
|
||||
function filterTxt(val: string) {
|
||||
listTarget.value = listTargetMain.value.filter(
|
||||
(v: any) => v.name.indexOf(val) > -1
|
||||
);
|
||||
|
|
@ -320,13 +320,7 @@ watch(
|
|||
@update:model-value="filterTxt"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="search == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="search !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="(search = ''), (listTarget = listTargetMain)"
|
||||
/>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -36,14 +36,12 @@ const searchRules = ref<boolean>(false);
|
|||
const selected = ref<any[]>([]);
|
||||
const personId = ref<string>("");
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const searchRef = ref<any>(null);
|
||||
const rows = ref<tableType[]>([]);
|
||||
const type = ref<string>("citizenId");
|
||||
const search = ref<string>("");
|
||||
const typeOps = ref<typeOp[]>([
|
||||
{ id: "citizenId", name: "เลขประจำตัวประชาชน" },
|
||||
{ id: "firstname", name: "ชื่อ" },
|
||||
{ id: "lastname", name: "นามสกุล" },
|
||||
{ id: "fullName", name: "ชื่อ-นามสกุล" },
|
||||
]);
|
||||
|
||||
const modalDialog = defineModel<boolean>("modal", { required: true });
|
||||
|
|
@ -152,6 +150,11 @@ function onCloseDialog() {
|
|||
selected.value = [];
|
||||
search.value = "";
|
||||
type.value = "citizenId";
|
||||
roundDialgOp.value = [];
|
||||
evaluatorIdMainOp.value = [];
|
||||
commanderIdMainOp.value = [];
|
||||
commanderHighMainOp.value = [];
|
||||
isRoundClose.value = false;
|
||||
}
|
||||
|
||||
/** ดึงข้อมูลตามรอบการประเมิน */
|
||||
|
|
@ -192,26 +195,26 @@ function fetchRoundOption() {
|
|||
* @param update function Quasar
|
||||
* @param refData เเยกประเภท
|
||||
*/
|
||||
function filterOption(val: any, update: Function, refData: string) {
|
||||
function filterOption(val: string, update: Function, refData: string) {
|
||||
switch (refData) {
|
||||
case "evaluatorIdOp":
|
||||
update(() => {
|
||||
evaluatorIdOp.value = evaluatorIdMainOp.value.filter(
|
||||
(v: any) => v.name.indexOf(val) > -1
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "commanderIdOp":
|
||||
update(() => {
|
||||
commanderIdOp.value = commanderIdMainOp.value.filter(
|
||||
(v: any) => v.name.indexOf(val) > -1
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "commanderHighOp":
|
||||
update(() => {
|
||||
commanderHighOp.value = commanderHighMainOp.value.filter(
|
||||
(v: any) => v.name.indexOf(val) > -1
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
|
|
@ -229,37 +232,35 @@ function checkClosed() {
|
|||
async function searchInput(check: boolean) {
|
||||
if (check) {
|
||||
searchRules.value = check;
|
||||
searchRef.value.validate();
|
||||
if (!searchRef.value.hasError) {
|
||||
showLoader();
|
||||
const body = {
|
||||
fieldName: type.value,
|
||||
keyword: search.value,
|
||||
};
|
||||
await http
|
||||
.post(
|
||||
config.API.orgSearchPersonal() +
|
||||
`?page=${query.page}&pageSize=${query.pageSize}`,
|
||||
body
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
maxPage.value = Math.ceil(data.total / query.pageSize);
|
||||
total.value = data.total;
|
||||
|
||||
rows.value = data.data;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
setTimeout(() => {
|
||||
searchRules.value = false;
|
||||
}, 100);
|
||||
showLoader();
|
||||
const body = {
|
||||
fieldName: type.value,
|
||||
keyword: search.value.trim(),
|
||||
};
|
||||
await http
|
||||
.post(
|
||||
config.API.orgSearchPersonal() +
|
||||
`?page=${query.page}&pageSize=${query.pageSize}`,
|
||||
body
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
maxPage.value = Math.ceil(data.total / query.pageSize);
|
||||
total.value = data.total;
|
||||
|
||||
rows.value = data.data;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
setTimeout(() => {
|
||||
searchRules.value = false;
|
||||
}, 100);
|
||||
}
|
||||
|
||||
/** update เมื่อเปลี่ยน option */
|
||||
|
|
@ -356,6 +357,17 @@ async function updatePagination(initialPagination: NewPagination) {
|
|||
query.pageSize = initialPagination.rowsPerPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* class input
|
||||
* @param val
|
||||
*/
|
||||
function classInput(val: boolean) {
|
||||
return {
|
||||
"full-width cursor-pointer ": val,
|
||||
"full-width cursor-pointer inputgreen": !val,
|
||||
};
|
||||
}
|
||||
|
||||
watch(
|
||||
() => modalDialog.value,
|
||||
(n) => {
|
||||
|
|
@ -380,6 +392,7 @@ watch(
|
|||
<q-separator />
|
||||
<q-card-section class="q-pa-none scroll" style="max-height: 80vh">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<!-- รายชื่อ -->
|
||||
<div class="col-12 col-md-9">
|
||||
<div class="row q-pa-md q-col-gutter-sm">
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
|
|
@ -399,19 +412,16 @@ watch(
|
|||
|
||||
<div class="col-12 col-sm-6 col-md-9">
|
||||
<q-input
|
||||
ref="searchRef"
|
||||
v-model="search"
|
||||
outlined
|
||||
clearable
|
||||
hide-bottom-space
|
||||
dense
|
||||
label="คำค้น"
|
||||
:rules="[
|
||||
(val:string) => !!val || !searchRules || `กรุณากรอกคำค้น`,
|
||||
]"
|
||||
@keydown.enter.pervent="(query.page = 1), searchInput(true)"
|
||||
>
|
||||
<template v-slot:after>
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
icon="search"
|
||||
label="ค้นหา"
|
||||
|
|
@ -477,7 +487,7 @@ watch(
|
|||
}}{{
|
||||
props.row.positionLevelName
|
||||
? ` (${props.row.positionLevelName})`
|
||||
: ""
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div
|
||||
|
|
@ -487,7 +497,7 @@ watch(
|
|||
{{ findOrgName(props.row) }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
{{ col.value ?? "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
|
|
@ -510,10 +520,13 @@ watch(
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- form -->
|
||||
<div class="col-12 col-md-3 bg-grey-2">
|
||||
<div class="row q-pa-md q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<datepicker
|
||||
:disable="selected.length === 0"
|
||||
menu-class-name="modalfix"
|
||||
v-model="yearDialog"
|
||||
:locale="'th'"
|
||||
|
|
@ -521,6 +534,7 @@ watch(
|
|||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="fetchRoundOption()"
|
||||
:class="classInput(false)"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
|
|
@ -528,6 +542,7 @@ watch(
|
|||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:disable="selected.length === 0"
|
||||
dense
|
||||
lazy-rules
|
||||
outlined
|
||||
|
|
@ -555,6 +570,8 @@ watch(
|
|||
|
||||
<div class="col-12">
|
||||
<q-select
|
||||
:disable="selected.length === 0"
|
||||
:class="classInput(false)"
|
||||
:readonly="yearDialog === null"
|
||||
v-model="formRound.kpiPeriodId"
|
||||
outlined
|
||||
|
|
@ -575,6 +592,8 @@ watch(
|
|||
|
||||
<div class="col-12">
|
||||
<q-select
|
||||
:disable="selected.length === 0"
|
||||
:class="classInput(false)"
|
||||
v-model="formRound.evaluatorId"
|
||||
outlined
|
||||
label="ผู้ประเมิน"
|
||||
|
|
@ -592,7 +611,9 @@ watch(
|
|||
!!val || `${'กรุณาเลือกผู้ประเมิน'}`,
|
||||
]"
|
||||
use-input
|
||||
@filter="(inputValue:any,
|
||||
hide-selected
|
||||
fill-input
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterOption(inputValue, doneFn,'evaluatorIdOp'
|
||||
) "
|
||||
>
|
||||
|
|
@ -605,8 +626,11 @@ watch(
|
|||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<q-select
|
||||
:disable="selected.length === 0"
|
||||
:class="classInput(false)"
|
||||
v-model="formRound.commanderId"
|
||||
outlined
|
||||
label="ผู้บังคับบัญชาเหนือขึ้นไป"
|
||||
|
|
@ -618,7 +642,9 @@ watch(
|
|||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
@filter="(inputValue:any,
|
||||
hide-selected
|
||||
fill-input
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterOption(inputValue, doneFn,'commanderIdOp'
|
||||
) "
|
||||
>
|
||||
|
|
@ -638,8 +664,11 @@ watch(
|
|||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<q-select
|
||||
:disable="selected.length === 0"
|
||||
:class="classInput(false)"
|
||||
v-model="formRound.commanderHighId"
|
||||
outlined
|
||||
label="ผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง"
|
||||
|
|
@ -651,7 +680,9 @@ watch(
|
|||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
@filter="(inputValue:any,
|
||||
hide-selected
|
||||
fill-input
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterOption(inputValue, doneFn,'commanderHighOp'
|
||||
) "
|
||||
>
|
||||
|
|
@ -683,7 +714,7 @@ watch(
|
|||
รอบการประเมินนี้ปิดแล้ว
|
||||
</div>
|
||||
<q-btn
|
||||
:disable="isRoundClose"
|
||||
:disable="isRoundClose || selected.length === 0"
|
||||
label="บันทึก"
|
||||
color="secondary"
|
||||
type="submit"
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ watch(
|
|||
(n) => {
|
||||
if (n == true) {
|
||||
getData();
|
||||
}
|
||||
} else rows.value = [];
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -387,6 +387,8 @@ onMounted(async () => {
|
|||
outlined
|
||||
@clear="(result = ''), (resultOp = store.resultsOptions)"
|
||||
use-input
|
||||
hide-selected
|
||||
fill-input
|
||||
:clearable="result !== ''"
|
||||
@update:model-value="onSearchData()"
|
||||
input-debounce="0"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue