ออกคำสั่ง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-10-21 13:50:56 +07:00
parent ae3cee9e2a
commit 2be29d9ae9
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-officer="store.isOfficer as boolean"
v-model:is-staff="store.isStaff as boolean" v-model:is-staff="store.isStaff as boolean"
v-model:root-id="store.rootId" v-model:root-id="store.rootId"
:system-name="'organization'" :system-name="'ORGANIZATION'"
/> />
</template> </template>

View file

@ -22,8 +22,7 @@ import type {
import TabGroup from "@/modules/13_salary/components/04_salaryLists/TabMain.vue"; import TabGroup from "@/modules/13_salary/components/04_salaryLists/TabMain.vue";
import ProcessStep from "@/modules/13_salary/components/04_salaryLists/ProcessStep.vue"; import ProcessStep from "@/modules/13_salary/components/04_salaryLists/ProcessStep.vue";
import PageDashBoard from "@/modules/13_salary/components/04_salaryLists/Dashboard.vue"; import PageDashBoard from "@/modules/13_salary/components/04_salaryLists/Dashboard.vue";
import DialogCommand from "@/modules/18_command/components/DialogCreateCommandORG.vue";
/** importStore*/
/** use*/ /** use*/
const store = useSalaryListSDataStore(); const store = useSalaryListSDataStore();
@ -51,6 +50,11 @@ const page = ref<number>(1);
const pageSize = ref<number>(50); const pageSize = ref<number>(50);
const lastPage = ref<number>(0); const lastPage = ref<number>(0);
/** ออกคำสั่ง*/
const modalCommand = ref<boolean>(false);
const isOfficer = ref<boolean>(false);
const isStaff = ref<boolean>(false);
/** /**
* function เรยกขอมลรอบการขนเงนเดอน * function เรยกขอมลรอบการขนเงนเดอน
*/ */
@ -364,117 +368,126 @@ onMounted(() => {
รายการเลอนเงนเดอนขาราชการ รายการเลอนเงนเดอนขาราชการ
</div> </div>
<q-space /> <q-space />
<datepicker <div class="row q-col-gutter-sm items-center q-py-xs">
v-model="year" <div>
:locale="'th'" <q-btn
autoApply color="primary"
year-picker label="ออกคำสั่ง"
:enableTimePicker="false" @click.pervent="modalCommand = true"
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"
/> />
</template> </div>
</q-select>
<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> </div>
<q-card flat bordered> <q-card flat bordered>
@ -516,6 +529,15 @@ onMounted(() => {
:get-data="getQuota" :get-data="getQuota"
/> />
</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"
:command-type-code-array="['C-PM-33', 'C-PM-34', 'C-PM-35']"
/>
</template> </template>
<style lang="sass" scoped> <style lang="sass" scoped>

View file

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

View file

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