Refactoring code module 11_discipline
This commit is contained in:
parent
202fbf27b6
commit
9653ae78cb
58 changed files with 1021 additions and 1305 deletions
|
|
@ -1,24 +1,18 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { QForm, useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps } from "quasar";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { HistoryResultCommand } from "@/modules/11_discipline/interface/index/Main";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
showLoader,
|
||||
success,
|
||||
messageError,
|
||||
dialogConfirm,
|
||||
hideLoader,
|
||||
date2Thai,
|
||||
} = mixin;
|
||||
const listCheck = ref<string>("");
|
||||
const id = ref<string>("");
|
||||
const { showLoader, messageError, hideLoader, date2Thai } = mixin;
|
||||
|
||||
const props = defineProps({
|
||||
modal: Boolean,
|
||||
personId: {
|
||||
|
|
@ -27,7 +21,7 @@ const props = defineProps({
|
|||
},
|
||||
close: Function,
|
||||
});
|
||||
const rows = ref<any[]>([]);
|
||||
const rows = ref<HistoryResultCommand[]>([]);
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,22 +1,20 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, watchEffect, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer";
|
||||
import type { OpType } from "@/modules/05_placement/interface/response/Main";
|
||||
import type { DataListRow } from "@/modules/11_discipline/interface/request/result";
|
||||
import { useRoute } from "vue-router";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
const route = useRoute();
|
||||
|
||||
const optionsType = ref<[]>([]);
|
||||
const idPath = ref<string>(route.params.id as string);
|
||||
const type = ref<string>("");
|
||||
const rows = ref<DataListRow[]>([]);
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
const $q = useQuasar();
|
||||
const selected = ref<ResponseData[]>([]);
|
||||
const route = useRoute();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
showLoader,
|
||||
|
|
@ -27,6 +25,12 @@ const {
|
|||
dialogMessageNotify,
|
||||
} = mixin;
|
||||
|
||||
const optionsType = ref<[]>([]);
|
||||
const idPath = ref<string>(route.params.id as string);
|
||||
const type = ref<string>("");
|
||||
const rows = ref<DataListRow[]>([]);
|
||||
const selected = ref<ResponseData[]>([]);
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
|
|
@ -90,25 +94,6 @@ async function Ordersave() {
|
|||
props.getData?.();
|
||||
hideLoader();
|
||||
});
|
||||
// } else if (props.title == "ส่งไปออกคำสั่งงดโทษ/เพิ่มโทษ") {
|
||||
// const body = {
|
||||
// persons,
|
||||
// };
|
||||
// showLoader();
|
||||
// await http
|
||||
// .put(config.API.discardResult(idPath.value, type.value as string), body)
|
||||
// .then((res: any) => {
|
||||
// success($q, `${props.title}สำเร็จ`);
|
||||
// props.closeModal?.();
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// props.getData?.();
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
const emit = defineEmits([
|
||||
|
|
@ -132,7 +117,6 @@ async function fecthTypeOption() {
|
|||
await http
|
||||
.get(config.API.typeOrder())
|
||||
.then((res) => {
|
||||
// if (props.title == "ส่งไปออกคำสั่ง") {
|
||||
optionsType.value = res.data.result.filter(
|
||||
(e: OpType) =>
|
||||
e.commandCode === "C-PM-19" ||
|
||||
|
|
@ -143,13 +127,6 @@ async function fecthTypeOption() {
|
|||
e.commandCode === "C-PM-30" ||
|
||||
e.commandCode === "C-PM-31"
|
||||
);
|
||||
// }
|
||||
// else {
|
||||
// optionsType.value = res.data.result.filter(
|
||||
// (e: OpType) =>
|
||||
// e.commandCode === "C-PM-30" || e.commandCode === "C-PM-31"
|
||||
// );
|
||||
// }
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -166,15 +143,6 @@ watchEffect(() => {
|
|||
rows.value = props.data.persons.filter(
|
||||
(item: any) => item.status === "NEW"
|
||||
);
|
||||
// if (props.title == "ส่งไปออกคำสั่งลงโทษทางวินัย") {
|
||||
// rows.value = props.data.persons.filter(
|
||||
// (item: any) => item.status !== "REPORT"
|
||||
// );
|
||||
// } else if (props.title == "ส่งไปออกคำสั่งงดโทษ/เพิ่มโทษ") {
|
||||
// rows.value = props.data.persons.filter(
|
||||
// (item: any) => item.status == "REPORT" && item.statusDiscard == "NEW"
|
||||
// );
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref, watch } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
||||
import FormInvestigatefacts from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue"; //สืบสวนข้อเท็จจริง
|
||||
import FormDisciplinary from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue"; // สอบสวนความผิดทางวินัย
|
||||
import FormResult from "@/modules/11_discipline/components/4_Result/Form.vue"; // สอบสวนความผิดทางวินัย
|
||||
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 {
|
||||
FormData as FormDataComplaint,
|
||||
|
|
@ -13,20 +16,21 @@ import type {
|
|||
ArrayFileList,
|
||||
} from "@/modules/11_discipline/interface/request/complaint";
|
||||
import type { FormData as FormInvestigateFact } from "@/modules/11_discipline/interface/request/investigateFact";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDisciplineResultStore } from "@/modules/11_discipline/store/ResultStore";
|
||||
import { useQuasar } from "quasar";
|
||||
import DialogSendToCommand from "@/modules/11_discipline/components/4_Result/DialogSendToCommand.vue";
|
||||
import { useDisciplineMainStore } from "@/modules/11_discipline/store/main";
|
||||
|
||||
const mainStore = useDisciplineMainStore();
|
||||
import DialogSendToCommand from "@/modules/11_discipline/components/4_Result/DialogSendToCommand.vue";
|
||||
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
||||
import FormInvestigatefacts from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue"; //สืบสวนข้อเท็จจริง
|
||||
import FormDisciplinary from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue"; // สอบสวนความผิดทางวินัย
|
||||
import FormResult from "@/modules/11_discipline/components/4_Result/Form.vue"; // สอบสวนความผิดทางวินัย
|
||||
|
||||
const $q = useQuasar();
|
||||
const mainStore = useDisciplineMainStore();
|
||||
const mixin = useCounterMixin();
|
||||
const store = useDisciplineResultStore();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const titlePopup = ref<string>("");
|
||||
const idInvestigate = ref<string>("");
|
||||
|
|
@ -39,6 +43,7 @@ const dataDisciplinary = ref<object>([]);
|
|||
const checkRoutePermisson = ref<boolean>(
|
||||
route.name == "disciplineResultDetail"
|
||||
);
|
||||
|
||||
const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
||||
id: "",
|
||||
idComplaint: "",
|
||||
|
|
@ -302,12 +307,6 @@ onMounted(async () => {
|
|||
color="public"
|
||||
@click="sentIssue('ส่งไปออกคำสั่ง')"
|
||||
/>
|
||||
<!-- <q-btn
|
||||
v-if="status === 'DONE'"
|
||||
label="ส่งไปออกคำสั่งงดโทษ/เพิ่มโทษ"
|
||||
color="blue-6"
|
||||
@click="sentIssue('ส่งไปออกคำสั่งงดโทษ/เพิ่มโทษ')"
|
||||
/> -->
|
||||
</div>
|
||||
</div>
|
||||
<q-card bordered flat class="col-12">
|
||||
|
|
|
|||
|
|
@ -1,30 +1,25 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDisciplineResultStore } from "@/modules/11_discipline/store/ResultStore";
|
||||
import { useDisciplineMainStore } from "@/modules/11_discipline/store/main";
|
||||
import DialogHistory from "@/modules/11_discipline/components/4_Result/DialogHistory.vue";
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
||||
|
||||
import type {
|
||||
FormData,
|
||||
FormRef,
|
||||
DataOption,
|
||||
DataOptionRes,
|
||||
FileArray,
|
||||
} from "@/modules/11_discipline/interface/request/result";
|
||||
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const personId = ref<string>("");
|
||||
import DialogHistory from "@/modules/11_discipline/components/4_Result/DialogHistory.vue";
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
||||
|
||||
const countNum = ref<number>(1);
|
||||
const mainStore = useDisciplineMainStore();
|
||||
const modalPerson = ref<boolean>(false);
|
||||
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||
|
||||
const dataStore = useDisciplineResultStore();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
|
|
@ -36,8 +31,13 @@ const {
|
|||
dialogRemove,
|
||||
downloadRenameFileByLink,
|
||||
} = mixin;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const personId = ref<string>("");
|
||||
const countNum = ref<number>(1);
|
||||
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||
|
||||
const checkRoutePermisson = ref<boolean>(
|
||||
route.name == "disciplineResultDetail"
|
||||
);
|
||||
|
|
@ -151,38 +151,6 @@ function onSubmit() {
|
|||
async function fetchDatadetail() {
|
||||
formData.resultDescription = props.data.resultDescription;
|
||||
}
|
||||
/**
|
||||
* เช็คข้อมูลจาก props
|
||||
* เมื่อมีข้อมูล
|
||||
* เก็บข้อมูลลง formData
|
||||
*/
|
||||
watch(
|
||||
() => props.data,
|
||||
async () => {
|
||||
if (countNum.value === 1) {
|
||||
respondentType.value = props.data.respondentType;
|
||||
formData.oc = props.data.resultOc;
|
||||
formData.disciplineType = props.data.resultDisciplineType;
|
||||
formData.titleType = props.data.resultTitleType;
|
||||
formData.disciplineDisciplinary_DocResults =
|
||||
props.data.disciplineDisciplinary_DocResults;
|
||||
formData.year = props.data.resultYear ?? 0;
|
||||
mainStore.rowsAdd = props.data.persons;
|
||||
await fetchDatadetail();
|
||||
await getActive();
|
||||
|
||||
organizationId.value = props.data.organizationId;
|
||||
organizationName.value = props.data.organization;
|
||||
organization.value = {
|
||||
id: props.data.organizationId,
|
||||
name: props.data.organization,
|
||||
};
|
||||
} else if (countNum.value === 2) {
|
||||
formData.disciplineDisciplinary_DocResults =
|
||||
props.data.disciplineDisciplinary_DocResults;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
function inputEdit(val: boolean) {
|
||||
return {
|
||||
|
|
@ -221,10 +189,7 @@ function uploadFile() {
|
|||
});
|
||||
}
|
||||
|
||||
function downloadFile(link: string) {
|
||||
window.open(link, "_blank");
|
||||
}
|
||||
|
||||
/** ลบไฟล์ */
|
||||
function deleteFile(id: string) {
|
||||
dialogRemove($q, () => confirmDelete(id));
|
||||
}
|
||||
|
|
@ -248,16 +213,19 @@ function confirmDelete(docid: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/** เปิดรายละเอียด */
|
||||
function openDetial(id: string) {
|
||||
personalId.value = id;
|
||||
modalHistory.value = true;
|
||||
}
|
||||
|
||||
/** xbf ikp]tgvupf */
|
||||
function closeDetail() {
|
||||
modalHistory.value = false;
|
||||
personalId.value = "";
|
||||
}
|
||||
|
||||
/** เปิดรายละเอียด */
|
||||
function onclickViewinfo(id: string) {
|
||||
modalPersonal.value = true;
|
||||
personId.value = id;
|
||||
|
|
@ -266,6 +234,39 @@ function onclickViewinfo(id: string) {
|
|||
function updatemodalPersonal(modal: boolean) {
|
||||
modalPersonal.value = modal;
|
||||
}
|
||||
|
||||
/**
|
||||
* เช็คข้อมูลจาก props
|
||||
* เมื่อมีข้อมูล
|
||||
* เก็บข้อมูลลง formData
|
||||
*/
|
||||
watch(
|
||||
() => props.data,
|
||||
async () => {
|
||||
if (countNum.value === 1) {
|
||||
respondentType.value = props.data.respondentType;
|
||||
formData.oc = props.data.resultOc;
|
||||
formData.disciplineType = props.data.resultDisciplineType;
|
||||
formData.titleType = props.data.resultTitleType;
|
||||
formData.disciplineDisciplinary_DocResults =
|
||||
props.data.disciplineDisciplinary_DocResults;
|
||||
formData.year = props.data.resultYear ?? 0;
|
||||
mainStore.rowsAdd = props.data.persons;
|
||||
await fetchDatadetail();
|
||||
await getActive();
|
||||
|
||||
organizationId.value = props.data.organizationId;
|
||||
organizationName.value = props.data.organization;
|
||||
organization.value = {
|
||||
id: props.data.organizationId,
|
||||
name: props.data.organization,
|
||||
};
|
||||
} else if (countNum.value === 2) {
|
||||
formData.disciplineDisciplinary_DocResults =
|
||||
props.data.disciplineDisciplinary_DocResults;
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<div class="row col-12 bg-white">
|
||||
|
|
|
|||
|
|
@ -2,17 +2,18 @@
|
|||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import Table from "@/modules/11_discipline/components/4_Result/Table.vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDisciplineResultStore } from "@/modules/11_discipline/store/ResultStore";
|
||||
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
|
||||
import Table from "@/modules/11_discipline/components/4_Result/Table.vue";
|
||||
|
||||
const $q = useQuasar(); // show dialog
|
||||
const router = useRouter();
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const store = useDisciplineResultStore();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
|
|
@ -28,6 +29,7 @@ const maxPage = ref<number>(1);
|
|||
const totalList = ref<number>(0);
|
||||
const filter = ref<string>("");
|
||||
const status = ref<string>("DONE");
|
||||
|
||||
/** function เรียกรายการสรุปผลการพิจารณาทางวินัย*/
|
||||
async function fetchListResult() {
|
||||
showLoader();
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, useAttrs, watch } from "vue";
|
||||
import { useDisciplineResultStore } from "@/modules/11_discipline/store/ResultStore";
|
||||
|
||||
import { useDisciplineResultStore } from "@/modules/11_discipline/store/ResultStore";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
const store = useDisciplineResultStore();
|
||||
const table = ref<any>(null);
|
||||
const filterRef = ref<any>(null);
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const paging = ref<boolean>(true);
|
||||
const statusFilter = ref<string>("DONE");
|
||||
|
||||
const option = ref<any[]>(store.statusOptions);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue