- คำสั่ง เพิ่ม get เรื่องร้องเรียน

- แก้ bug
This commit is contained in:
Warunee Tamkoo 2024-01-15 12:07:13 +07:00
parent 53cd8e593c
commit 79288c80f5
5 changed files with 111 additions and 20 deletions

View file

@ -101,7 +101,7 @@ onMounted(() => {
color="primary"
class="q-mr-sm"
@click="
route.name == 'disciplineOrderDatail'
route.name == 'disciplineOrderDatail' || route.name == 'disciplineOrderAdd'
? router.push(`/discipline-order`)
: router.push(`/order`)
"

View file

@ -8,8 +8,12 @@ import http from "@/plugins/http";
import config from "@/app.config";
import type { treeTab } from "@/modules/05_placement/interface/index/Main";
import type { ResponseOrganiz } from "@/modules/05_placement/interface/response/Order";
import type { complaintLists } from "@/modules/10_order/interface/response/Order";
import type { QTableProps } from "quasar";
import type { DataOption1, OrederResult } from "@/modules/10_order/interface/index/Main";
import type {
DataOption1,
OrederResult,
} from "@/modules/10_order/interface/index/Main";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import { useOrderPlacementDataStore } from "@/modules/10_order/store";
@ -121,12 +125,6 @@ const caseFault = ref<string>("");
const result = ref<string>("");
const refRaw = ref<string>("");
const complaintId = ref<string>("");
const complaintOption = ref<DataOption1[]>([
{
id: "00000000-0000-0000-0000-000000000000",
name: "ทุจริตต่อหน้าที่",
},
]);
const typeOrderFilter = ref<any>({
typeOrderOption: [],
@ -138,6 +136,13 @@ onMounted(async () => {
} else {
await fecthTypeOption("noData");
}
if (
route.name == "disciplineOrderDatail" ||
route.name == "disciplineOrderAdd"
) {
await getComplaint();
}
});
//
watch(byOrder, async () => {
@ -312,13 +317,62 @@ const fecthCommand = async () => {
});
};
const selectCMP = (selectOrder: OrederResult) => {
const selectCMP = async (selectOrder: OrederResult) => {
if (selectOrder != null) {
fecthExamRoundOption(selectOrder.commandCode);
if (selectOrder.commandCode === "C-PM-10") {
nodeTree();
}
nameOrder.value = DataStore.nameOrderFilter(selectOrder.commandCode);
// 01 - 04
if (
selectOrder.commandCode == "C-PM-01" ||
selectOrder.commandCode == "C-PM-02" ||
selectOrder.commandCode == "C-PM-03" ||
selectOrder.commandCode == "C-PM-04"
) {
fecthExamRoundOption(selectOrder.commandCode);
}
//
// console.log(DataStore.complaintLists)
DataStore.complaintOption = [];
if (
selectOrder.commandCode == "C-PM-25" ||
selectOrder.commandCode == "C-PM-26"
) {
await DataStore.complaintLists
.filter((x: complaintLists) => x.isDisciplinary === true)
.map((val: complaintLists) => {
DataStore.complaintOption.push({ id: val.id, name: val.title });
});
} else if (selectOrder.commandCode == "C-PM-32") {
await DataStore.complaintLists
.filter(
(x: complaintLists) =>
x.isInvestigate === true ||
x.isDisciplinary === true ||
x.isResult === true
)
.map((val: complaintLists) => {
DataStore.complaintOption.push({ id: val.id, name: val.title });
});
} else if (
selectOrder.commandCode == "C-PM-19" ||
selectOrder.commandCode == "C-PM-20" ||
selectOrder.commandCode == "C-PM-27" ||
selectOrder.commandCode == "C-PM-28" ||
selectOrder.commandCode == "C-PM-29" ||
selectOrder.commandCode == "C-PM-30" ||
selectOrder.commandCode == "C-PM-31"
) {
await DataStore.complaintLists
.filter((x: complaintLists) => x.isResult === true)
.map((val: complaintLists) => {
DataStore.complaintOption.push({ id: val.id, name: val.title });
});
}
}
//01-04
examRound.value = "";
@ -391,6 +445,21 @@ const fecthExamRoundOption = async (commandCode: string) => {
});
};
/**
* งรายการเรองรองเรยนจาก API
*/
async function getComplaint() {
await http
.get(config.API.disciplineReportList)
.then((res: any) => {
const dataArr = res.data.result;
DataStore.complaintLists = dataArr;
})
.catch((e) => {
messageError($q, e);
});
}
//
const submit = async () => {
let signBy = null;
@ -557,6 +626,7 @@ const submit = async () => {
}
});
};
//
const createListOrder = async (formData: Object, type: string) => {
showLoader();
@ -1936,7 +2006,7 @@ const getClass = (val: boolean) => {
:label="`${'เรื่องร้องเรียน'}`"
map-options
option-label="name"
:options="complaintOption"
:options="DataStore.complaintOption"
option-value="id"
use-input
input-debounce="0"
@ -2160,7 +2230,7 @@ const getClass = (val: boolean) => {
:label="`${'เรื่องร้องเรียน'}`"
map-options
option-label="name"
:options="complaintOption"
:options="DataStore.complaintOption"
option-value="id"
use-input
input-debounce="0"

View file

@ -5,7 +5,7 @@ interface ResponseData {
personalId: string;
selectStatus: boolean;
sequence: number;
refRecordId: string
refRecordId: string;
}
interface ResponseOrganiz {
@ -41,4 +41,14 @@ interface DataCopyOrder {
mutiselect: number[];
}
export type { ResponseData, ResponseOrganiz, ResponseCopyOrder, DataCopyOrder };
interface complaintLists {
id: string;
title: string;
dateConsideration: Date | null;
isComplaint: boolean;
isInvestigate: boolean;
isDisciplinary: boolean;
isResult: boolean;
}
export type { ResponseData, ResponseOrganiz, ResponseCopyOrder, DataCopyOrder, complaintLists };

View file

@ -1,14 +1,18 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type { FormOrderPlacementMainData } from "@/modules/10_order/interface/request/Main";
import type { complaintLists } from "@/modules/10_order/interface/response/Order";
import type { DataOption1 } from "@/modules/10_order/interface/index/Main";
export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
interface placementOrder {
mappingPosition: { columns: String[] };
}
const placementOrderData = ref<placementOrder>({
mappingPosition: { columns: [] },
});
const changePlacementColumns = (system: String, val: String[]) => {
if (system == "mappingPosition")
placementOrderData.value.mappingPosition.columns = val;
@ -168,6 +172,9 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
}
};
const complaintLists = ref<complaintLists[]>([]);
const complaintOption = ref<DataOption1[]>([]);
return {
placementOrderData,
changePlacementColumns,
@ -178,5 +185,7 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => {
DataMainYearSetOrder,
DataMainOrder,
nameOrderFilter,
complaintLists,
complaintOption,
};
});