แก้ไขบัด จัดสรรเครื่องราช
This commit is contained in:
parent
4ca00ceadb
commit
91bb279158
7 changed files with 95 additions and 396 deletions
|
|
@ -29,7 +29,6 @@ const props = defineProps({
|
|||
});
|
||||
watch(props, () => {
|
||||
if (props.modal === true) {
|
||||
console.log(props.insigniadata);
|
||||
amount.value = props.insigniadata.total;
|
||||
if (props.actionType === "insignia") {
|
||||
title.value = props.insigniadata.insignia;
|
||||
|
|
|
|||
|
|
@ -7,9 +7,7 @@ import { useRouter } from "vue-router";
|
|||
const $q = useQuasar();
|
||||
const myForm = ref<QForm>();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
const { dialogConfirm } = mixin;
|
||||
const router = useRouter();
|
||||
const routeName = router.currentRoute.value.name;
|
||||
const amount = ref<number | null>();
|
||||
|
|
@ -31,18 +29,17 @@ const props = defineProps({
|
|||
},
|
||||
insigniaList: {
|
||||
type: Array,
|
||||
default: []
|
||||
default: [],
|
||||
},
|
||||
});
|
||||
|
||||
watch(props, () => {
|
||||
if (props.modal) {
|
||||
grandCross.value = ""
|
||||
Org.value = ""
|
||||
amount.value = null
|
||||
if (props.modal === false) {
|
||||
grandCross.value = "";
|
||||
Org.value = "";
|
||||
amount.value = null;
|
||||
}
|
||||
console.log("insigniaList===>", props.insigniaList)
|
||||
})
|
||||
});
|
||||
|
||||
const clickSave = () => {
|
||||
dialogConfirm($q, () => props.save(grandCross.value, amount.value));
|
||||
|
|
@ -54,22 +51,53 @@ const clickSave = () => {
|
|||
<q-card style="width: 800px">
|
||||
<q-toolbar class="q-py-sm">
|
||||
<q-toolbar-title class="text-h6">จัดสรรเครื่องราชฯ </q-toolbar-title>
|
||||
<q-btn icon="close" unelevated round dense @click="closeModal"
|
||||
style="color: #ff8080; background-color: #ffdede" />
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="closeModal"
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-toolbar>
|
||||
<q-separator />
|
||||
|
||||
<q-form ref="myForm">
|
||||
<div class="q-pa-md">
|
||||
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||
<div
|
||||
class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"
|
||||
>
|
||||
<div class="col-6">
|
||||
<q-select hide-bottom-space :options="insigniaList" dense borderless
|
||||
option-label="name" option-value="id" emit-value map-options outlined options-cover v-model="grandCross"
|
||||
:label="routeName == 'insigniaAllocate' ? `เครื่องราชฯ` : `เลือกหน่วยงาน`" />
|
||||
<q-select
|
||||
hide-bottom-space
|
||||
:options="insigniaList"
|
||||
dense
|
||||
borderless
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
outlined
|
||||
options-cover
|
||||
v-model="grandCross"
|
||||
:label="
|
||||
routeName == 'insigniaAllocate'
|
||||
? `เครื่องราชฯ`
|
||||
: `เลือกหน่วยงาน`
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<q-input hide-bottom-space outlined class="inputgreen" v-model="amount" dense lazy-rules type="number"
|
||||
label="จำนวน" />
|
||||
<q-input
|
||||
hide-bottom-space
|
||||
outlined
|
||||
class="inputgreen"
|
||||
v-model="amount"
|
||||
dense
|
||||
lazy-rules
|
||||
type="number"
|
||||
label="จำนวน"
|
||||
/>
|
||||
<!-- :rules="[(val:any) =>val.length != 13 ||`${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ครบ'}`,]" -->
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { ref, onMounted, watch, useAttrs } from "vue";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useResultDataStore } from "@/modules/07_insignia/storeAllocate";
|
||||
import { useAllocateDataStore } from "@/modules/07_insignia/storeAllocate";
|
||||
import type { FormProprsalsRound } from "@/modules/07_insignia/interface/request/Main";
|
||||
import router from "@/router";
|
||||
import DialogForm from "@/modules/07_insignia/components/4_Allocate/DialogForm.vue";
|
||||
|
|
@ -14,7 +14,7 @@ import type { OptionDataYear } from "@/modules/07_insignia/interface/index/Main"
|
|||
import type { QTableProps, QInput } from "quasar";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const DataStore = useResultDataStore();
|
||||
const DataStore = useAllocateDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, dialogRemove, success } = mixin;
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ const fecthInsigniaType = async () => {
|
|||
DataStore.fetchDatainsigniaType(data);
|
||||
tab.value = DataStore.insigniaType[0].name;
|
||||
|
||||
fecthlistInsignia();
|
||||
// fecthlistInsignia();
|
||||
fecthInsignia();
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -158,18 +158,17 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
const rows = ref<FormProprsalsRound[]>([]);
|
||||
|
||||
watch(tab, () => {
|
||||
insigniaOp.value = DataStore.insigniaOp.filter(
|
||||
(x: any) => x.type == tab.value
|
||||
);
|
||||
DataStore.insignia = "";
|
||||
fecthlistInsignia();
|
||||
});
|
||||
|
||||
const selectorInsignia = () => {
|
||||
fecthlistInsignia();
|
||||
};
|
||||
// const selectorInsignia = () => {
|
||||
// fecthlistInsignia();
|
||||
// };
|
||||
const selectorRound = (round: string) => {
|
||||
selectRound.value = round;
|
||||
const yearFilter = selectRoundOption.value.find((x: any) => x.id == round);
|
||||
|
|
@ -182,18 +181,7 @@ const fecthlistInsignia = async () => {
|
|||
.get(config.API.insigniaManageType(tab.value, Number(roundYear.value)))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
// console.log("dsata===>", data);
|
||||
rows.value = data.map((e: any) => ({
|
||||
id: e.id,
|
||||
insignia: e.insignia,
|
||||
insigniaId: e.insigniaId,
|
||||
total: e.total,
|
||||
allocate: e.allocate,
|
||||
remain: e.remain,
|
||||
year: e.year,
|
||||
// status: DataStore.status(e.status),
|
||||
}));
|
||||
DataStore.listinsignia(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
|
|
@ -217,13 +205,6 @@ const addData = () => {
|
|||
action.value = "addData";
|
||||
};
|
||||
|
||||
const editData = (data: any) => {
|
||||
personId.value = data.id;
|
||||
profileType.value = data.profileType;
|
||||
action.value = "editData";
|
||||
modal.value = true;
|
||||
};
|
||||
|
||||
const modalEdit = ref<boolean>(false);
|
||||
const rowData = ref<any>([]);
|
||||
const actionType = ref<string>("");
|
||||
|
|
@ -231,7 +212,6 @@ const clickEditrow = (data: any) => {
|
|||
rowData.value = data;
|
||||
modalEdit.value = true;
|
||||
actionType.value = "insignia";
|
||||
console.log(data);
|
||||
};
|
||||
|
||||
const save = async (insigniaId: string, total: string) => {
|
||||
|
|
@ -341,10 +321,14 @@ const resetFilter = () => {
|
|||
</q-tabs>
|
||||
|
||||
<q-separator />
|
||||
|
||||
<div>
|
||||
<div v-for="item in DataStore.insigniaType">
|
||||
<div v-if="tab == item.name" class="q-pa-md">
|
||||
<q-tab-panels v-model="tab" animated>
|
||||
<q-tab-panel
|
||||
v-for="item in DataStore.insigniaType"
|
||||
:key="item.name"
|
||||
:name="item.name"
|
||||
class="q-pa-none"
|
||||
>
|
||||
<div class="q-pa-md">
|
||||
<div class="row col-12 q-pb-sm q-col-gutter-x-xs">
|
||||
<div>
|
||||
<q-select
|
||||
|
|
@ -362,7 +346,7 @@ const resetFilter = () => {
|
|||
:readonly="false"
|
||||
:borderless="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="selectorInsignia"
|
||||
@update:model-value="DataStore.selectInsignia"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -378,9 +362,7 @@ const resetFilter = () => {
|
|||
<q-tooltip>เพิ่ม</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<q-space />
|
||||
|
||||
<div class="items-center" style="display: flex">
|
||||
<!-- ค้นหาข้อความใน table -->
|
||||
<q-input
|
||||
|
|
@ -424,8 +406,8 @@ const resetFilter = () => {
|
|||
<d-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
:rows="DataStore.rows"
|
||||
:filter="filter"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
|
|
@ -538,279 +520,15 @@ const resetFilter = () => {
|
|||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
|
||||
<div v-else-if="tab == item.name" class="q-pa-md">
|
||||
<div class="row col-12 q-pb-sm q-col-gutter-x-xs">
|
||||
<selector
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="DataStore.insignia"
|
||||
hide-bottom-space
|
||||
:label="`${'เครื่องราชฯ'}`"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="DataStore.insigniaOp"
|
||||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
style="min-width: 150px"
|
||||
/>
|
||||
<div>
|
||||
<q-btn
|
||||
@click="addData()"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่ม</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div>
|
||||
<q-btn flat round color="light-blue" icon="upload">
|
||||
<!-- <q-tooltip>อัพโหลดไฟล์</q-tooltip> -->
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-close-popup>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green-7" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section
|
||||
>บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green-7" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>บันทึกผลการจ่ายใบกำกับ</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<q-space />
|
||||
|
||||
<div class="items-center" style="display: flex">
|
||||
<!-- ค้นหาข้อความใน table -->
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
v-model="filter"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
:display-value="$q.lang.table.columns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
:options="columns"
|
||||
options-dense
|
||||
option-value="name"
|
||||
map-options
|
||||
emit-value
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<d-table
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:visible-columns="visibleColumns"
|
||||
:filter="filter"
|
||||
row-key="name"
|
||||
>
|
||||
<template v-slot:body-cell="props">
|
||||
<q-td :props="props">
|
||||
<div v-if="props.col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
|
||||
<div v-else-if="props.col.name == 'action'">
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
@click="editData(props.row)"
|
||||
icon="mdi-pencil-outline"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
{{ props.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
|
||||
<div v-else-if="tab == item.name" class="q-pa-md">
|
||||
<div class="row col-12 q-pb-sm q-col-gutter-x-xs">
|
||||
<selector
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="DataStore.insignia"
|
||||
hide-bottom-space
|
||||
:label="`${'เครื่องราชฯ'}`"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="DataStore.insigniaOp"
|
||||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
style="min-width: 150px"
|
||||
/>
|
||||
<div>
|
||||
<q-btn
|
||||
@click="addData()"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่ม</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div>
|
||||
<q-btn flat round color="light-blue" icon="upload">
|
||||
<!-- <q-tooltip>อัพโหลดไฟล์</q-tooltip> -->
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-close-popup>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green-7" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section
|
||||
>บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green-7" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>บันทึกผลการจ่ายใบกำกับ</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-space />
|
||||
|
||||
<div class="items-center" style="display: flex">
|
||||
<!-- ค้นหาข้อความใน table -->
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
v-model="filter"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
:display-value="$q.lang.table.columns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
:options="columns"
|
||||
options-dense
|
||||
option-value="name"
|
||||
map-options
|
||||
emit-value
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<d-table
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:visible-columns="visibleColumns"
|
||||
:filter="filter"
|
||||
row-key="name"
|
||||
>
|
||||
<template v-slot:body-cell="props">
|
||||
<q-td :props="props">
|
||||
<div v-if="props.col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
|
||||
<div v-else-if="props.col.name == 'action'">
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
@click="editData(props.row)"
|
||||
icon="mdi-pencil-outline"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
{{ props.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<DialogForm
|
||||
:modal="modal"
|
||||
:save="save"
|
||||
:close="close"
|
||||
:insignia-list="insigniaOp"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</q-card>
|
||||
<DialogForm
|
||||
:modal="modal"
|
||||
:save="save"
|
||||
:close="close"
|
||||
:insignia-list="insigniaOp"
|
||||
/>
|
||||
|
||||
<DialogEdit
|
||||
:modal="modalEdit"
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
import { ref, watch, computed } from "vue";
|
||||
import { QForm, useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useResultDataStore } from "@/modules/07_insignia/storeAllocate";
|
||||
import { useAllocateDataStore } from "@/modules/07_insignia/storeAllocate";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import type { DataOption } from "@/modules/04_registry/components/profileType";
|
||||
|
||||
const DataStore = useResultDataStore();
|
||||
const DataStore = useAllocateDataStore();
|
||||
const $q = useQuasar();
|
||||
const myForm = ref<QForm>();
|
||||
const mixin = useCounterMixin();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { ref, onMounted, watch } from "vue";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useResultDataStore } from "@/modules/07_insignia/storeAllocate";
|
||||
import { useAllocateDataStore } from "@/modules/07_insignia/storeAllocate";
|
||||
|
||||
import DialogForm from "@/modules/07_insignia/components/5_Borrow/DialogForm.vue";
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ import type { QTableProps, QInput } from "quasar";
|
|||
import { useQuasar } from "quasar";
|
||||
|
||||
// const router = useRouter();
|
||||
const DataStore = useResultDataStore();
|
||||
const DataStore = useAllocateDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
date2Thai,
|
||||
|
|
|
|||
|
|
@ -7,80 +7,43 @@ const {
|
|||
date2Thai,
|
||||
} = mixin;
|
||||
|
||||
export const useResultDataStore = defineStore("insigniaResult", () => {
|
||||
export const useAllocateDataStore = defineStore("insigniaallocate", () => {
|
||||
const insigniaName = ref<string>('')
|
||||
const insignia = ref<string>('')
|
||||
const insigniaOp = ref<any[]>([{ name: "ทั้งหมด", id: "", type: "" }])
|
||||
const insigniaOp2 = ref<any[]>([])
|
||||
const insigniaType = ref<any>()
|
||||
const invoiceType = ref<string>('all')
|
||||
const invoiceTypeop = ref<any>([{ name: "ทั้งหมด", id: "all" }, { name: "ใบกำกับที่ค้างจ่าย", id: "noDate" }, { name: "ใบกำกับที่จ่ายแล้ว", id: "haveDate" }])
|
||||
const rows = ref<any>([])
|
||||
const listInsignia = ref<any>([])
|
||||
|
||||
const fetchDatainsignia = async (data: any) => {
|
||||
insignia.value = ''
|
||||
invoiceType.value = 'all'
|
||||
insigniaOp.value = [{ name: "ทั้งหมด", id: "", type: "" }]
|
||||
data.forEach((e: any) => {
|
||||
insigniaOp.value.push({ name: e.name, id: e.id, type: e.insigniaType.id })
|
||||
});
|
||||
}
|
||||
|
||||
const fetchDatainsigniaType = async (data: any) => {
|
||||
insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name }))
|
||||
}
|
||||
|
||||
const fetchlistinsignia = async (data: any) => {
|
||||
const listinsignia = async (data: any) => {
|
||||
rows.value = [];
|
||||
let alllist = await data.map((e: any) => ({
|
||||
let list = await data.map((e: any) => ({
|
||||
id: e.id,
|
||||
citizenId: e.citizenId,
|
||||
prefix: e.prefix,
|
||||
position: e.position,
|
||||
status: status(e.status),
|
||||
dateReceive: date2Thai(e.dateReceive),
|
||||
name: e.fullName,
|
||||
type: e.requestInsignia,
|
||||
employeeType: profileType(e.profileType),
|
||||
profileType: e.profileType,
|
||||
page: e.page,
|
||||
number: e.no,
|
||||
vatnumber: e.number,
|
||||
datepay: date2Thai(e.datePayment),
|
||||
typepay: e.typePayment,
|
||||
address: e.address,
|
||||
}));
|
||||
rows.value = alllist
|
||||
listInsignia.value = alllist
|
||||
selectInvoice(invoiceType.value)
|
||||
insignia: e.insignia,
|
||||
insigniaId: e.insigniaId,
|
||||
total: e.total,
|
||||
allocate: e.allocate,
|
||||
remain: e.remain,
|
||||
year: e.year,
|
||||
}))
|
||||
rows.value = list
|
||||
listInsignia.value = list
|
||||
|
||||
}
|
||||
|
||||
const selectInvoice = (invoice: string) => {
|
||||
console.log(invoice);
|
||||
if (invoice === "noDate") {
|
||||
let list = listInsignia.value.filter((e: any) => e.datepay === null)
|
||||
rows.value = list
|
||||
} else if (invoice === "haveDate") {
|
||||
let list = listInsignia.value.filter((e: any) => e.datepay !== null)
|
||||
rows.value = list
|
||||
} else rows.value = listInsignia.value
|
||||
const selectInsignia = () => {
|
||||
console.log(insignia.value);
|
||||
rows.value = listInsignia.value.filter((e: any) => e.insigniaId === insignia.value)
|
||||
}
|
||||
|
||||
const status = (val: string) => {
|
||||
switch (val) {
|
||||
case "PENDING":
|
||||
return "รอบันทึกข้อมูล";
|
||||
case "REJECT":
|
||||
return "ยกเลิก";
|
||||
case "DELETE":
|
||||
return "ลบ";
|
||||
case "DONE":
|
||||
return "บันทึกลง ก.พ. 7 แล้ว";
|
||||
}
|
||||
}
|
||||
|
||||
const profileType = (val: string) => {
|
||||
switch (val) {
|
||||
case "officer":
|
||||
|
|
@ -89,21 +52,16 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
|
|||
return "ลูกจ้างประจำ";
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
rows,
|
||||
insignia,
|
||||
insigniaOp,
|
||||
insigniaOp2,
|
||||
insigniaType,
|
||||
invoiceType,
|
||||
invoiceTypeop,
|
||||
fetchDatainsignia,
|
||||
fetchDatainsigniaType,
|
||||
status,
|
||||
listinsignia,
|
||||
selectInsignia,
|
||||
profileType,
|
||||
fetchlistinsignia,
|
||||
selectInvoice,
|
||||
insigniaName
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,11 +5,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
const mixin = useCounterMixin();
|
||||
const {
|
||||
date2Thai,
|
||||
dialogConfirm,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
|
||||
} = mixin;
|
||||
|
||||
export const useResultDataStore = defineStore("insigniaResult", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue