Merge branch 'develop' of https://github.com/Frappet/BMA-EHR-USER into develop
This commit is contained in:
commit
01b550520e
5 changed files with 34 additions and 25 deletions
|
|
@ -31,6 +31,10 @@ export const useAppealComplainStore = defineStore("appealComplainStore", () => {
|
||||||
{ id: "DONE", name: "ปิดคำร้อง" },
|
{ id: "DONE", name: "ปิดคำร้อง" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* จัดข้อมูลที่ได้รับมา
|
||||||
|
* @param data ข้อมูลจาก API
|
||||||
|
*/
|
||||||
function fetchAppealComplain(data: MainList[]) {
|
function fetchAppealComplain(data: MainList[]) {
|
||||||
let dataList: RowList[] = data.map((e: MainList) => ({
|
let dataList: RowList[] = data.map((e: MainList) => ({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
|
|
@ -49,7 +53,11 @@ export const useAppealComplainStore = defineStore("appealComplainStore", () => {
|
||||||
rows.value = dataList;
|
rows.value = dataList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* แปลงข้อมูลที่รับมา เป็น text
|
||||||
|
* @param val status
|
||||||
|
* @returns ส่งค่าที่แปลง ออกไป
|
||||||
|
*/
|
||||||
const typeConvert = (val: string) => {
|
const typeConvert = (val: string) => {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case "APPEAL":
|
case "APPEAL":
|
||||||
|
|
@ -61,6 +69,11 @@ export const useAppealComplainStore = defineStore("appealComplainStore", () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* แปลงข้อมูลที่รับมา เป็น text
|
||||||
|
* @param val status
|
||||||
|
* @returns ส่งค่าที่แปลง ออกไป
|
||||||
|
*/
|
||||||
function statusTothai(val: string){
|
function statusTothai(val: string){
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case "NEW":
|
case "NEW":
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import { useRouter, useRoute } from "vue-router";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import type { QForm } from "quasar";
|
|
||||||
|
|
||||||
import Form from "@/modules/07_appealComplain/views/Form.vue";
|
import Form from "@/modules/07_appealComplain/views/Form.vue";
|
||||||
|
|
||||||
|
|
@ -20,6 +19,8 @@ const formProfile = reactive<any>({
|
||||||
fullname: "",
|
fullname: "",
|
||||||
citizenId: "",
|
citizenId: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** ดึงข้อมูลจาก keycloak*/
|
||||||
function getProFile() {
|
function getProFile() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -39,6 +40,11 @@ function getProFile() {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* บันทึกข้อมูล
|
||||||
|
* @param data ฟอร์มข้อมูล
|
||||||
|
*/
|
||||||
function onSubmit(data: any) {
|
function onSubmit(data: any) {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("profileId", data.profileId);
|
formData.append("profileId", data.profileId);
|
||||||
|
|
@ -68,6 +74,7 @@ function onSubmit(data: any) {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getProFile();
|
getProFile();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
import genReport from "@/plugins/genreport";
|
import genReport from "@/plugins/genreport";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import type { QForm } from "quasar";
|
|
||||||
import type {
|
import type {
|
||||||
EditDataList,
|
EditDataList,
|
||||||
HistoryStatusType,
|
HistoryStatusType,
|
||||||
|
|
@ -20,8 +19,7 @@ const route = useRoute();
|
||||||
const id = ref<string>(route.params.id as string);
|
const id = ref<string>(route.params.id as string);
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const myform = ref<QForm | null>(null);
|
const { messageError, showLoader, hideLoader } = mixin;
|
||||||
const { fails, success, messageError, showLoader, hideLoader } = mixin;
|
|
||||||
|
|
||||||
const historyStatusOb = reactive<HistoryStatusType>({
|
const historyStatusOb = reactive<HistoryStatusType>({
|
||||||
status: "",
|
status: "",
|
||||||
|
|
@ -80,6 +78,9 @@ function getData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ดึงข้อมูลหน้า แก้ไขอุทธรณ์/ร้องทุกข์
|
||||||
|
* @param fileName ชื่อไฟล์
|
||||||
|
*/
|
||||||
async function getReport(fileName: string) {
|
async function getReport(fileName: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
|
||||||
|
|
@ -2,17 +2,13 @@
|
||||||
import { ref, reactive, defineProps, watch } from "vue";
|
import { ref, reactive, defineProps, watch } from "vue";
|
||||||
import { useAppealComplainStore } from "@/modules/07_appealComplain/store";
|
import { useAppealComplainStore } from "@/modules/07_appealComplain/store";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { is, useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import type { MyObjectAppealRef } from "@/modules/07_appealComplain/interface/request/appeal";
|
import type { MyObjectAppealRef } from "@/modules/07_appealComplain/interface/request/appeal";
|
||||||
import type {
|
import type {
|
||||||
EditDataList,
|
|
||||||
HistoryStatusType,
|
HistoryStatusType,
|
||||||
FileObType,
|
FileObType,
|
||||||
} from "@/modules/07_appealComplain/interface/response/mainType";
|
} from "@/modules/07_appealComplain/interface/response/mainType";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
|
||||||
import config from "@/app.config";
|
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
||||||
const isReadOnly = ref<boolean>(false);
|
const isReadOnly = ref<boolean>(false);
|
||||||
|
|
@ -135,13 +131,6 @@ watch(props.data, () => {
|
||||||
formData.disciplineComplaint_Appeal_Docs =
|
formData.disciplineComplaint_Appeal_Docs =
|
||||||
props.data.disciplineComplaint_Appeal_Docs;
|
props.data.disciplineComplaint_Appeal_Docs;
|
||||||
formData.historyStatus = props.data.historyStatus;
|
formData.historyStatus = props.data.historyStatus;
|
||||||
// dataStore.getRow([
|
|
||||||
// {
|
|
||||||
// profileId: props.data.profileId,
|
|
||||||
// fullname: props.data.fullname,
|
|
||||||
// citizenId: props.data.citizenId,
|
|
||||||
// },
|
|
||||||
// ]);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function inputEdit(val: boolean) {
|
function inputEdit(val: boolean) {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import { useAppealComplainStore } from "@/modules/07_appealComplain/store";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import Table from "@/components/Table.vue";
|
|
||||||
|
|
||||||
import type { FormType } from "@/modules/07_appealComplain/interface/response/mainType";
|
import type { FormType } from "@/modules/07_appealComplain/interface/response/mainType";
|
||||||
import type { DataOption } from "@/modules/07_appealComplain/interface/index/main";
|
import type { DataOption } from "@/modules/07_appealComplain/interface/index/main";
|
||||||
|
|
@ -188,13 +187,6 @@ const getData = async () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* ฟังก์ชั่นกดเพิ่มไปหน้าเพิ่ม
|
|
||||||
*/
|
|
||||||
const clickAdd = async () => {
|
|
||||||
router.push(`/appeal-complain/add`);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* กดเพื่อย้อนกลับ
|
* กดเพื่อย้อนกลับ
|
||||||
*/
|
*/
|
||||||
|
|
@ -202,10 +194,12 @@ const clickBack = () => {
|
||||||
router.push(`/`);
|
router.push(`/`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** ดึงข้อมูลเมื่อมีการปรับฟิลเตอร์ */
|
||||||
function dataUpdate() {
|
function dataUpdate() {
|
||||||
getData();
|
getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ดึงข้อมูลจาก keyword*/
|
||||||
function filterFn() {
|
function filterFn() {
|
||||||
getData();
|
getData();
|
||||||
}
|
}
|
||||||
|
|
@ -227,9 +221,14 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* เปิดหน้าแก้ไข
|
||||||
|
* @param id id ของ บุคคล
|
||||||
|
*/
|
||||||
function editPage(id: string) {
|
function editPage(id: string) {
|
||||||
router.push(`/appeal-complain/${id}`);
|
router.push(`/appeal-complain/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function redirectToPageadd() {
|
function redirectToPageadd() {
|
||||||
// dataStore.rowsAdd = []
|
// dataStore.rowsAdd = []
|
||||||
router.push(`/appeal-complain/add`);
|
router.push(`/appeal-complain/add`);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue