Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into develop

* 'develop' of github.com:Frappet/bma-ehr-frontend:
  KPI => รายงาน
  ออกคำสั่ง => fix bug
This commit is contained in:
Warunee Tamkoo 2024-07-12 12:30:51 +07:00
commit 0d544bfd3b
5 changed files with 70 additions and 11 deletions

View file

@ -39,7 +39,7 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
(DataMainOrigOrder.value = val); (DataMainOrigOrder.value = val);
const DataUpdateOrder = ( const DataUpdateOrder = (
filter_1: string, filter_1: string | null,
filter_2: string, filter_2: string,
filterYear: number | null filterYear: number | null
) => { ) => {

View file

@ -204,7 +204,7 @@ const fiscalYearFilter = async () => {
}; };
// //
const OrderType = ref<string>(""); const OrderType = ref<string | null>("");
const OrderTypeFilter1 = ref<any>([]); const OrderTypeFilter1 = ref<any>([]);
const OrderTypeOption = ref<DataOption1[]>([{ id: "", name: "ทั้งหมด" }]); const OrderTypeOption = ref<DataOption1[]>([{ id: "", name: "ทั้งหมด" }]);
@ -278,6 +278,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
switch (refData) { switch (refData) {
case "fiscalyearOP": case "fiscalyearOP":
update(() => { update(() => {
fiscalyear.value = null;
fiscalyearOP.value = fiscalyearFilter1.value.filter( fiscalyearOP.value = fiscalyearFilter1.value.filter(
(v: any) => v.name.indexOf(val) > -1 (v: any) => v.name.indexOf(val) > -1
); );
@ -285,6 +286,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
break; break;
case "OrderTypeOption": case "OrderTypeOption":
update(() => { update(() => {
OrderType.value = null;
OrderTypeOption.value = OrderTypeFilter1.value.filter( OrderTypeOption.value = OrderTypeFilter1.value.filter(
(v: any) => v.name.indexOf(val) > -1 (v: any) => v.name.indexOf(val) > -1
); );
@ -292,6 +294,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
break; break;
case "OrderStatusOption": case "OrderStatusOption":
update(() => { update(() => {
OrderStatus.value = "";
OrderStatusOption.value = OrderStatusFilter1.value.filter( OrderStatusOption.value = OrderStatusFilter1.value.filter(
(v: any) => v.name.indexOf(val) > -1 (v: any) => v.name.indexOf(val) > -1
); );
@ -342,6 +345,17 @@ const paginationLabel = (start: string, end: string, total: string) => {
<q-item-section class="text-grey"> ไมอม </q-item-section> <q-item-section class="text-grey"> ไมอม </q-item-section>
</q-item> </q-item>
</template> </template>
<template v-if="fiscalyear !== 0" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(fiscalyearOP = fiscalyearFilter1),
(fiscalyear = 0),
searchFilterTable()
"
class="cursor-pointer"
/>
</template>
</q-select> </q-select>
<!-- use-input --> <!-- use-input -->
<div> <div>
@ -427,6 +441,17 @@ const paginationLabel = (start: string, end: string, total: string) => {
</q-item-section> </q-item-section>
</q-item> </q-item>
</template> </template>
<template v-if="OrderType !== ''" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(OrderTypeOption = OrderTypeFilter1),
(OrderType = ''),
searchFilterTable()
"
class="cursor-pointer"
/>
</template>
</q-select> </q-select>
</div> </div>
<div class="col-xs-12 col-sm-3 col-md-3"> <div class="col-xs-12 col-sm-3 col-md-3">
@ -458,6 +483,17 @@ const paginationLabel = (start: string, end: string, total: string) => {
</q-item-section> </q-item-section>
</q-item> </q-item>
</template> </template>
<template v-if="OrderStatus !== 'ทั้งหมด'" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(OrderStatusOption = OrderStatusFilter1),
(OrderStatus = 'ทั้งหมด'),
searchFilterTable()
"
class="cursor-pointer"
/>
</template>
</q-select> </q-select>
</div> </div>
<q-space /> <q-space />

View file

@ -45,7 +45,7 @@ export const useOrderStore = defineStore("DisciplineOrder", () => {
} }
function filterListOrder( function filterListOrder(
filter_1: string, filter_1: string | null,
filter_2: string, filter_2: string,
filterYear: number | null filterYear: number | null
) { ) {

View file

@ -148,6 +148,7 @@ async function fetchOrderlist() {
.get(config.API.listOrder()) .get(config.API.listOrder())
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
const typeid = OrderTypeOption.value.map((e: DataOption1) => e.id); const typeid = OrderTypeOption.value.map((e: DataOption1) => e.id);
const filterListOrder = data.filter((e: ResListOrder) => const filterListOrder = data.filter((e: ResListOrder) =>
typeid.includes(e.orderTypeValue) typeid.includes(e.orderTypeValue)
@ -238,9 +239,7 @@ async function OrderTypeFilter() {
/** ฟังชั่นฟิลเตอร์ตามค่า ประเภท สถานะ ปี */ /** ฟังชั่นฟิลเตอร์ตามค่า ประเภท สถานะ ปี */
async function searchFilterTable() { async function searchFilterTable() {
if (OrderType.value) { stroe.filterListOrder(OrderType.value, OrderStatus.value, fiscalyear.value);
stroe.filterListOrder(OrderType.value, OrderStatus.value, fiscalyear.value);
}
} }
/** fucnction หาสถานะทั่งหมด*/ /** fucnction หาสถานะทั่งหมด*/
@ -373,7 +372,9 @@ onMounted(async () => {
<q-icon <q-icon
name="cancel" name="cancel"
@click.stop.prevent=" @click.stop.prevent="
(fiscalyearOP = fiscalyearFilter1), (fiscalyear = 0) (fiscalyearOP = fiscalyearFilter1),
(fiscalyear = 0),
searchFilterTable()
" "
class="cursor-pointer" class="cursor-pointer"
/> />
@ -467,7 +468,9 @@ onMounted(async () => {
<q-icon <q-icon
name="cancel" name="cancel"
@click.stop.prevent=" @click.stop.prevent="
(OrderTypeOption = OrderTypeFilter1), (OrderType = '') (OrderTypeOption = OrderTypeFilter1),
(OrderType = ''),
searchFilterTable()
" "
class="cursor-pointer" class="cursor-pointer"
/> />
@ -508,7 +511,8 @@ onMounted(async () => {
name="cancel" name="cancel"
@click.stop.prevent=" @click.stop.prevent="
(OrderStatusOption = OrderStatusFilter1), (OrderStatusOption = OrderStatusFilter1),
(OrderStatus = 'ทั้งหมด') (OrderStatus = 'ทั้งหมด'),
searchFilterTable()
" "
class="cursor-pointer" class="cursor-pointer"
/> />

View file

@ -333,6 +333,8 @@ const formFilter = reactive({
const maxPage = ref<number>(1); const maxPage = ref<number>(1);
const total = ref<number>(0); const total = ref<number>(0);
const roundRef = ref<any>(null);
const rowsPerson = ref<ResPerson[]>([]); const rowsPerson = ref<ResPerson[]>([]);
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
@ -398,8 +400,17 @@ const columns = ref<QTableProps["columns"]>([
* function เป popup เลอกราชช * function เป popup เลอกราชช
*/ */
function onClickModal() { function onClickModal() {
modal.value = true; if (typeReport.value === "KPI8") {
fetchListPerson(); roundRef.value.validate();
if (!roundRef.value.hasError) {
modal.value = true;
fetchListPerson();
}
} else {
modal.value = true;
fetchListPerson();
}
} }
/** /**
@ -592,11 +603,13 @@ onMounted(() => {
</template> </template>
</datepicker> </datepicker>
<q-select <q-select
ref="roundRef"
class="bg-white" class="bg-white"
v-model="round" v-model="round"
outlined outlined
label="รอบการประเมิน" label="รอบการประเมิน"
dense dense
hide-bottom-space
option-label="name" option-label="name"
option-value="id" option-value="id"
:options="roundOp" :options="roundOp"
@ -605,6 +618,12 @@ onMounted(() => {
map-options map-options
:disable="roundOp.length === 0" :disable="roundOp.length === 0"
@update:model-value="changOption(typeReport)" @update:model-value="changOption(typeReport)"
lazy-rules
:rules="
typeReport === 'KPI8'
? [(val) => !!val || 'กรุณาเลือกรอบการประเมิน']
: []
"
/> />
<q-select <q-select
v-if="typeReport !== 'KPI8'" v-if="typeReport !== 'KPI8'"