no message

This commit is contained in:
setthawutttty 2023-08-23 14:28:50 +07:00
commit c01503b297
48 changed files with 4735 additions and 4760 deletions

View file

@ -426,7 +426,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
round
color="primary"
@click="clickListInsignia(props.row.id)"
icon="mdi-account-star"
icon="mdi-account-check"
>
<q-tooltip>ไดบเครองราชฯ</q-tooltip>
</q-btn>

View file

@ -1,7 +1,7 @@
<script setup lang="ts">
const sizeCard = (val: number) => {
if (val === 5) {
return "width:15%;";
return "width:20%;";
}
};
const props = defineProps({

View file

@ -6,6 +6,9 @@ import type { QTableProps } from "quasar";
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
import http from "@/plugins/http";
import config from "@/app.config";
import { useRouter } from "vue-router";
const router = useRouter();
const mixin = useCounterMixin();
const {
@ -190,10 +193,11 @@ const props = defineProps({
});
onMounted(async () => {
if (DataStore.typeOc == "") {
organization.value = DataStore.optionsTypeOc[2].id;
DataStore.typeOc = organization.value;
} else organization.value = DataStore.typeOc;
// if (DataStore.typeOc == "") {
// // organization.value = DataStore.optionsTypeOc[2].id;
// DataStore.typeOc = organization.value;
// } else organization.value = DataStore.typeOc;
organization.value = DataStore.typeOc;
organizationOptions.value = DataStore.optionsTypeOc;
if (organization.value !== "" || organization.value !== undefined) {
if (props.fecthInsigniaByOc) {
@ -232,7 +236,7 @@ const fecthlistRetire = async () => {
}
})
.catch((e) => {
console.log(e);
// console.log(e);
messageError($q, e);
});
};
@ -253,7 +257,7 @@ const fecthlistperson = async (id: string) => {
criterias: data,
})
.then((res) => {
console.log(res);
// console.log(res);
rows2.value = res.data.result.map((e: any) => ({
id: e.id,
@ -265,7 +269,7 @@ const fecthlistperson = async (id: string) => {
modalAdd.value = true;
})
.catch((e) => {
console.log(e);
// console.log(e);
messageError($q, e);
})
.finally(() => {
@ -290,14 +294,14 @@ const addlistperson = async (id: string) => {
// insigniaId: organization.value,
insigniaPeriodId: props.roundId,
};
console.log(data);
// console.log(data);
await http
.post(config.API.insigniaCreate(), data)
.then(() => {
success($q, "เพิ่มรายชื่อสำเร็จ");
})
.catch((err) => {
console.log(err);
// console.log(err);
messageError($q, err);
})
.finally(() => {
@ -323,12 +327,11 @@ const addlistperson = async (id: string) => {
// };
const clickmodalEdit = (props: any) => {
insignia.value = props.insigniaSend;
insigniaType.value = props.insigniaLevel;
// insigniaType.value = props.insigniaLevel;
person.value = props;
console.log(person.value);
modalEdit.value = true;
fecthInsignia();
fecthInsigniaType();
// fecthInsigniaType();
};
const clickSave = () => {
dialogConfirm(
@ -343,7 +346,7 @@ const clickSave = () => {
const listEdit = async (profileId: string) => {
let data: any = {
insigniaId: insignia.value,
insigniaTypeId: insigniaType.value,
// insigniaTypeId: insigniaType.value,
};
await http
.put(config.API.insigniaEdit(profileId), data)
@ -428,7 +431,7 @@ const listdelete = async (profileId: string) => {
const insignia = ref<string>("");
const insigniaOptions = ref<any>([]);
const insigniaType = ref<string>("");
const insigniaTypeOptions = ref<any>([]);
// const insigniaTypeOptions = ref<any>([]);
const fecthInsignia = async () => {
await http
@ -436,14 +439,20 @@ const fecthInsignia = async () => {
.then((res) => {
insigniaOptions.value = res.data.result;
})
.catch((err) => {});
.catch(() => {
// console.log(err);
});
};
const fecthInsigniaType = async () => {
await http(config.API.insigniaType)
.then((res) => {
insigniaTypeOptions.value = res.data.result;
})
.catch((err) => {});
// const fecthInsigniaType = async () => {
// await http(config.API.insigniaType)
// .then((res) => {
// insigniaTypeOptions.value = res.data.result;
// })
// .catch((err) => {});
// };
const nextPage = (id: string) => {
router.push(`/registry/${id}`);
};
const filterKeyword = ref<string>("");
@ -597,7 +606,11 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-tr
:props="props"
class="cursor-pointer"
@click.stop="nextPage(props.row.profileId)"
>
<q-td key="no" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
@ -636,13 +649,14 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
flat
round
dense
@click.stop
>
<q-menu transition-show="jump-down" transition-hide="jump-up">
<q-list dense style="min-width: 250px">
<q-item
clickable
v-close-popup
@click="clickmodalEdit(props.row)"
@click.stop="clickmodalEdit(props.row)"
>
<q-item-section
style="min-width: 0px"
@ -659,7 +673,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
<q-item
clickable
v-close-popup
@click="clickReject(props.row.profileId)"
@click.stop="clickReject(props.row.profileId)"
>
<q-item-section
style="min-width: 0px"
@ -678,7 +692,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
<q-item
clickable
v-close-popup
@click="clickDelete(props.row.profileId)"
@click.stop="clickDelete(props.row.profileId)"
>
<q-item-section
style="min-width: 0px"
@ -846,7 +860,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
style="min-width: 150px"
/>
</div>
<div class="col">
<!-- <div class="col">
<q-select
v-model="insigniaType"
label="ชั้นเครื่องราชฯ"
@ -864,7 +878,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
:hide-dropdown-icon="false"
style="min-width: 150px"
/>
</div>
</div> -->
</div>
</div>
<q-separator />
@ -877,7 +891,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
</q-dialog>
<!-- note -->
<q-dialog v-model="modalNote" persistent>
<!-- <q-dialog v-model="modalNote" persistent>
<q-card style="min-width: 350px">
<q-toolbar>
<q-toolbar-title class="text-subtitle2 text-bold">
@ -924,5 +938,5 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
/>
</q-card-actions>
</q-card>
</q-dialog>
</q-dialog> -->
</template>

View file

@ -2,6 +2,9 @@
import { onMounted, ref, watch, reactive } from "vue";
import type { QTableProps } from "quasar";
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
import { useRouter } from "vue-router";
const router = useRouter();
import http from "@/plugins/http";
import config from "@/app.config";
@ -159,6 +162,9 @@ const changtypeOc = () => {
}
DataStore.typeOc = organization.value;
};
const nextPage = (id: string) => {
router.push(`/registry/${id}`);
};
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
@ -285,7 +291,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
<q-tr
:props="props"
class="cursor-pointer"
@click="nextPage(props.row)"
@click="nextPage(props.row.profileId)"
>
<q-td key="no" :props="props">
{{ props.rowIndex + 1 }}

View file

@ -3,7 +3,9 @@ import { onMounted, ref, watch, reactive } from "vue";
import { useQuasar } from "quasar";
import type { QTableProps } from "quasar";
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
import { useRouter } from "vue-router";
const router = useRouter();
const DataStore = useInsigniaDataStore();
const props = defineProps({
@ -155,6 +157,9 @@ const changtypeOc = () => {
}
DataStore.typeOc = organization.value;
};
const nextPage = (id: string) => {
router.push(`/registry/${id}`);
};
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
@ -280,7 +285,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
<q-tr
:props="props"
class="cursor-pointer"
@click="nextPage(props.row)"
@click="nextPage(props.row.profileId)"
>
<q-td key="no" :props="props">
{{ props.rowIndex + 1 }}

View file

@ -2,6 +2,7 @@
import { onMounted, ref, watch } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import type { QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
@ -9,21 +10,16 @@ const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError } = mixin;
const organization = ref<string>(1);
const organizationOptions = ref<any>([{ id: 1, name: "ทั้งหมด" }]);
const visibleColumns = ref<string[]>([
"no",
// "citizenId",
// "name",
// "position",
// "level",
// "salary",
"organization",
// "insigniaType",
// "insigniaSend",
// "insigniaLevel",
// "dateSend",
]);
const props = defineProps({
roundId: {
type: String,
},
tab: {
type: String,
},
});
const visibleColumns = ref<string[]>(["no", "orgName"]);
//
const columns = ref<QTableProps["columns"]>([
{
@ -34,169 +30,43 @@ const columns = ref<QTableProps["columns"]>([
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
width: "0px",
},
// {
// name: "citizenId",
// align: "left",
// label: "",
// sortable: true,
// field: "citizenId",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
// {
// name: "name",
// align: "left",
// label: "-",
// sortable: true,
// field: "name",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
// {
// name: "position",
// align: "left",
// label: "",
// sortable: true,
// field: "position",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
// {
// name: "level",
// align: "left",
// label: "/",
// sortable: true,
// field: "level",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
// {
// name: "salary",
// align: "left",
// label: "",
// sortable: true,
// field: "salary",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
{
name: "organization",
name: "orgName",
align: "left",
label: "หน่วยงาน",
sortable: true,
field: "organization",
field: "orgName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
width: "100px",
},
// {
// name: "insigniaType",
// align: "left",
// label: " ",
// sortable: true,
// field: "insigniaType",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
// {
// name: "insigniaSend",
// align: "left",
// label: " ",
// sortable: true,
// field: "insigniaSend",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
// {
// name: "insigniaLevel",
// align: "left",
// label: "",
// sortable: true,
// field: "insigniaLevel",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
// {
// name: "dateSend",
// align: "left",
// label: "",
// sortable: true,
// field: "dateSend",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
]);
// ()
const rows = ref<any[]>([
{
no: "1",
citizenId: "1xxxxxxxxxx",
name: "นายใจดี ยอดใจ ",
position: "นักวิชาการพัสดุ",
level: "1",
salary: "15000",
organization: "บริหาร",
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
insigniaSend: "ตริตาภรณ์ช้างเผือก",
insigniaLevel: "ต่ำกว่าสายสะพาย",
dateSend: "31 ม.ค. 2566",
},
{
no: "2",
citizenId: "1xxxxxxxxxx",
name: "นายจักกริน บัณฑิต",
position: "นักวิชาการพัสดุ",
level: "ปฏิบัติการ",
salary: "15000",
organization: "บริหาร",
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
insigniaSend: "ตริตาภรณ์ช้างเผือก",
insigniaLevel: "ต่ำกว่าสายสะพาย",
dateSend: "31 ม.ค. 2566",
},
{
no: "3",
citizenId: "1xxxxxxxxxx",
name: "นางสาวกัณฐิมา กาฬสินธุ์",
position: "นักจัดการงานทั่วไป",
level: "ปฏิบัติการ",
salary: "15000",
organization: "บริหาร",
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
insigniaSend: "ตริตาภรณ์ช้างเผือก",
insigniaLevel: "ต่ำกว่าสายสะพาย",
dateSend: "31 ม.ค. 2566",
},
{
no: "4",
citizenId: "1xxxxxxxxxx",
name: "นางสาวเมขลา กระจ่างมนตรี",
position: "นักจัดการงานทั่วไป",
level: "ปฏิบัติการ",
salary: "15000",
organization: "บริหาร",
insigniaType: "ทวีติยาภรณ์ช้างเผือก",
insigniaSend: "ตริตาภรณ์ช้างเผือก",
insigniaLevel: "ต่ำกว่าสายสะพาย",
dateSend: "31 ม.ค. 2566",
},
]);
const rows = ref<any[]>([]);
onMounted(async () => {
await fecthAgency();
await fecthOrg();
});
watch(props, async () => {
if (props.tab === "organization") {
await fecthOrg();
}
});
const fecthAgency = async () => {
const fecthOrg = async () => {
showLoader();
await http
.get(config.API.insigniaAgency())
.get(config.API.insigniaNosend(props.roundId))
.then((res) => {
console.log(res);
let data = res.data.result;
rows.value = data.map((e: any) => ({
orgId: e.orgId,
orgName: e.orgName,
}));
console.log(rows.value);
})
.catch((err) => {
messageError($q, eer);
messageError($q, err);
})
.finally(() => {
hideLoader();
@ -289,13 +159,14 @@ const paginationLabel = (start: string, end: string, total: string) => {
class="col-xs-12 col-sm-3 col-md-2"
/>
</div> -->
<div class="col-12 q-pt-sm">
<div class="col-12">
<q-table
ref="table"
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="name"
dense
flat
bordered
:paging="true"
@ -318,8 +189,8 @@ const paginationLabel = (start: string, end: string, total: string) => {
<q-td key="no" style="width: 50px" :props="props">
{{ props.rowIndex + 1 }}
</q-td>
<q-td key="organization" style="width: 300px" :props="props">
{{ props.row.organization }}
<q-td key="orgName" style="width: 300px" :props="props">
{{ props.row.orgName }}
</q-td>
</q-tr>
</template>

View file

@ -37,7 +37,7 @@ const stat = ref<any>({
});
onMounted(async () => {
await fecthlistRound();
await fecthType();
await fecthAgency();
});
const fecthlistRound = async () => {
await http
@ -46,7 +46,9 @@ const fecthlistRound = async () => {
optionRound.value = res.data.result.map((e: any) => ({
id: e.period_id,
year: e.period_year,
name: `รอบการเสนอพระราชทานเครื่องราช ${e.period_name} ปี ${e.period_year} `,
name: `รอบการเสนอพระราชทานเครื่องราชรอบที่ ${e.period_round} ปี ${
e.period_year + 543
} `,
}));
// console.log(optionRound.value);
// const lastIndex = optionRound.value.length;
@ -59,24 +61,6 @@ const fecthlistRound = async () => {
messageError($q, err);
});
};
const fecthType = async () => {
await http
.get(config.API.typeOc())
.then((res) => {
optiontypeOc.value = res.data.result.map((e: any) => ({
id: e.organizationId,
name: e.organizationName,
}));
DataStore.optionsTypeOc = optiontypeOc.value;
})
.catch((err) => {
console.log(err);
messageError($q, err);
})
.finally(() => {
loading.value = true;
});
};
const fecthStat = async (id: string) => {
showLoader();
await http
@ -91,6 +75,40 @@ const fecthStat = async (id: string) => {
hideLoader();
});
};
const fecthAgency = async () => {
showLoader();
await http
.get(config.API.insigniaAgency())
.then(async (res) => {
DataStore.agency = res.data.result;
await fecthType();
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
};
const fecthType = async () => {
await http
.get(config.API.typeOc())
.then((res) => {
optiontypeOc.value = res.data.result.map((e: any) => ({
id: e.organizationId,
name: e.organizationName,
}));
DataStore.fetchOption(optiontypeOc.value);
// DataStore.optionsTypeOc = ;
})
.catch((err) => {
console.log(err);
messageError($q, err);
})
.finally(() => {
loading.value = true;
});
};
const changround = () => {
fecthStat(round.value);
fecthInsigniaByOc(round.value, DataStore.typeOc, "officer", tab.value);
@ -139,11 +157,11 @@ const fecthInsigniaByOc = async (
รายชอขาราชการสามญฯ ทธนขอพระราชทานเครองราชยสรยาภรณ
</div>
<q-card bordered class="row col-12 q-mt-sm">
<div class="bg-grey-2 col-12 row items-center">
<div class="q-pl-sm q-mr-md text-weight-bold text-grey">รอบ</div>
<div class="bg-grey-1 col-12 row items-center">
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
<q-select
borderless
dense
v-model="round"
:options="optionRound"
map-options
@ -153,9 +171,10 @@ const fecthInsigniaByOc = async (
@update:model-value="changround"
/>
</div>
<div class="col-12"><q-separator /></div>
<div class="col-12 row bg-white">
<div class="fit q-px-md q-py-sm">
<div class="row col-12 q-col-gutter-md fit">
<div class="row col-12 q-col-gutter-sm fit">
<cardTop
:amount="stat.orgAllCount"
label="หน่วยงานทั้งหมด"
@ -200,28 +219,28 @@ const fecthInsigniaByOc = async (
</div>
<q-separator />
<q-tab-panels v-model="tab" animated>
<q-tab-panel name="pending">
<q-tab-panel name="pending" class="q-pa-none">
<tab1
:tab="tab"
:roundId="round"
:fecthInsigniaByOc="fecthInsigniaByOc"
/>
</q-tab-panel>
<q-tab-panel name="reject">
<q-tab-panel name="reject" class="q-pa-none">
<tab2
:tab="tab"
:roundId="round"
:fecthInsigniaByOc="fecthInsigniaByOc"
/>
</q-tab-panel>
<q-tab-panel name="delete">
<q-tab-panel name="delete" class="q-pa-none">
<tab3
:tab="tab"
:roundId="round"
:fecthInsigniaByOc="fecthInsigniaByOc"
/>
</q-tab-panel>
<q-tab-panel name="organization">
<q-tab-panel name="organization" class="q-pa-none">
<tab4 :tab="tab" :roundId="round" />
</q-tab-panel>
</q-tab-panels>

View file

@ -40,6 +40,10 @@
<style lang="scss" scope>
.q-item.hover-green:hover {
background-color: #d5f1ee;
background-color: #d5f1ee57;
border-radius: 2px ;
}
.q-item.hover-green{
padding: 10px;
}
</style>

View file

@ -63,7 +63,7 @@ const backHistory = () => {
</div>
<div>
<q-card flat bordered class="col-12 q-mt-sm">
<div class="q-pa-md q-gutter-y-md">
<div class="q-pa-md q-gutter-y-sm">
<q-toolbar style="padding: 0" >
<q-select
class="q-mr-sm"
@ -87,11 +87,13 @@ const backHistory = () => {
<q-space />
<div class="q-pa-ms q-gutter-sm" style="padding: 0">
<q-btn outline color="primary" icon="download" label="ดาวน์โหลด" />
<q-btn icon="mdi-eye" color="primary" label="แสดงรางงาน" />
<q-btn unelevated icon="mdi-eye" color="primary" label="แสดงรางงาน" />
<q-btn
color="primary"
unelevated
color="blue"
icon="mdi-fullscreen"
@click="dialog = true"
dense
/>
</div>
</q-toolbar>
@ -107,7 +109,7 @@ const backHistory = () => {
separator-class="bg-white disabled"
>
<template v-slot:before>
<div class="q-pa-md">
<div class="q-px-sm">
<div class="row items-start items-center">
<div class="col">
<q-btn