Merge branch 'develop' into devTee

# Conflicts:
#	src/modules/11_discipline/components/2_InvestigateFacts/EditPage.vue
#	src/modules/11_discipline/components/PopupSendToNext.vue
This commit is contained in:
STW_TTTY\stwtt 2024-10-03 15:06:51 +07:00
commit fddb0f7dc4
19 changed files with 274 additions and 155 deletions

View file

@ -7,13 +7,7 @@ const modal = defineModel<boolean>("modal", { required: true });
const step = ref<number>(1); const step = ref<number>(1);
const devices = ref<string>(""); const devices = ref<string>("");
const devicesData = ref<string[]>([ const devicesData = ref<string[]>(["Generic EMV Smartcard Reader0"]);
"Generic",
"EMV",
"Smartcard",
"Reader",
"0",
]);
const devicesOp = ref<string[]>([]); const devicesOp = ref<string[]>([]);
/** 1.เสียบบัตรประชาชนเข้ากับเครื่องอ่าน*/ /** 1.เสียบบัตรประชาชนเข้ากับเครื่องอ่าน*/

View file

@ -47,6 +47,15 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{
name: "createdFullName",
align: "left",
label: "ผู้ยื่นขอ",
sortable: true,
field: "createdFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{ {
name: "name", name: "name",
align: "left", align: "left",
@ -124,6 +133,7 @@ const columns = ref<QTableProps["columns"]>([
]); ]);
const visibleColumns = ref<string[]>([ const visibleColumns = ref<string[]>([
"createdAt", "createdAt",
"createdFullName",
"name", "name",
"developmentProjects", "developmentProjects",
"developmentTarget", "developmentTarget",

View file

@ -17,8 +17,14 @@ import DialogHeader from "@/components/DialogHeader.vue";
const $q = useQuasar(); const $q = useQuasar();
const store = useRequestEditStore(); const store = useRequestEditStore();
const { dialogConfirm, showLoader, hideLoader, messageError, success } = const {
useCounterMixin(); dialogConfirm,
showLoader,
hideLoader,
messageError,
success,
date2Thai,
} = useCounterMixin();
const modal = defineModel<boolean>("modal", { required: true }); //, popup const modal = defineModel<boolean>("modal", { required: true }); //, popup
const requestId = defineModel<string>("requestId", { required: true }); // id const requestId = defineModel<string>("requestId", { required: true }); // id
@ -40,6 +46,8 @@ const formData = reactive<FormDataIDP>({
developmentReport: "", // developmentReport: "", //
status: "", // status: "", //
reason: "", // reason: "", //
createdFullName: "", //
createdAt: null, //
}); });
//70 () //70 ()
@ -151,6 +159,8 @@ function fetchDataByid(id: string) {
formData.reasonDevelopment10 = data.reasonDevelopment10; formData.reasonDevelopment10 = data.reasonDevelopment10;
formData.status = data.status; formData.status = data.status;
formData.reason = data.reason; formData.reason = data.reason;
formData.createdFullName = data.createdFullName;
formData.createdAt = data.createdAt;
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -213,6 +223,8 @@ function closeDialog() {
formData.developmentReport = ""; formData.developmentReport = "";
formData.status = ""; formData.status = "";
formData.reason = ""; formData.reason = "";
formData.createdFullName = "";
formData.createdAt = null;
} }
/** /**
@ -241,16 +253,22 @@ watch(modal, (val) => {
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card style="min-width: 65%"> <q-card style="min-width: 65%">
<q-form greedy @submit.prevent @validation-success="onSubmit"> <q-form greedy @submit.prevent @validation-success="onSubmit">
<DialogHeader tittle="ข้อมูลการพัฒนารายบุคคล" :close="closeDialog" /> <DialogHeader
:tittle="`${formData.createdFullName}
(ขอแกไขเม ${
formData.createdAt ? date2Thai(formData.createdAt, true, true) : ''
})`"
:close="closeDialog"
/>
<q-separator /> <q-separator />
<!-- สถานะคำรอง --> <!-- สถานะคำรอง -->
<q-card-section> <q-card-section>
<q-card bordered class="col-12"> <q-card bordered class="col-12">
<div class="col-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"> <!-- <div class="col-12 text-weight-medium bg-grey-1 q-py-xs q-px-md">
สถานะคำรอง สถานะคำรอง
</div> </div>
<q-separator /> <q-separator /> -->
<div class="row q-pa-md q-col-gutter-sm"> <div class="row q-pa-md q-col-gutter-sm">
<!-- สถานะ --> <!-- สถานะ -->
<div class="col-4"> <div class="col-4">
@ -297,6 +315,8 @@ watch(modal, (val) => {
</div> </div>
</div> </div>
<q-separator />
<q-card-actions align="right"> <q-card-actions align="right">
<q-btn label="บันทึก" color="secondary" type="submit" <q-btn label="บันทึก" color="secondary" type="submit"
><q-tooltip>นท</q-tooltip></q-btn ><q-tooltip>นท</q-tooltip></q-btn

View file

@ -77,6 +77,8 @@ interface FormDataIDP {
developmentReport: string; developmentReport: string;
status: string; status: string;
reason: string; reason: string;
createdFullName?: string;
createdAt?: Date | null;
} }
export type { export type {

View file

@ -15,7 +15,6 @@ import type { ListCommand } from "@/modules/18_command/interface/index/Main";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue"; import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
import { options } from "@fullcalendar/core/preact";
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();

View file

@ -27,7 +27,9 @@ interface TypeData {
interface OptionDataInsignia { interface OptionDataInsignia {
id: string; id: string;
name: string; name: string;
type: string; type?: string;
insigniaType?: string;
label?: string;
} }
interface InsigniaType { interface InsigniaType {
label: string; label: string;
@ -96,6 +98,39 @@ interface DataAllocate {
year: number; year: number;
} }
interface DataInsignia {
name: string;
shortName: string;
}
interface DataRecord {
id: string;
citizenId: string;
prefix: string;
position: string;
status: string;
dateReceive: string | Date | null;
name: string;
type: string;
employeeType: string | undefined;
profileType: string;
date: string | Date | null;
volumeNo: string;
section: string;
page: string;
number: string;
vatnumber: string;
datepay: string | Date | null;
typepay: string;
address: string;
dateReceiveInsignia: string;
dateReturnInsignia: string;
docReceiveInsignia: string;
docReturnInsignia: string;
orgReceiveInsignia: string;
orgReturnInsignia: string;
}
export type { export type {
OptionData, OptionData,
OptionDataYear, OptionDataYear,
@ -110,4 +145,6 @@ export type {
DataPerson, DataPerson,
DataDocuments, DataDocuments,
DataAllocate, DataAllocate,
DataRecord,
DataInsignia,
}; };

View file

@ -45,10 +45,58 @@ interface ResponseAllocate {
total: number; total: number;
} }
interface ResponseInsigniaType {
createdAt: string;
id: string;
insigniaTypeId: string;
insigniaTypeName: string;
isActive: boolean;
lastUpdateFullName: string;
lastUpdatedAt: string;
name: string;
note: string;
shortName: string;
}
interface ResponseRecordLists {
address: string;
citizenId: string;
date: string | Date;
datePayment: string | Date;
dateReceive: string | Date;
dateReceiveInsignia: string;
dateReturnInsignia: string;
docReceiveInsignia: string;
docReturnInsignia: string;
fullName: string;
id: string;
issue: string;
no: string;
number: string;
orgReceiveInsignia: string;
orgReturnInsignia: string;
organizationOrganizationReceive: string;
organizationOrganizationSend: string;
page: string;
position: string;
prefix: string;
profileType: string;
requestInsignia: string;
requestInsigniaId: string;
requestInsigniaShortName: string;
salary: number;
section: string;
status: string;
typePayment: string;
volumeNo: string;
}
export type { export type {
ResponseObject, ResponseObject,
ResponsePeriod, ResponsePeriod,
ResponseNoSend, ResponseNoSend,
ResponseRound, ResponseRound,
ResponseAllocate, ResponseAllocate,
ResponseInsigniaType,
ResponseRecordLists,
}; };

View file

@ -2,7 +2,17 @@ import { defineStore } from "pinia";
import { ref } from "vue"; import { ref } from "vue";
/** import Type*/ /** import Type*/
import type { OptionData } from "@/modules/07_insignia/interface/index/Main"; import type {
OptionData,
DataRecord,
DataInsignia,
OptionDataInsignia,
InsigniaType,
} from "@/modules/07_insignia/interface/index/Main";
import type {
ResponseInsigniaType,
ResponseRecordLists,
} from "@/modules/07_insignia/interface/response/Main";
/** import Stores */ /** import Stores */
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
@ -11,9 +21,9 @@ const { date2Thai } = mixin;
export const useResultDataStore = defineStore("insigniaResult", () => { export const useResultDataStore = defineStore("insigniaResult", () => {
const insignia = ref<string>(""); const insignia = ref<string>("");
const insigniaOp = ref<any[]>([{ name: "ทั้งหมด", id: "" }]); const insigniaOp = ref<OptionDataInsignia[]>([{ name: "ทั้งหมด", id: "" }]);
const insigniaOp2 = ref<any[]>([]); const insigniaOp2 = ref<OptionData[]>([]);
const insigniaType = ref<any>(); const insigniaType = ref<InsigniaType[]>([]);
const invoiceType = ref<string>("all"); const invoiceType = ref<string>("all");
const invoiceTypeop = ref<OptionData[]>([ const invoiceTypeop = ref<OptionData[]>([
{ name: "ทั้งหมด", id: "all" }, { name: "ทั้งหมด", id: "all" },
@ -26,20 +36,20 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
{ name: "ข้าราชการ กทม.สามัญ", id: "officer" }, { name: "ข้าราชการ กทม.สามัญ", id: "officer" },
{ name: "ลูกจ้างประจำ", id: "employee" }, { name: "ลูกจ้างประจำ", id: "employee" },
]); ]);
const rows = ref<any[]>([]); const rows = ref<DataRecord[]>([]);
const listInsignia = ref<any>([]); const listInsignia = ref<DataRecord[]>([]);
const type = ref<any[]>([]); const type = ref<DataInsignia[]>([]);
/** /**
* function * function
* @param data * @param data
*/ */
async function fetchDatainsignia(data: any) { async function fetchDatainsignia(data: ResponseInsigniaType[]) {
insignia.value = ""; insignia.value = "";
invoiceType.value = "all"; invoiceType.value = "all";
insigniaOp.value = [{ name: "ทั้งหมด", id: "" }]; insigniaOp.value = [{ name: "ทั้งหมด", id: "" }];
insigniaOp2.value = []; insigniaOp2.value = [];
data.forEach((e: any) => { data.forEach((e: ResponseInsigniaType) => {
insigniaOp.value.push({ insigniaOp.value.push({
name: `${e.name} (${e.shortName})`, name: `${e.name} (${e.shortName})`,
id: e.id, id: e.id,
@ -47,10 +57,10 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
}); });
}); });
data.forEach((e: any) => { data.forEach((e: ResponseInsigniaType) => {
insigniaOp2.value.push({ name: `${e.name} (${e.shortName})`, id: e.id }); insigniaOp2.value.push({ name: `${e.name} (${e.shortName})`, id: e.id });
}); });
data.forEach((e: any) => { data.forEach((e: ResponseInsigniaType) => {
type.value.push({ type.value.push({
name: e.name, name: e.name,
shortName: e.shortName, shortName: e.shortName,
@ -62,23 +72,28 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
* function * function
* @param data * @param data
*/ */
async function fetchDatainsigniaType(data: any) { async function fetchDatainsigniaType(data: ResponseInsigniaType[]) {
insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name })); insigniaType.value = data.map((e: ResponseInsigniaType) => ({
name: e.id,
label: e.name,
}));
} }
/** /**
* function / * function /
* @param data * @param data
*/ */
async function fetchlistinsignia(data: any) { async function fetchlistinsignia(data: ResponseRecordLists[]) {
console.log(data);
rows.value = []; rows.value = [];
let alllist = await data.map((e: any) => ({ const alllist = await data.map((e: ResponseRecordLists) => ({
id: e.id, id: e.id,
citizenId: e.citizenId, citizenId: e.citizenId,
prefix: e.prefix, prefix: e.prefix,
position: e.position, position: e.position,
status: status(e.status), status: status(e.status) ?? "",
dateReceive: date2Thai(e.dateReceive), dateReceive: e.dateReceive ?? date2Thai(e.dateReceive),
name: e.fullName, name: e.fullName,
type: `${e.requestInsignia} (${ type: `${e.requestInsignia} (${
type.value.find((item) => item.name === e.requestInsignia)?.shortName || type.value.find((item) => item.name === e.requestInsignia)?.shortName ||
@ -88,13 +103,13 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
e.profileType === "" ? "officer" : e.profileType e.profileType === "" ? "officer" : e.profileType
), ),
profileType: e.profileType === "" ? "officer" : e.profileType, profileType: e.profileType === "" ? "officer" : e.profileType,
date: date2Thai(e.date), date: e.date ?? date2Thai(e.date),
volumeNo: e.volumeNo, volumeNo: e.volumeNo,
section: e.section, section: e.section,
page: e.page, page: e.page,
number: e.no, number: e.no,
vatnumber: e.number, vatnumber: e.number,
datepay: date2Thai(e.datePayment), datepay: e.datePayment ?? date2Thai(e.datePayment),
typepay: e.typePayment, typepay: e.typePayment,
address: e.address, address: e.address,
dateReceiveInsignia: e.dateReceiveInsignia, dateReceiveInsignia: e.dateReceiveInsignia,
@ -104,6 +119,7 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
orgReceiveInsignia: e.orgReceiveInsignia, orgReceiveInsignia: e.orgReceiveInsignia,
orgReturnInsignia: e.orgReturnInsignia, orgReturnInsignia: e.orgReturnInsignia,
})); }));
rows.value = alllist; rows.value = alllist;
listInsignia.value = alllist; listInsignia.value = alllist;
searchData(invoiceType.value, employeeClass.value); searchData(invoiceType.value, employeeClass.value);
@ -129,7 +145,7 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
rows.value = list; rows.value = list;
} else if (invoice === "all" && employeeClass !== "all") { } else if (invoice === "all" && employeeClass !== "all") {
let list = listInsignia.value.filter( let list = listInsignia.value.filter(
(e: any) => e.employeeType === profileType(employeeClass) (e: DataRecord) => e.employeeType === profileType(employeeClass)
); );
rows.value = list; rows.value = list;
} else if (invoice === "all" && employeeClass == "all") { } else if (invoice === "all" && employeeClass == "all") {
@ -158,27 +174,29 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
* function convert * function convert
* @param val * @param val
*/ */
const profileType = (val: string) => { function profileType(val: string) {
switch (val) { const newVal = val.toLocaleLowerCase();
switch (newVal) {
case "officer": case "officer":
return "ข้าราชการ กทม.สามัญ"; return "ข้าราชการ กทม.สามัญ";
case "employee": case "employee":
return "ลูกจ้างประจำ"; return "ลูกจ้างประจำ";
} }
}; }
/** /**
* function convert * function convert
* @param val * @param val
*/ */
const convertDatepay = (val: any) => { function convertDatepay(val: string | null) {
switch (val) { switch (val) {
case null: case null:
return "noDate"; return "noDate";
default: default:
return "haveDate"; return "haveDate";
} }
}; }
return { return {
rows, rows,
insignia, insignia,
@ -195,7 +213,5 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
profileType, profileType,
fetchlistinsignia, fetchlistinsignia,
searchData, searchData,
// selectInvoice,
// selectEmployeeClass,
}; };
}); });

View file

@ -229,7 +229,7 @@ const visibleColumns = ref<String[]>([
"dateReceive", "dateReceive",
"date", "date",
"employeeType", "employeeType",
"volumeNo", " ",
"section", "section",
"page", "page",
"number", "number",

View file

@ -13,7 +13,7 @@ import type {
FormData, FormData,
ArrayPerson, ArrayPerson,
ArrayFileList, 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 Form from "@/modules/11_discipline/components/1_Complaint/Form.vue";
import PopupSendToNext from "@/modules/11_discipline/components/PopupSendToNext.vue"; import PopupSendToNext from "@/modules/11_discipline/components/PopupSendToNext.vue";
@ -163,16 +163,17 @@ const visibleColumns = ref<string[]>([
"organization", "organization",
]); ]);
/** ดึงข้อมูล */ /** ดึงข้อมูล */
async function getData() { async function getData() {
showLoader(); showLoader();
await http await http
.get( .get(
config.API.complaintbyGetId(id.value, mainStore.pathComplaints(route.name as string)) config.API.complaintbyGetId(
id.value,
mainStore.pathComplaints(route.name as string)
)
) )
.then((res) => { .then(async (res) => {
const dataList = res.data.result; const dataList = res.data.result;
data.id = dataList.id; data.id = dataList.id;
data.respondentType = dataList.respondentType; data.respondentType = dataList.respondentType;
@ -194,8 +195,7 @@ async function getData() {
data.result = dataList.result; data.result = dataList.result;
data.disciplineComplaintDocs = dataList.disciplineComplaintDocs; data.disciplineComplaintDocs = dataList.disciplineComplaintDocs;
data.activeId = dataList.activeId; data.activeId = dataList.activeId;
await mainStore.fetchDataRowsSend(dataList.persons);
mainStore.fetchDataRowsSend(dataList.persons);
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -214,8 +214,8 @@ async function onSubmit(data: any) {
http http
.put(config.API.complaintbyId(id.value), data) .put(config.API.complaintbyId(id.value), data)
.then((res) => { .then(async () => {
getData(); await getData();
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
}) })
.catch((e) => { .catch((e) => {
@ -233,31 +233,28 @@ function sentInvestigate() {
} else { } else {
dialogConfirm( dialogConfirm(
$q, $q,
() => sentConfirmNoPerson(), () => {
showLoader();
http
.put(config.API.complaintApprove(id.value), {
persons: [],
})
.then(() => {
router.push(`/discipline/complaints`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
},
"ยืนยันส่งไปสืบสวน", "ยืนยันส่งไปสืบสวน",
"ต้องการยืนยันยืนยันส่งไปสืบสวนใช่หรือไม่?" "ต้องการยืนยันยืนยันส่งไปสืบสวนใช่หรือไม่?"
); );
} }
} }
/** ส่งไปสืบสวน */
function sentConfirmNoPerson() {
showLoader();
http
.put(config.API.complaintApprove(id.value), {
persons: [],
})
.then((res) => {
router.push(`/discipline/complaints`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
/** ปิด dialog */ /** ปิด dialog */
function closePopup() { function closePopup() {
modalPopup.value = false; modalPopup.value = false;
@ -267,7 +264,21 @@ function closePopup() {
function endInvestigate() { function endInvestigate() {
dialogConfirm( dialogConfirm(
$q, $q,
() => confirmEndInvestigate(), () => {
showLoader();
http
.get(config.API.complaintReject(id.value))
.then(async () => {
await getData();
success($q, "ยุติเรื่องสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
});
},
"ยืนยันยุติเรื่อง", "ยืนยันยุติเรื่อง",
"ต้องการยืนยันยุติเรื่องใช่หรือไม่?" "ต้องการยืนยันยุติเรื่องใช่หรือไม่?"
); );
@ -277,58 +288,38 @@ function endInvestigate() {
function cancelInvestigate() { function cancelInvestigate() {
dialogConfirm( dialogConfirm(
$q, $q,
() => confirmCancelInvestigate(), () => {
showLoader();
http
.get(config.API.complaintResume(id.value))
.then(async () => {
await getData();
success($q, "ยกเลิกยุติเรื่องสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
},
"ยืนยันยกเลิกการยุติเรื่อง", "ยืนยันยกเลิกการยุติเรื่อง",
"ต้องการยืนยันยกเลิกการยุติเรื่องใช่หรือไม่?" "ต้องการยืนยันยกเลิกการยุติเรื่องใช่หรือไม่?"
); );
} }
/** ฟังชั่น ยุติเรื่อง*/
function confirmEndInvestigate() {
showLoader();
http
.get(config.API.complaintReject(id.value))
.then((res) => {
success($q, "ยุติเรื่องสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await getData();
});
}
/** ฟังชั่น ยกเลิกการยุติเรื่อง*/
function confirmCancelInvestigate() {
showLoader();
http
.get(config.API.complaintResume(id.value))
.then((res) => {
getData();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
success($q, "ยกเลิกยุติเรื่องสำเร็จ");
});
}
/** /**
* งขอม จาก component เเล update * งขอม จาก component เเล update
* @param data person data * @param data person data
*/ */
function sendPersonToNext(data: ArrayPerson[]) { function sendPersonToNext(data: ArrayPerson[]) {
const dataMapId = data.map((item: ArrayPerson) => item.id); const dataMapId = data.map((item: ArrayPerson) => item.id);
showLoader(); showLoader();
http http
.put(config.API.complaintApprove(id.value), { .put(config.API.complaintApprove(id.value), {
persons: dataMapId, persons: dataMapId,
}) })
.then((res) => { .then(() => {
router.push(`/discipline/complaints`); router.push(`/discipline/complaints`);
}) })
.catch((e) => { .catch((e) => {
@ -340,8 +331,8 @@ function sendPersonToNext(data: ArrayPerson[]) {
} }
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */ /** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
onMounted(() => { onMounted(async () => {
getData(); await getData();
}); });
</script> </script>

View file

@ -14,7 +14,7 @@ import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
import type { import type {
FormData, FormData,
ArrayFileList, ArrayFileList,
} from "@/modules/11_discipline/interface/request/Complaint"; } from "@/modules/11_discipline/interface/request/complaint";
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue"; import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
import DialogAddPersonal from "@/components/Dialogs/AddPersonal.vue"; import DialogAddPersonal from "@/components/Dialogs/AddPersonal.vue";
@ -133,8 +133,6 @@ function onSubmit() {
if (mainStore.rowsAdd) { if (mainStore.rowsAdd) {
formData.persons = await mainStore.rowsAdd; formData.persons = await mainStore.rowsAdd;
} }
console.log("formData===>", formData);
await props.onSubmit(formData); await props.onSubmit(formData);
isSave.value = false; isSave.value = false;
}); });
@ -156,9 +154,9 @@ function confirmDelete(id: string) {
showLoader(); showLoader();
http http
.delete(config.API.complaintFileDelete(formData.id, id)) .delete(config.API.complaintFileDelete(formData.id, id))
.then((res) => { .then(async (res) => {
await props.getData();
success($q, `ลบไฟล์สำเร็จ`); success($q, `ลบไฟล์สำเร็จ`);
props.getData();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -184,18 +182,19 @@ function upLoadFileDoc() {
showLoader(); showLoader();
http http
.put(config.API.complaintFileUpload(formData.id), Data) .put(config.API.complaintFileUpload(formData.id), Data)
.then((res) => { .then(async (res) => {
await props.getData();
countNum.value = 2; countNum.value = 2;
formData.documentFile = null; formData.documentFile = null;
hideLoader();
success($q, "อัพโหลดไฟล์สำเร็จ"); success($q, "อัพโหลดไฟล์สำเร็จ");
props.getData();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
hideLoader();
}) })
.finally(async () => {}); .finally(async () => {
hideLoader();
});
} }
/** /**
@ -216,8 +215,8 @@ async function getActive() {
.get(config.API.activeOrganization) .get(config.API.activeOrganization)
.then(async (res) => { .then(async (res) => {
const data = await res.data.result; const data = await res.data.result;
await getOc(data.activeId);
formData.activeId = data.activeId; formData.activeId = data.activeId;
getOc(data.activeId);
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -226,7 +225,7 @@ async function getActive() {
hideLoader(); hideLoader();
}); });
} else { } else {
getOc(formData.activeId); await getOc(formData.activeId);
} }
} }
@ -382,9 +381,9 @@ watch(props.data, async () => {
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */ /** โหลดข้อมูลเมื่อเข้าหน้านี้ */
onMounted(() => { onMounted(() => {
mainStore.rowsAdd = []; mainStore.rowsAdd = [];
getListChannel();
getActive(); getActive();
getListChannel();
}); });
</script> </script>

View file

@ -153,9 +153,9 @@ async function getDataComplaint() {
} }
/** ดึงข้อมูลรายละเอียด */ /** ดึงข้อมูลรายละเอียด */
function getData() { async function getData() {
showLoader(); showLoader();
http await http
.get( .get(
config.API.investigateByGetId( config.API.investigateByGetId(
id.value, id.value,
@ -206,14 +206,12 @@ function getData() {
* @param id ระบ คคล * @param id ระบ คคล
*/ */
async function onSubmit(data: any) { async function onSubmit(data: any) {
// put
showLoader(); showLoader();
http http
.put(config.API.investigateById(id.value), data) .put(config.API.investigateById(id.value), data)
.then(async (res) => { .then(async () => {
await getData(); await getData();
await success($q, "บันทึกข้อมูลสำเร็จ"); await success($q, "บันทึกข้อมูลสำเร็จ");
// router.push(`/discipline/complaints`);
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -245,7 +243,7 @@ function sentConfirmNoPerson() {
.put(config.API.investigateApprove(id.value), { .put(config.API.investigateApprove(id.value), {
persons: [], persons: [],
}) })
.then((res) => { .then(() => {
getData(); getData();
router.push(`/discipline/investigatefacts`); router.push(`/discipline/investigatefacts`);
}) })
@ -344,10 +342,11 @@ watch(
); );
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */ /** โหลดข้อมูลเมื่อเข้าหน้านี้ */
onMounted(() => { onMounted(async () => {
getData();
if (store.tabMenu == "complaints") { if (store.tabMenu == "complaints") {
getDataComplaint(); await Promise.all([getData(), getDataComplaint()]);
} else {
getData();
} }
}); });
</script> </script>
@ -424,18 +423,19 @@ onMounted(() => {
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>
</q-card> </q-card>
<PopupSendToNext
:modal="modalPopup"
:close="closePopup"
title="ส่งไปสอบสวน"
:rows="mainStore.rowsSend.filter((item: ArrayPersonAdd)=> item.isSend == 'NEW')"
:columns="mainStore.columnsDirector"
:visible-columns="mainStore.visibleColumnsDirector"
@return-person="emitPerson"
/>
</div> </div>
<PopupSendToNext
:modal="modalPopup"
:close="closePopup"
title="ส่งไปสอบสวน"
:rows="mainStore.rowsSend.filter((item: ArrayPersonAdd)=> item.isSend == 'NEW')"
:columns="mainStore.columnsDirector"
:visible-columns="mainStore.visibleColumnsDirector"
@return-person="emitPerson"
/>
</template> </template>
<style scoped> <style scoped>
.q-tab-panel { .q-tab-panel {
padding: 0; padding: 0;

View file

@ -11,7 +11,7 @@ import { useInvestigateDisStore } from "@/modules/11_discipline/store/Investigat
import { useInvestigateFactStore } from "@/modules/11_discipline/store/InvestigateFactStore"; import { useInvestigateFactStore } from "@/modules/11_discipline/store/InvestigateFactStore";
import { useDisciplineMainStore } from "@/modules/11_discipline/store/Main"; import { useDisciplineMainStore } from "@/modules/11_discipline/store/Main";
import type { FormData } from "@/modules/11_discipline/interface/request/InvestigateFact"; import type { FormData } from "@/modules/11_discipline/interface/request/investigateFact";
import type { OptionData } from "@/modules/07_insignia/interface/index/Main"; import type { OptionData } from "@/modules/07_insignia/interface/index/Main";
import CalandarDialog from "@/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue"; import CalandarDialog from "@/modules/11_discipline/components/2_InvestigateFacts/CalandarDialog.vue";
@ -327,8 +327,8 @@ async function getActive() {
showLoader(); showLoader();
await http await http
.get(config.API.activeOrganization) .get(config.API.activeOrganization)
.then((res) => { .then(async (res) => {
getOc(res.data.result.activeId); await getOc(res.data.result.activeId);
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -677,6 +677,7 @@ watch(props.data, async () => {
posTypeName: person.posTypeName, posTypeName: person.posTypeName,
posLevelId: person.posLevelId, posLevelId: person.posLevelId,
posLevelName: person.posLevelName, posLevelName: person.posLevelName,
citizenId: person.idcard,
})); }));
mainStore.rowsCheck = mainStore.rowsAdd.filter( mainStore.rowsCheck = mainStore.rowsAdd.filter(
(item: any) => item.isDisciplinary === false && item.isSend === "NEW" (item: any) => item.isDisciplinary === false && item.isSend === "NEW"
@ -1723,7 +1724,6 @@ onMounted(async () => {
</div> </div>
<!-- พโหลดไฟล --> <!-- พโหลดไฟล -->
<DialogDuty <DialogDuty
:modal="modalEditDirector" :modal="modalEditDirector"
:close-popup="closeEditDirector" :close-popup="closeEditDirector"

View file

@ -15,7 +15,7 @@ import type {
FormData, FormData,
Director, Director,
PersonsArray, PersonsArray,
} from "@/modules/11_discipline/interface/request/disciplinary"; } from "@/modules/11_discipline/interface/request/Disciplinary";
import type { import type {
DataOption, DataOption,
FileLists, FileLists,

View file

@ -61,7 +61,7 @@ const props = defineProps({
const modalCommand = ref<boolean>(false); const modalCommand = ref<boolean>(false);
const emit = defineEmits(["returnPerson"]); const emit = defineEmits(["returnPerson"]);
const selected = ref<any>([]); const selected = ref<any[]>([]);
const inspectionResults = ref<string>(""); const inspectionResults = ref<string>("");
const filter = ref<string>(""); const filter = ref<string>("");
const initialPagination = ref<any>({ const initialPagination = ref<any>({

View file

@ -28,6 +28,7 @@ interface ArrayPerson {
interface ArrayPersonAdd { interface ArrayPersonAdd {
personId: string; //id อ้างอิง profile personId: string; //id อ้างอิง profile
idcard: string; //เลขประจำตัวประชาชน idcard: string; //เลขประจำตัวประชาชน
citizenId: string;
isSend: string; //สถานะการส่งคนไป isSend: string; //สถานะการส่งคนไป
prefix: string; //คำนำหน้า prefix: string; //คำนำหน้า
firstName: string; //ชื่อ firstName: string; //ชื่อ

View file

@ -394,7 +394,7 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
* POPUP * POPUP
* @param data * @param data
*/ */
function fetchData(data: ArrayPersonAdd[]) { async function fetchData(data: ArrayPersonAdd[]) {
const dataList: any = data.map((item: any) => ({ const dataList: any = data.map((item: any) => ({
id: item.id, id: item.id,
idcard: item.idcard, idcard: item.idcard,
@ -436,7 +436,7 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
* POPUP * POPUP
* @param data * @param data
*/ */
function fetchDataRowsSend(data: ArrayPersonAdd[]) { async function fetchDataRowsSend(data: ArrayPersonAdd[]) {
const dataList: any = data.map((item: any) => ({ const dataList: any = data.map((item: any) => ({
id: item.id, id: item.id,
idcard: item.idcard, idcard: item.idcard,

View file

@ -144,6 +144,7 @@ function createCommand(isRedirect: boolean) {
commandTypeId: commandType.value, commandTypeId: commandType.value,
persons: data, persons: data,
}; };
showLoader(); showLoader();
await http await http
.post(config.API.command + `/person`, body) .post(config.API.command + `/person`, body)

View file

@ -703,23 +703,24 @@ async function fetchPermissionsSys() {
<div class="text-subtitle2 q-mt-md q-mb-xs text-center"> <div class="text-subtitle2 q-mt-md q-mb-xs text-center">
{{ fullname }} {{ fullname }}
</div> </div>
<div class="row q-col-gutter-sm q-pa-sm"> <div class="row q-col-gutter-sm q-pa-sm text-center">
<div class="col-6"> <div class="col-12">
<q-btn <q-btn
color="blue" flat
color="blue-6"
label="เข้าสู่ระบบ Linkage Center" label="เข้าสู่ระบบ Linkage Center"
size="sm"
v-close-popup v-close-popup
@click="modalLoginLinkage = true" @click="modalLoginLinkage = true"
/> />
</div> </div>
<div class="col-6"> <div class="col-12" id="#logout">
<q-btn <q-btn
push
size="sm"
color="primary" color="primary"
label="ออกจากระบบ" label="ออกจากระบบ"
v-close-popup v-close-popup
@click="doLogout" @click="doLogout"
class="full-width full-height"
/> />
</div> </div>
</div> </div>