Merge branch 'develop' into nice_dev
This commit is contained in:
commit
42c0eb669f
11 changed files with 604 additions and 346 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import env from "../index";
|
||||
const discipline = `${env.API_URI}/discipline`;
|
||||
const discipline = `${env.API_URI}/discipline/disciplinary`;
|
||||
const investigate = `${env.API_URI}/discipline/investigate`;
|
||||
|
||||
export default {
|
||||
|
|
@ -46,18 +46,18 @@ export default {
|
|||
investigateApprove: (id: string) => `${investigate}/approve/${id}`,
|
||||
|
||||
/** ระบบวินัยเรื่องสอบสวน */
|
||||
disciplineDisciplinary: () => `${discipline}/disciplinary`,
|
||||
disciplineDisciplinaryById: (id: string) =>
|
||||
`${discipline}/disciplinary/${id}`,
|
||||
disciplineInvestigateById: (id: string) =>
|
||||
`${discipline}/disciplinary/investigate/${id}`,
|
||||
disciplineComplaintsById: (id: string) =>
|
||||
`${discipline}/disciplinary/complaint/${id}`,
|
||||
disciplineDisciplinary: () => `${discipline}`,
|
||||
disciplineDisciplinaryById: (id: string) => `${discipline}/${id}`,
|
||||
disciplineInvestigateById: (id: string) => `${discipline}/investigate/${id}`,
|
||||
disciplineComplaintsById: (id: string) => `${discipline}/complaint/${id}`,
|
||||
disciplineDirector: () => `${discipline}/director`,
|
||||
disciplineDoc: (type: string, id: string) =>
|
||||
`${discipline}/disciplinary/${type}/file/${id}`,
|
||||
`${discipline}/${type}/file/${id}`,
|
||||
disciplineByIdDoc: (type: string, id: string, docId: string) =>
|
||||
`${discipline}/disciplinary/${type}/file/${id}/${docId}`,
|
||||
disciplinaryReject: (id: string) => `${discipline}/reject/${id}`,
|
||||
disciplinaryResume: (id: string) => `${discipline}/resume/${id}`,
|
||||
disciplinaryApprove: (id: string) => `${discipline}/approve/${id}`,
|
||||
|
||||
/** รายการผลการพิจารณาทางวินัย*/
|
||||
listResult: () => `${discipline}/result`,
|
||||
|
|
|
|||
|
|
@ -452,7 +452,7 @@ const menuList = readonly<any[]>([
|
|||
role: "discipline",
|
||||
},
|
||||
{
|
||||
key: 11.6,
|
||||
key: 11.5,
|
||||
label: "รายงาน",
|
||||
path: "disciplineReport",
|
||||
role: "discipline",
|
||||
|
|
@ -460,7 +460,7 @@ const menuList = readonly<any[]>([
|
|||
{
|
||||
label: "ข้อมูลพื้นฐาน",
|
||||
path: "",
|
||||
key: 11.6,
|
||||
key: 11.7,
|
||||
role: "discipline",
|
||||
children: [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,33 +26,6 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
|
|||
const selectDate = ref<Date | null>(new Date());
|
||||
const fiscalYear = ref<string | null>("0");
|
||||
const DataMainOrig = ref<DataRows[]>([]); // ข้อมูลหลักดั้งเดิม
|
||||
// async function fecthList(data: ListData[]) {
|
||||
// let datalist: DataRows[] = data.map((e: ListData) => ({
|
||||
// id: e.id,
|
||||
// fullname: e.fullname,
|
||||
// date: date2Thai(new Date(e.date), false, true),
|
||||
// dateFix: date2Thai(new Date(e.dateFix)),
|
||||
// timeMorning:
|
||||
// e.startTimeMorning == null
|
||||
// ? "-"
|
||||
// : e.startTimeMorning + " - " + e.endTimeMorning,
|
||||
// timeAfternoon:
|
||||
// e.startTimeAfternoon == null
|
||||
// ? "-"
|
||||
// : e.startTimeAfternoon + " - " + e.endTimeAfternoon,
|
||||
// startTimeMorning: e.startTimeMorning,
|
||||
// endTimeMorning: e.endTimeMorning,
|
||||
// startTimeAfternoon: e.startTimeAfternoon,
|
||||
// endTimeAfternoon: e.endTimeAfternoon,
|
||||
// checkIn: e.checkOut,
|
||||
// checkOut: e.checkOut,
|
||||
// status: e.status,
|
||||
// checkInStatus: convertStatus(e.checkInStatus),
|
||||
// checkOutStatus: convertStatus(e.checkOutStatus),
|
||||
// }));
|
||||
// rows.value = datalist;
|
||||
// DataMainOrig.value = datalist;
|
||||
// }
|
||||
const DataMainUpdate = ref<DataRows[]>([]); // ข้อมูลเปลี่ยนแปลง
|
||||
const DataMain = (val: DataRows[]) => (DataMainOrig.value = val);
|
||||
const DataUpdate = (filterYear: string) => {
|
||||
|
|
@ -68,15 +41,16 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
|
|||
const year = ref<number>(2023);
|
||||
const month = ref<number>(11);
|
||||
const page = ref<number>(1);
|
||||
const total = ref<number>(0);
|
||||
const pageSize = ref<number>(10);
|
||||
const filter = ref<string>(""); //search data table
|
||||
|
||||
const maxPage = ref<number>(0);
|
||||
// Pagination - update rowsPerPage
|
||||
async function updatePagination(newPagination: any) {
|
||||
initialPagination.value = newPagination;
|
||||
// currentPage.value = 1;
|
||||
console.log("updatePagination");
|
||||
}
|
||||
// async function updatePagination(newPagination: any) {
|
||||
// initialPagination.value = newPagination;
|
||||
// // currentPage.value = 1;
|
||||
// console.log("updatePagination");
|
||||
// }
|
||||
|
||||
// Pagination - initial pagination
|
||||
const initialPagination = ref<any>({
|
||||
|
|
@ -86,21 +60,6 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
|
|||
// rowsPerPage: pageSize,
|
||||
});
|
||||
|
||||
// Pagination - page & change page & get new data
|
||||
// const currentPage = ref<number>(1);
|
||||
// watch(
|
||||
// [() => currentPage.value, () => initialPagination.value.rowsPerPage],
|
||||
// () => {
|
||||
// emit(
|
||||
// "update:change-page",
|
||||
// currentPage.value,
|
||||
// initialPagination.value.rowsPerPage,
|
||||
// true
|
||||
// );
|
||||
// }
|
||||
// );
|
||||
|
||||
// const emit = defineEmits(["update:change-page"]);
|
||||
/**
|
||||
* ฟังก์ชั่น api เปลี่ยนหน้า
|
||||
* @param pageVal page
|
||||
|
|
@ -123,12 +82,16 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
|
|||
config.API.specialTime() +
|
||||
`?year=${year.value}&month=${month.value}&page=${page.value}&pageSize=${pageSize.value}&keyword=${filter.value}`
|
||||
)
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
.then(async (res) => {
|
||||
let data = res.data.result.data;
|
||||
total.value = res.data.result.total;
|
||||
maxPage.value = await Math.ceil(total.value / pageSize.value);
|
||||
maxPage.value = maxPage.value < 1 ? 1 : maxPage.value;
|
||||
rows.value = [];
|
||||
data.map((e: any) => {
|
||||
rows.value.push({
|
||||
id: e.id,
|
||||
fullname: e.fullname,
|
||||
fullname: e.fullName,
|
||||
date: date2Thai(new Date(e.checkDate), false, true),
|
||||
dateFix: date2Thai(new Date(e.createdAt)),
|
||||
timeMorning:
|
||||
|
|
@ -299,7 +262,11 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
|
|||
optionStatus,
|
||||
fetchData,
|
||||
changePage,
|
||||
initialPagination,
|
||||
updatePagination,
|
||||
total,
|
||||
maxPage,
|
||||
year,
|
||||
page,
|
||||
pageSize,
|
||||
month,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import config from "@/app.config";
|
|||
|
||||
import { useRouter } from "vue-router";
|
||||
import { identity } from "@fullcalendar/core/internal";
|
||||
|
||||
/**ตัวแปรที่ใช้ */
|
||||
const dataSpecialTime = useSpecialTimeStore();
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -20,21 +22,14 @@ const modalUnapprove = ref(false);
|
|||
const modalApprove = ref(false);
|
||||
const detailData = ref<any>();
|
||||
const editCheck = ref<string>("");
|
||||
|
||||
const pagination = ref({
|
||||
// sortBy: "desc",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
const dialogTitle = ref<string>("");
|
||||
const dialogDesc = ref<string>("");
|
||||
const name = ref<string>("");
|
||||
const id = ref<string>("");
|
||||
const reasonNote = ref<string>("");
|
||||
const dateDialog = ref<string>("");
|
||||
const dateFixDialog = ref<string>("");
|
||||
|
||||
/**ฟังก์ชั่นไม่อนุมัติ */
|
||||
const unapprove = async (fullname: string, personId: string) => {
|
||||
id.value = personId;
|
||||
dialogTitle.value = " ไม่อนุมัติการลงเวลาพิเศษของ" + fullname;
|
||||
|
|
@ -42,6 +37,9 @@ const unapprove = async (fullname: string, personId: string) => {
|
|||
modalUnapprove.value = true;
|
||||
// rejectData();
|
||||
};
|
||||
|
||||
/** function Model */
|
||||
//เปิด
|
||||
function openModal(
|
||||
data: any,
|
||||
check: string,
|
||||
|
|
@ -60,6 +58,7 @@ function openModal(
|
|||
}
|
||||
console.log(data);
|
||||
}
|
||||
//ปิด
|
||||
const closeDialog = () => {
|
||||
modalUnapprove.value = false;
|
||||
modalApprove.value = false;
|
||||
|
|
@ -94,63 +93,63 @@ const resetFilter = () => {
|
|||
}
|
||||
};
|
||||
|
||||
// paging
|
||||
const page = ref<number>(1);
|
||||
const pageSize = ref<number>(10);
|
||||
const filter = ref<string>(""); //search data table
|
||||
/**
|
||||
* ฟังก์ชั่น api เปลี่ยนหน้า
|
||||
* @param pageVal page
|
||||
* @param pageSizeVal pagesize
|
||||
*/
|
||||
async function changePage(pageVal: number, pageSizeVal: number) {
|
||||
// page.value = await pageVal;
|
||||
// pageSize.value = await pageSizeVal;
|
||||
// dataSpecialTime.fetchData();
|
||||
console.log("test");
|
||||
}
|
||||
// Pagination - initial pagination
|
||||
const initialPagination = ref<any>({
|
||||
sortBy: null,
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: pageSize, // set ตาม page หลักส่งมา
|
||||
});
|
||||
const emit = defineEmits(["update:change-page"]);
|
||||
// Pagination - page & change page & get new data
|
||||
const currentPage = ref<number>(1);
|
||||
watch(
|
||||
[() => currentPage.value, () => initialPagination.value.rowsPerPage],
|
||||
async () => {
|
||||
dataSpecialTime.page = currentPage.value;
|
||||
await dataSpecialTime.fetchData();
|
||||
// emit(
|
||||
// "update:change-page",
|
||||
// currentPage.value,
|
||||
// initialPagination.value.rowsPerPage,
|
||||
// true
|
||||
// );
|
||||
}
|
||||
);
|
||||
// Pagination - update rowsPerPage
|
||||
async function updatePagination(newPagination: any) {
|
||||
currentPage.value = 1;
|
||||
dataSpecialTime.pageSize = initialPagination.value.rowsPerPage;
|
||||
dataSpecialTime.page = 1; // set current page เป็น 1 เสมอเมื่อเปลี่ยน per row
|
||||
}
|
||||
|
||||
/**Hook */
|
||||
onMounted(async () => {
|
||||
// fecthList([
|
||||
// {
|
||||
// id: "eefa2f4f-c507-4a42-8567-4fadb8dc1f50",
|
||||
// fullname: "นางสาวณัฐกา ชมสิน",
|
||||
// date: "2023-11-01 08:54",
|
||||
// dateFix: "2023-10-30",
|
||||
// startTimeMorning: "08:00",
|
||||
// endTimeMorning: "12:00",
|
||||
// startTimeAfternoon: "08:00",
|
||||
// endTimeAfternoon: "12:00",
|
||||
// status: "PENDING",
|
||||
// checkInStatus: "normal",
|
||||
// checkOutStatus: "late",
|
||||
// checkIn: "08:00",
|
||||
// checkOut: "12.00",
|
||||
// },
|
||||
// {
|
||||
// id: "00000000-0000-0000-0000-000000000000",
|
||||
// fullname: "นางสาวรัชภรณ์ ภักดี",
|
||||
// date: "2023-10-30 08:55",
|
||||
// dateFix: "2023-10-29",
|
||||
// startTimeMorning: "08:00",
|
||||
// endTimeMorning: "12:00",
|
||||
// startTimeAfternoon: null,
|
||||
// endTimeAfternoon: null,
|
||||
// status: "APPROVE",
|
||||
// checkInStatus: "normal",
|
||||
// checkOutStatus: "late",
|
||||
// checkIn: "08:00",
|
||||
// checkOut: "12.00",
|
||||
// },
|
||||
// {
|
||||
// id: "00000000-0000-0000-0000-000000000000",
|
||||
// fullname: "นางสาวภาพรรณ ลออ",
|
||||
// date: "2023-10-31 18:54",
|
||||
// dateFix: "2023-10-30",
|
||||
// startTimeMorning: null,
|
||||
// endTimeMorning: null,
|
||||
// startTimeAfternoon: "13:00",
|
||||
// endTimeAfternoon: "16:30",
|
||||
// status: "REJECT",
|
||||
// checkInStatus: "normal",
|
||||
// checkOutStatus: "late",
|
||||
// checkIn: "08:00",
|
||||
// checkOut: "12.00",
|
||||
// },
|
||||
// ]);
|
||||
dataSpecialTime.fetchData();
|
||||
console.log("test");
|
||||
await dataSpecialTime.fetchData();
|
||||
});
|
||||
|
||||
/** Function Date */
|
||||
const selectedDate = ref<string>("");
|
||||
const dateMonth = ref<any>({
|
||||
month: new Date().getMonth(),
|
||||
year: new Date().getFullYear(),
|
||||
});
|
||||
|
||||
const monthYearThai = (val: any) => {
|
||||
if (val == null) return "";
|
||||
else return monthYear2Thai(val.month, val.year);
|
||||
|
|
@ -244,13 +243,26 @@ const monthYearThai = (val: any) => {
|
|||
row-key="tb-list"
|
||||
flat
|
||||
bordered
|
||||
:paging="true"
|
||||
:paging="false"
|
||||
dense
|
||||
:pagination="dataSpecialTime.initialPagination"
|
||||
:visible-columns="dataSpecialTime.visibleColumns"
|
||||
:rows-per-page-options="[1, 10, 25, 50, 100]"
|
||||
@update:pagination="dataSpecialTime.updatePagination"
|
||||
:rows-per-page-options="[5, 10, 25, 50, 100]"
|
||||
v-model:pagination="initialPagination"
|
||||
@update:pagination="updatePagination"
|
||||
>
|
||||
<template v-slot:pagination="scope">
|
||||
ทั้งหมด {{ dataSpecialTime.total }} รายการ
|
||||
<q-pagination
|
||||
v-model="currentPage"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
:max="Number(dataSpecialTime.maxPage)"
|
||||
></q-pagination>
|
||||
</template>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
|
|
|
|||
|
|
@ -74,12 +74,6 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const fileListOj = reactive<ArrayFileList>({
|
||||
id: "",
|
||||
pathName: "",
|
||||
fileName: "",
|
||||
});
|
||||
|
||||
const formData = reactive<FormData>({
|
||||
id: "",
|
||||
respondentType: "",
|
||||
|
|
@ -261,20 +255,20 @@ async function fileUploadDoc(documentFile: any) {
|
|||
*/
|
||||
function selectLevel(val: string) {
|
||||
let dayNum = 0;
|
||||
if (val == "3") {
|
||||
if (val == "VERY_URGENT") {
|
||||
dayNum = 15; // ด่วนมาก
|
||||
} else if (val == "1") {
|
||||
} else if (val == "URGENT") {
|
||||
dayNum = 30; // ด่วน
|
||||
} else {
|
||||
dayNum = 45; // ปกติ
|
||||
}
|
||||
// วันแจ้งเตือนล่วงหน้า
|
||||
if (formData.dateConsideration) {
|
||||
const currentDate = new Date(formData.dateConsideration);
|
||||
if (formData.dateReceived) {
|
||||
const currentDate = new Date(formData.dateReceived);
|
||||
const newDate = new Date(
|
||||
currentDate.getTime() + dayNum * 24 * 60 * 60 * 1000
|
||||
);
|
||||
formData.dateNotification = newDate;
|
||||
formData.dateConsideration = newDate;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -410,6 +404,7 @@ function upLoadFileDoc() {
|
|||
|
||||
async function addPerson(data: any) {
|
||||
toggleModal();
|
||||
changeFormData();
|
||||
await complainstStore.fetchComplainstAdd(data);
|
||||
}
|
||||
|
||||
|
|
@ -425,20 +420,24 @@ function deletePerson(id: string) {
|
|||
}
|
||||
|
||||
function removePerson(id: string) {
|
||||
isSave.value = true;
|
||||
changeFormData();
|
||||
const dataRow = complainstStore.rowsAdd;
|
||||
const updatedRows = dataRow.filter((item: any) => item.personId !== id);
|
||||
complainstStore.rowsAdd = updatedRows;
|
||||
}
|
||||
|
||||
function getList() {
|
||||
function getListChannel() {
|
||||
http.get(config.API.complaintListOp()).then((res) => {
|
||||
complaintFromtoptions.value = res.data.result.data;
|
||||
});
|
||||
}
|
||||
|
||||
function changeFormData() {
|
||||
isSave.value = props.data != null ?? true;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getListChannel();
|
||||
getOc();
|
||||
complainstStore.columns = columns.value;
|
||||
complainstStore.visibleColumns = visibleColumns.value;
|
||||
|
|
@ -487,6 +486,7 @@ onMounted(() => {
|
|||
@filter="(inputValue: any,
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn, 'filterrespondentType'
|
||||
)"
|
||||
@update:model-value="changeFormData()"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
|
|
@ -522,6 +522,7 @@ onMounted(() => {
|
|||
label="เลือกสำนักงาน"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกสำนักงาน'}`]"
|
||||
lazy-rules
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -548,6 +549,7 @@ onMounted(() => {
|
|||
@filter="(inputValue: any,
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn, 'filterconsideredAgencytoptions'
|
||||
)"
|
||||
@update:model-value="changeFormData()"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
|
|
@ -686,6 +688,7 @@ onMounted(() => {
|
|||
label="เรื่องร้องเรียน"
|
||||
type="textarea"
|
||||
rows="5"
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -705,6 +708,7 @@ onMounted(() => {
|
|||
label="รายละเอียดเรื่องร้องเรียน"
|
||||
type="textarea"
|
||||
rows="5"
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -720,6 +724,7 @@ onMounted(() => {
|
|||
"
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
@update:model-value="changeFormData()"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
|
|
@ -784,7 +789,8 @@ onMounted(() => {
|
|||
]"
|
||||
lazy-rules
|
||||
@update:model-value="
|
||||
selectLevel(formData.levelConsideration)
|
||||
selectLevel(formData.levelConsideration);
|
||||
changeFormData();
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -793,9 +799,7 @@ onMounted(() => {
|
|||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="formData.dateConsideration"
|
||||
@update:model-value="
|
||||
selectLevel(formData.levelConsideration)
|
||||
"
|
||||
@update:model-value="changeFormData()"
|
||||
:locale="'th'"
|
||||
:readonly="
|
||||
formData.status !== 'NEW' && formData.status !== ''
|
||||
|
|
@ -866,6 +870,7 @@ onMounted(() => {
|
|||
map-options
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกลักษณะความผิด'}`]"
|
||||
lazy-rules
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -881,6 +886,7 @@ onMounted(() => {
|
|||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
@update:model-value="changeFormData()"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
|
|
@ -945,6 +951,7 @@ onMounted(() => {
|
|||
(val) => !!val || `${'กรุณาเลือกรับเรื่องร้องเรียน'}`,
|
||||
]"
|
||||
lazy-rules
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -964,6 +971,7 @@ onMounted(() => {
|
|||
hide-bottom-space
|
||||
type="textarea"
|
||||
rows="5"
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12">
|
||||
|
|
@ -984,6 +992,7 @@ onMounted(() => {
|
|||
label="ผลการตรวจสอบเรื่องร้องเรียน"
|
||||
type="textarea"
|
||||
rows="5"
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1100,7 +1109,7 @@ onMounted(() => {
|
|||
</q-list>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-mt-sm" v-if="fileList.length == 0">
|
||||
<div class="col-12 q-pa-sm" v-if="fileList.length == 0">
|
||||
<q-card class="q-pa-md" bordered> ไม่มีรายการเอกสาร </q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import http from "@/plugins/http";
|
|||
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const modalPerson = ref<boolean>(false);
|
||||
const toggleModal = () => (modalPerson.value = !modalPerson.value);
|
||||
/**เรียกใช้ store */
|
||||
|
|
@ -134,6 +135,15 @@ const initialPagination = ref<any>({
|
|||
|
||||
/** หัวตาราง */
|
||||
const columnsPerson = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "info",
|
||||
align: "center",
|
||||
label: "",
|
||||
sortable: false,
|
||||
field: "info",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
|
|
@ -210,6 +220,7 @@ const columnsPerson = ref<QTableProps["columns"]>([
|
|||
|
||||
/** หัวข้อที่เเสดงในตาราง */
|
||||
const visibleColumnsPerson = ref<string[]>([
|
||||
"info",
|
||||
"no",
|
||||
"idcard",
|
||||
"name",
|
||||
|
|
@ -715,7 +726,27 @@ onMounted(async () => {
|
|||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div>
|
||||
<div v-else-if="col.name == 'info'">
|
||||
<q-btn
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="info"
|
||||
icon="info"
|
||||
@click="
|
||||
router.push(`/registry/${props.row.personId}`)
|
||||
"
|
||||
><q-tooltip>ดูข้อมูลในทะเบียนประวัติ</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.name === 'organization'"
|
||||
class="table_ellipsis"
|
||||
>
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
|
@ -1234,9 +1265,15 @@ onMounted(async () => {
|
|||
formData.disciplineInvestigateRelevantDocs.length === 0
|
||||
"
|
||||
>
|
||||
<q-card class="q-pa-md q-ma-xs" bordered> ไม่มีรายการเอกสาร </q-card>
|
||||
<q-card class="q-pa-md q-ma-xs" bordered>
|
||||
ไม่มีรายการเอกสาร
|
||||
</q-card>
|
||||
</div>
|
||||
<q-list separator class="full-width q-mt-md" v-if="props.data.disciplineInvestigateRelevantDocs.length >0">
|
||||
<q-list
|
||||
separator
|
||||
class="full-width q-mt-md"
|
||||
v-if="props.data.disciplineInvestigateRelevantDocs.length > 0"
|
||||
>
|
||||
<q-item
|
||||
clickable
|
||||
v-ripple
|
||||
|
|
@ -1279,94 +1316,94 @@ onMounted(async () => {
|
|||
</q-card>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<q-card
|
||||
bordered
|
||||
class="row col-12"
|
||||
style="border: 1px solid #d6dee1"
|
||||
<q-card bordered class="row col-12" style="border: 1px solid #d6dee1">
|
||||
<div class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md">
|
||||
อัปโหลดไฟล์เอกสารหลักฐาน
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<q-file
|
||||
v-if="formData.status === 'NEW'"
|
||||
class="col-10 q-pa-sm"
|
||||
for="#documentFile"
|
||||
outlined
|
||||
dense
|
||||
v-model="formData.documentFile"
|
||||
label="ไฟล์เอกสารหลักฐาน"
|
||||
hide-bottom-space
|
||||
>
|
||||
<div class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md">
|
||||
อัปโหลดไฟล์เอกสารหลักฐาน
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<q-file
|
||||
v-if="formData.status === 'NEW'"
|
||||
class="col-10 q-pa-sm"
|
||||
for="#documentFile"
|
||||
outlined
|
||||
dense
|
||||
v-model="formData.documentFile"
|
||||
label="ไฟล์เอกสารหลักฐาน"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" color="primary" />
|
||||
</template>
|
||||
</q-file>
|
||||
|
||||
<div class="col-2 self-center">
|
||||
<q-btn
|
||||
v-if="formData.documentFile"
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="add"
|
||||
icon="mdi-upload"
|
||||
@click="uploadFile"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
v-if="formData.disciplineInvestigateDocs.length === 0"
|
||||
class="col-12"
|
||||
>
|
||||
<q-card class="q-pa-md q-ma-xs" bordered> ไม่มีรายการเอกสาร </q-card>
|
||||
</div>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" color="primary" />
|
||||
</template>
|
||||
</q-file>
|
||||
|
||||
<div class="col-xs-12 q-pa-sm row" v-if="props.data.disciplineInvestigateDocs.length >0">
|
||||
<q-list separator class="full-width">
|
||||
<q-item
|
||||
clickable
|
||||
v-ripple
|
||||
v-for="file in props.data.disciplineInvestigateDocs"
|
||||
:key="file.id"
|
||||
>
|
||||
<q-item-section>{{ file.fileName }}</q-item-section>
|
||||
<q-item-section avatar>
|
||||
<div class="row">
|
||||
<div>
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
round
|
||||
size="12px"
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadFile(file.pathName)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดเอกสารหลักฐาน</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div>
|
||||
<q-btn
|
||||
v-if="formData.status === 'NEW'"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
size="12px"
|
||||
color="red"
|
||||
icon="mdi-delete-outline"
|
||||
@click="deleteFile(file.id)"
|
||||
><q-tooltip>ลบเอกสารหลักฐาน</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
<div class="col-2 self-center">
|
||||
<q-btn
|
||||
v-if="formData.documentFile"
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="add"
|
||||
icon="mdi-upload"
|
||||
@click="uploadFile"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
v-if="formData.disciplineInvestigateDocs.length === 0"
|
||||
class="col-12"
|
||||
>
|
||||
<q-card class="q-pa-md q-ma-xs" bordered>
|
||||
ไม่มีรายการเอกสาร
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="col-xs-12 q-pa-sm row"
|
||||
v-if="props.data.disciplineInvestigateDocs.length > 0"
|
||||
>
|
||||
<q-list separator class="full-width">
|
||||
<q-item
|
||||
clickable
|
||||
v-ripple
|
||||
v-for="file in props.data.disciplineInvestigateDocs"
|
||||
:key="file.id"
|
||||
>
|
||||
<q-item-section>{{ file.fileName }}</q-item-section>
|
||||
<q-item-section avatar>
|
||||
<div class="row">
|
||||
<div>
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
round
|
||||
size="12px"
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadFile(file.pathName)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดเอกสารหลักฐาน</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<div>
|
||||
<q-btn
|
||||
v-if="formData.status === 'NEW'"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
size="12px"
|
||||
color="red"
|
||||
icon="mdi-delete-outline"
|
||||
@click="deleteFile(file.id)"
|
||||
><q-tooltip>ลบเอกสารหลักฐาน</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,23 +2,25 @@
|
|||
import { onMounted, reactive, ref, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import type { QTableProps } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import Popup from "@/modules/11_discipline/components/1_Complaint/Popup.vue";
|
||||
/**import component*/
|
||||
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 type { FormData } from "@/modules/11_discipline/interface/request/disciplinary";
|
||||
import type {
|
||||
FormData,
|
||||
PersonsArray,
|
||||
} from "@/modules/11_discipline/interface/request/disciplinary";
|
||||
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";
|
||||
import type { FormData as FormInvestigateFact } from "@/modules/11_discipline/interface/request/investigateFact";
|
||||
|
||||
/**import store*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -31,9 +33,10 @@ const { dialogConfirm, success, messageError, showLoader, hideLoader } = mixin;
|
|||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const modalPopup = ref<boolean>(false);
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const data = ref<object>();
|
||||
const status = ref<string>("")
|
||||
const status = ref<string>("");
|
||||
|
||||
/** function fetchData สอบสวนความผิดทางวินัย*/
|
||||
async function fetchDetailDisciplinary() {
|
||||
|
|
@ -42,7 +45,7 @@ async function fetchDetailDisciplinary() {
|
|||
.get(config.API.disciplineDisciplinaryById(id.value))
|
||||
.then((res) => {
|
||||
data.value = res.data.result;
|
||||
status.value = res.data.result.status
|
||||
status.value = res.data.result.status;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -64,18 +67,24 @@ async function fetchDetailInvestigate() {
|
|||
dataInvestigatefacts.respondentType = dataList.respondentType;
|
||||
dataInvestigatefacts.persons = dataList.persons;
|
||||
dataInvestigatefacts.investigationDetail = dataList.investigationDetail;
|
||||
dataInvestigatefacts.investigationDetailOther = dataList.investigationDetailOther;
|
||||
dataInvestigatefacts.investigationDateStart = dataList.investigationDateStart;
|
||||
dataInvestigatefacts.investigationDetailOther =
|
||||
dataList.investigationDetailOther;
|
||||
dataInvestigatefacts.investigationDateStart =
|
||||
dataList.investigationDateStart;
|
||||
dataInvestigatefacts.investigationDateEnd = dataList.investigationDateEnd;
|
||||
dataInvestigatefacts.investigationDescription = dataList.investigationDescription;
|
||||
dataInvestigatefacts.investigationCauseText = dataList.investigationCauseText;
|
||||
dataInvestigatefacts.investigationDescription =
|
||||
dataList.investigationDescription;
|
||||
dataInvestigatefacts.investigationCauseText =
|
||||
dataList.investigationCauseText;
|
||||
dataInvestigatefacts.status = dataList.status;
|
||||
dataInvestigatefacts.result = dataList.result;
|
||||
dataInvestigatefacts.directors = dataList.director;
|
||||
dataInvestigatefacts.disciplineInvestigateDocs = dataList.disciplineInvestigateDocs;
|
||||
dataInvestigatefacts.disciplineInvestigateDocs =
|
||||
dataList.disciplineInvestigateDocs;
|
||||
dataInvestigatefacts.disciplineInvestigateRelevantDocs =
|
||||
dataList.disciplineInvestigateRelevantDocs;
|
||||
dataInvestigatefacts.investigationStatusResult = dataList.investigationStatusResult;
|
||||
dataInvestigatefacts.investigationStatusResult =
|
||||
dataList.investigationStatusResult;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -155,12 +164,25 @@ const onSubmit = async (id: string) => {
|
|||
|
||||
/** ยืนยัน ส่งไปออกคำสั่ง */
|
||||
function sentIssue() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => confirmSentIssue(),
|
||||
"ยืนยันส่งไปสรุปผลการพิจารณา",
|
||||
"ต้องการยืนยันส่งไปสรุปผลการพิจารณาใช่หรือไม่?"
|
||||
);
|
||||
console.log("sent");
|
||||
modalPopup.value = true;
|
||||
}
|
||||
|
||||
function sentIssueGate() {
|
||||
dialogConfirm($q, () => confirmSentIssueGate(),'ยืนยันส่งไปสรุปผลการพิจารณา','ต้องการยืนยันส่งไปสรุปผลการพิจารณาใช่หรือไม่?');
|
||||
}
|
||||
|
||||
function confirmSentIssueGate() {
|
||||
showLoader()
|
||||
http
|
||||
.get(config.API.disciplinaryApprove(id.value))
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
fetchDetailDisciplinary();
|
||||
});
|
||||
}
|
||||
|
||||
/** ยืนยัน ยุติเรื่อง */
|
||||
|
|
@ -186,16 +208,41 @@ function cancelInvestigate() {
|
|||
/** ฟังชั่น ส่งไปออกคำสั่ง*/
|
||||
function confirmSentIssue() {
|
||||
console.log("sent");
|
||||
modalPopup.value = true;
|
||||
}
|
||||
|
||||
/** ฟังชั่น ยุติเรื่อง*/
|
||||
function confirmEndInvestigate() {
|
||||
console.log("sent");
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.disciplinaryReject(id.value))
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
fetchDetailDisciplinary();
|
||||
});
|
||||
}
|
||||
|
||||
/** ฟังชั่น ยกเลิกการยุติเรื่อง*/
|
||||
function confirmCancelInvestigate() {
|
||||
console.log("sent");
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.disciplinaryResume(id.value))
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
fetchDetailDisciplinary();
|
||||
});
|
||||
}
|
||||
|
||||
function closePopup() {
|
||||
modalPopup.value = false;
|
||||
}
|
||||
|
||||
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
|
||||
|
|
@ -243,6 +290,125 @@ const fileListObjComplaint = reactive<ArrayFileList>({
|
|||
fileName: "",
|
||||
});
|
||||
|
||||
function emitPerson(data: PersonsArray[]) {
|
||||
console.log(data);
|
||||
// const dataMapId = data.map((item: PersonsArray) => item.id);
|
||||
// console.log(dataMapId);
|
||||
// showLoader();
|
||||
// http
|
||||
// .put(config.API.investigateApprove(id.value), {
|
||||
// persons: dataMapId,
|
||||
// })
|
||||
// .then((res) => {
|
||||
// // router.push(`/discipline/investigatefacts`);
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// fetchDetailDisciplinary();
|
||||
// });
|
||||
}
|
||||
|
||||
/** หัวตาราง */
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "info",
|
||||
align: "left",
|
||||
label: "",
|
||||
sortable: false,
|
||||
field: "info",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "idcard",
|
||||
align: "left",
|
||||
label: "เลขบัตรประชาชน",
|
||||
sortable: true,
|
||||
field: "idcard",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ - นามสกุล",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "posNo",
|
||||
align: "left",
|
||||
label: "ตำแหน่งเลขที่",
|
||||
sortable: true,
|
||||
field: "posNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "position",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionLevel",
|
||||
align: "left",
|
||||
label: "ระดับ",
|
||||
sortable: true,
|
||||
field: "positionLevel",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "salary",
|
||||
align: "left",
|
||||
label: "เงินเดือน",
|
||||
sortable: true,
|
||||
field: "salary",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "organization",
|
||||
align: "left",
|
||||
label: "หน่วยงาน",
|
||||
sortable: true,
|
||||
field: "organization",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
/** หัวข้อที่เเสดงในตาราง */
|
||||
const visibleColumns = ref<string[]>([
|
||||
"info",
|
||||
"no",
|
||||
"idcard",
|
||||
"name",
|
||||
"posNo",
|
||||
"position",
|
||||
"positionLevel",
|
||||
"salary",
|
||||
"organization",
|
||||
]);
|
||||
|
||||
const dataComplaints = reactive<FormDataComplaint>({
|
||||
id: "",
|
||||
respondentType: "",
|
||||
|
|
@ -314,7 +480,7 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
|||
v-if="status === 'NEW'"
|
||||
label="ส่งไปสรุปผลการพิจารณา"
|
||||
color="public"
|
||||
@click="sentIssue"
|
||||
@click="sentIssueGate"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="status === 'NEW'"
|
||||
|
|
@ -358,7 +524,10 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
|||
<FormComplaints :on-submit="onSubmit" :data="dataComplaints" />
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="investigatefacts">
|
||||
<FormInvestigatefacts :on-submit="onSubmit" :data="dataInvestigatefacts" />
|
||||
<FormInvestigatefacts
|
||||
:on-submit="onSubmit"
|
||||
:data="dataInvestigatefacts"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="disciplinary">
|
||||
<FormDisciplinary
|
||||
|
|
@ -371,6 +540,16 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
|||
</q-tab-panels>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
<Popup
|
||||
:modal="modalPopup"
|
||||
:close="closePopup"
|
||||
title="ส่งไปพักราชการ"
|
||||
:rows="store.rowSent"
|
||||
:columns="columns"
|
||||
:visibleColumns="visibleColumns"
|
||||
@return-person="emitPerson"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { ref, onMounted, reactive, watch } from "vue";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useRoute,useRouter } from "vue-router";
|
||||
|
||||
/**import type*/
|
||||
import type { QTableProps } from "quasar";
|
||||
|
|
@ -40,6 +40,7 @@ const { date2Thai, showLoader, hideLoader, dialogConfirm, messageError } =
|
|||
mixin;
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const $q = useQuasar();
|
||||
|
||||
const id = ref<string>(route.params.id as string);
|
||||
|
|
@ -57,6 +58,15 @@ function toggleModal() {
|
|||
|
||||
/** หัวตารางของรายการผู้ถูกสอบสวน กรณีบุคคล */
|
||||
const columnsPerson = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "info",
|
||||
align: "center",
|
||||
label: "",
|
||||
sortable: false,
|
||||
field: "info",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
|
|
@ -347,6 +357,8 @@ async function fetchDatadetail() {
|
|||
disciplineDisciplinary_DocRelevants.value =
|
||||
props.data.disciplineDisciplinary_DocRelevants;
|
||||
|
||||
investigateDis.rowSent = formData.persons
|
||||
|
||||
/** MAP รายชื่อกรรมการ หน้าหลัก */
|
||||
let datalistDirector: responseType[] = formData.directors.map(
|
||||
(e: directorType) => ({
|
||||
|
|
@ -390,6 +402,7 @@ async function addPerson(data: Persons[]) {
|
|||
}));
|
||||
const mergedArray = [...formData.persons, ...newPerson];
|
||||
formData.persons = mergedArray;
|
||||
investigateDis.rowSent = formData.persons
|
||||
toggleModal();
|
||||
}
|
||||
|
||||
|
|
@ -669,7 +682,27 @@ onMounted(async () => {
|
|||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div>
|
||||
<div v-else-if="col.name == 'info'">
|
||||
<q-btn
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="info"
|
||||
icon="info"
|
||||
@click="
|
||||
router.push(`/registry/${props.row.personId}`)
|
||||
"
|
||||
><q-tooltip>ดูข้อมูลในทะเบียนประวัติ</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.name === 'organization'"
|
||||
class="table_ellipsis"
|
||||
>
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
|
@ -1364,7 +1397,7 @@ onMounted(async () => {
|
|||
label="เลือกไฟล์"
|
||||
:files="disciplineDisciplinary_DocRelevants"
|
||||
:id="id"
|
||||
type="relevants"
|
||||
type="relevant"
|
||||
:fetchData="props.fetchData"
|
||||
/>
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
const $q = useQuasar();
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, success, messageError } = mixin;
|
||||
const { showLoader, hideLoader, success, messageError,dialogRemove } = mixin;
|
||||
|
||||
const fileRef = ref<Object | null>(null);
|
||||
const file = ref<any>();
|
||||
|
|
@ -72,12 +72,17 @@ async function uploadFile() {
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function popupRemove(id:string){
|
||||
dialogRemove($q,()=> removeFile(id))
|
||||
}
|
||||
|
||||
async function removeFile(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.disciplineByIdDoc(props.type, props.id, id))
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
success($q, "ลบไฟล์สำเร็จ");
|
||||
props.fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -99,92 +104,90 @@ function downloadFile(link: string) {
|
|||
|
||||
<template>
|
||||
<q-card flat class="q-pa-md" bordered>
|
||||
<div class="col-12 row q-col-gutter-md">
|
||||
<div class="row col-12">
|
||||
<q-card bordered class="row col-12" style="border: 1px solid #d6dee1">
|
||||
<div class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md">
|
||||
{{ title }}
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-xs-12 q-pa-sm row">
|
||||
<q-file
|
||||
class="col-11"
|
||||
outlined
|
||||
dense
|
||||
ref="fileRef"
|
||||
for="#files"
|
||||
v-model="file"
|
||||
:label="label"
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
accept=".pdf,.xlsx,.doc"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
<div class="col-1 self-center">
|
||||
<q-btn
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="add"
|
||||
icon="mdi-upload"
|
||||
@click="uploadFile()"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="props.files.length > 0" class="col-xs-12 q-pa-sm row">
|
||||
<q-list
|
||||
v-for="(f, index) in props.files"
|
||||
:key="index"
|
||||
bordered
|
||||
separator
|
||||
class="full-width"
|
||||
>
|
||||
<q-item clickable v-ripple>
|
||||
<q-item-section>{{ f.fileName }}</q-item-section>
|
||||
<q-item-section avatar>
|
||||
<div class="row">
|
||||
<div>
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
round
|
||||
size="12px"
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadFile(f.pathName)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดเอกสาร</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div>
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
round
|
||||
size="12px"
|
||||
color="red"
|
||||
icon="mdi-delete-outline"
|
||||
@click="removeFile(f.id)"
|
||||
><q-tooltip>ลบเอกสาร</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-mt-sm" v-if="props.files.length == 0">
|
||||
<q-card class="q-pa-md" bordered> ไม่มีรายการเอกสาร </q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-card bordered style="border: 1px solid #d6dee1">
|
||||
<div class="text-weight-medium bg-grey-1 q-py-sm q-px-md">
|
||||
{{ title }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row">
|
||||
<div class="col-11 q-pa-sm">
|
||||
<q-file
|
||||
outlined
|
||||
dense
|
||||
ref="fileRef"
|
||||
for="#files"
|
||||
v-model="file"
|
||||
:label="label"
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
accept=".pdf,.xlsx,.doc"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
<div class="col-1 self-center text-center">
|
||||
<q-btn
|
||||
v-if="file"
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="add"
|
||||
icon="mdi-upload"
|
||||
@click="uploadFile()"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="props.files.length > 0" class="col-xs-12 q-pa-sm row">
|
||||
<q-list
|
||||
v-for="(f, index) in props.files"
|
||||
:key="index"
|
||||
bordered
|
||||
separator
|
||||
class="full-width"
|
||||
>
|
||||
<q-item clickable v-ripple>
|
||||
<q-item-section>{{ f.fileName }}</q-item-section>
|
||||
<q-item-section avatar>
|
||||
<div class="row">
|
||||
<div>
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
round
|
||||
size="12px"
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadFile(f.pathName)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดเอกสาร</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div>
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
round
|
||||
size="12px"
|
||||
color="red"
|
||||
icon="mdi-delete-outline"
|
||||
@click="popupRemove(f.id)"
|
||||
><q-tooltip>ลบเอกสาร</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-ma-xs" v-if="props.files.length == 0">
|
||||
<q-card class="q-pa-md" bordered> ไม่มีรายการเอกสาร </q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
</q-card>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,19 @@ interface Persons {
|
|||
organization: string; //สังกัด
|
||||
name: string;
|
||||
}
|
||||
interface PersonsArray {
|
||||
id: string; //id อ้างอิง profile
|
||||
idcard: string; //รหัสบัตรประชาชน
|
||||
prefix: string; //คำนำหน้า
|
||||
firstName: string; //ชื่อ
|
||||
lastName: string; //นามสกุล
|
||||
posNo: string; //เลขที่ตำแหน่ง
|
||||
position: string; //ตำแหน่ง
|
||||
positionLevel: string; //ระดับ
|
||||
salary: number; //เงินเดือน
|
||||
organization: string; //สังกัด
|
||||
name: string;
|
||||
}
|
||||
interface Director {
|
||||
directorId?: string;
|
||||
duty?: string;
|
||||
|
|
@ -115,4 +128,4 @@ interface DisciplinaryRef {
|
|||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type { FormData, DisciplinaryRef, Persons, Director };
|
||||
export type { FormData, DisciplinaryRef, Persons, Director,PersonsArray };
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ import type {
|
|||
DataOptioGroup,
|
||||
DataNumberOption,
|
||||
} from "@/modules/11_discipline/interface/index/Main";
|
||||
import type {
|
||||
Persons
|
||||
} from "@/modules/11_discipline/interface/request/disciplinary";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai } = mixin;
|
||||
|
|
@ -18,6 +21,7 @@ export const useInvestigateDisStore = defineStore(
|
|||
() => {
|
||||
const tabMenu = ref<string>("disciplinary");
|
||||
const rows = ref<investigateDisDataRowType[]>([]);
|
||||
const rowSent = ref<Persons[]>([]);
|
||||
const rows2 = ref<directorType[]>([]);
|
||||
const selected = ref<directorType[]>([]);
|
||||
|
||||
|
|
@ -346,6 +350,7 @@ export const useInvestigateDisStore = defineStore(
|
|||
fetchList,
|
||||
rows,
|
||||
rows2,
|
||||
rowSent,
|
||||
offenseDetailsOps,
|
||||
optionsfaultLevel,
|
||||
fecthDirector,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue