ลบ store ออก
This commit is contained in:
parent
55ce294f79
commit
18a151716e
10 changed files with 269 additions and 356 deletions
|
|
@ -5,7 +5,7 @@ import type {
|
|||
FormAddHistory,
|
||||
FormAddHistoryProject,
|
||||
} from "@/modules/15_development/interface/request/Main";
|
||||
import { useDevelopmentDataStoreHistory } from "@/modules/15_development/store/developmentStoreHistory";
|
||||
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ const id = ref<string>(route.params.id as string);
|
|||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, showLoader, hideLoader, messageError,date2Thai } = mixin;
|
||||
const store = useDevelopmentDataStoreHistory();
|
||||
const store = useDevelopmentDataStore();
|
||||
const modalDialogGov = ref<boolean>(false);
|
||||
const modalDialogProject = ref<boolean>(false);
|
||||
|
||||
|
|
@ -89,131 +89,12 @@ const fieldLabelsProject = {
|
|||
organizingTraining: "หน่วยงานที่รับผิดชอบจัดการอบรม",
|
||||
};
|
||||
|
||||
const visibleColumnsGov = ref<string[]>([
|
||||
"citizenId",
|
||||
"name",
|
||||
"position",
|
||||
"type",
|
||||
"level",
|
||||
"positionSide",
|
||||
]);
|
||||
|
||||
const visibleColumnsProject = ref<string[]>([
|
||||
"project",
|
||||
"year",
|
||||
"organizingTraining",
|
||||
]);
|
||||
|
||||
const columnsGov = ref<QTableProps["columns"]>([
|
||||
{
|
||||
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: "type",
|
||||
align: "left",
|
||||
label: "ประเภทตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "type",
|
||||
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: "positionSide",
|
||||
align: "left",
|
||||
label: "ตําแหน่งทางการบริหาร",
|
||||
sortable: true,
|
||||
field: "positionSide",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
const columnsProject = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "project",
|
||||
align: "left",
|
||||
label: "ชื่อโครงการ/กิจกรรม/หลักสูตร",
|
||||
sortable: true,
|
||||
field: "project",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "year",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "year",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
||||
{
|
||||
name: "organizingTraining",
|
||||
align: "left",
|
||||
label: "หน่วยงานที่รับผิดชอบ",
|
||||
sortable: true,
|
||||
field: "organizingTraining",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
/** เปิด dialog ข้าราชการ*/
|
||||
function openDialogGov() {
|
||||
store.columns = columnsGov.value;
|
||||
store.visibleColumns = visibleColumnsGov.value;
|
||||
modalDialogGov.value = true;
|
||||
}
|
||||
|
||||
/** เปิด dialog โครงการ */
|
||||
function openDialogProject() {
|
||||
store.columns = columnsProject.value;
|
||||
store.visibleColumns = visibleColumnsProject.value;
|
||||
|
||||
modalDialogProject.value = true;
|
||||
}
|
||||
|
||||
function getClass() {
|
||||
return "inputgreen";
|
||||
}
|
||||
/** save */
|
||||
function onSubmit() {
|
||||
const url = store.status
|
||||
const url = store.statusEdit
|
||||
? config.API.developmentHistoryList('officer')+`${id.value}`
|
||||
: config.API.developmentHistoryAdd('officer')
|
||||
|
||||
|
|
@ -234,7 +115,7 @@ function onSubmit() {
|
|||
}
|
||||
dialogConfirm($q,()=>{
|
||||
showLoader()
|
||||
http[store.status ? 'put':'post'](url,body)
|
||||
http[store.statusEdit ? 'put':'post'](url,body)
|
||||
.then((res)=>{
|
||||
console.log(res)
|
||||
router.push(`/development/history`)
|
||||
|
|
@ -282,7 +163,7 @@ function getDataEdit(){
|
|||
}
|
||||
|
||||
onMounted(()=>{
|
||||
if(store.status == true){
|
||||
if(store.statusEdit == true){
|
||||
console.log(1)
|
||||
// getDataEdit()
|
||||
}
|
||||
|
|
@ -300,7 +181,7 @@ onMounted(()=>{
|
|||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
<span>{{ store.status ? `แก้ไขประวัติการฝึกอบรม/ดูงานของข้าราชการกรุงเทพมหานครสามัญ`:`เพิ่มประวัติการฝึกอบรม/ดูงานของข้าราชการกรุงเทพมหานครสามัญ`}}</span
|
||||
<span>{{ store.statusEdit ? `แก้ไขประวัติการฝึกอบรม/ดูงานของข้าราชการกรุงเทพมหานครสามัญ`:`เพิ่มประวัติการฝึกอบรม/ดูงานของข้าราชการกรุงเทพมหานครสามัญ`}}</span
|
||||
>
|
||||
</div>
|
||||
<q-card flat bordered>
|
||||
|
|
@ -316,7 +197,7 @@ onMounted(()=>{
|
|||
color="teal"
|
||||
label="เลือกข้าราชการฯ"
|
||||
icon="add"
|
||||
@click="openDialogGov()"
|
||||
@click="modalDialogGov = true"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
|
|
@ -366,7 +247,7 @@ onMounted(()=>{
|
|||
color="teal"
|
||||
label="เลือกโครงการ"
|
||||
icon="add"
|
||||
@click="openDialogProject()"
|
||||
@click="modalDialogProject = true;"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@
|
|||
import { ref, watch, computed,reactive } from "vue";
|
||||
import Header from "@/components/DialogHeader.vue";
|
||||
import type { DataOption,FormFilter,NewPagination } from "@/modules/15_development/interface/index/Main";
|
||||
import { useDevelopmentDataStoreHistory } from "@/modules/15_development/store/developmentStoreHistory";
|
||||
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
||||
|
||||
const rows = ref<any[]>([])
|
||||
const props = defineProps({
|
||||
upDate: { type: Function },
|
||||
});
|
||||
|
|
@ -45,7 +45,7 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
} = mixin;
|
||||
const store = useDevelopmentDataStoreHistory();
|
||||
const store = useDevelopmentDataStore();
|
||||
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
|
||||
|
|
@ -67,6 +67,72 @@ const govOp = ref<DataOption[]>([
|
|||
},
|
||||
]);
|
||||
|
||||
const visibleColumns = ref<string[]>([
|
||||
"citizenId",
|
||||
"name",
|
||||
"position",
|
||||
"type",
|
||||
"level",
|
||||
"positionSide",
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
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: "type",
|
||||
align: "left",
|
||||
label: "ประเภทตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "type",
|
||||
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: "positionSide",
|
||||
align: "left",
|
||||
label: "ตําแหน่งทางการบริหาร",
|
||||
sortable: true,
|
||||
field: "positionSide",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
/** save ข้อมูล */
|
||||
function onSubmit() {
|
||||
if (selected.value?.length == 0) {
|
||||
|
|
@ -99,7 +165,7 @@ function onSubmit() {
|
|||
/** ปิด dialog */
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
store.rows = [];
|
||||
rows.value = [];
|
||||
selected.value = [];
|
||||
}
|
||||
|
||||
|
|
@ -119,7 +185,7 @@ function searchFilter() {
|
|||
console.log(res.data.result.data);
|
||||
const data = res.data.result.data;
|
||||
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
|
||||
store.rows = data.map((item: any) => ({
|
||||
rows.value = data.map((item: any) => ({
|
||||
id:item.id ? item.id : null,
|
||||
name: item.firstName ? `${item.prefix}${item.firstName} ${item.lastName}` : null,
|
||||
prefix:item.prefix ? item.prefix : null,
|
||||
|
|
@ -213,14 +279,14 @@ watch(
|
|||
v-model:selected="selected"
|
||||
for="table"
|
||||
ref="table"
|
||||
:columns="store.columns"
|
||||
:rows="store.rows"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
class="custom-header-table"
|
||||
:visible-columns="store.visibleColumns"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[20, 25, 50, 100]"
|
||||
@update:pagination="updatePageSize"
|
||||
|
|
|
|||
|
|
@ -6,13 +6,15 @@ import type {
|
|||
FormFilter,
|
||||
NewPagination,
|
||||
} from "@/modules/15_development/interface/index/Main";
|
||||
import { useDevelopmentDataStoreHistory } from "@/modules/15_development/store/developmentStoreHistory";
|
||||
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const rows = ref<any[]>([])
|
||||
|
||||
const props = defineProps({
|
||||
upDate: { type: Function },
|
||||
});
|
||||
|
|
@ -27,7 +29,7 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
} = mixin;
|
||||
const store = useDevelopmentDataStoreHistory();
|
||||
const store = useDevelopmentDataStore();
|
||||
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
|
||||
|
|
@ -70,6 +72,45 @@ const projectOp = ref<DataOption[]>([
|
|||
// },
|
||||
]);
|
||||
|
||||
const visibleColumns = ref<string[]>([
|
||||
"project",
|
||||
"year",
|
||||
"organizingTraining",
|
||||
]);
|
||||
|
||||
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "project",
|
||||
align: "left",
|
||||
label: "ชื่อโครงการ/กิจกรรม/หลักสูตร",
|
||||
sortable: true,
|
||||
field: "project",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "year",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "year",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
||||
{
|
||||
name: "organizingTraining",
|
||||
align: "left",
|
||||
label: "หน่วยงานที่รับผิดชอบ",
|
||||
sortable: true,
|
||||
field: "organizingTraining",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
/** save ข้อมูล */
|
||||
function onSubmit() {
|
||||
if (selected.value?.length == 0) {
|
||||
|
|
@ -96,7 +137,7 @@ function onSubmit() {
|
|||
/** ปิด dialog */
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
store.rows = [];
|
||||
rows.value = [];
|
||||
selected.value = [];
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +159,7 @@ function searchFilter() {
|
|||
.then((res) => {
|
||||
const data = res.data.result.data;
|
||||
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
|
||||
store.rows = data.map((item: any) => ({
|
||||
rows.value = data.map((item: any) => ({
|
||||
id: item.id ? item.id : null,
|
||||
year: item.year ? item.year : null,
|
||||
project: item.projectName ? item.projectName : null,
|
||||
|
|
@ -244,14 +285,14 @@ watch(
|
|||
v-model:selected="selected"
|
||||
for="table"
|
||||
ref="table"
|
||||
:columns="store.columns"
|
||||
:rows="store.rows"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
class="custom-header-table"
|
||||
:visible-columns="store.visibleColumns"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[20, 25, 50, 100]"
|
||||
@update:pagination="updatePageSize"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import type {
|
|||
FormAddHistoryEmployee,
|
||||
FormAddHistoryProject,
|
||||
} from "@/modules/15_development/interface/request/Main";
|
||||
import { useDevelopmentDataStoreHistory } from "@/modules/15_development/store/developmentStoreHistory";
|
||||
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ const $q = useQuasar();
|
|||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, showLoader, hideLoader, messageError, date2Thai } =
|
||||
mixin;
|
||||
const store = useDevelopmentDataStoreHistory();
|
||||
const store = useDevelopmentDataStore();
|
||||
const modalDialogGov = ref<boolean>(false);
|
||||
const modalDialogProject = ref<boolean>(false);
|
||||
|
||||
|
|
@ -88,122 +88,12 @@ const fieldLabelsProject = {
|
|||
organizingTraining: "หน่วยงานที่รับผิดชอบจัดการอบรม",
|
||||
};
|
||||
|
||||
const visibleColumnsGov = ref<string[]>([
|
||||
"citizenId",
|
||||
"name",
|
||||
"position",
|
||||
"type",
|
||||
"level",
|
||||
"positionSide",
|
||||
]);
|
||||
|
||||
const visibleColumnsProject = ref<string[]>([
|
||||
"project",
|
||||
"year",
|
||||
"organizingTraining",
|
||||
]);
|
||||
|
||||
const columnsGov = ref<QTableProps["columns"]>([
|
||||
{
|
||||
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: "type",
|
||||
align: "left",
|
||||
label: "กลุ่มงาน",
|
||||
sortable: true,
|
||||
field: "type",
|
||||
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",
|
||||
},
|
||||
]);
|
||||
|
||||
const columnsProject = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "project",
|
||||
align: "left",
|
||||
label: "ชื่อโครงการ/กิจกรรม/หลักสูตร",
|
||||
sortable: true,
|
||||
field: "project",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "year",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "year",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
||||
{
|
||||
name: "organizingTraining",
|
||||
align: "left",
|
||||
label: "หน่วยงานที่รับผิดชอบ",
|
||||
sortable: true,
|
||||
field: "organizingTraining",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
/** เปิด dialog ข้าราชการ*/
|
||||
function openDialogGov() {
|
||||
store.columns = columnsGov.value;
|
||||
store.visibleColumns = visibleColumnsGov.value;
|
||||
modalDialogGov.value = true;
|
||||
}
|
||||
|
||||
/** เปิด dialog โครงการ */
|
||||
function openDialogProject() {
|
||||
store.columns = columnsProject.value;
|
||||
store.visibleColumns = visibleColumnsProject.value;
|
||||
|
||||
modalDialogProject.value = true;
|
||||
}
|
||||
|
||||
function getClass() {
|
||||
return "inputgreen";
|
||||
}
|
||||
/** save */
|
||||
function onSubmit() {
|
||||
const url = store.status
|
||||
const url = store.statusEdit
|
||||
? config.API.developmentHistoryList("employee") + `${id.value}`
|
||||
: config.API.developmentHistoryAdd("employee");
|
||||
|
||||
|
|
@ -214,7 +104,7 @@ function onSubmit() {
|
|||
lastName: formMain.lastName,
|
||||
citizenId: formMain.citizenId,
|
||||
position: formMain.position,
|
||||
// posExecutive:formMain.positionSide,
|
||||
posExecutive:null,
|
||||
posLevelId: formMain.posLevelId,
|
||||
posTypeId: formMain.posTypeId,
|
||||
|
||||
|
|
@ -224,7 +114,7 @@ function onSubmit() {
|
|||
};
|
||||
dialogConfirm($q, () => {
|
||||
showLoader();
|
||||
http[store.status ? "put" : "post"](url, body)
|
||||
http[store.statusEdit ? "put" : "post"](url, body)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
router.push(`/development/history`);
|
||||
|
|
@ -274,7 +164,7 @@ function getDataEdit() {
|
|||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (store.status == true) {
|
||||
if (store.statusEdit == true) {
|
||||
console.log(1);
|
||||
// getDataEdit()
|
||||
}
|
||||
|
|
@ -293,7 +183,7 @@ onMounted(() => {
|
|||
@click="router.go(-1)"
|
||||
/>
|
||||
<span>{{
|
||||
store.status
|
||||
store.statusEdit
|
||||
? `แก้ไขประวัติฝึกอบรม/ดูงานลูกจ้าง`
|
||||
: `เพิ่มประวัติฝึกอบรม/ดูงานลูกจ้าง`
|
||||
}}</span>
|
||||
|
|
@ -311,7 +201,7 @@ onMounted(() => {
|
|||
color="teal"
|
||||
label="เลือกลูกจ้าง"
|
||||
icon="add"
|
||||
@click="openDialogGov()"
|
||||
@click="modalDialogGov = true"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
|
|
@ -361,7 +251,7 @@ onMounted(() => {
|
|||
color="teal"
|
||||
label="เลือกโครงการ"
|
||||
icon="add"
|
||||
@click="openDialogProject()"
|
||||
@click="modalDialogProject = true"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@
|
|||
import { ref, watch, computed,reactive } from "vue";
|
||||
import Header from "@/components/DialogHeader.vue";
|
||||
import type { DataOption,FormFilter,NewPagination } from "@/modules/15_development/interface/index/Main";
|
||||
import { useDevelopmentDataStoreHistory } from "@/modules/15_development/store/developmentStoreHistory";
|
||||
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
||||
|
||||
const rows = ref<any[]>([])
|
||||
const props = defineProps({
|
||||
upDate: { type: Function },
|
||||
});
|
||||
|
|
@ -45,7 +45,7 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
} = mixin;
|
||||
const store = useDevelopmentDataStoreHistory();
|
||||
const store = useDevelopmentDataStore();
|
||||
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
|
||||
|
|
@ -67,6 +67,63 @@ const govOp = ref<DataOption[]>([
|
|||
},
|
||||
]);
|
||||
|
||||
const visibleColumns = ref<string[]>([
|
||||
"citizenId",
|
||||
"name",
|
||||
"position",
|
||||
"type",
|
||||
"level",
|
||||
"positionSide",
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
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: "type",
|
||||
align: "left",
|
||||
label: "กลุ่มงาน",
|
||||
sortable: true,
|
||||
field: "type",
|
||||
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",
|
||||
},
|
||||
]);
|
||||
|
||||
/** save ข้อมูล */
|
||||
function onSubmit() {
|
||||
if (selected.value?.length == 0) {
|
||||
|
|
@ -99,7 +156,7 @@ function onSubmit() {
|
|||
/** ปิด dialog */
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
store.rows = [];
|
||||
rows.value = [];
|
||||
selected.value = [];
|
||||
}
|
||||
|
||||
|
|
@ -120,7 +177,7 @@ function searchFilter() {
|
|||
.then((res) => {
|
||||
const data = res.data.result.data;
|
||||
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
|
||||
store.rows = data.map((item: any) => ({
|
||||
rows.value = data.map((item: any) => ({
|
||||
id:item.id ? item.id:null,
|
||||
prefix:item.prefix ? item.prefix:null,
|
||||
rank:item.rank ? item.rank:null,
|
||||
|
|
@ -145,42 +202,6 @@ function searchFilter() {
|
|||
});
|
||||
}
|
||||
|
||||
// function searchFilter() {
|
||||
// showLoader();
|
||||
// http
|
||||
// .get(
|
||||
// config.API.registryNew +
|
||||
// `?page=${formFilter.page}&pageSize=${formFilter.pageSize}&searchField=${search.value}&searchKeyword=${inputSearch.value}`
|
||||
// )
|
||||
// .then((res) => {
|
||||
// console.log(res.data.result.data);
|
||||
// const data = res.data.result.data;
|
||||
// maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
|
||||
// store.rows = data.map((item: any) => ({
|
||||
// id:item.id ? item.id : null,
|
||||
// name: item.firstName ? `${item.prefix}${item.firstName} ${item.lastName}` : null,
|
||||
// prefix:item.prefix ? item.prefix : null,
|
||||
// rank:item.rank ? item.rank : null,
|
||||
// firstName:item.firstName ? item.firstName : null,
|
||||
// lastName:item.lastName ? item.lastName : null,
|
||||
// citizenId:item.citizenId ? item.citizenId : null,
|
||||
// level:item.posLevel ? item.posLevel : null,
|
||||
// type:item.posType ? item.posType : null,
|
||||
// posLevelId:item.posLevelId ? item.posLevelId : null,
|
||||
// posTypeId:item.posTypeId ? item.posTypeId : null,
|
||||
// position:item.position ? item.position : null,
|
||||
// positionSide:item.posExecutive ? item.posExecutive : null,
|
||||
// posNo:item.posNo ? item.posNo : null,
|
||||
// }));
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
|
||||
function updatePage(val:number){
|
||||
formFilter.page = val;
|
||||
searchFilter();
|
||||
|
|
@ -250,14 +271,14 @@ watch(
|
|||
v-model:selected="selected"
|
||||
for="table"
|
||||
ref="table"
|
||||
:columns="store.columns"
|
||||
:rows="store.rows"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
class="custom-header-table"
|
||||
:visible-columns="store.visibleColumns"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[20, 25, 50, 100]"
|
||||
@update:pagination="updatePageSize"
|
||||
|
|
|
|||
|
|
@ -6,13 +6,14 @@ import type {
|
|||
FormFilter,
|
||||
NewPagination,
|
||||
} from "@/modules/15_development/interface/index/Main";
|
||||
import { useDevelopmentDataStoreHistory } from "@/modules/15_development/store/developmentStoreHistory";
|
||||
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const rows = ref<any[]>([]);
|
||||
const props = defineProps({
|
||||
upDate: { type: Function },
|
||||
});
|
||||
|
|
@ -27,7 +28,7 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
} = mixin;
|
||||
const store = useDevelopmentDataStoreHistory();
|
||||
const store = useDevelopmentDataStore();
|
||||
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
|
||||
|
|
@ -70,6 +71,39 @@ const projectOp = ref<DataOption[]>([
|
|||
// },
|
||||
]);
|
||||
|
||||
const visibleColumns = ref<string[]>(["project", "year", "organizingTraining"]);
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "project",
|
||||
align: "left",
|
||||
label: "ชื่อโครงการ/กิจกรรม/หลักสูตร",
|
||||
sortable: true,
|
||||
field: "project",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "year",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "year",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
||||
{
|
||||
name: "organizingTraining",
|
||||
align: "left",
|
||||
label: "หน่วยงานที่รับผิดชอบ",
|
||||
sortable: true,
|
||||
field: "organizingTraining",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
/** save ข้อมูล */
|
||||
function onSubmit() {
|
||||
if (selected.value?.length == 0) {
|
||||
|
|
@ -78,16 +112,16 @@ function onSubmit() {
|
|||
dialogConfirm($q, () => {
|
||||
const data = selected.value[0];
|
||||
const body = {
|
||||
id:data.id,
|
||||
year:data.year,
|
||||
project:data.project,
|
||||
dateStart:data.dateStart,
|
||||
dateEnd:data.dateEnd,
|
||||
totalDate:data.totalDate,
|
||||
addressAcademic:data.addressAcademic,
|
||||
topicAcademic:data.topicAcademic,
|
||||
id: data.id,
|
||||
year: data.year,
|
||||
project: data.project,
|
||||
dateStart: data.dateStart,
|
||||
dateEnd: data.dateEnd,
|
||||
totalDate: data.totalDate,
|
||||
addressAcademic: data.addressAcademic,
|
||||
topicAcademic: data.topicAcademic,
|
||||
};
|
||||
props.upDate?.(body)
|
||||
props.upDate?.(body);
|
||||
closeDialog();
|
||||
});
|
||||
}
|
||||
|
|
@ -96,7 +130,7 @@ function onSubmit() {
|
|||
/** ปิด dialog */
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
store.rows = [];
|
||||
rows.value = [];
|
||||
selected.value = [];
|
||||
}
|
||||
|
||||
|
|
@ -117,7 +151,7 @@ function searchFilter() {
|
|||
.then((res) => {
|
||||
const data = res.data.result.data;
|
||||
maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize);
|
||||
store.rows = data.map((item: any) => ({
|
||||
rows.value = data.map((item: any) => ({
|
||||
id: item.id ? item.id : null,
|
||||
year: item.year ? item.year : null,
|
||||
project: item.projectName ? item.projectName : null,
|
||||
|
|
@ -136,7 +170,7 @@ function searchFilter() {
|
|||
});
|
||||
}
|
||||
|
||||
function updatePage(val:number){
|
||||
function updatePage(val: number) {
|
||||
formFilter.page = val;
|
||||
searchFilter();
|
||||
}
|
||||
|
|
@ -243,14 +277,14 @@ watch(
|
|||
v-model:selected="selected"
|
||||
for="table"
|
||||
ref="table"
|
||||
:columns="store.columns"
|
||||
:rows="store.rows"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
class="custom-header-table"
|
||||
:visible-columns="store.visibleColumns"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[20, 25, 50, 100]"
|
||||
@update:pagination="updatePageSize"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue