Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into me

This commit is contained in:
Thanit Konmek 2023-08-29 11:10:19 +07:00
commit ea1f7b5592
26 changed files with 1979 additions and 1391 deletions

View file

@ -4,6 +4,7 @@
import env from "../index";
const reportOrder = `${env.API_REPORT2_URI}/report/order`;
const reportRetire = `${env.API_REPORT2_URI}/report/retire`;
const reportProbation = `${env.API_REPORT2_URI}/report/probation`;
export default {
reportOrderCover: (fileType: string, id: string, commandCode: string) =>
@ -17,4 +18,14 @@ export default {
`${reportOrder}/${format}/cover/${fileType}/${id}`,
fileAttachment: (format: string, fileType: string, id: string) =>
`${reportOrder}/${format}/attachment/${fileType}/${id}`,
//ระบบทดลองงาน
reportAssign:(type:string, id:string) => `${reportProbation}/13/${type}/${id}`,
reportEvaluateRecord1:(type:string, id:string) => `${reportProbation}/14/${type}/${id}`,
reportEvaluateRecord2:(type:string, id:string) => `${reportProbation}/15/${type}/${id}`,
reportEvaluate:(type:string, id:string) => `${reportProbation}/16/${type}/${id}`,
reportEvaluateChairman:(type:string, id:string) => `${reportProbation}/17/${type}/${id}`,
reportEvaluateResult:(type:string, id:string) => `${reportProbation}/18/${type}/${id}`,
reportSurvey:(type:string, id:string) => `${reportProbation}/19/${type}/${id}`
};

View file

@ -43,7 +43,7 @@ const visibleColumns = ref<string[]>([
"position",
"positionLevel",
"organizationPositionOld",
// "organization",
"organization",
"createdAt",
"statusText",
"btn",
@ -55,7 +55,7 @@ const visibleColumns2 = ref<string[]>([
"position",
"positionLevel",
"organizationPositionOld",
// "organization",
"organization",
"createdAt",
"statusText",
]); //
@ -72,53 +72,7 @@ const resetFilter = () => {
// router.push("/retirement/resign/"+id);
// };
const rows = ref<officerType[]>([]);
const rows2 = ref<any>([
{
personalId: "0a846508-4932-40de-9a9e-5b519492217c",
fullname: "นางสาวอย พชช",
position: "นักบริหาร",
positionLevel: "ต้น",
oc: "สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร",
agency: "กลุ่มงานกุมารเวชกรรม",
status: "รออนุมัติ",
},
{
personalId: "08db721d-add6-47b0-8a13-5f45d106e8d1",
fullname: "นางสาววญ สพ",
position: "นักจัดการงานทั่วไป",
positionLevel: "ปฏิบัติการ",
oc: "กลุ่มงานช่วยนักบริหาร",
agency: "กลุ่มงานข้อมูลเมือง",
status: "รออนุมัติ",
},
{
personalId: "08db721d-adf2-4842-8056-1abb1539356e",
fullname: "นางสาววญ สพ",
position: "นักจัดการงานทั่วไป",
positionLevel: "ปฏิบัติการ",
oc: "กลุ่มงานช่วยนักบริหาร",
agency: "กลุ่มงานข้อมูลเมือง",
status: "รออนุมัติ",
},
{
personalId: "08db721d-adff-47b0-8762-41cd5c991001",
fullname: "นางสาววญ สพ",
position: "นักจัดการงานทั่วไป",
positionLevel: "ปฏิบัติการ",
oc: "กลุ่มงานช่วยนักบริหาร",
agency: "กลุ่มงานข้อมูลเมือง",
status: "รออนุมัติ",
},
{
personalId: "08db721d-ae22-424d-8f4a-87ba30cc3ee7",
fullname: "นางสาววญ สพ",
position: "นักจัดการงานทั่วไป",
positionLevel: "ปฏิบัติการ",
oc: "กลุ่มงานช่วยนักบริหาร",
agency: "กลุ่มงานข้อมูลเมือง",
status: "รออนุมัติ",
},
]);
const rows2 = ref<any>([]);
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -177,7 +131,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "organization",
align: "left",
label: "หน่วยงานที่ขอโอนไป",
label: "หน่วยงานที่ให้ช่วยราชการ",
sortable: true,
field: "organization",
headerStyle: "font-size: 14px",
@ -272,7 +226,7 @@ const columns2 = ref<QTableProps["columns"]>([
{
name: "organization",
align: "left",
label: "หน่วยงานที่ขอโอนไป",
label: "หน่วยงานที่ให้ช่วยราชการ",
sortable: true,
field: "organization",
headerStyle: "font-size: 14px",

View file

@ -200,9 +200,9 @@
:readonly="!edit"
:borderless="!edit"
v-model="organization"
:rules="[(val) => !!val || `${'กรุณากรอกโอนไปสังกัด'}`]"
:rules="[(val) => !!val || `${'กรุณากรอกหน่วยงานที่ให้ช่วยราชการ'}`]"
hide-bottom-space
:label="`${'โอนไปสังกัด'}`"
:label="`${'หน่วยงานที่ให้ช่วยราชการ'}`"
/>
</div>
</div>

View file

@ -181,7 +181,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "organization",
align: "left",
label: "หน่วยงานที่ขอโอนไป",
label: "หน่วยงานที่ให้ช่วยราชการ",
sortable: true,
field: "organization",
headerStyle: "font-size: 14px",
@ -298,7 +298,7 @@ const columns2 = ref<QTableProps["columns"]>([
{
name: "organization",
align: "left",
label: "หน่วยงานที่ขอโอนไป",
label: "หน่วยงานที่ให้ช่วยราชการ",
sortable: true,
field: "organization",
headerStyle: "font-size: 14px",

File diff suppressed because it is too large Load diff

View file

@ -77,13 +77,14 @@ const reson = ref<string>("");
const chairman_dated = ref<string>("");
const director1_dated = ref<any>("");
const director2_dated = ref<any>("");
const fullname = ref<string>("")
const fecthResult = async (id: string) => {
await http
.get(config.API.createformReport(id))
.then((res: any) => {
let data = res.data.data.evaluate;
console.log(data);
fullname.value = res.data.data.profile.name;
date_start.value = data.date_start;
date_finish.value = data.date_finish;
develop.value = Number(data.develop_complete);
@ -124,7 +125,32 @@ const savaForm = async () => {
}
});
};
const downloadFile = (response: any, filename: string) => {
const link = document.createElement("a");
var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data]));
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
const clickdownloadFile = async (type: string) => {
showLoader();
await http
.get(config.API.reportEvaluateResult(type, assignId.value), {
responseType: "blob",
})
.then((res) => {
downloadFile(res,`แบบรายงานการประเมินฯ_${fullname.value}.${type}`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
const postData = async () => {
const data = await {
start_date: date_start.value,
@ -153,6 +179,7 @@ const postData = async () => {
<template>
<div class="row col-12">
<div class="toptitle text-dark col-12 row items-center q-gutter-md">
<div>แบบรายงานการประเมนฯ</div>
<!-- <q-space /> -->
@ -160,11 +187,11 @@ const postData = async () => {
<q-tooltip>ดาวนโหลด</q-tooltip>
<q-menu>
<q-list style="min-width: 150px">
<q-item clickable v-close-popup>
<q-item clickable v-close-popup @click="clickdownloadFile('pdf')">
<q-item-section avatar><q-icon color="red" name="mdi-file-pdf" /></q-item-section>
<q-item-section>ไฟล .PDF</q-item-section>
</q-item>
<q-item clickable v-close-popup>
<q-item clickable v-close-popup @click="clickdownloadFile('docx')">
<q-item-section avatar><q-icon color="blue" name="mdi-file-word" /></q-item-section>
<q-item-section>ไฟล .docx</q-item-section>
</q-item>

View file

@ -61,6 +61,7 @@ onMounted(async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
fecthFormdata();
}
});
@ -69,6 +70,7 @@ watch(props, async () => {
if (props.tab && props.action == "edit") {
evaluate_no.value = Number(props.tab.charAt(4));
dataArr.value = await props.data;
console.log(dataArr.value)
fecthFormdata();
// console.log("props===>", props.data);
}

View file

@ -6,6 +6,12 @@ const route = useRoute();
const tabHead = ref<string>("save1");
const props = defineProps({
FileDownload:{
type:Function,
default() {
return "Default function";
},
},
loop: {
type: Number,
},
@ -22,6 +28,9 @@ const props = defineProps({
},
},
});
const downloadFile = (type:string) =>{
props.FileDownload(type)
}
watch(tabHead, () => {
props.changeTab(tabHead.value);
@ -58,13 +67,13 @@ const nextPage = () => {
<q-tooltip>ดาวนโหลด</q-tooltip>
<q-menu>
<q-list style="min-width: 150px">
<q-item clickable v-close-popup>
<q-item clickable v-close-popup @click="downloadFile('pdf')">
<q-item-section avatar
><q-icon color="red" name="mdi-file-pdf"
/></q-item-section>
<q-item-section>ไฟล .PDF</q-item-section>
</q-item>
<q-item clickable v-close-popup>
<q-item clickable v-close-popup @click="downloadFile('docx')">
<q-item-section avatar
><q-icon color="blue" name="mdi-file-word"
/></q-item-section>

View file

@ -3,15 +3,17 @@ import { ref, defineAsyncComponent, watch, onMounted, onUpdated } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
const Header = defineAsyncComponent(() =>
import(
"@/modules/05_placement/components/probation/FormEvaluation/Header.vue"
)
const Header = defineAsyncComponent(
() =>
import(
"@/modules/05_placement/components/probation/FormEvaluation/Header.vue"
)
);
const FormSaveResult = defineAsyncComponent(() =>
import(
"@/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue"
)
const FormSaveResult = defineAsyncComponent(
() =>
import(
"@/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue"
)
);
import http from "@/plugins/http";
@ -24,12 +26,12 @@ const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, success } = mixin;
const assignId = ref<string>(route.params.form.toString());
const personalId = ref<string>(route.params.personalId.toString());
const fullname = ref<string>("");
const evaluate = ref<any>([]);
const tabs = ref<any>([]);
const tab = ref<string>("save1");
const dataArrayNumber = ref<number>();
const dataRole = ref<string>("metor");
onMounted(async () => {
await fecthAssign(assignId.value);
});
@ -41,6 +43,7 @@ const fecthAssign = async (id: string) => {
.then(async (res: any) => {
evaluate.value = res.data.data.evaluate;
tabs.value = evaluate.value;
fullname.value = res.data.data.person.name;
dataArrayNumber.value = 1;
})
.catch((e: any) => {
@ -56,6 +59,58 @@ const changeTab = (tabVal: string) => {
tab.value = tabVal;
dataArrayNumber.value = Number(tabVal.charAt(4));
};
const downloadFile = (response: any, filename: string) => {
const link = document.createElement("a");
var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data]));
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
const FileDownload = async (type: string) => {
let numTab = evaluate.value.find((e: any) => e.no === dataArrayNumber.value);
//
if (dataRole.value == "mentor") {
showLoader();
await http
.get(config.API.reportEvaluateRecord1(type, numTab.id), {
responseType: "blob",
})
.then(async (res) => {
downloadFile(
res,
`แบบบันทึกผล(ผู้ดูเเล)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
} else {
//
showLoader();
await http
.get(config.API.reportEvaluateRecord2(type, numTab.id), {
responseType: "blob",
})
.then(async (res) => {
downloadFile(
res,
`แบบบันทึกผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`
);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
};
const addData = () => {
router.push(
`/probation/detail/addresult/${personalId.value}/${assignId.value}`
@ -64,15 +119,29 @@ const addData = () => {
</script>
<template>
<Header v-if="tabs.length > 0" :change-tab="changeTab" :add-data="addData" :loop="tabs.length" />
<Header
v-if="tabs.length > 0"
:change-tab="changeTab"
:add-data="addData"
:loop="tabs.length"
:FileDownload="FileDownload"
/>
<q-page-container v-if="tabs.length > 0">
<FormSaveResult :tab="tab" :data="evaluate.find((x: any) => x.no === dataArrayNumber)" action="edit" />
<FormSaveResult
:tab="tab"
:data="evaluate.find((x: any) => x.no === dataArrayNumber)"
action="edit"
/>
</q-page-container>
<div class="q-gutter-md" v-else-if="tabs.length == 0">
<div class="flex justify-center items-center q-my-md q-gutter-md">
<q-btn outline color="primary" label="สร้างแบบบันทึกผล" @click="addData" />
<q-btn
outline
color="primary"
label="สร้างแบบบันทึกผล"
@click="addData"
/>
</div>
</div>
</template>

View file

@ -6,8 +6,18 @@ import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
const Header = defineAsyncComponent(() => import("@/modules/05_placement/components/probation/FormEvaluation/Header.vue"));
const FormEvaluate = defineAsyncComponent(() => import("@/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue"));
const Header = defineAsyncComponent(
() =>
import(
"@/modules/05_placement/components/probation/FormEvaluation/Header.vue"
)
);
const FormEvaluate = defineAsyncComponent(
() =>
import(
"@/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue"
)
);
const router = useRouter();
const route = useRoute();
@ -16,7 +26,7 @@ const $q = useQuasar();
const { showLoader, hideLoader, messageError, success } = mixin;
const assignId = ref<string>(route.params.form.toString());
const personalId = ref<string>(route.params.personalId.toString());
const fullname = ref<string>("")
const tab = ref<string>("save1");
const tabs = ref<any>([]);
const dataArrayNumber = ref<number>(1);
@ -37,8 +47,10 @@ const fecthAssign = async (id: string) => {
.get(config.API.createformCommader(id))
.then((res: any) => {
evaluate.value = res.data.data.evaluate;
fullname.value = res.data.data.person.name;
tabs.value = evaluate.value;
dataArrayNumber.value = 1;
console.log(fullname.value);
})
.catch((e: any) => {
// console.log(e);
@ -48,6 +60,33 @@ const fecthAssign = async (id: string) => {
hideLoader();
});
};
const downloadFile = (response: any, filename: string) => {
const link = document.createElement("a");
var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data]));
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
const FileDownload = async (type: string) => {
let numTab = evaluate.value.find((e: any) => e.no === dataArrayNumber.value);
showLoader();
await http
.get(config.API.reportEvaluate(type, numTab.id), {
responseType: "blob",
})
.then(async (res) => {
downloadFile(res, `แบบประเมินผล(ผู้บังคับบัญชา)_${fullname.value}_ครั้งที่${numTab.no}.${type}`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
const addData = () => {
router.push(
`/probation/detail/addevalua/${personalId.value}/${assignId.value}`
@ -56,10 +95,20 @@ const addData = () => {
</script>
<template>
<Header v-if="tabs.length > 0" :change-tab="changeTab" :loop="tabs.length" :add-data="addData" />
<Header
v-if="tabs.length > 0"
:change-tab="changeTab"
:loop="tabs.length"
:add-data="addData"
:FileDownload="FileDownload"
/>
<q-page-container v-if="tabs.length > 0">
<FormEvaluate :tab="tab" :data="evaluate.find((x: any) => x.no === dataArrayNumber)" action="edit" />
<FormEvaluate
:tab="tab"
:data="evaluate.find((x: any) => x.no === dataArrayNumber)"
action="edit"
/>
</q-page-container>
<div v-else class="q-gutter-md">

View file

@ -17,6 +17,7 @@ const { showLoader, hideLoader, messageError, success } = mixin;
const assignId = ref<string>(route.params.form.toString());
const personalId = ref<string>(route.params.personalId.toString());
const fullname = ref<string>("")
const tab = ref<string>("save1");
const tabs = ref<any>([]);
const dataArrayNumber = ref<number>(1);
@ -32,6 +33,7 @@ const fecthAssign = async (id: string) => {
.get(config.API.createformChairman(id))
.then((res: any) => {
evaluate.value = res.data.data.evaluate;
fullname.value = res.data.data.person.name;
tabs.value = evaluate.value;
dataArrayNumber.value = 1;
})
@ -42,6 +44,33 @@ const fecthAssign = async (id: string) => {
hideLoader();
});
};
const downloadFile = (response: any, filename: string) => {
const link = document.createElement("a");
var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data]));
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
const FileDownload = async (type: string) => {
let numTab = evaluate.value.find((e: any) => e.no === dataArrayNumber.value);
showLoader();
await http
.get(config.API.reportEvaluateChairman(type, numTab.id), {
responseType: "blob",
})
.then(async (res) => {
downloadFile(res, `แบบประเมินผล(คณะกรรมการ)_${fullname.value}_ครั้งที่${numTab.no}.${type}`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
const addData = () => {
router.push(
`/probation/detail/addevaluascore/${personalId.value}/${assignId.value}`
@ -55,7 +84,7 @@ const changeTab = (tabVal: string) => {
</script>
<template>
<Header v-if="tabs.length > 0" :change-tab="changeTab" :loop="tabs.length" :add-data="addData" />
<Header v-if="tabs.length > 0" :change-tab="changeTab" :loop="tabs.length" :add-data="addData" :FileDownload="FileDownload"/>
<q-page-container v-if="tabs.length > 0">
<FormEvaluateScore :tab="tab" :data="evaluate.find((x: any) => x.no === dataArrayNumber)" action="edit" />

View file

@ -1,106 +1,4 @@
<template>
<div class="col-xs-12 col-sm-12 col-md-11">
<div class="toptitle col-12 row items-center">
<q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm" @click="clickBack" />
{{
edit
? "รอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์"
: "เพิ่มรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์"
}}
</div>
<q-form ref="myForm">
<div class="col-12">
<q-card bordered>
<div class="col-12 row q-col-gutter-md q-pa-md">
<div class="col-xs-12 col-sm-12 row">
<q-separator />
<div class="col-12 row q-pa-sm q-col-gutter-sm">
<q-select class="col-10" dense outlined v-model="roundInsig" :options="options" option-value="value"
option-label="label" label="รอบการเสนอขอพระราชทานเครื่องราชฯ" @update:model-value="updateDateRange"
:rules="[(val) => !!val || `${'กรุณาเลือกรอบที่'}`]" />
<datepicker menu-class-name="modalfix" v-model="yearly" class="col-2" :locale="'th'" autoApply year-picker
:enableTimePicker="false" @update:modelValue="updateYear">
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input dense lazy-rules outlined :model-value="yearly + 543"
:rules="[(val) => !!val || `${'กรุณาเลือกปีที่เสนอ'}`]" :label="`${'ปีที่เสนอ'}`">
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<datepicker menu-class-name="modalfix" v-model="dateStart" :locale="'th'" autoApply
class="col-xs-12 col-sm-5" borderless :enableTimePicker="false" week-start="0">
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input outlined dense class="full-width datepicker" :model-value="dateStart != null ? date2Thai(dateStart) : null
" :label="`${'วันเริ่มต้น'}`" :rules="[(val) => !!val || `${'กรุณาเลือกวันเริ่มต้น'}`]">
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<datepicker menu-class-name="modalfix" v-model="dateEnd" class="col-xs-12 col-sm-5" :locale="'th'"
autoApply borderless :enableTimePicker="false" week-start="0">
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input outlined dense class="col-xs-12 col-sm-4"
:model-value="dateEnd != null ? date2Thai(dateEnd) : null" :label="`${'วันสิ้นสุด'}`" :rules="[
(val) => !!val || `${'กรุณาเลือกวันที่วันสิ้นสุด'}`,
]">
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<q-input class="col-xs-12 col-sm-2" dense outlined v-model="datelast"
label="จำนวนวันแจ้งเตือนก่อนวันสิ้นสุด" />
<q-file class="col-xs-12 col-sm-10" outlined dense v-model="files" @added="fileUploadDoc"
label="อัปโหลดเอกสารประกอบ" hide-bottom-space lazy-rules>
<!-- :rules="[
(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน',
]" -->
<template v-slot:prepend>
<q-icon name="attach_file" />
</template>
</q-file>
</div>
</div>
</div>
<q-separator />
<q-separator />
<div class="row col-12 q-pa-sm">
<q-space />
<q-btn unelevated dense class="q-px-md items-center" color="light-blue-10" label="บันทึก"
@click="checkSave" />
</div>
</q-card>
</div>
</q-form>
</div>
</template>
<script setup lang="ts">
import type { QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import { useQuasar, QForm } from "quasar";
import { useRouter, useRoute } from "vue-router";
@ -111,12 +9,12 @@ import config from "@/app.config";
const mixin = useCounterMixin();
const {
date2Thai,
success,
dateToISO,
messageError,
showLoader,
hideLoader,
dialogConfirm,
success,
} = mixin;
const router = useRouter();
const route = useRoute();
@ -138,18 +36,14 @@ const options = ref([
onMounted(async () => {
await fetchData();
});
const fetchData = async () => {
if (route.params.id) {
edit.value = true;
showLoader();
// console.log(id.value);
await http
.get(config.API.getRoundInsignia(id.value))
.then((res) => {
const data = res.data.result;
// const files = res.data.result.files;
id.value = data.period_id;
roundInsig.value =
options.value.filter((r: any) => r.value == data.period_round)
@ -171,8 +65,6 @@ const fetchData = async () => {
}
};
const routeName = router.currentRoute.value.name;
const fileUploadDoc = async (files: any) => {
files.forEach((file: any) => {
fileDocDataUpload.value.push(file);
@ -185,7 +77,9 @@ const updateYear = async (e: number) => {
const editData = async (id: string) => {
const formData = new FormData();
const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${roundInsig.value.value} ปี ${yearly.value + 543}`;
const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${
roundInsig.value.value
} ${yearly.value + 543}`;
formData.append("name", name);
formData.append("year", yearly.value.toString());
formData.append("amount", datelast.value.toString());
@ -196,15 +90,12 @@ const editData = async (id: string) => {
if (dateEnd.value !== null) {
formData.append("endDate", dateToISO(dateEnd.value));
}
// files.value.forEach((file: any) => {
// formData.append("file", file);
// });
formData.append("file", files.value);
console.log(formData);
showLoader();
await http
.put(config.API.editRoundInsignia(id), formData)
.then(async () => { })
.then(async () => {})
.catch((e) => {
messageError($q, e);
})
@ -231,19 +122,7 @@ const SaveData = async () => {
});
}
};
// const sendData = () => {
// const valueData: any = {
// Name: roundInsig.value,
// year: year.value,
// Amount: datelast.value,
// dateStart: dateStart.value !== null ? dateToISO(dateStart.value) : null,
// dateEnd: dateEnd.value !== null ? dateToISO(dateEnd.value) : null,
// };
// return valueData;
// };
const updateDateRange = () => {
// console.log("test")
if (roundInsig.value.value == 1) {
dateStart.value = new Date(new Date().getFullYear(), 9, 1);
dateEnd.value = new Date(new Date().getFullYear() + 1, 3, 29);
@ -257,8 +136,9 @@ const updateDateRange = () => {
const addData = async () => {
const formData = new FormData();
const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${roundInsig.value.value
} ${yearly.value + 543} `;
const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${
roundInsig.value.value
} ${yearly.value + 543} `;
console.log(name);
formData.append("name", name);
formData.append("year", yearly.value.toString());
@ -270,17 +150,14 @@ const addData = async () => {
if (dateEnd.value !== null) {
formData.append("endDate", dateToISO(dateEnd.value));
}
console.log(files.value);
// files.value.forEach((file: any) => {
// formData.append("file", file);
// });
formData.append("file", files.value);
console.log(files.value);
showLoader();
await http
.post(config.API.listRoundInsignia(), formData)
.then(async (res) => { })
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
@ -293,3 +170,197 @@ const clickBack = () => {
router.push({ name: "insigniaProposals" });
};
</script>
<template>
<div class="col-xs-12 col-sm-12 col-md-11">
<div class="toptitle col-12 row items-center">
<q-btn
icon="mdi-arrow-left"
unelevated
round
dense
flat
color="primary"
class="q-mr-sm"
@click="clickBack"
/>
{{
edit
? "รอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์"
: "เพิ่มรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์"
}}
</div>
<q-form ref="myForm">
<div class="col-12">
<q-card bordered>
<div class="col-12 row q-col-gutter-md q-pa-md">
<div class="col-xs-12 col-sm-12 row">
<q-separator />
<div class="col-12 row q-pa-sm q-col-gutter-sm">
<q-select
class="col-10"
dense
outlined
v-model="roundInsig"
:options="options"
option-value="value"
option-label="label"
label="รอบการเสนอขอพระราชทานเครื่องราชฯ"
@update:model-value="updateDateRange"
:rules="[(val) => !!val || `${'กรุณาเลือกรอบที่'}`]"
/>
<datepicker
menu-class-name="modalfix"
v-model="yearly"
class="col-2"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
@update:modelValue="updateYear"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
dense
lazy-rules
outlined
:model-value="yearly + 543"
:rules="[(val) => !!val || `${'กรุณาเลือกปีที่เสนอ'}`]"
:label="`${'ปีที่เสนอ'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<datepicker
menu-class-name="modalfix"
v-model="dateStart"
:locale="'th'"
autoApply
class="col-xs-12 col-sm-5"
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
class="full-width datepicker"
:model-value="
dateStart != null ? date2Thai(dateStart) : null
"
:label="`${'วันเริ่มต้น'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันเริ่มต้น'}`]"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<datepicker
menu-class-name="modalfix"
v-model="dateEnd"
class="col-xs-12 col-sm-5"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
class="col-xs-12 col-sm-4"
:model-value="dateEnd != null ? date2Thai(dateEnd) : null"
:label="`${'วันสิ้นสุด'}`"
:rules="[
(val) => !!val || `${'กรุณาเลือกวันที่วันสิ้นสุด'}`,
]"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<q-input
class="col-xs-12 col-sm-2"
dense
outlined
v-model="datelast"
label="จำนวนวันแจ้งเตือนก่อนวันสิ้นสุด"
/>
<q-file
class="col-xs-12 col-sm-10"
outlined
dense
v-model="files"
@added="fileUploadDoc"
label="อัปโหลดเอกสารประกอบ"
hide-bottom-space
lazy-rules
>
<!-- :rules="[
(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน',
]" -->
<template v-slot:prepend>
<q-icon name="attach_file" />
</template>
</q-file>
</div>
</div>
</div>
<q-separator />
<q-separator />
<div class="row col-12 q-pa-sm">
<q-space />
<q-btn
unelevated
dense
class="q-px-md items-center"
color="light-blue-10"
label="บันทึก"
@click="checkSave"
/>
</div>
</q-card>
</div>
</q-form>
</div>
</template>

View file

@ -5,9 +5,7 @@ import router from "@/router";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import type { FormProprsalsRound } from " @/modules/07_insignia/interface/request/Main.ts";
import { useRoute } from "vue-router";
import config from "@/app.config";
import http from "@/plugins/http";
const mixin = useCounterMixin();
@ -15,22 +13,12 @@ const {
date2Thai,
success,
messageError,
statusLeave,
dialogMessage,
dateToISO,
showLoader,
hideLoader,
dialogConfirm,
dialogRemove,
} = mixin;
const route = useRoute();
const $q = useQuasar(); // noti quasar
const modal = ref<boolean>(false);
const pagination = ref({
sortBy: "desc",
descending: false,
page: 1,
rowsPerPage: 10,
});
const visibleColumns = ref<string[]>([
"round",
@ -194,34 +182,22 @@ const clickEdit = (col: any) => {
router.push(`/insignia/round-add/${col.id}`);
};
// 2
const clickDelete = (id: string) => {
$q.dialog({
title: "ยืนยันการลบข้อมูล",
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
cancel: {
flat: true,
color: "negative",
},
persistent: true,
})
.onOk(async () => {
showLoader();
await http
.delete(config.API.RoundInsignia(id))
.then((res) => {
success($q, "ลบข้อมูลการเสนอขอสำเร็จ");
fetchData();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
})
.onCancel(() => {})
.onDismiss(() => {});
dialogRemove($q, async () => {
showLoader();
await http
.delete(config.API.RoundInsignia(id))
.then(() => {
success($q, "ลบข้อมูลการเสนอขอสำเร็จ");
fetchData();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
});
};
const clickAdd = () => {
@ -247,12 +223,10 @@ const getRequest = async (id: string) => {
showLoader();
await http
.get(config.API.requestInsignia(id))
.then((res) => {
console.log(res);
.then(() => {
success($q, "ยืนยันสำเร็จ");
})
.catch((err) => {
console.log(err);
messageError($q, err);
})
.finally(async () => {
@ -268,16 +242,14 @@ const resetFilter = () => {
filterRef.value.focus();
};
const filterKeyword2 = ref<string>("");
const filterRef2 = ref<any>(null);
const resetFilter2 = () => {
filterKeyword2.value = "";
filterRef2.value.focus();
};
const attrs = ref<any>(useAttrs());
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "desc",
descending: false,
page: 1,
rowsPerPage: 10,
});
const paginationLabel = (start: string, end: string, total: string) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;

View file

@ -12,14 +12,7 @@ import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
const router = useRouter();
const mixin = useCounterMixin();
const {
dialogRemove,
dialogConfirm,
showLoader,
hideLoader,
messageError,
success,
} = mixin;
const { dialogConfirm, showLoader, hideLoader, messageError, success } = mixin;
const $q = useQuasar();
const DataStore = useInsigniaDataStore();
@ -30,7 +23,6 @@ const modalAdd = ref<boolean>(false);
const modalEdit = ref<boolean>(false);
const rowid = ref<string>("");
const organization = ref<string>("");
const fileId = ref<string>("");
const organizationOptions = ref<any>([{ id: "1", name: "ทั้งหมด" }]);
const visibleColumns = ref<string[]>([
@ -178,7 +170,6 @@ const columns2 = ref<QTableProps["columns"]>([
]);
const rows2 = ref<any[]>([]);
const person = ref<any>([]);
const props = defineProps({
tab: {
@ -205,10 +196,6 @@ const props = defineProps({
});
onMounted(async () => {
// if (DataStore.typeOc == "") {
// // organization.value = DataStore.optionsTypeOc[2].id;
// DataStore.typeOc = organization.value;
// } else organization.value = DataStore.typeOc;
organization.value = await (DataStore.agency != null
? DataStore.agency
: DataStore.typeOc);
@ -250,7 +237,6 @@ const fecthlistRetire = async () => {
}
})
.catch((e) => {
// console.log(e);
messageError($q, e);
});
};
@ -271,8 +257,6 @@ const fecthlistperson = async (id: string) => {
criterias: data,
})
.then((res) => {
// console.log(res);
rows2.value = res.data.result.map((e: any) => ({
id: e.id,
fullname: e.fullname == null ? "-" : e.fullname,
@ -283,14 +267,12 @@ const fecthlistperson = async (id: string) => {
modalAdd.value = true;
})
.catch((e) => {
// console.log(e);
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
const clickAdd = async (id: string) => {
dialogConfirm(
$q,
@ -306,17 +288,14 @@ const addlistperson = async (id: string) => {
showLoader();
let data = {
profileId: id,
// insigniaId: organization.value,
insigniaPeriodId: props.roundId,
};
// console.log(data);
await http
.post(config.API.insigniaCreate(), data)
.then(() => {
success($q, "เพิ่มรายชื่อสำเร็จ");
})
.catch((err) => {
// console.log(err);
messageError($q, err);
})
.finally(() => {
@ -333,20 +312,11 @@ const addlistperson = async (id: string) => {
});
};
// const clickAction = (props: any, action: string) => {
// Note.value = "";
// person.value = props;
// titleModal.value = props.name;
// actionModal.value = action;
// modalNote.value = true;
// };
const clickmodalEdit = (props: any) => {
insignia.value = props.insigniaSend;
// insigniaType.value = props.insigniaLevel;
person.value = props;
modalEdit.value = true;
fecthInsignia();
// fecthInsigniaType();
};
const downloadFile = (response: any, filename: string) => {
@ -393,7 +363,6 @@ const clickSave = () => {
const listEdit = async (profileId: string) => {
let data: any = {
insigniaId: insignia.value,
// insigniaTypeId: insigniaType.value,
};
await http
.put(config.API.insigniaEdit(profileId), data)
@ -499,7 +468,6 @@ const listdelete = async (id: string, reason: string) => {
const insignia = ref<string>("");
const insigniaOptions = ref<any>([]);
const insigniaType = ref<string>("");
// const insigniaTypeOptions = ref<any>([]);
const fecthInsignia = async () => {
await http
@ -507,17 +475,10 @@ const fecthInsignia = async () => {
.then((res) => {
insigniaOptions.value = res.data.result;
})
.catch(() => {
// console.log(err);
.catch((e) => {
messageError($q, e);
});
};
// 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}`);
@ -559,7 +520,6 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
<div class="col-12 row q-pa-md">
<div class="row col-12">
<div class="row col-12 q-col-gutter-sm">
<!-- {{ DataStore.typeinsigniaOptions }} -->
<q-select
v-if="props.roleUser == 'admin'"
v-model="organization"
@ -958,31 +918,14 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
style="min-width: 150px"
/>
</div>
<!-- <div class="col">
<q-select
v-model="insigniaType"
label="ชั้นเครื่องราชฯ"
dense
emit-value
map-options
:options="insigniaTypeOptions"
option-value="id"
option-label="name"
lazy-rules
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
style="min-width: 150px"
/>
</div> -->
</div>
</div>
<q-separator />
<div class="q-pa-md">
<div class="row justify-end">
<q-btn label="บันทึก" @click="clickSave" color="public" />
<q-btn label="บันทึก" @click="clickSave" color="public"
><q-tooltip>นท</q-tooltip></q-btn
>
</div>
</div>
</q-card>
@ -1002,54 +945,4 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
:click-close="closemodelPopupDelete"
:savaForm="savaReasonDelete"
/>
<!-- note -->
<!-- <q-dialog v-model="modalNote" persistent>
<q-card style="min-width: 350px">
<q-toolbar>
<q-toolbar-title class="text-subtitle2 text-bold">
<div v-if="actionModal == 'note'">
เปนเหตผลทไมนขอ {{ titleModal }}
</div>
<div v-if="actionModal == 'delete'">ลบออก {{ titleModal }}</div>
</q-toolbar-title>
<q-btn
icon="close"
unelevated
round
dense
@click="modalNote = false"
style="color: #ff8080; background-color: #ffdede"
/> </q-toolbar
><q-separator />
<q-card-section class="q-pt-none"></q-card-section>
<q-card-section class="q-pt-none">
<q-input
dense
outlined
type="textarea"
label="เหตุผลที่ไม่ยื่นขอ"
v-model="Note"
@keyup.enter="modalNote = false"
:rules="[(val) => !!val || 'เหตุผลที่ไม่ยื่นขอ']"
/>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn
v-if="actionModal == 'note'"
label="บันทึก"
@click="clickSavenote"
color="public"
:disable="Note === ''"
/>
<q-btn
v-if="actionModal == 'delete'"
label="บันทึก"
@click="clickDelete"
color="public"
:disable="Note === ''"
/>
</q-card-actions>
</q-card>
</q-dialog> -->
</template>

View file

@ -6,11 +6,7 @@ import { useRouter } from "vue-router";
import DialogInformation from "@/components/Dialogs/Information.vue";
const router = useRouter();
import http from "@/plugins/http";
import config from "@/app.config";
const DataStore = useInsigniaDataStore();
const props = defineProps({
tab: {
type: String,
@ -38,7 +34,6 @@ const visibleColumns = ref<string[]>([
"position",
"level",
"salary",
"insigniaType",
"insigniaSend",
"insigniaLevel",
@ -143,12 +138,9 @@ onMounted(async () => {
organization.value = await (DataStore.agency != null
? DataStore.agency
: DataStore.typeOc);
// if (props.fecthInsigniaAll) {
// await props.fecthInsigniaAll(props.roundId, props.tab);
// }
if (organization.value !== "" || organization.value !== undefined) {
if (props.fecthInsigniaByOc) {
props.fecthInsigniaByOc(
await props.fecthInsigniaByOc(
props.roundId,
organization.value,
"officer",
@ -207,7 +199,6 @@ const closeReson = () => {
<template>
<div class="col-12 row q-pa-md">
<div class="row col-12">
<!-- {{ DataStore.typeinsigniaOptions }} -->
<div class="row col-12 q-col-gutter-sm">
<q-select
v-if="props.roleUser == 'admin'"

View file

@ -8,7 +8,6 @@ import DialogInformation from "@/components/Dialogs/Information.vue";
const router = useRouter();
const DataStore = useInsigniaDataStore();
const props = defineProps({
tab: {
type: String,
@ -138,12 +137,10 @@ onMounted(async () => {
organization.value = await (DataStore.agency != null
? DataStore.agency
: DataStore.typeOc);
// if (props.fecthInsigniaAll) {
// await props.fecthInsigniaAll(props.roundId, props.tab);
// }
if (organization.value !== "" || organization.value !== undefined) {
if (props.fecthInsigniaByOc) {
props.fecthInsigniaByOc(
await props.fecthInsigniaByOc(
props.roundId,
organization.value,
"officer",
@ -152,9 +149,9 @@ onMounted(async () => {
}
}
});
const changtypeOc = () => {
const changtypeOc = async () => {
if (props.fecthInsigniaByOc) {
props.fecthInsigniaByOc(
await props.fecthInsigniaByOc(
props.roundId,
organization.value,
"officer",
@ -342,8 +339,7 @@ const closeReson = () => {
flat
round
color="blue"
@click.stop
@click="showNote(props.row)"
@click.stop="showNote(props.row)"
icon="mdi-information-outline"
>
<q-tooltip>เหตผลการลบ</q-tooltip>

View file

@ -9,7 +9,6 @@ import config from "@/app.config";
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError } = mixin;
const props = defineProps({
roundId: {
type: String,
@ -73,12 +72,6 @@ const fecthOrg = async () => {
});
};
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
const resetFilter = () => {
filterKeyword.value = "";
filterRef.value.focus();
};
const pagination = ref({
sortBy: "desc",
descending: false,
@ -94,77 +87,11 @@ const paginationLabel = (start: number, end: number, total: number) => {
<template>
<div class="col-12 row q-pa-md">
<div class="row col-12">
<!-- <div class="row col-12 q-col-gutter-sm">
<q-select
v-model="organization"
label="หน่วยงาน"
dense
emit-value
map-options
:options="organizationOptions"
option-value="id"
option-label="name"
lazy-rules
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
style="min-width: 150px"
/>
<div>
<q-btn size="md" icon="mdi-download" flat round color="primary">
<q-tooltip>ดาวนโหลด</q-tooltip>
</q-btn>
<q-btn size="12px" flat round color="add" icon="mdi-plus">
<q-tooltip>เพ</q-tooltip>
</q-btn>
</div>
<q-space />
<q-input
class="col-xs-12 col-sm-3 col-md-2"
standout
dense
v-model="filterKeyword"
ref="filterRef"
outlined
debounce="300"
placeholder="ค้นหา"
>
<template v-slot:append>
<q-icon v-if="filterKeyword == ''" name="search" />
<q-icon
v-if="filterKeyword !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template>
</q-input>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
class="col-xs-12 col-sm-3 col-md-2"
/>
</div> -->
<div class="col-12">
<q-table
ref="table"
:columns="columns"
:rows="rows"
:filter="filterKeyword"
row-key="name"
dense
flat
@ -180,8 +107,6 @@ const paginationLabel = (start: number, end: number, total: number) => {
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<!-- <q-th auto-width />
<q-th auto-width /> -->
</q-tr>
</template>
<template v-slot:body="props">

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { onMounted, ref, watch } from "vue";
import { onMounted, ref } from "vue";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
@ -21,17 +21,13 @@ const roleUser = ref<string>("admin");
const DataStore = useInsigniaDataStore();
const mixin = useCounterMixin();
const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
const router = useRouter();
const $q = useQuasar(); // noti quasar
const loading = ref<boolean>(false);
const round = ref<string>("");
const roundName = ref<string>("");
const optionRound = ref<any>([]);
// const typeOc = ref<string>("kljkljk");
const optiontypeOc = ref<any>([]);
const tab = ref<any>("pending");
const stat = ref<any>({
allUserUser: 0,
@ -57,7 +53,6 @@ const checkRole = async () => {
} else {
roleUser.value = "admin";
}
// console.log("roleUser ===> ", roleUser.value);
}
};
@ -70,8 +65,6 @@ const fecthlistRound = async () => {
year: e.period_year,
name: e.period_name,
}));
// console.log(optionRound.value);
// const lastIndex = optionRound.value.length;
const lastValue = optionRound.value[0];
round.value = lastValue.id.toString();
roundName.value = lastValue.name;
@ -126,10 +119,8 @@ const fecthType = async () => {
name: e.organizationName,
}));
DataStore.fetchOption(optiontypeOc.value);
// DataStore.optionsTypeOc = ;
})
.catch((err) => {
console.log(err);
messageError($q, err);
})
.finally(() => {
@ -151,21 +142,6 @@ const changround = async () => {
roundFilter.year + 543
}`;
};
// const fecthInsigniaAll = async (periodId: string, tab: string) => {
// // let data: any = [];
// // for (const item of DataStore.optionsTypeOc) {
// // await http
// // .get(config.API.insigniaList(periodId, item["id"], "officer", tab))
// // .then((res) => {
// // // console.log(res);
// // data.push(res.data.result);
// // })
// // .catch((err) => {
// // console.log(err);
// // });
// // }
// // console.log(data);
// };
const requestNote = ref<string>("");
const requestStatus = ref<string>("");
const fecthInsigniaByOc = async (
@ -175,19 +151,16 @@ const fecthInsigniaByOc = async (
status: string
) => {
showLoader();
// console.log("ocId===>", ocId);
await http
.get(config.API.insigniaList(roundId, ocId, role, status))
.then(async (res) => {
// console.log(res);
requestNote.value = res.data.result.requestNote;
requestStatus.value = res.data.result.requestStatus;
await DataStore.fetchData(res.data.result.items);
})
.catch((err) => {
// console.log(err);
messageError($q);
messageError($q, err);
})
.finally(() => {
loading.value = true;
@ -210,7 +183,6 @@ const sendToDirector = async () => {
);
})
.catch((err) => {
// console.log(err);
messageError($q, err);
})
.finally(() => {
@ -249,7 +221,6 @@ const backToEdit = async (reason: string) => {
);
})
.catch((err) => {
// console.log(err);
messageError($q, err);
})
.finally(() => {
@ -279,7 +250,6 @@ const directorApproved = async () => {
);
})
.catch((err) => {
// console.log(err);
messageError($q, err);
})
.finally(() => {
@ -308,7 +278,6 @@ const requestSendNote = async () => {
);
})
.catch((err) => {
// console.log(err);
messageError($q, err);
})
.finally(() => {
@ -479,7 +448,9 @@ const requestSendNote = async () => {
color="public"
class="q-px-md q-ml-md"
@click="requestSendNote"
/>
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-toolbar>
<DialogPopupReason

View file

@ -20,22 +20,18 @@ const {
hideLoader,
notifyError,
} = mixin;
const status = ref<status>("");
const status = ref<string>("");
const Advertise = ref<string>("");
const issue = ref<string>("");
const brand = ref<string>("");
const cardid = ref<string>("");
const prefixId = ref<string>("");
const fullName = ref<string>("");
const volume = ref<string>("");
const episode = ref<string>("");
const duty = ref<string>("");
const announced = ref<string>("");
const firstname = ref<string>("");
const lastname = ref<string>("");
const position = ref<string>("");
const invoice = ref<string | null>(null);
const payment = ref<string>("");
const addressPayment = ref<string | null>(null);
const affiliationRequest = ref<string>("");
@ -56,46 +52,6 @@ const paymentOp = [
{ label: "จัดส่งทางไปรษณี", value: "จัดส่งทางไปรษณี" },
{ label: "มารับด้วยตัวเอง", value: "มารับด้วยตัวเอง" },
];
const volumeOp = [
{ label: "เล่มที่", value: "xx1" },
{ label: "เล่มที่2", value: "xx2" },
{ label: "เล่มที่3", value: "xx3" },
];
const episodeOp = [
{ label: "ตอนที่1", value: "xx1" },
{ label: "ตอนที่2", value: "xx2" },
{ label: "ตอนที่3", value: "xx3" },
];
const dutyOp = [
{ label: "หน้าที่1", value: "xx1" },
{ label: "หน้าที่2", value: "xx2" },
{ label: "หน้าที่3", value: "xx3" },
];
const announcedOp = [
{ label: "ลำดับที่1", value: "xx1" },
{ label: "ลำดับที่2", value: "xx2" },
{ label: "ลำดับที่3", value: "xx3" },
];
const affiliationRequestOp = [
{ label: "สังกัด1", value: "xx1" },
{ label: "สังกัด2", value: "xx2" },
{ label: "สังกัด3", value: "xx3" },
];
const affiliationReceivedOp = [
{ label: "สังกัด4", value: "xx4" },
{ label: "สังกัด5", value: "xx5" },
{ label: "สังกัด6", value: "xx6" },
];
const prefixOp = [
{ label: "นาย", value: "mr" },
{ label: "นางสาว", value: "miss" },
{ label: "นาง", value: "mrs" },
];
const positionOp = [
{ label: "ตำแหน่ง1", value: "xxx1" },
{ label: "ตำแหน่ง2", value: "xxx2" },
{ label: "ตำแหน่ง3", value: "xxx3" },
];
const clearDateExam = () => {
receivedate.value = null;
announceDate.value = null;
@ -141,12 +97,12 @@ watch(props, () => {
episode.value = "";
duty.value = "";
announced.value = "";
// invoice.value = "";
invoiceDate.value = null;
payment.value = "";
if (props.action === "editData") {
fectDataByid(props.personId);
if (props.personId !== undefined) {
if (props.action === "editData") {
fectDataByid(props.personId);
}
}
}
});
@ -205,11 +161,10 @@ const findlist = async (id: string) => {
criterias: data,
})
.then((res) => {
// console.log(res.data.result);
listPerson.value = res.data.result;
})
.catch((e) => {
console.log(e);
messageError($q, e);
})
.finally(() => {
hideLoader();
@ -217,7 +172,9 @@ const findlist = async (id: string) => {
};
const fectDataByid = async (id: string) => {
showLoader();
employeeClass.value = "";
if (props.profileType !== undefined) {
employeeClass.value = props.profileType.toString();
}
await http
.get(config.API.noteByid(id))
.then((res) => {
@ -240,7 +197,6 @@ const fectDataByid = async (id: string) => {
payment.value = data.typePayment;
addressPayment.value = data.address;
status.value = data.status;
employeeClass.value = props.profileType;
})
.catch((err) => {
console.log(err);
@ -264,7 +220,6 @@ const clickSave = async () => {
section: episode.value, //
page: duty.value, //
no: announced.value,
// : invoice.value,
datePayment: invoiceDate.value, //
typePayment: payment.value, //
address: addressPayment.value, //
@ -278,20 +233,21 @@ const clickSave = async () => {
});
};
const addNote = async (body: any) => {
await http
.put(config.API.noteAdd(props.roundId), body)
.then(() => {
success($q, "เพิ่มราชชื่อสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
props.close();
});
if (props.roundId !== undefined) {
await http
.put(config.API.noteAdd(props.roundId), body)
.then(() => {
success($q, "เพิ่มราชชื่อสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
props.close();
});
}
};
const searchcardid = () => {
// console.log(cardid.value);
if (cardid.value.length === 13) {
let data = listPerson.value.find((e: any) => e.citizenId === cardid.value);
if (data) {
@ -314,7 +270,8 @@ const searchcardid = () => {
dense
@click="props.close"
style="color: #ff8080; background-color: #ffdede"
/>
><q-tooltip></q-tooltip></q-btn
>
</q-toolbar>
<q-separator />
@ -368,24 +325,8 @@ const searchcardid = () => {
mask="#############"
@keyup="searchcardid"
/>
<!-- :rules="[(val:any) =>val.length != 13 ||`${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ครบ'}`,]" -->
</div>
<!-- <div class="col-xs-12 col-sm-4">
<q-select
:rules="[(val) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ']"
hide-bottom-space
:options="prefixOp"
class="col-xs-12 col-sm-6 inputgreen"
dense
borderless
option-label="label"
option-value="value"
outlined
v-model="prefixId"
:label="`คำนำหน้าชื่อ`"
:disable="disbleStatus"
/>
</div> -->
<div class="col-xs-6 col-sm-4">
<q-input
disable
@ -412,35 +353,10 @@ const searchcardid = () => {
v-model="position"
:label="`ตำเเหน่ง`"
/>
<!-- <q-select
:disable="disbleStatus"
hide-bottom-space
:options="positionOp"
class="col-xs-12 col-sm-6 inputgreen"
dense
borderless
option-label="label"
option-value="value"
outlined
v-model="position"
:label="`ตำเเหน่ง`"
/> -->
</div>
<div class="col-6"></div>
<!-- <div class="col-xs-6 col-sm-3 col-md-5">
<q-input
hide-bottom-space
outlined
dense
lazy-rules
borderless
v-model="lastname"
:rules="[(val:string) => !!val || `${'กรุณากรอก นามสกุล'}`]"
:label="`${'นามสกุล'}`"
/>
</div> -->
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
<div class="col-12 text-weight-bold text-grey">
รายละเอยดตำเเหน
@ -462,18 +378,6 @@ const searchcardid = () => {
/>
</div>
<div class="col-xs-12 col-sm-6">
<!-- <q-input
:disable="disbleStatus"
:rules="[
(val) => !!val || 'กรุณากรอกชื่อชั้นตราเครื่องราชอิสริยาภรณ์',
]"
hide-bottom-space
dense
borderless
outlined
v-model="brand"
label="ชั้นตราเครื่องราชอิสริยาภรณ์"
/> -->
<q-select
:disable="disbleStatus || status == 'DONE'"
v-model="brand"
@ -563,20 +467,6 @@ const searchcardid = () => {
v-model="affiliationRequest"
label="สังกัด ณ วันที่ขอพระราชทานเครื่องราชอิสริยาภรณ์"
/>
<!-- <q-select
:disable="disbleStatus"
:rules="[(val) => !!val || 'กรุณาเลือกสังกัด']"
hide-bottom-space
:options="affiliationRequestOp"
class="col-xs-12 col-sm-6"
dense
borderless
option-label="label"
option-value="value"
outlined
v-model="affiliationRequest"
:label="`สังกัด ณ วันที่ขอพระราชทานเครื่องราชอิสริยาภรณ์`"
/> -->
</div>
<div class="col-xs-12 col-sm-6">
<q-input
@ -591,19 +481,6 @@ const searchcardid = () => {
v-model="affiliationReceived"
label="สังกัด ณ วันที่ได้รับประกาศนียบัตรกำกับเครื่องราชอิสริยาภรณ์"
/>
<!-- <q-select
:rules="[(val) => !!val || 'กรุณาเลือกสังกัด']"
hide-bottom-space
:options="affiliationReceivedOp"
class="col-xs-12 col-sm-6"
dense
borderless
option-label="label"
option-value="value"
outlined
v-model="affiliationReceived"
:label="`สังกัด ณ วันที่ได้รับประกาศนียบัตรกำกับเครื่องราชอิสริยาภรณ์`"
/> -->
</div>
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
<div class="col-12 text-weight-bold text-grey">
@ -665,21 +542,6 @@ const searchcardid = () => {
:label="`เล่มที่`"
:rules="[(val) => !!val || 'กรุณากรอกเล่มที่']"
/>
<!-- <q-select
:disable="disbleStatus"
:rules="[(val) => !!val || 'กรุณาเลือกเล่มที่']"
hide-bottom-space
:options="volumeOp"
class="col-xs-12 col-sm-6"
dense
borderless
option-label="label"
option-value="value"
outlined
emit-value
v-model="volume"
:label="`เล่มที่`"
/> -->
</div>
<div class="col-xs-12 col-sm-4">
<q-input
@ -694,21 +556,6 @@ const searchcardid = () => {
:label="`ตอนที่`"
:rules="[(val) => !!val || 'กรุณากรอกตอนที่']"
/>
<!-- <q-select
:disable="disbleStatus"
:rules="[(val) => !!val || 'กรุณาเลือกตอนที่']"
hide-bottom-space
:options="episodeOp"
class="col-xs-12 col-sm-6"
dense
borderless
option-label="label"
option-value="value"
outlined
v-model="episode"
emit-value
:label="`ตอนที่`"
/> -->
</div>
<div class="col-xs-12 col-sm-6">
<q-input
@ -723,21 +570,6 @@ const searchcardid = () => {
:label="`หน้าที่`"
:rules="[(val) => !!val || 'กรุณากรอกหน้าที่']"
/>
<!-- <q-select
:disable="disbleStatus"
:rules="[(val) => !!val || 'กรุณาเลือกหน้าที่']"
hide-bottom-space
:options="dutyOp"
class="col-xs-12 col-sm-6"
dense
emit-value
borderless
option-label="label"
option-value="value"
outlined
v-model="duty"
:label="`หน้าที่`"
/> -->
</div>
<div class="col-xs-12 col-sm-6">
<q-input
@ -752,36 +584,11 @@ const searchcardid = () => {
:label="`ลำดับที่`"
:rules="[(val) => !!val || 'กรุณากรอกลำดับที่']"
/>
<!-- <q-select
:disable="disbleStatus"
:rules="[(val) => !!val || 'กรุณาเลือกลำดับที่']"
hide-bottom-space
:options="announcedOp"
class="col-xs-12 col-sm-6"
dense
emit-value
borderless
option-label="label"
option-value="value"
outlined
v-model="announced"
:label="`ลำดับที่`"
/> -->
</div>
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
<div class="col-12 text-weight-bold text-grey">
ผลการจายใบกำก
</div>
<!-- <div class="col-xs-12 col-sm-4"> -->
<!-- :rules="[(val) => !!val || 'กรุณากรแกหมายเล่นใบกำกับ']" -->
<!-- <q-input
dense
borderless
outlined
v-model="invoice"
label="หมายเลขใบกํากับ"
/>
</div> -->
<div class="col-xs-12 col-sm-6">
<datepicker
menu-class-name="modalfix"
@ -860,7 +667,9 @@ const searchcardid = () => {
<q-separator />
<div class="q-pa-md">
<div class="row justify-end">
<q-btn label="บันทึก" @click="clickSave" color="public" />
<q-btn label="บันทึก" @click="clickSave" color="public"
><q-tooltip>นท</q-tooltip></q-btn
>
</div>
</div>
</q-card>

View file

@ -1,18 +1,17 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useCounterMixin } from '@/stores/mixin'
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
const mixin = useCounterMixin()
const { success, messageError,hideLoader,dialogConfirm } = mixin
const mixin = useCounterMixin();
const { success, messageError, hideLoader, dialogConfirm, showLoader } = mixin;
const fileUpload = ref<any>(null);
const reason = ref<string>("");
const file = ref<string>("");
const documentTitle = ref<string>("");
const $q = useQuasar();
const $q = useQuasar();
const filterKeyword = ref<string>("");
const filterDoc = ref<any>(null);
@ -55,9 +54,9 @@ const colums2 = ref<QTableProps["columns"]>([
const rows2 = ref<any>([]);
interface TypeData {
fileName:string
reason:string
pathName:string
fileName: string;
reason: string;
pathName: string;
}
const props = defineProps({
roundId: {
@ -66,41 +65,39 @@ const props = defineProps({
});
const getRequest = async () => {
showLoader();
await http
.get(config.API.requestDocNote(props.roundId as string))
.then((res:any) =>{
console.log(res)
const data = res.data.result
console.log(data)
data.map((item:TypeData) =>{
rows2.value.push({
fileName:item.fileName,
annotation:item.reason,
file:item.pathName
})
}
)
console.log(rows2.value)
})
.catch((e) => {
.get(config.API.requestDocNote(props.roundId as string))
.then((res: any) => {
const data = res.data.result;
data.map((item: TypeData) => {
rows2.value.push({
fileName: item.fileName,
annotation: item.reason,
file: item.pathName,
});
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
};
const putRequest = () => {
const dataAppend = new FormData()
dataAppend.append("Name",documentTitle.value)
dataAppend.append("Reason",reason.value)
dataAppend.append("File",fileUpload.value)
http
.put(config.API.requestDocNote(props.roundId as string),dataAppend)
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((e) => {
const putRequest = async () => {
showLoader();
const dataAppend = new FormData();
dataAppend.append("Name", documentTitle.value);
dataAppend.append("Reason", reason.value);
dataAppend.append("File", fileUpload.value);
await http
.put(config.API.requestDocNote(props.roundId as string), dataAppend)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
@ -110,10 +107,9 @@ const putRequest = () => {
getRequest();
hideLoader();
});
}
onMounted(async() => {
console.log(props.roundId);
await getRequest()
};
onMounted(async () => {
await getRequest();
});
const resetFilterRef = () => {
filterKeyword.value = "";
@ -126,8 +122,8 @@ const pagination = ref({
rowsPerPage: 10,
});
const save = () => {
dialogConfirm($q,()=>putRequest())
}
dialogConfirm($q, () => putRequest());
};
</script>
<template>
<Transition>
@ -171,7 +167,9 @@ const save = () => {
/>
</div>
<div class="col-12 flex justify-end">
<q-btn label="บันทึก" @click="save" color="public" />
<q-btn label="บันทึก" @click="save" color="public">
<q-tooltip>นท</q-tooltip></q-btn
>
</div>
<div class="row col-12">
<q-space />
@ -238,13 +236,15 @@ const save = () => {
{{ props.row.fileName }}
</q-td>
<q-td key="annotation" :props="props">
{{ props.row.annotation !== null ? props.row.annotation:"-"}}
{{
props.row.annotation !== null ? props.row.annotation : "-"
}}
</q-td>
<q-td auto-width>
<q-btn
type="a"
:href="props.row.file"
target="_blank"
type="a"
:href="props.row.file"
target="_blank"
dense
size="14px"
flat

View file

@ -63,10 +63,9 @@ const fecthRound = async () => {
}));
selectRound.value = data[0].id;
roundYear.value = data[0].year;
// console.log(roundYear.value);
})
.catch((err) => {
console.log(err);
messageError($q, err);
});
};
@ -82,7 +81,7 @@ const fecthInsignia = async () => {
})
.finally(async () => {
insigniaOp.value = await DataStore.insigniaOp.filter(
(x: any) => x.type == tab.value
(x: any) => x.type == tab.value || x.type === ""
);
});
};
@ -90,16 +89,13 @@ const fecthInsignia = async () => {
const fecthInsigniaType = async () => {
await http(config.API.insigniaType)
.then((res) => {
// console.log(res);
let data = res.data.result;
DataStore.fetchDatainsigniaType(data);
tab.value = DataStore.insigniaType[0].name;
// fecthlistInsignia();
fecthInsignia();
})
.catch((err) => {
console.log(err);
messageError($q, err);
});
};
@ -160,7 +156,7 @@ const columns = ref<QTableProps["columns"]>([
]);
watch(tab, () => {
insigniaOp.value = DataStore.insigniaOp.filter(
(x: any) => x.type == tab.value
(x: any) => x.type == tab.value || x.type === ""
);
DataStore.insignia = "";
fecthlistInsignia();
@ -181,7 +177,6 @@ const fecthlistInsignia = async () => {
DataStore.listinsignia(data);
})
.catch((err) => {
console.log(err);
messageError($q, err);
})
.finally(() => {
@ -541,31 +536,4 @@ const resetFilter = () => {
/>
</template>
<style lang="scss" scoped>
.arrow {
transition: transform 0.5s;
}
.arrow-active {
transition: transform 0.5s;
transform: rotate(-90deg);
}
.bg-base {
background-color: #f3f3f398;
}
.v-enter-active,
.v-leave-active {
transition: opacity 0.5s ease;
}
.v-enter-from,
.v-leave-to {
opacity: 0;
}
.flexsave {
display: flex;
justify-content: flex-end;
}
</style>

View file

@ -1,13 +1,11 @@
<script setup lang="ts">
import { ref, watch, computed } from "vue";
import { ref, watch } from "vue";
import { QForm, useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
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 = useAllocateDataStore();
const $q = useQuasar();
const myForm = ref<QForm>();
const mixin = useCounterMixin();
@ -32,17 +30,17 @@ const returndate = ref<Date | null>();
const reason = ref<string>("");
const listPerson = ref<any>([]);
const OrgList = ref<DataOption[]>([]);
const insigniaNoteProfileId = ref<string>("")
const insigniaNoteProfileId = ref<string>("");
const clearData = () => {
receivedate.value = null
returndate.value = null
OrganazationId.value = ""
roundNo.value = ""
cardid.value = ""
fullName.value = ""
brand.value = ""
reason.value = ""
receivedate.value = null;
returndate.value = null;
OrganazationId.value = "";
roundNo.value = "";
cardid.value = "";
fullName.value = "";
brand.value = "";
reason.value = "";
};
const props = defineProps({
@ -69,21 +67,21 @@ const props = defineProps({
type: String,
},
selectRoundOption: {
type: Array
type: Array,
},
profileId: {
type: String,
default: ""
}
default: "",
},
});
watch(props, () => {
if (props.modal == true && props.roundId != 'all') {
roundNo.value = props.roundId
fecthlistInsignia()
fetchOrgList()
if (props.action == 'editData') {
fetchData()
if (props.modal == true && props.roundId != "all") {
roundNo.value = props.roundId;
fecthlistInsignia();
fetchOrgList();
if (props.action == "editData") {
fetchData();
}
}
});
@ -98,10 +96,9 @@ const fecthlistInsignia = async () => {
await http
.post(config.API.noteSearch(), data)
.then((res) => {
listPerson.value = res.data.result
listPerson.value = res.data.result;
})
.catch((err) => {
// console.log(err);
messageError($q, err);
})
.finally(() => {
@ -116,17 +113,23 @@ const fetchOrgList = async () => {
.then(async (response: any) => {
const orgArr = response.data.result.map((e: any) => ({
id: e.organizationId,
name: e.organizationName
}))
name: e.organizationName,
}));
if (props.action == 'editData') {
OrgList.value = [{id: "00000000-0000-0000-0000-000000000000", name: 'สำนักนายกรัฐมนตรี'},...orgArr]
if (props.action == "editData") {
OrgList.value = [
{
id: "00000000-0000-0000-0000-000000000000",
name: "สำนักนายกรัฐมนตรี",
},
...orgArr,
];
} else {
OrgList.value = orgArr
OrgList.value = orgArr;
}
})
.catch((err) => {
messageError($q, err)
messageError($q, err);
})
.finally(() => {
hideLoader();
@ -138,10 +141,10 @@ const fetchData = async () => {
await http
.get(config.API.insigniaManageBorrowById(props.profileId))
.then(async (response: any) => {
console.log(response.data.result)
console.log(response.data.result);
})
.catch((err) => {
messageError($q, err)
messageError($q, err);
})
.finally(() => {
hideLoader();
@ -152,12 +155,12 @@ const clickSave = async () => {
await myForm.value!.validate().then((result: boolean) => {
if (result) {
dialogConfirm($q, async () => {
if (props.action == 'addData') {
if (props.action == "addData") {
await http
.post(config.API.insigniaManageBorrow(), {
borrowDate: receivedate.value,
borrowOrganizationId: OrganazationId.value,
insigniaNoteProfileId: insigniaNoteProfileId.value
insigniaNoteProfileId: insigniaNoteProfileId.value,
})
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
@ -166,7 +169,7 @@ const clickSave = async () => {
messageError($q, err);
})
.finally(() => {
clearData()
clearData();
props.closeAndFecth();
});
} else {
@ -174,7 +177,7 @@ const clickSave = async () => {
.put(config.API.insigniaManageBorrowReturn(props.profileId), {
returnDate: returndate.value,
returnOrganizationId: OrganazationId.value,
returnReason: reason.value
returnReason: reason.value,
})
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
@ -183,7 +186,7 @@ const clickSave = async () => {
messageError($q, err);
})
.finally(() => {
clearData()
clearData();
props.closeAndFecth();
});
}
@ -194,21 +197,23 @@ const clickSave = async () => {
const searchcardid = async () => {
if (cardid.value.length === 13) {
const node = await listPerson.value.find((e: any) => e.citizenId === cardid.value);
const node = await listPerson.value.find(
(e: any) => e.citizenId === cardid.value
);
if (node) {
console.log("node", node)
fullName.value = `${node.prefix} ${node.fullName}`
brand.value = node.requestInsignia
insigniaNoteProfileId.value = node.id
console.log("node", node);
fullName.value = `${node.prefix} ${node.fullName}`;
brand.value = node.requestInsignia;
insigniaNoteProfileId.value = node.id;
} else notifyError($q, "ไม่พบข้อมูลการได้รับในรอบนี้");
}
};
const closeDialog = () => {
clearData()
props.close()
}
clearData();
props.close();
};
</script>
<template>
@ -216,39 +221,81 @@ const closeDialog = () => {
<q-card style="min-width: 900px" class="q-pb-md">
<q-toolbar class="q-py-md">
<q-toolbar-title class="text-h6">-นเครองราชฯ </q-toolbar-title>
<q-btn icon="close" unelevated round dense @click="closeDialog"
style="color: #ff8080; background-color: #ffdede" />
<q-btn
icon="close"
unelevated
round
dense
@click="closeDialog"
style="color: #ff8080; background-color: #ffdede"
><q-tooltip></q-tooltip></q-btn
>
</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 v-if="props.action === 'addData'" class="row col-12 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
v-if="props.action === 'addData'"
class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"
>
<div class="col-6">
<q-select v-model="roundNo" dense outlined lazy-rules hide-bottom-space
:label="`${'รอบการขอเครื่องราชฯ'}`" emit-value map-options option-label="name"
:options="selectRoundOption" option-value="id" :readonly="false" :borderless="false"
style="min-width: 150px" :rules="[
(val) => !!val || 'กรุณาเลือกรอบการขอเครื่องราชฯ',
]" @update:model-value="fecthlistInsignia()" />
</div>
<div class="col-12 text-weight-bold text-grey">
อมลผ
<q-select
v-model="roundNo"
dense
outlined
lazy-rules
hide-bottom-space
:label="`${'รอบการขอเครื่องราชฯ'}`"
emit-value
map-options
option-label="name"
:options="selectRoundOption"
option-value="id"
:readonly="false"
:borderless="false"
style="min-width: 150px"
:rules="[(val) => !!val || 'กรุณาเลือกรอบการขอเครื่องราชฯ']"
@update:model-value="fecthlistInsignia()"
/>
</div>
<div class="col-12 text-weight-bold text-grey">อมลผ</div>
<div class="col-xs-12 col-sm-6">
<q-input :disable="roundNo == ''" hide-bottom-space outlined class="inputgreen" v-model="cardid" dense
lazy-rules :rules="[
<q-input
:disable="roundNo == ''"
hide-bottom-space
outlined
class="inputgreen"
v-model="cardid"
dense
lazy-rules
:rules="[
(val: string) => !!val || `${'กรุณากรอก เลขบัตรประจำตัวประชาชน'}`,
(val: string) =>
val.length >= 13 ||
`${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ครบ'}`,
]" label="เลขบตรประจำตวประชาชน" maxlength="13" mask="#############" @keyup="searchcardid" />
<!-- :rules="[(val:any) =>val.length != 13 ||`${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ครบ'}`,]" -->
]"
label="เลขบัตรประจำตัวประชาชน"
maxlength="13"
mask="#############"
@keyup="searchcardid"
/>
</div>
<div class="col-xs-6 col-sm-6">
<q-input disable hide-bottom-space outlined dense lazy-rules class="inputgreen" borderless
v-model="fullName" :label="`${'ชื่อ-นามสกุล'}`" />
<q-input
disable
hide-bottom-space
outlined
dense
lazy-rules
class="inputgreen"
borderless
v-model="fullName"
:label="`${'ชื่อ-นามสกุล'}`"
/>
</div>
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
@ -256,12 +303,26 @@ const closeDialog = () => {
รายละเอยดการยมเครองราชฯ
</div>
<div class="col-xs-12 col-sm-6">
<q-input v-model="brand" disable dense outlined lazy-rules hide-bottom-space
:label="`${'เครื่องราชฯ'}`" />
<q-input
v-model="brand"
disable
dense
outlined
lazy-rules
hide-bottom-space
:label="`${'เครื่องราชฯ'}`"
/>
</div>
<div class="col-xs-12 col-sm-6">
<datepicker menu-class-name="modalfix" v-model="receivedate" :locale="'th'" autoApply borderless
:enableTimePicker="false" week-start="0">
<datepicker
menu-class-name="modalfix"
v-model="receivedate"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -269,11 +330,24 @@ const closeDialog = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input dense borderless outlined :rules="[(val) => !!val || 'กรุณาเลือกวันที่']" hide-bottom-space
:model-value="receivedate != null ? date2Thai(receivedate) : undefined
" :label="`${'วันที่ยืม'}`" clearable>
<q-input
dense
borderless
outlined
:rules="[(val) => !!val || 'กรุณาเลือกวันที่']"
hide-bottom-space
:model-value="
receivedate != null ? date2Thai(receivedate) : undefined
"
:label="`${'วันที่ยืม'}`"
clearable
>
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" color="primary">
<q-icon
name="event"
class="cursor-pointer"
color="primary"
>
</q-icon>
</template>
</q-input>
@ -282,20 +356,40 @@ const closeDialog = () => {
</div>
<div class="col-xs-12 col-sm-6">
<q-select hide-bottom-space :options="OrgList" dense borderless option-label="name" option-value="id"
emit-value map-options outlined v-model="OrganazationId" :label="`เลือกหน่วยงาน`" />
<q-select
hide-bottom-space
:options="OrgList"
dense
borderless
option-label="name"
option-value="id"
emit-value
map-options
outlined
v-model="OrganazationId"
:label="`เลือกหน่วยงาน`"
/>
</div>
</div>
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs" v-if="props.action === 'editData'">
<div
class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"
v-if="props.action === 'editData'"
>
<div class="col-12 q-my-xs"><q-separator size="2px" /></div>
<div class="col-12 text-weight-bold text-grey">
รายละเอยดการคนเครองราชฯ
</div>
<div class="col-xs-12 col-sm-6">
<datepicker menu-class-name="modalfix" v-model="returndate" :locale="'th'" autoApply borderless
:enableTimePicker="false" week-start="0">
<datepicker
menu-class-name="modalfix"
v-model="returndate"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -303,11 +397,24 @@ const closeDialog = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input dense borderless outlined :rules="[(val) => !!val || 'กรุณาเลือกวันที่']" hide-bottom-space
:model-value="returndate != null ? date2Thai(returndate) : undefined
" :label="`${'วันที่คืน'}`" clearable>
<q-input
dense
borderless
outlined
:rules="[(val) => !!val || 'กรุณาเลือกวันที่']"
hide-bottom-space
:model-value="
returndate != null ? date2Thai(returndate) : undefined
"
:label="`${'วันที่คืน'}`"
clearable
>
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer" color="primary">
<q-icon
name="event"
class="cursor-pointer"
color="primary"
>
</q-icon>
</template>
</q-input>
@ -316,16 +423,37 @@ const closeDialog = () => {
</div>
<div class="col-xs-12 col-sm-6">
<q-select hide-bottom-space :options="OrgList" dense borderless option-label="name" option-value="id"
emit-value map-options outlined v-model="OrganazationId" :label="`เลือกหน่วยงานที่ส่งคืน`" />
<q-select
hide-bottom-space
:options="OrgList"
dense
borderless
option-label="name"
option-value="id"
emit-value
map-options
outlined
v-model="OrganazationId"
:label="`เลือกหน่วยงานที่ส่งคืน`"
/>
</div>
<div class="col-12">
<q-input type="textarea" hide-bottom-space dense borderless option-label="name" option-value="id"
emit-value map-options outlined v-model="reason" :label="`สาเหตุที่ส่งคืนเครื่องราชอิสริยาภรณ์`" />
<q-input
type="textarea"
hide-bottom-space
dense
borderless
option-label="name"
option-value="id"
emit-value
map-options
outlined
v-model="reason"
:label="`สาเหตุที่ส่งคืนเครื่องราชอิสริยาภรณ์`"
/>
</div>
</div>
</div>
</div>
</q-form>
@ -333,9 +461,11 @@ const closeDialog = () => {
<q-separator />
<div class="q-pa-md">
<div class="row justify-end">
<q-btn label="บันทึก" @click="clickSave" color="public" />
<q-btn label="บันทึก" @click="clickSave" color="public">
<q-tooltip>นท</q-tooltip>
</q-btn>
</div>
</div>
</q-card>
</q-dialog>
</template>
</template>

View file

@ -11,17 +11,9 @@ import type { OptionDataYear } from "@/modules/07_insignia/interface/index/Main"
import type { QTableProps, QInput } from "quasar";
import { useQuasar } from "quasar";
// const router = useRouter();
const DataStore = useBrrowDataStore();
const mixin = useCounterMixin();
const {
date2Thai,
dialogConfirm,
showLoader,
hideLoader,
messageError,
success,
} = mixin;
const { showLoader, hideLoader, messageError } = mixin;
const $q = useQuasar();
const tab = ref<string>("");
@ -31,10 +23,8 @@ const selectRoundAllOption = ref<OptionDataYear[]>([]);
const modal = ref<boolean>(false);
const action = ref<string>("");
const personId = ref<string>();
const profileId = ref<string>("");
const roundYear = ref<any>();
const insigniaListAll = ref<any>([]);
const insigniaList = ref<any>([]);
onMounted(async () => {
@ -46,30 +36,32 @@ const fecthRound = async () => {
.get(config.API.noteround())
.then((res) => {
let data = res.data.result;
selectRoundAllOption.value = [{
name: "ทั้งหมด",
id: "00000000-0000-0000-0000-000000000000",
year: 0,
}]
selectRoundAllOption.value = [
{
name: "ทั้งหมด",
id: "0",
year: 0,
},
];
data.map((e: any) => {
selectRoundOption.value = [...selectRoundOption.value, {
selectRoundOption.value.push({
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
id: e.id,
year: e.year
}]
selectRoundAllOption.value = [...selectRoundAllOption.value, {
year: e.year,
});
selectRoundAllOption.value.push({
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
id: e.id,
year: e.year
}]
year: e.year,
});
});
selectRound.value = data[0].id;
yearRound.value = data[0].year;
roundYear.value = data[0].year;
})
.catch((err) => {
console.log(err);
messageError($q, err);
});
};
@ -77,21 +69,22 @@ const fecthInsignia = async () => {
await http
.get(config.API.insignia)
.then((res) => {
// console.log(res);
let data = res.data.result;
DataStore.fetchDataInsignia(data);
})
.catch((err) => {
console.log(err);
}).finally(async () => {
insigniaList.value = await DataStore.insigniaOp.filter((x: any) => x.type == tab.value || x.type == '')
})
.finally(async () => {
insigniaList.value = await DataStore.insigniaOp.filter(
(x: any) => x.type == tab.value || x.type == ""
);
});
};
const fecthInsigniaType = async () => {
await http(config.API.insigniaType)
.then(async (res) => {
// console.log(res);
let data = res.data.result;
DataStore.fetchDatainsigniaType(data);
tab.value = DataStore.insigniaType[0].name;
@ -276,31 +269,39 @@ const columns = ref<QTableProps["columns"]>([
]);
watch(tab, async () => {
insigniaList.value = await DataStore.insigniaOp.filter((x: any) => x.type == tab.value || x.type == '')
DataStore.insignia = ''
insigniaList.value = await DataStore.insigniaOp.filter(
(x: any) => x.type == tab.value || x.type == ""
);
DataStore.insignia = "";
fecthlistInsignia();
});
const selectorInsignia = async() => {
const selectorInsignia = async () => {
const dataCopy = await DataStore.listInsignia;
rows.value = DataStore.insignia != '' ? dataCopy.filter((x:any)=>x.requestInsigniaId == DataStore.insignia): dataCopy
rows.value =
DataStore.insignia != ""
? dataCopy.filter((x: any) => x.requestInsigniaId == DataStore.insignia)
: dataCopy;
};
// const selectorRound = (round: string) => {
// selectRound.value = round;
// };
const yearRound = ref<number>();
const selectorRound = async (round: number) => {
roundYear.value = round;
await fecthlistInsignia();
};
const rows = ref<any[]>([]);
const fecthlistInsignia = async () => {
showLoader();
await http
.get(config.API.insigniaManageBorrowList(Number(roundYear.value), tab.value))
.get(
config.API.insigniaManageBorrowList(Number(roundYear.value), tab.value)
)
.then(async (res) => {
await DataStore.fetchlistinsignia(res.data.result)
rows.value = DataStore.rows
await DataStore.fetchlistinsignia(res.data.result);
rows.value = DataStore.rows;
})
.catch((err) => {
console.log(err);
messageError($q, err);
})
.finally(() => {
@ -317,7 +318,7 @@ const close = () => {
const closeAndFecth = () => {
modal.value = false;
fecthlistInsignia()
fecthlistInsignia();
};
const addData = () => {
@ -329,7 +330,6 @@ const editData = (id: any) => {
profileId.value = id;
action.value = "editData";
modal.value = true;
};
const resetFilter = () => {
@ -344,34 +344,75 @@ const resetFilter = () => {
-นเครองราชฯ
</div>
<q-card flat bordered class="col-12 q-my-md q-mt-sm rounded-borders">
<q-tabs dense v-model="tab" align="left" class="bg-white text-grey" active-color="primary" indicator-color="primary">
<q-tabs
dense
v-model="tab"
align="left"
class="bg-white text-grey"
active-color="primary"
indicator-color="primary"
>
<div v-for="item in DataStore.insigniaType">
<q-tab :name="item.name" :label="item.label" />
</div>
</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 v-model="selectRound" dense outlined lazy-rules hide-bottom-space
:label="`${'รอบการเสนอขอเครื่องราชฯ'}`" emit-value map-options option-label="name"
:options="selectRoundAllOption" option-value="id" :borderless="false"
style="min-width: 150px" @update:emit-value="selectorRound" />
</div> -->
<div>
<q-select v-model="DataStore.insignia" dense outlined lazy-rules hide-bottom-space
:label="`${'เครื่องราชฯ'}`" emit-value map-options option-label="name" :options="insigniaList"
option-value="id" :readonly="false" :borderless="false" style="min-width: 150px"
@update:model-value="selectorInsignia" />
<q-select
v-model="yearRound"
dense
outlined
lazy-rules
hide-bottom-space
:label="`${'รอบการเสนอขอเครื่องราชฯ'}`"
emit-value
map-options
option-label="name"
:options="selectRoundAllOption"
option-value="year"
:borderless="false"
style="min-width: 150px"
@update:model-value="selectorRound"
/>
</div>
<div>
<q-select
v-model="DataStore.insignia"
dense
outlined
lazy-rules
hide-bottom-space
:label="`${'เครื่องราชฯ'}`"
emit-value
map-options
option-label="name"
:options="insigniaList"
option-value="id"
:readonly="false"
:borderless="false"
style="min-width: 150px"
@update:model-value="selectorInsignia"
/>
</div>
<div>
<q-btn @click="addData()" size="12px" flat round color="add" icon="mdi-plus">
<q-btn
@click="addData()"
size="12px"
flat
round
color="add"
icon="mdi-plus"
>
<q-tooltip>เพ</q-tooltip>
</q-btn>
</div>
@ -379,31 +420,68 @@ const resetFilter = () => {
<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">
<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" />
<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" />
<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">
<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' && props.row.returnDate == '-'">
<div
v-else-if="
props.col.name == 'action' && props.row.returnDate == '-'
"
>
<q-td>
<q-btn label="คืนเครื่องราชฯ" @click="editData(props.row.id)" color="blue" />
<q-btn
label="คืนเครื่องราชฯ"
@click="editData(props.row.id)"
color="blue"
/>
</q-td>
</div>
@ -414,112 +492,19 @@ const resetFilter = () => {
</template>
</d-table>
</div>
</q-tab-panel>
</q-tab-panels>
<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>
<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' && props.row.returnDate == '-'">
<q-td>
<q-btn label="คืนเครื่องราชฯ" @click="editData(props.row.id)" color="blue" />
</q-td>
</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>
<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' && props.row.returnDate == '-'">
<q-td>
<q-btn label="คืนเครื่องราชฯ" @click="editData(props.row.id)" color="blue" />
</q-td>
</div>
<div v-else>
{{ props.value }}
</div>
</q-td>
</template>
</d-table>
</div>
</div>
</div>
<DialogForm :modal="modal" :close="close" :close-and-fecth="closeAndFecth"
:round-id="selectRound == '00000000-0000-0000-0000-000000000000' ? 'all' : selectRound" :action="action"
:profile-id="profileId" :select-round-option="selectRoundOption" :type-id="tab" />
<DialogForm
:modal="modal"
:close="close"
:close-and-fecth="closeAndFecth"
:round-id="selectRound == '0' ? 'all' : selectRound"
:action="action"
:profile-id="profileId"
:select-round-option="selectRoundOption"
:type-id="tab"
/>
</q-card>
</template>
<style lang="scss" scoped>

View file

@ -41,7 +41,10 @@ export const useAllocateDataStore = defineStore("insigniaallocate", () => {
}
const selectInsignia = () => {
console.log(insignia.value);
rows.value = listInsignia.value.filter((e: any) => e.insigniaId === insignia.value)
if (insignia.value !== "") {
rows.value = listInsignia.value.filter((e: any) => e.insigniaId === insignia.value)
} else rows.value = listInsignia.value
}
const profileType = (val: string) => {
switch (val) {

View file

@ -1,6 +1,5 @@
<script setup lang="ts">
import { ref, onMounted, watch } from "vue";
// import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
@ -13,7 +12,6 @@ import type { OptionData } from "@/modules/07_insignia/interface/index/Main";
import type { QTableProps, QInput } from "quasar";
import { useQuasar } from "quasar";
// const router = useRouter();
const DataStore = useResultDataStore();
const mixin = useCounterMixin();
const {
@ -59,24 +57,22 @@ const fecthInsignia = async () => {
await http
.get(config.API.insignia)
.then((res) => {
console.log(res);
let data = res.data.result;
DataStore.fetchDatainsignia(data);
})
.catch((err) => {
console.log(err);
messageError($q, err);
});
};
const fecthInsigniaType = async () => {
await http(config.API.insigniaType)
.then((res) => {
// console.log(res);
let data = res.data.result;
DataStore.fetchDatainsigniaType(data);
tab.value = DataStore.insigniaType[0].name;
})
.catch((err) => {
console.log(err);
messageError($q, err);
});
};
const visibleColumns = ref<String[]>([
@ -271,7 +267,6 @@ const uploadFile = async (event: any, action: string) => {
success($q, "อัพโหลดไฟล์สำเร็จ");
})
.catch((err) => {
console.log(err);
messageError($q, err);
})
.finally(async () => {
@ -288,43 +283,6 @@ const uploadFile = async (event: any, action: string) => {
"ยืนยันการบันทึกรายการข้อมูล",
"ต้องการยืนยันรายการข้อมูลนี้หรื้อไม่ ?";
}
// console.log(selectRound.value);
// let id = selectRound.value.toString();
// if (action === "result") {
// const formdata = new FormData();
// formdata.append("file", event);
// await http
// .put(config.API.uploadfilereceice(id), formdata)
// .then(() => {
// success($q, "");
// })
// .catch((err) => {
// console.log(err);
// messageError($q, err);
// })
// .finally(async () => {
// await fecthlistInsignia();
// fileResult.value = null;
// });
// } else if (action === "invoice") {
// const formdata = new FormData();
// formdata.append("file", event);
// await http
// .put(config.API.uploadfileinvoice(id), formdata)
// .then(() => {
// success($q, "");
// })
// .catch((err) => {
// console.log(err);
// messageError($q, err);
// })
// .finally(async () => {
// await fecthlistInsignia();
// fileinvoice.value = null;
// });
// }
// }
};
const filterRef = ref<QInput>();
@ -482,7 +440,6 @@ const resetFilter = () => {
icon="mdi-upload"
@click="perviewfile(fileResult, 'receice')"
>
<!-- @click="uploadFile(fileResult, 'result')" -->
<q-tooltip
>พโหลดไฟลนทกผลการไดบพระราชทานเครองราชอสรยาภรณ</q-tooltip
>

View file

@ -151,7 +151,7 @@ const OriginalDataFetch = async () => {
rows.value = res.data.result.map((e: any) => ({
orderId: e.orderId,
Order: e.orderName,
OrderNum: `${e.orderNo}/${Number(e.fiscalYear) + 543}`,
OrderNum: e.orderNo == '' ? '-' : `${e.orderNo}/${Number(e.fiscalYear) + 543}`,
fiscalYear: Number(e.fiscalYear),
OrderDate: date2Thai(e.orderDate),
OrderBy: e.orderBy,