Merge branch 'nice' into develop

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-10-21 13:51:19 +07:00
commit 6a329ac265
4 changed files with 297 additions and 230 deletions

View file

@ -421,7 +421,7 @@ onMounted(async () => {
v-model:is-officer="store.isOfficer as boolean"
v-model:is-staff="store.isStaff as boolean"
v-model:root-id="store.rootId"
:system-name="'organization'"
:system-name="'ORGANIZATION'"
/>
</template>

View file

@ -22,8 +22,7 @@ import type {
import TabGroup from "@/modules/13_salary/components/04_salaryLists/TabMain.vue";
import ProcessStep from "@/modules/13_salary/components/04_salaryLists/ProcessStep.vue";
import PageDashBoard from "@/modules/13_salary/components/04_salaryLists/Dashboard.vue";
/** importStore*/
import DialogCommand from "@/modules/18_command/components/DialogCreateCommandORG.vue";
/** use*/
const store = useSalaryListSDataStore();
@ -51,6 +50,11 @@ const page = ref<number>(1);
const pageSize = ref<number>(50);
const lastPage = ref<number>(0);
/** ออกคำสั่ง*/
const modalCommand = ref<boolean>(false);
const isOfficer = ref<boolean>(false);
const isStaff = ref<boolean>(false);
/**
* function เรยกขอมลรอบการขนเงนเดอน
*/
@ -364,117 +368,126 @@ onMounted(() => {
รายการเลอนเงนเดอนขาราชการ
</div>
<q-space />
<datepicker
v-model="year"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
style="width: 150px"
@update:model-value="getRound()"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
outlined
:model-value="Number(year) + 543"
:label="`${'ปีงบประมาณ'}`"
bg-color="white"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<q-select
class="q-ml-xs"
v-model="roundFilter"
label="รอบการขึ้นเงินเดือน"
dense
outlined
map-options
option-label="name"
option-value="id"
:options="roundOptions"
lazy-rules
hide-bottom-space
bg-color="white"
@update:model-value="onChangeRound"
:disable="!isDisable"
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label>{{ scope.opt.name }}</q-item-label>
</q-item-section>
</q-item>
</template>
</q-select>
<q-select
v-if="roundFilter ? roundFilter.shortCode !== 'SPECIAL' : false"
class="q-ml-xs"
v-model="snapFilter"
label="รอบ"
dense
outlined
emit-value
map-options
option-label="name"
option-value="id"
:options="snapOptions"
lazy-rules
hide-bottom-space
bg-color="white"
@update:model-value="onChangeSnap"
:disable="!isDisable"
/>
<q-select
class="q-ml-xs"
v-model="agencyFilter"
label="หน่วยงาน"
lazy-rules
dense
outlined
emit-value
map-options
option-label="name"
option-value="id"
:options="agencyOptions"
hide-bottom-space
bg-color="white"
@update:model-value="onChangeAgency"
:disable="!isDisable"
use-input
@filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn,'agencyFilter'
) "
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey"> ไมอม </q-item-section>
</q-item>
</template>
<template v-if="agencyFilter !== 'ALL'" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(agencyOptions = agencyOptionsMain), (agencyFilter = 'ALL')
"
class="cursor-pointer"
<div class="row q-col-gutter-sm items-center q-py-xs">
<div>
<q-btn
color="primary"
label="ออกคำสั่ง"
@click.pervent="modalCommand = true"
/>
</template>
</q-select>
</div>
<datepicker
v-model="year"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
style="width: 150px"
@update:model-value="getRound()"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
outlined
:model-value="Number(year) + 543"
:label="`${'ปีงบประมาณ'}`"
bg-color="white"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<q-select
v-model="roundFilter"
label="รอบการขึ้นเงินเดือน"
dense
outlined
map-options
option-label="name"
option-value="id"
:options="roundOptions"
lazy-rules
hide-bottom-space
bg-color="white"
@update:model-value="onChangeRound"
:disable="!isDisable"
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label>{{ scope.opt.name }}</q-item-label>
</q-item-section>
</q-item>
</template>
</q-select>
<q-select
v-if="roundFilter ? roundFilter.shortCode !== 'SPECIAL' : false"
v-model="snapFilter"
label="รอบ"
dense
outlined
emit-value
map-options
option-label="name"
option-value="id"
:options="snapOptions"
lazy-rules
hide-bottom-space
bg-color="white"
@update:model-value="onChangeSnap"
:disable="!isDisable"
/>
<q-select
v-model="agencyFilter"
label="หน่วยงาน"
lazy-rules
dense
outlined
emit-value
map-options
option-label="name"
option-value="id"
:options="agencyOptions"
hide-bottom-space
bg-color="white"
@update:model-value="onChangeAgency"
:disable="!isDisable"
use-input
@filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn,'agencyFilter'
) "
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey"> ไมอม </q-item-section>
</q-item>
</template>
<template v-if="agencyFilter !== 'ALL'" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(agencyOptions = agencyOptionsMain), (agencyFilter = 'ALL')
"
class="cursor-pointer"
/>
</template>
</q-select>
</div>
</div>
<q-card flat bordered>
@ -516,6 +529,15 @@ onMounted(() => {
:get-data="getQuota"
/>
</q-card>
<DialogCommand
v-model:modal="modalCommand"
v-model:root-id="agencyFilter"
v-model:is-officer="isOfficer"
v-model:is-staff="isStaff"
system-name="SALARY"
:command-type-code-array="['C-PM-33', 'C-PM-34', 'C-PM-35']"
/>
</template>
<style lang="sass" scoped>

View file

@ -22,6 +22,7 @@ import type {
import TabGroup from "@/modules/13_salary/components/05_salaryListsEmployee/TabMain.vue";
import ProcessStep from "@/modules/13_salary/components/05_salaryListsEmployee/ProcessStep.vue";
import PageDashBoard from "@/modules/13_salary/components/05_salaryListsEmployee/Dashboard.vue";
import DialogCommand from "@/modules/18_command/components/DialogCreateCommandORG.vue";
/** use*/
const store = useSalaryEmployeeListSDataStore();
@ -51,6 +52,11 @@ const lastPage = ref<number>(0);
const loading = ref(false);
const nextPage = ref<number>(1);
/** ออกคำสั่ง*/
const modalCommand = ref<boolean>(false);
const isOfficer = ref<boolean>(false);
const isStaff = ref<boolean>(false);
/**
* function เรยกขอมลรอบการขนคาจาง
*/
@ -364,114 +370,120 @@ onMounted(() => {
รายการเลอนคาจางลกจางประจำ
</div>
<q-space />
<datepicker
menu-class-name="modalfix"
v-model="year"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
style="width: 150px"
@update:model-value="getRound"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
outlined
:model-value="Number(year) + 543"
:label="`${'ปีงบประมาณ'}`"
bg-color="white"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<div class="row q-col-gutter-sm items-center q-py-xs">
<div>
<q-btn
color="primary"
label="ออกคำสั่ง"
@click.pervent="modalCommand = true"
/>
</div>
<datepicker
menu-class-name="modalfix"
v-model="year"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
style="width: 150px"
@update:model-value="getRound"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
outlined
:model-value="Number(year) + 543"
:label="`${'ปีงบประมาณ'}`"
bg-color="white"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<q-select
class="q-ml-xs"
v-model="roundFilter"
label="รอบการขึ้นค่าจ้าง"
dense
outlined
map-options
option-label="name"
option-value="id"
:options="roundOptions"
lazy-rules
hide-bottom-space
bg-color="white"
@update:model-value="onChangeRound"
:loading="loading"
@virtual-scroll="onScroll"
:disable="!isDisable"
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label>{{ scope.opt.name }}</q-item-label>
</q-item-section>
</q-item>
</template>
</q-select>
<q-select
v-if="roundFilter ? roundFilter.shortCode !== 'SPECIAL' : false"
class="q-ml-xs"
v-model="snapFilter"
label="รอบ"
dense
outlined
emit-value
map-options
option-label="name"
option-value="id"
:options="snapOptions"
lazy-rules
hide-bottom-space
bg-color="white"
@update:model-value="onChangeSnap"
:disable="!isDisable"
/>
<q-select
class="q-ml-xs"
v-model="agencyFilter"
label="หน่วยงาน"
dense
outlined
emit-value
map-options
option-label="name"
option-value="id"
:options="agencyOptions"
lazy-rules
hide-bottom-space
bg-color="white"
@update:model-value="onChangeAgency"
:disable="!isDisable"
use-input
@filter="(inputValue:string,
<q-select
v-model="roundFilter"
label="รอบการขึ้นค่าจ้าง"
dense
outlined
map-options
option-label="name"
option-value="id"
:options="roundOptions"
lazy-rules
hide-bottom-space
bg-color="white"
@update:model-value="onChangeRound"
:loading="loading"
@virtual-scroll="onScroll"
:disable="!isDisable"
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label>{{ scope.opt.name }}</q-item-label>
</q-item-section>
</q-item>
</template>
</q-select>
<q-select
v-if="roundFilter ? roundFilter.shortCode !== 'SPECIAL' : false"
v-model="snapFilter"
label="รอบ"
dense
outlined
emit-value
map-options
option-label="name"
option-value="id"
:options="snapOptions"
lazy-rules
hide-bottom-space
bg-color="white"
@update:model-value="onChangeSnap"
:disable="!isDisable"
/>
<q-select
v-model="agencyFilter"
label="หน่วยงาน"
dense
outlined
emit-value
map-options
option-label="name"
option-value="id"
:options="agencyOptions"
lazy-rules
hide-bottom-space
bg-color="white"
@update:model-value="onChangeAgency"
:disable="!isDisable"
use-input
@filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn,'agencyFilter'
) "
>
<template v-if="agencyFilter !== 'ALL'" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(agencyOptions = agencyOptionsMain), (agencyFilter = 'ALL')
"
class="cursor-pointer"
/> </template
></q-select>
>
<template v-if="agencyFilter !== 'ALL'" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="
(agencyOptions = agencyOptionsMain), (agencyFilter = 'ALL')
"
class="cursor-pointer"
/> </template
></q-select>
</div>
</div>
<q-card flat bordered>
@ -514,7 +526,14 @@ onMounted(() => {
/>
</q-card>
<!-- </q-card> -->
<DialogCommand
v-model:modal="modalCommand"
v-model:root-id="agencyFilter"
v-model:is-officer="isOfficer"
v-model:is-staff="isStaff"
system-name="SALARY_EMP"
:command-type-code-array="['C-PM-36', 'C-PM-37']"
/>
</template>
<style lang="sass" scoped>

View file

@ -36,7 +36,8 @@ const isStaff = defineModel<boolean>("isStaff");
const rootId = defineModel<string>("rootId");
const props = defineProps({
commandTypeCode: String, //
commandTypeCode: { type: String, defult: "" }, //
commandTypeCodeArray: { type: Array, defult: [] }, //
systemName: String, //
orgPublishDate: { type: Date || undefined, defult: undefined },
});
@ -168,16 +169,23 @@ function closeModal() {
isCheckOrgPublishDate.value = false;
rows.value = [];
selected.value = [];
commandType.value = "";
}
/** ฟังก์ชันดึงข้อมูลคำสั่ง */
async function fetchCommandType() {
const data = await storeCommand.getCommandTypes(); // get store
// filter code
commandOp.value = await data.filter(
(v: ListCommand) => v.code == props.commandTypeCode
);
commandType.value = commandOp.value[0].id;
if (props.systemName === "SALARY" || props.systemName === "SALARY_EMP") {
commandOp.value = await data.filter((v: ListCommand) =>
props.commandTypeCodeArray?.includes(v.code)
);
} else {
commandOp.value = await data.filter(
(v: ListCommand) => v.code == props.commandTypeCode
);
commandType.value = commandOp.value[0].id;
}
}
/**
@ -210,19 +218,29 @@ function getPerson() {
type: group.value,
};
const pathAPI =
props.systemName === "ORGANIZATION"
? config.API.orgPosReport
: props.systemName === "SALARY"
? config.API.orgPosReport
: props.systemName === "SALARY_EMP"
? config.API.orgPosReport
: "";
showLoader();
http
.post(config.API.orgPosReport, body)
.post(pathAPI, body)
.then((res) => {
const data = res.data.result;
rows.value = data;
hideLoader();
selected.value = rows.value;
})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {});
.finally(() => {
hideLoader();
});
}
watch(modal, async () => {
@ -263,10 +281,18 @@ watch(modal, async () => {
emit-value
map-options
lazy-rules
use-input
hide-bottom-space
outlined
readonly
:readonly="
props.systemName !== 'SALARY' &&
props.systemName !== 'SALARY_EMP'
"
:class="
props.systemName === 'SALARY' ||
props.systemName === 'SALARY_EMP'
? 'inputgreen'
: ''
"
>
<template v-slot:no-option>
<q-item>