Merge branch 'nice_dev' into develop
This commit is contained in:
commit
215f09c8f1
4 changed files with 136 additions and 31 deletions
|
|
@ -202,9 +202,10 @@ async function clickUpload(file: any) {
|
||||||
formData.append("file", selectedFile);
|
formData.append("file", selectedFile);
|
||||||
await http
|
await http
|
||||||
.post(config.API.developmentMainTab("tab6", id.value), formData)
|
.post(config.API.developmentMainTab("tab6", id.value), formData)
|
||||||
.then((res) => {
|
.then(() => {
|
||||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||||
getData();
|
getData();
|
||||||
|
files.value = null;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -358,8 +359,13 @@ onMounted(() => {
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td v-if="props.row.isDone">
|
<q-td>
|
||||||
<q-icon name="mdi-check" color="green" size="xs">
|
<q-icon
|
||||||
|
name="mdi-check"
|
||||||
|
color="green"
|
||||||
|
size="xs"
|
||||||
|
v-if="props.row.isDone"
|
||||||
|
>
|
||||||
<q-tooltip>ส่งไปบันทึกที่ทะเบียนประวัติแล้ว</q-tooltip>
|
<q-tooltip>ส่งไปบันทึกที่ทะเบียนประวัติแล้ว</q-tooltip>
|
||||||
</q-icon>
|
</q-icon>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,10 @@ import config from "@/app.config";
|
||||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
import type { NewPagination } from "@/modules/15_development/interface/index/Main";
|
import type {
|
||||||
|
NewPagination,
|
||||||
|
ItemsMenu,
|
||||||
|
} from "@/modules/15_development/interface/index/Main";
|
||||||
|
|
||||||
/** importStore*/
|
/** importStore*/
|
||||||
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||||
|
|
@ -18,25 +21,36 @@ const store = useDevelopmentDataStore();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||||
|
|
||||||
const pagination = ref({
|
|
||||||
page: 1,
|
|
||||||
rowsPerPage: 10,
|
|
||||||
});
|
|
||||||
const maxPage = ref<number>(1);
|
const maxPage = ref<number>(1);
|
||||||
const totalList = ref<number>(0); //จำนวนข้อมูลรายการ
|
const totalList = ref<number>(0); //จำนวนข้อมูลรายการ
|
||||||
|
|
||||||
const formFilter = reactive({
|
const formFilter = reactive({
|
||||||
root: null,
|
root: null,
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 20,
|
pageSize: 10,
|
||||||
keyword: "",
|
keyword: "",
|
||||||
year: new Date().getFullYear(),
|
year: new Date().getFullYear(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const rows = ref<any>([]);
|
const rows = ref<any[]>([]);
|
||||||
const agencyOp = ref<[]>([]);
|
const agencyOp = ref<[]>([]);
|
||||||
|
const itemMenu = ref<ItemsMenu[]>([
|
||||||
|
{
|
||||||
|
label: "ไฟล์ .xlsx",
|
||||||
|
value: "xlsx",
|
||||||
|
icon: "mdi-file-excel",
|
||||||
|
color: "green",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "ไฟล์ .PDF",
|
||||||
|
value: "pdf",
|
||||||
|
icon: "mdi-file-pdf",
|
||||||
|
color: "red",
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
const visibleColumns = ref<string[]>([
|
const visibleColumns = ref<string[]>([
|
||||||
|
"year",
|
||||||
"citizenId",
|
"citizenId",
|
||||||
"name",
|
"name",
|
||||||
"position",
|
"position",
|
||||||
|
|
@ -47,6 +61,16 @@ const visibleColumns = ref<string[]>([
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
{
|
||||||
|
name: "year",
|
||||||
|
align: "left",
|
||||||
|
label: "ปีงบประมาณ",
|
||||||
|
sortable: true,
|
||||||
|
field: "year",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
format: (v) => v + 543,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "citizenId",
|
name: "citizenId",
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|
@ -122,7 +146,7 @@ function fetchListOrg() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDownload() {
|
function onDownload(type: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.post(config.API.developmentReportHistoryOfficer(), {
|
.post(config.API.developmentReportHistoryOfficer(), {
|
||||||
|
|
@ -131,7 +155,7 @@ function onDownload() {
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const dataList = res.data.result;
|
const dataList = res.data.result;
|
||||||
genReportXLSX(dataList, "รายการประวัติฝึกอบรม/ดูงานลูกจ้าง");
|
genReportXLSX(dataList, "รายการประวัติฝึกอบรม/ดูงานลูกจ้าง", type);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -166,6 +190,7 @@ function getData() {
|
||||||
level: item.posLevel ? item.posLevel : null,
|
level: item.posLevel ? item.posLevel : null,
|
||||||
positionSide: item.posExecutive ? item.posExecutive : null,
|
positionSide: item.posExecutive ? item.posExecutive : null,
|
||||||
projectName: item.projectName ? item.projectName : null,
|
projectName: item.projectName ? item.projectName : null,
|
||||||
|
year: item.year ? item.year : null,
|
||||||
}));
|
}));
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -193,6 +218,11 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const pagination = ref({
|
||||||
|
page: formFilter.page,
|
||||||
|
rowsPerPage: formFilter.pageSize,
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchListOrg();
|
fetchListOrg();
|
||||||
});
|
});
|
||||||
|
|
@ -271,13 +301,28 @@ onMounted(() => {
|
||||||
<q-toolbar class="col-4 text-white q-pa-none q-gutter-x-sm">
|
<q-toolbar class="col-4 text-white q-pa-none q-gutter-x-sm">
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="formFilter.root !== null"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
dense
|
dense
|
||||||
icon="mdi-arrow-down-bold-circle-outline"
|
icon="mdi-arrow-down-bold-circle-outline"
|
||||||
color="blue"
|
color="blue"
|
||||||
@click="onDownload"
|
|
||||||
>
|
>
|
||||||
|
<q-menu>
|
||||||
|
<q-list style="min-width: 150px">
|
||||||
|
<q-item
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
v-for="items in itemMenu"
|
||||||
|
@click="onDownload(items.value)"
|
||||||
|
>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon :color="items.color" :name="items.icon" />
|
||||||
|
</q-item-section>
|
||||||
|
<q-item-section>{{ items.label }}</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
</q-menu>
|
||||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
|
|
|
||||||
|
|
@ -5,23 +5,22 @@ import { useQuasar, type QTableProps } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||||
|
import genReport from "@/plugins/genreport";
|
||||||
|
|
||||||
/**importType*/
|
/**importType*/
|
||||||
import type { NewPagination } from "@/modules/15_development/interface/index/Main";
|
import type {
|
||||||
|
NewPagination,
|
||||||
|
ItemsMenu,
|
||||||
|
} from "@/modules/15_development/interface/index/Main";
|
||||||
|
|
||||||
/** importStore*/
|
/** importStore*/
|
||||||
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
const pagination = ref({
|
|
||||||
page: 1,
|
|
||||||
rowsPerPage: 10,
|
|
||||||
});
|
|
||||||
|
|
||||||
const formFilter = reactive({
|
const formFilter = reactive({
|
||||||
root: null,
|
root: null,
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 20,
|
pageSize: 10,
|
||||||
keyword: "",
|
keyword: "",
|
||||||
year: new Date().getFullYear(),
|
year: new Date().getFullYear(),
|
||||||
});
|
});
|
||||||
|
|
@ -34,9 +33,10 @@ const store = useDevelopmentDataStore();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||||
|
|
||||||
const rows = ref<any>([]);
|
const rows = ref<any[]>([]);
|
||||||
|
|
||||||
const visibleColumns = ref<string[]>([
|
const visibleColumns = ref<string[]>([
|
||||||
|
"year",
|
||||||
"citizenId",
|
"citizenId",
|
||||||
"name",
|
"name",
|
||||||
"position",
|
"position",
|
||||||
|
|
@ -47,6 +47,16 @@ const visibleColumns = ref<string[]>([
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
{
|
||||||
|
name: "year",
|
||||||
|
align: "left",
|
||||||
|
label: "ปีงบประมาณ",
|
||||||
|
sortable: true,
|
||||||
|
field: "year",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
format: (v) => v + 543,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "citizenId",
|
name: "citizenId",
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|
@ -112,8 +122,21 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const agencyOp = ref<[]>([]);
|
const agencyOp = ref<[]>([]);
|
||||||
|
const itemMenu = ref<ItemsMenu[]>([
|
||||||
|
{
|
||||||
|
label: "ไฟล์ .xlsx",
|
||||||
|
value: "xlsx",
|
||||||
|
icon: "mdi-file-excel",
|
||||||
|
color: "green",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "ไฟล์ .PDF",
|
||||||
|
value: "pdf",
|
||||||
|
icon: "mdi-file-pdf",
|
||||||
|
color: "red",
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
function fetchListOrg() {
|
function fetchListOrg() {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -152,6 +175,7 @@ function getData() {
|
||||||
level: item.posLevel ? item.posLevel : null,
|
level: item.posLevel ? item.posLevel : null,
|
||||||
projectName: item.projectName ? item.projectName : null,
|
projectName: item.projectName ? item.projectName : null,
|
||||||
positionSide: item.posExecutive ? item.posExecutive : null,
|
positionSide: item.posExecutive ? item.posExecutive : null,
|
||||||
|
year: item.year ? item.year : null,
|
||||||
}));
|
}));
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -162,7 +186,7 @@ function getData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDownload() {
|
function onDownload(type: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.post(config.API.developmentReportHistory(), {
|
.post(config.API.developmentReportHistory(), {
|
||||||
|
|
@ -171,9 +195,11 @@ function onDownload() {
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const dataList = res.data.result;
|
const dataList = res.data.result;
|
||||||
|
|
||||||
genReportXLSX(
|
genReportXLSX(
|
||||||
dataList,
|
dataList,
|
||||||
"รายการประวัติการฝึกอบรม/ดูงานของข้าราชการกรุงเทพมหานครสามัญ"
|
"รายการประวัติการฝึกอบรม/ดูงานของข้าราชการกรุงเทพมหานครสามัญ",
|
||||||
|
type
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -206,6 +232,11 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const pagination = ref({
|
||||||
|
page: formFilter.page,
|
||||||
|
rowsPerPage: formFilter.pageSize,
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchListOrg();
|
fetchListOrg();
|
||||||
});
|
});
|
||||||
|
|
@ -281,16 +312,32 @@ onMounted(() => {
|
||||||
<q-tooltip>เพิ่ม</q-tooltip>
|
<q-tooltip>เพิ่ม</q-tooltip>
|
||||||
</q-btn> -->
|
</q-btn> -->
|
||||||
</q-toolbar>
|
</q-toolbar>
|
||||||
<q-toolbar class="col-4 text-white q-pa-none q-gutter-x-sm">
|
<q-toolbar class="col-4 q-pa-none q-gutter-x-sm">
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="formFilter.root !== null"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
dense
|
dense
|
||||||
icon="mdi-arrow-down-bold-circle-outline"
|
icon="mdi-arrow-down-bold-circle-outline"
|
||||||
color="blue"
|
color="blue"
|
||||||
@click="onDownload"
|
|
||||||
>
|
>
|
||||||
|
<q-menu>
|
||||||
|
<q-list style="min-width: 150px">
|
||||||
|
<q-item
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
v-for="items in itemMenu"
|
||||||
|
@click="onDownload(items.value)"
|
||||||
|
>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon :color="items.color" :name="items.icon" />
|
||||||
|
</q-item-section>
|
||||||
|
<q-item-section>{{ items.label }}</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
</q-menu>
|
||||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,18 @@ async function genReportXLSX(
|
||||||
showLoader();
|
showLoader();
|
||||||
await axios
|
await axios
|
||||||
.post(`${config.API.reportTemplate}/xlsx`, data, {
|
.post(`${config.API.reportTemplate}/xlsx`, data, {
|
||||||
headers: {
|
headers:
|
||||||
accept:
|
type == "xlsx"
|
||||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
? {
|
||||||
"content-Type": "application/json",
|
accept:
|
||||||
},
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||||
|
"content-Type": "application/json",
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
accept: "application/pdf",
|
||||||
|
"content-Type": "application/json",
|
||||||
|
},
|
||||||
|
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue