แก้ path
This commit is contained in:
parent
e15d27ca8b
commit
daa2054b56
6 changed files with 104 additions and 21 deletions
|
|
@ -120,4 +120,8 @@ export default {
|
|||
`${disciplineMain}/director/${type}/${id}`,
|
||||
historyOrderById: (id: string) =>
|
||||
`${env.API_URI}/order/history/discipline/${id}`,
|
||||
|
||||
complaintbyGetId: (id: string,page?:string) => `${disciplineMain}/complaint/${page}/${id}`,
|
||||
investigateByGetId: (id: string,page?:string) => `${investigate}/${page}/${id}`,
|
||||
disciplineDisciplinaryByGetId: (id: string,page?:string) => `${discipline}/${page}/${id}`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import { onMounted, reactive, ref, computed } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ import type {
|
|||
FormData,
|
||||
ArrayPerson,
|
||||
ArrayFileList,
|
||||
} from "@/modules/11_discipline/interface/request/complaint";
|
||||
} from "@/modules/11_discipline/interface/request/Complaint";
|
||||
|
||||
import Form from "@/modules/11_discipline/components/1_Complaint/Form.vue";
|
||||
import PopupSendToNext from "@/modules/11_discipline/components/PopupSendToNext.vue";
|
||||
|
|
@ -163,11 +163,15 @@ const visibleColumns = ref<string[]>([
|
|||
"organization",
|
||||
]);
|
||||
|
||||
|
||||
|
||||
/** ดึงข้อมูล */
|
||||
async function getData() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.complaintbyId(id.value))
|
||||
.get(
|
||||
config.API.complaintbyGetId(id.value, mainStore.pathComplaints(route.name as string))
|
||||
)
|
||||
.then((res) => {
|
||||
const dataList = res.data.result;
|
||||
data.id = dataList.id;
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import { useInvestigateFactStore } from "@/modules/11_discipline/store/InvestigateFactStore";
|
||||
import { useDisciplineMainStore } from "@/modules/11_discipline/store/Main";
|
||||
|
||||
import type { ArrayPersonAdd } from "../../interface/response/investigate";
|
||||
import type { FormData } from "@/modules/11_discipline/interface/request/investigateFact";
|
||||
import type { ArrayPersonAdd } from "../../interface/response/Investigate";
|
||||
import type { FormData } from "@/modules/11_discipline/interface/request/InvestigateFact";
|
||||
import type {
|
||||
FormData as FormDataComplaint,
|
||||
ArrayPerson,
|
||||
ArrayFileList,
|
||||
} from "@/modules/11_discipline/interface/request/complaint";
|
||||
} from "@/modules/11_discipline/interface/request/Complaint";
|
||||
|
||||
import PopupSendToNext from "@/modules/11_discipline/components/PopupSendToNext.vue";
|
||||
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
||||
|
|
@ -117,8 +117,8 @@ async function getDataComplaint() {
|
|||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.complaintbyId(
|
||||
data.idComplaint ? data.idComplaint : store.complaintId
|
||||
config.API.complaintbyGetId(
|
||||
data.idComplaint ? data.idComplaint : store.complaintId,mainStore.pathComplaints(route.name as string)
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
|
|
@ -155,7 +155,7 @@ async function getDataComplaint() {
|
|||
function getData() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.investigateById(id.value))
|
||||
.get(config.API.investigateByGetId(id.value,mainStore.pathInves(route.name as string)))
|
||||
.then((res) => {
|
||||
const dataList = res.data.result;
|
||||
data.id = dataList.id;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ import type {
|
|||
FormData as FormDataComplaint,
|
||||
ArrayPerson,
|
||||
ArrayFileList,
|
||||
} from "@/modules/11_discipline/interface/request/complaint";
|
||||
import type { FormData as FormInvestigateFact } from "@/modules/11_discipline/interface/request/investigateFact";
|
||||
} from "@/modules/11_discipline/interface/request/Complaint";
|
||||
import type { FormData as FormInvestigateFact } from "@/modules/11_discipline/interface/request/InvestigateFact";
|
||||
|
||||
import PopupSendToNext from "@/modules/11_discipline/components/PopupSendToNext.vue";
|
||||
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
||||
|
|
@ -127,7 +127,7 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
|||
async function fetchDetailDisciplinary() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.disciplineDisciplinaryById(id.value))
|
||||
.get(config.API.disciplineDisciplinaryByGetId(id.value,mainStore.pathDiscip(route.name as string)))
|
||||
.then((res) => {
|
||||
data.value = res.data.result;
|
||||
status.value = res.data.result.status;
|
||||
|
|
@ -146,7 +146,7 @@ async function fetchDetailDisciplinary() {
|
|||
async function fetchDetailInvestigate() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.investigateById(idInvestigate.value))
|
||||
.get(config.API.investigateByGetId(idInvestigate.value,mainStore.pathInves(route.name as string)))
|
||||
.then((res) => {
|
||||
const dataList = res.data.result;
|
||||
dataInvestigatefacts.id = dataList.id;
|
||||
|
|
@ -191,7 +191,7 @@ async function fetchDetailInvestigate() {
|
|||
async function fetchDetailComplaints() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.complaintbyId(idComplaint.value))
|
||||
.get(config.API.complaintbyGetId(idComplaint.value,mainStore.pathComplaints(route.name as string)))
|
||||
.then((res) => {
|
||||
const dataList = res.data.result;
|
||||
dataComplaints.id = dataList.id;
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import { useDisciplineResultStore } from "@/modules/11_discipline/store/ResultStore";
|
||||
import { useDisciplineMainStore } from "@/modules/11_discipline/store/Main";
|
||||
|
||||
import type { DataListRow } from "@/modules/11_discipline/interface/request/result";
|
||||
import type { DataListRow } from "@/modules/11_discipline/interface/request/Result";
|
||||
import type {
|
||||
FormData as FormDataComplaint,
|
||||
ArrayPerson,
|
||||
ArrayFileList,
|
||||
} from "@/modules/11_discipline/interface/request/complaint";
|
||||
import type { FormData as FormInvestigateFact } from "@/modules/11_discipline/interface/request/investigateFact";
|
||||
} from "@/modules/11_discipline/interface/request/Complaint";
|
||||
import type { FormData as FormInvestigateFact } from "@/modules/11_discipline/interface/request/InvestigateFact";
|
||||
|
||||
import DialogSendToCommand from "@/modules/11_discipline/components/4_Result/DialogSendToCommand.vue";
|
||||
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
||||
|
|
@ -162,7 +162,12 @@ async function fetchDetailResult() {
|
|||
async function fetchDetailDisciplinary() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.disciplineDisciplinaryById(id.value))
|
||||
.get(
|
||||
config.API.disciplineDisciplinaryByGetId(
|
||||
id.value,
|
||||
mainStore.pathDiscip(route.name as string)
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
dataDisciplinary.value = res.data.result;
|
||||
})
|
||||
|
|
@ -178,7 +183,12 @@ async function fetchDetailDisciplinary() {
|
|||
async function fetchDetailInvestigate() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.investigateById(idInvestigate.value))
|
||||
.get(
|
||||
config.API.investigateByGetId(
|
||||
idInvestigate.value,
|
||||
mainStore.pathInves(route.name as string)
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
const dataList = res.data.result;
|
||||
dataInvestigatefacts.id = dataList.id;
|
||||
|
|
@ -223,7 +233,12 @@ async function fetchDetailInvestigate() {
|
|||
async function fetchDetailComplaints() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.complaintbyId(idComplaint.value))
|
||||
.get(
|
||||
config.API.complaintbyGetId(
|
||||
idComplaint.value,
|
||||
mainStore.pathComplaints(route.name as string)
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
const dataList = res.data.result;
|
||||
dataComplaints.id = dataList.id;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { defineStore } from "pinia";
|
|||
import type { QTableProps } from "quasar";
|
||||
|
||||
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
|
||||
import type { ArrayPersonAdd } from "@/modules/11_discipline/interface/response/investigate";
|
||||
import type { ArrayPersonAdd } from "@/modules/11_discipline/interface/response/Investigate";
|
||||
|
||||
export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
|
||||
/** option ผู้ถูกสอบสวน*/
|
||||
|
|
@ -267,6 +267,63 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* แปลง status เป็น text #เรื่องร้องเรียน
|
||||
* @param val status
|
||||
* @returns text
|
||||
*/
|
||||
function pathComplaints(val: string) {
|
||||
switch (val) {
|
||||
case "disciplineComplaintsEdit":
|
||||
case "disciplineComplaintsDetail":
|
||||
return "main";
|
||||
case "disciplineInvestigatefactsEdit":
|
||||
case "disciplineInvestigatefactsDetail":
|
||||
return "inves";
|
||||
case "disciplineDisciplinaryEdit":
|
||||
case "disciplineDisciplinaryDetail":
|
||||
return "discip";
|
||||
case "disciplineEditResult":
|
||||
case "disciplineResultDetail":
|
||||
return "result";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* แปลง status เป็น text #สืบสวนข้อเท็จจริง
|
||||
* @param val status
|
||||
* @returns text
|
||||
*/
|
||||
function pathInves(val: string) {
|
||||
switch (val) {
|
||||
case "disciplineInvestigatefactsEdit":
|
||||
case "disciplineInvestigatefactsDetail":
|
||||
return "main";
|
||||
case "disciplineDisciplinaryEdit":
|
||||
case "disciplineDisciplinaryDetail":
|
||||
return "discip";
|
||||
case "disciplineEditResult":
|
||||
case "disciplineResultDetail":
|
||||
return "result";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* แปลง status เป็น text #สอบสวนความผิดทางวินัย
|
||||
* @param val status
|
||||
* @returns text
|
||||
*/
|
||||
function pathDiscip(val: string) {
|
||||
switch (val) {
|
||||
case "disciplineDisciplinaryEdit":
|
||||
case "disciplineDisciplinaryDetail":
|
||||
return "main";
|
||||
case "disciplineEditResult":
|
||||
case "disciplineResultDetail":
|
||||
return "result";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* แปลง option ที่รับมาเป็น ไทย
|
||||
* @param val ค่าที่ได้จาก API
|
||||
|
|
@ -395,5 +452,8 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
|
|||
causeTextOptions,
|
||||
rowsSend,
|
||||
fetchDataRowsSend,
|
||||
pathComplaints,
|
||||
pathInves,
|
||||
pathDiscip
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue