เเก้ฟิล เพิ่ม api ไฟล์
This commit is contained in:
parent
339c7d2c10
commit
68e78403ca
5 changed files with 94 additions and 21 deletions
|
|
@ -8,5 +8,7 @@ export default {
|
|||
appealMainList:(status: string, type: string, year: number, page: number, pageSize: number, keyword: string)=>`${appeal}/user?status=${status}&type=${type}&year=${year}&page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
|
||||
appealAdd:()=>`${appeal}`,
|
||||
|
||||
appealByID:(id:string)=>`${appeal}/${id}`
|
||||
appealByID:(id:string)=>`${appeal}/${id}`,
|
||||
|
||||
appealByPrintReport:(id:string)=>`${appeal}/report/${id}`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export const useAppealComplainStore = defineStore("appealComplainStore", () => {
|
|||
type: typeConvert(e.type),
|
||||
title: e.title,
|
||||
description: e.description,
|
||||
year: e.year,
|
||||
year: e.year + 543,
|
||||
fullname: e.fullname,
|
||||
citizenId: e.citizenId,
|
||||
caseType: e.caseType,
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ function getProFile() {
|
|||
formProfile.profileId = data.id;
|
||||
formProfile.fullname = `${data.prefix}${data.firstName} ${data.lastName}`;
|
||||
formProfile.citizenId = data.citizenId;
|
||||
formProfile.oc = data.oc;
|
||||
formProfile.position = data.position;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -45,16 +47,18 @@ function onSubmit(data: any) {
|
|||
formData.append("title", data.title);
|
||||
formData.append("description", data.description);
|
||||
formData.append("type", data.type);
|
||||
formData.append("year", data.year);
|
||||
formData.append("caseType", data.caseType);
|
||||
formData.append("caseNumber", data.caseNumber);
|
||||
formData.append("year", '');
|
||||
formData.append("caseType", '');
|
||||
formData.append("caseNumber", '');
|
||||
formData.append("file", data.files);
|
||||
formData.append("oc", data.oc);
|
||||
formData.append("position", data.position);
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.appealAdd(), formData)
|
||||
.then((res) => {
|
||||
/** รอรับ id จาก response */
|
||||
// router.push(`/appeal-complain/${res.data.result}`);
|
||||
router.push(`/appeal-complain/${res.data.result}`);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { ref, onMounted, reactive } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import genReport from "@/plugins/genreport";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import type { QForm } from "quasar";
|
||||
|
|
@ -54,7 +55,6 @@ function getData() {
|
|||
http
|
||||
.get(config.API.appealByID(id.value))
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
const dataList = res.data.result;
|
||||
data.id = dataList.id;
|
||||
data.title = dataList.title;
|
||||
|
|
@ -80,6 +80,23 @@ function getData() {
|
|||
});
|
||||
}
|
||||
|
||||
async function getReport(fileName: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.appealByPrintReport(id.value))
|
||||
.then(async (res) => {
|
||||
console.log(res.data.result.data);
|
||||
const data = res.data.result
|
||||
await genReport(data, fileName);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
|
|
@ -101,7 +118,7 @@ onMounted(() => {
|
|||
/>
|
||||
แก้ไขอุทธรณ์/ร้องทุกข์
|
||||
</div>
|
||||
<Form :data="data" />
|
||||
<Form :data="data" :get-report="getReport" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -9,12 +9,17 @@ import type {
|
|||
HistoryStatusType,
|
||||
FileObType,
|
||||
} from "@/modules/07_appealComplain/interface/response/mainType";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar();
|
||||
|
||||
const isReadOnly = ref<boolean>(false);
|
||||
const printForm = ref<string>("");
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, modalWarning } = mixin;
|
||||
const { dialogConfirm, modalWarning, showLoader, hideLoader, messageError } =
|
||||
mixin;
|
||||
const dataStore = useAppealComplainStore();
|
||||
|
||||
const historyStatusOb = reactive<HistoryStatusType>({
|
||||
|
|
@ -38,6 +43,8 @@ const formData = reactive<any>({
|
|||
fullname: "",
|
||||
profileId: "",
|
||||
citizenId: "",
|
||||
oc: "",
|
||||
position: "",
|
||||
disciplineComplaint_Appeal_Docs: [fileOb],
|
||||
historyStatus: [historyStatusOb],
|
||||
});
|
||||
|
|
@ -55,6 +62,10 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: () => "",
|
||||
},
|
||||
getReport: {
|
||||
type: Function,
|
||||
default: () => "",
|
||||
},
|
||||
getData: {
|
||||
type: Function,
|
||||
default: () => "",
|
||||
|
|
@ -105,6 +116,8 @@ watch(props.formProfile, () => {
|
|||
formData.fullname = props.formProfile.fullname;
|
||||
formData.profileId = props.formProfile.profileId;
|
||||
formData.citizenId = props.formProfile.citizenId;
|
||||
formData.oc = props.formProfile.oc;
|
||||
formData.position = props.formProfile.position;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -134,9 +147,6 @@ watch(props.data, () => {
|
|||
// },
|
||||
// ]);
|
||||
});
|
||||
function filePrint() {
|
||||
console.log("print");
|
||||
}
|
||||
|
||||
function inputEdit(val: boolean) {
|
||||
return {
|
||||
|
|
@ -148,6 +158,11 @@ function inputEdit(val: boolean) {
|
|||
function downLoadFile(path: string) {
|
||||
window.open(path, "_blank");
|
||||
}
|
||||
|
||||
function filePrintDownload(fileName: string) {
|
||||
props.getReport(fileName);
|
||||
}
|
||||
|
||||
function onSubmit(data: any) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -172,21 +187,22 @@ function onSubmit(data: any) {
|
|||
v-model="printForm"
|
||||
color="blue"
|
||||
label="พิมพ์แบบฟอร์มคำร้อง"
|
||||
@click="filePrint"
|
||||
@click="filePrintDownload('แบบฟอร์มคำร้อง')"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="q-gutter-sm"
|
||||
v-if="formData.status === 'NEW'"
|
||||
>
|
||||
<div class="q-gutter-sm" v-if="isReadOnly">
|
||||
<q-banner
|
||||
inline-actions
|
||||
bordered
|
||||
class="bg-red-1 text-red border-red q-pa-md"
|
||||
:class="
|
||||
formData.status === 'NEW'
|
||||
? 'bg-red-1 text-red border-red q-pa-md'
|
||||
: 'bg-blue-1 text-blue border-blue q-pa-md'
|
||||
"
|
||||
>
|
||||
<q-icon name="mdi-information-outline" size="20px" />
|
||||
คำอุทธรณ์/ร้องทุกข์นี้จะยังไม่สมบูรณ์
|
||||
จนกว่าผู้อุทธรณ์/ร้องทุกข์ จะ “Print แบบฟอร์มคำร้อง” จากระบบ
|
||||
จนกว่าผู้อุทธรณ์/ร้องทุกข์ จะ “พิมพ์ แบบฟอร์มคำร้อง” จากระบบ
|
||||
พร้อม เอกสารหลักฐานทั้งหมดเป็น Hard Copy <br />
|
||||
แล้วส่งไปรษณีย์ให้ กพค. หรือ
|
||||
นำเอกสารทั้งหมดไปส่งด้วยตนเองที่ชั้น 14 อาคารศรีจุลทรัพย์
|
||||
|
|
@ -249,7 +265,41 @@ function onSubmit(data: any) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-gutter-x-sm">
|
||||
|
||||
|
||||
<!-- <div class="row q-col-gutter-x-sm">
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
:class="inputEdit(isReadOnly)"
|
||||
:readonly="isReadOnly"
|
||||
ref="ocRef"
|
||||
v-model="formData.oc"
|
||||
dense
|
||||
outlined
|
||||
:rules="[(val) => !!val || 'กรุณากรอกสังกัด']"
|
||||
lazy-rules
|
||||
label="สังกัด"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
:class="inputEdit(isReadOnly)"
|
||||
:readonly="isReadOnly"
|
||||
ref="ocRef"
|
||||
v-model="formData.position"
|
||||
dense
|
||||
outlined
|
||||
:rules="[(val) => !!val || 'กรุณากรอกสังกัด']"
|
||||
lazy-rules
|
||||
label="สังกัด"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
<!-- <div class="row q-gutter-x-sm">
|
||||
<div class="col-3">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
|
|
@ -316,7 +366,7 @@ function onSubmit(data: any) {
|
|||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="row" v-if="!isReadOnly">
|
||||
<!-- multiple
|
||||
use-chips -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue