แก้วินัย อัพไฟล์ เเล้ว ข้อมูลเเก้ไขหาย/เเก้ฟิลเตอร์
This commit is contained in:
parent
b670ae3733
commit
9bf53d2689
8 changed files with 275 additions and 190 deletions
|
|
@ -75,10 +75,11 @@ const props = defineProps({
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => console.log("not function"),
|
default: () => console.log("not function"),
|
||||||
required: true,
|
required: true,
|
||||||
},selecetSwitch:{
|
},
|
||||||
type:String,
|
selecetSwitch: {
|
||||||
default:'multiple'
|
type: String,
|
||||||
}
|
default: "multiple",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**ส่งค่ากลับหน้าหลัก */
|
/**ส่งค่ากลับหน้าหลัก */
|
||||||
|
|
@ -147,16 +148,18 @@ async function searchInput() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** update เมื่อเปลี่ยน option */
|
/** update เมื่อเปลี่ยน option */
|
||||||
function updateSelect() {
|
function updateSelect() {
|
||||||
search.value = "";
|
search.value = "";
|
||||||
}
|
}
|
||||||
watch(()=>props.selectedData,()=>{
|
watch(
|
||||||
if(props.selectedData){
|
() => props.selectedData,
|
||||||
selected.value = props.selectedData
|
() => {
|
||||||
|
if (props.selectedData) {
|
||||||
|
selected.value = props.selectedData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -277,7 +280,10 @@ watch(()=>props.selectedData,()=>{
|
||||||
<div v-if="col.name === 'fullName'">
|
<div v-if="col.name === 'fullName'">
|
||||||
{{ props.prefix }}
|
{{ props.prefix }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div v-else-if="col.name === 'salary'">
|
||||||
|
{{ props.row.salary.toLocaleString() }}
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
{{ col.value }}
|
{{ col.value }}
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ const resultRef = ref<Object | null>(null);
|
||||||
const isSave = ref<boolean>(false); // มีการแก้ไขรอบันทึก
|
const isSave = ref<boolean>(false); // มีการแก้ไขรอบันทึก
|
||||||
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||||
const fileList = ref<ArrayFileList[]>([]);
|
const fileList = ref<ArrayFileList[]>([]);
|
||||||
|
const countNum = ref<number>(1);
|
||||||
|
|
||||||
/** รับ props มาจากหน้าหลัก */
|
/** รับ props มาจากหน้าหลัก */
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -158,6 +159,7 @@ function validateForm() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (hasError.every((result) => result === true)) {
|
if (hasError.every((result) => result === true)) {
|
||||||
|
countNum.value = 1
|
||||||
onSubmit();
|
onSubmit();
|
||||||
} else {
|
} else {
|
||||||
console.log("ไม่ผ่าน ");
|
console.log("ไม่ผ่าน ");
|
||||||
|
|
@ -222,28 +224,32 @@ function confirmDelete(id: string) {
|
||||||
*/
|
*/
|
||||||
watch(props.data, async () => {
|
watch(props.data, async () => {
|
||||||
if (props.data !== null) {
|
if (props.data !== null) {
|
||||||
isReadonly.value = props.data.status != "NEW" ?? true;
|
if (countNum.value === 1) {
|
||||||
isSave.value = false;
|
isReadonly.value = props.data.status != "NEW" ?? true;
|
||||||
|
isSave.value = false;
|
||||||
|
|
||||||
fileList.value = props.data.disciplineComplaintDocs;
|
fileList.value = props.data.disciplineComplaintDocs;
|
||||||
mainStore.fetchData(props.data.persons);
|
mainStore.fetchData(props.data.persons);
|
||||||
|
|
||||||
formData.id = props.data.id;
|
formData.id = props.data.id;
|
||||||
formData.respondentType = props.data.respondentType;
|
formData.respondentType = props.data.respondentType;
|
||||||
formData.organizationId = props.data.organizationId;
|
formData.organizationId = props.data.organizationId;
|
||||||
formData.consideredAgency = props.data.consideredAgency;
|
formData.consideredAgency = props.data.consideredAgency;
|
||||||
formData.title = props.data.title;
|
formData.title = props.data.title;
|
||||||
formData.description = props.data.description;
|
formData.description = props.data.description;
|
||||||
formData.dateReceived = props.data.dateReceived;
|
formData.dateReceived = props.data.dateReceived;
|
||||||
formData.dateConsideration = props.data.dateConsideration;
|
formData.dateConsideration = props.data.dateConsideration;
|
||||||
formData.offenseDetails = props.data.offenseDetails;
|
formData.offenseDetails = props.data.offenseDetails;
|
||||||
formData.levelConsideration = props.data.levelConsideration;
|
formData.levelConsideration = props.data.levelConsideration;
|
||||||
formData.dateNotification = props.data.dateNotification;
|
formData.dateNotification = props.data.dateNotification;
|
||||||
formData.complaintFrom = props.data.complaintFrom;
|
formData.complaintFrom = props.data.complaintFrom;
|
||||||
formData.appellant = props.data.appellant;
|
formData.appellant = props.data.appellant;
|
||||||
formData.status = props.data.status;
|
formData.status = props.data.status;
|
||||||
formData.result = props.data.result;
|
formData.result = props.data.result;
|
||||||
formData.persons = mainStore.rowsAdd;
|
formData.persons = mainStore.rowsAdd;
|
||||||
|
}else if (countNum.value === 2){
|
||||||
|
fileList.value = props.data.disciplineComplaintDocs;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -267,6 +273,7 @@ function upLoadFileDoc() {
|
||||||
.put(config.API.complaintFileUpload(formData.id), Data)
|
.put(config.API.complaintFileUpload(formData.id), Data)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
success($q, "อัพโหลดไฟล์สำเร็จ");
|
success($q, "อัพโหลดไฟล์สำเร็จ");
|
||||||
|
countNum.value = 2
|
||||||
props.getData();
|
props.getData();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -497,7 +504,7 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
<q-th auto-width></q-th>
|
<q-th auto-width></q-th>
|
||||||
<q-th
|
<q-th
|
||||||
v-for="col in props.cols"
|
v-for="col in props.cols"
|
||||||
:key="col.name"
|
:key="col.name"
|
||||||
|
|
@ -513,15 +520,17 @@ onMounted(() => {
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<td>
|
<td>
|
||||||
<router-link
|
<router-link
|
||||||
target="_blank"
|
target="_blank"
|
||||||
:to="`/registry/${props.row.personId}`"
|
:to="`/registry/${props.row.personId}`"
|
||||||
><q-icon name="info" color="info" size="sm"
|
><q-icon name="info" color="info" size="sm"
|
||||||
><q-tooltip>ดูข้อมูลในทะเบียนประวัติ</q-tooltip>
|
><q-tooltip
|
||||||
</q-icon></router-link
|
>ดูข้อมูลในทะเบียนประวัติ</q-tooltip
|
||||||
>
|
>
|
||||||
</td>
|
</q-icon></router-link
|
||||||
|
>
|
||||||
|
</td>
|
||||||
<q-td
|
<q-td
|
||||||
v-for="col in props.cols"
|
v-for="col in props.cols"
|
||||||
:key="col.name"
|
:key="col.name"
|
||||||
|
|
@ -536,10 +545,8 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
{{ props.row.organization }}
|
{{ props.row.organization }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-else-if="col.name === 'salary'">
|
||||||
v-else-if="col.name === 'salary'"
|
{{ props.row.salary.toLocaleString() }}
|
||||||
>
|
|
||||||
{{ props.row.salary.toLocaleString() }}
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ col.value }}
|
{{ col.value }}
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ const {
|
||||||
dialogRemove,
|
dialogRemove,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
const investigateDis = useInvestigateDisStore();
|
const investigateDis = useInvestigateDisStore();
|
||||||
|
const countNum = ref<number>(1);
|
||||||
|
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
const filterKeyword2 = ref<string>("");
|
const filterKeyword2 = ref<string>("");
|
||||||
|
|
@ -188,6 +189,7 @@ function validateForm() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasError.every((result) => result === true)) {
|
if (hasError.every((result) => result === true)) {
|
||||||
|
countNum.value = 1
|
||||||
onSubmit();
|
onSubmit();
|
||||||
} else {
|
} else {
|
||||||
console.log("ไม่ผ่าน ");
|
console.log("ไม่ผ่าน ");
|
||||||
|
|
@ -265,56 +267,65 @@ function clickClose() {
|
||||||
*/
|
*/
|
||||||
watch(props.data, async () => {
|
watch(props.data, async () => {
|
||||||
if (props.data !== null) {
|
if (props.data !== null) {
|
||||||
isReadonly.value = props.data.status != "NEW" ?? true;
|
if (countNum.value === 1) {
|
||||||
isSave.value = false;
|
isReadonly.value = props.data.status != "NEW" ?? true;
|
||||||
|
isSave.value = false;
|
||||||
|
|
||||||
isUpdate.value = true;
|
isUpdate.value = true;
|
||||||
formData.id = props.data.id;
|
formData.id = props.data.id;
|
||||||
formData.complaint = props.data.complaint;
|
formData.complaint = props.data.complaint;
|
||||||
formData.organizationId = props.data.organizationId;
|
formData.organizationId = props.data.organizationId;
|
||||||
formData.respondentType = props.data.respondentType;
|
formData.respondentType = props.data.respondentType;
|
||||||
formData.complaintdetail = props.data.complaintdetail;
|
formData.complaintdetail = props.data.complaintdetail;
|
||||||
formData.investigationDescription = props.data.investigationDescription;
|
formData.investigationDescription = props.data.investigationDescription;
|
||||||
formData.fault = props.data.fault;
|
formData.fault = props.data.fault;
|
||||||
formData.investigationDetailOther = props.data.investigationDetailOther;
|
formData.investigationDetailOther = props.data.investigationDetailOther;
|
||||||
formData.fileComplaint = props.data.fileComplaint;
|
formData.fileComplaint = props.data.fileComplaint;
|
||||||
formData.investigationDateStart = props.data.investigationDateStart;
|
formData.investigationDateStart = props.data.investigationDateStart;
|
||||||
formData.investigationDateEnd = props.data.investigationDateEnd;
|
formData.investigationDateEnd = props.data.investigationDateEnd;
|
||||||
formData.investigationDetail = props.data.investigationDetail;
|
formData.investigationDetail = props.data.investigationDetail;
|
||||||
formData.investigationDaysExtend = props.data.investigationDaysExtend;
|
formData.investigationDaysExtend = props.data.investigationDaysExtend;
|
||||||
formData.investigationExtendStatus = props.data.investigationExtendStatus;
|
formData.investigationExtendStatus = props.data.investigationExtendStatus;
|
||||||
formData.investigationStatusResult = props.data.investigationStatusResult;
|
formData.investigationStatusResult = props.data.investigationStatusResult;
|
||||||
formData.investigationCauseText = props.data.investigationCauseText;
|
formData.investigationCauseText = props.data.investigationCauseText;
|
||||||
formData.result = props.data.result;
|
formData.result = props.data.result;
|
||||||
formData.disciplineInvestigateDocs = props.data.disciplineInvestigateDocs;
|
formData.disciplineInvestigateDocs = props.data.disciplineInvestigateDocs;
|
||||||
formData.disciplineInvestigateRelevantDocs =
|
formData.disciplineInvestigateRelevantDocs =
|
||||||
props.data.disciplineInvestigateRelevantDocs;
|
props.data.disciplineInvestigateRelevantDocs;
|
||||||
formData.status = props.data.status;
|
formData.status = props.data.status;
|
||||||
formData.investigationExtendHistory = props.data.investigationExtendHistory;
|
formData.investigationExtendHistory =
|
||||||
|
props.data.investigationExtendHistory;
|
||||||
|
|
||||||
mainStore.rowsAdd = props.data.persons;
|
mainStore.rowsAdd = props.data.persons;
|
||||||
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"
|
||||||
);
|
);
|
||||||
|
|
||||||
const dataMap = props.data.directors.map((item: any) => ({
|
const dataMap = props.data.directors.map((item: any) => ({
|
||||||
id: item.id ? item.id : "-",
|
id: item.id ? item.id : "-",
|
||||||
directorId: item.directorId ? item.directorId : "-",
|
directorId: item.directorId ? item.directorId : "-",
|
||||||
name: `${item.prefix}${item.firstName} ${item.lastName}`,
|
name: `${item.prefix}${item.firstName} ${item.lastName}`,
|
||||||
prefix: item.prefix ? item.prefix : "-",
|
prefix: item.prefix ? item.prefix : "-",
|
||||||
firstName: item.firstName ? item.firstName : "-",
|
firstName: item.firstName ? item.firstName : "-",
|
||||||
lastName: item.lastName ? item.lastName : "-",
|
lastName: item.lastName ? item.lastName : "-",
|
||||||
position: item.position ? item.position : "-",
|
position: item.position ? item.position : "-",
|
||||||
email: item.email ? item.email : "-",
|
email: item.email ? item.email : "-",
|
||||||
phone: item.phone ? item.phone : "-",
|
phone: item.phone ? item.phone : "-",
|
||||||
commandNo: item.commandNo ? item.commandNo : "-",
|
commandNo: item.commandNo ? item.commandNo : "-",
|
||||||
duty: item.duty ? item.duty : "-",
|
duty: item.duty ? item.duty : "-",
|
||||||
check: "props",
|
check: "props",
|
||||||
}));
|
}));
|
||||||
|
|
||||||
rows.value = dataMap;
|
rows.value = dataMap;
|
||||||
const dataList = dataMap.map((item: any) => item.id);
|
const dataList = dataMap.map((item: any) => item.id);
|
||||||
formData.directors = dataList;
|
formData.directors = dataList;
|
||||||
|
} else if (countNum.value === 2) {
|
||||||
|
formData.disciplineInvestigateRelevantDocs =
|
||||||
|
props.data.disciplineInvestigateRelevantDocs;
|
||||||
|
|
||||||
|
} else if (countNum.value === 3) {
|
||||||
|
formData.disciplineInvestigateDocs = props.data.disciplineInvestigateDocs;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -326,6 +337,7 @@ function uploadFileRelevant() {
|
||||||
.put(config.API.investigateRelevantUploadFile(formData.id), Data)
|
.put(config.API.investigateRelevantUploadFile(formData.id), Data)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||||
|
countNum.value = 2;
|
||||||
props.getData();
|
props.getData();
|
||||||
// router.push(`/discipline/complaints`);
|
// router.push(`/discipline/complaints`);
|
||||||
})
|
})
|
||||||
|
|
@ -347,6 +359,7 @@ function uploadFile() {
|
||||||
.put(config.API.investigateUploadFile(formData.id), Data)
|
.put(config.API.investigateUploadFile(formData.id), Data)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||||
|
countNum.value = 3
|
||||||
props.getData();
|
props.getData();
|
||||||
// router.push(`/discipline/complaints`);
|
// router.push(`/discipline/complaints`);
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ const filter = ref<string>("");
|
||||||
const isSave = ref<boolean>(false); // มีการแก้ไขรอบันทึก
|
const isSave = ref<boolean>(false); // มีการแก้ไขรอบันทึก
|
||||||
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||||
const extendStatus = ref<boolean>(false);
|
const extendStatus = ref<boolean>(false);
|
||||||
|
const countNum = ref<number>(1);
|
||||||
/** formData*/
|
/** formData*/
|
||||||
const formData = reactive<FormData>({
|
const formData = reactive<FormData>({
|
||||||
respondentType: "",
|
respondentType: "",
|
||||||
|
|
@ -213,6 +213,7 @@ function validateForm() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (hasError.every((result) => result === true)) {
|
if (hasError.every((result) => result === true)) {
|
||||||
|
countNum.value = 1
|
||||||
onSubmit();
|
onSubmit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -279,75 +280,99 @@ async function deleteDirector(id: string) {
|
||||||
/** เรียกข้อมูลรายละเอียด*/
|
/** เรียกข้อมูลรายละเอียด*/
|
||||||
async function fetchDatadetail() {
|
async function fetchDatadetail() {
|
||||||
if (props.data) {
|
if (props.data) {
|
||||||
isReadonly.value = props.data.status != "NEW" ?? true;
|
if (countNum.value === 1) {
|
||||||
isSave.value = false;
|
isReadonly.value = props.data.status != "NEW" ?? true;
|
||||||
|
isSave.value = false;
|
||||||
|
|
||||||
formData.respondentType = props.data.respondentType;
|
formData.respondentType = props.data.respondentType;
|
||||||
formData.organizationId = props.data.organizationId;
|
formData.organizationId = props.data.organizationId;
|
||||||
formData.consideredAgency = props.data.consideredAgency;
|
formData.consideredAgency = props.data.consideredAgency;
|
||||||
formData.disciplinaryDateAllegation = props.data.disciplinaryDateAllegation;
|
formData.disciplinaryDateAllegation =
|
||||||
formData.disciplinaryDateEvident = props.data.disciplinaryDateEvident;
|
props.data.disciplinaryDateAllegation;
|
||||||
formData.disciplinaryCaseFault = props.data.disciplinaryCaseFault;
|
formData.disciplinaryDateEvident = props.data.disciplinaryDateEvident;
|
||||||
formData.disciplinaryInvestigateAt = props.data.disciplinaryInvestigateAt;
|
formData.disciplinaryCaseFault = props.data.disciplinaryCaseFault;
|
||||||
formData.disciplinaryFaultLevel = props.data.disciplinaryFaultLevel;
|
formData.disciplinaryInvestigateAt = props.data.disciplinaryInvestigateAt;
|
||||||
formData.disciplinaryRefLaw = props.data.disciplinaryRefLaw;
|
formData.disciplinaryFaultLevel = props.data.disciplinaryFaultLevel;
|
||||||
formData.disciplinarySummaryEvidence =
|
formData.disciplinaryRefLaw = props.data.disciplinaryRefLaw;
|
||||||
props.data.disciplinarySummaryEvidence;
|
formData.disciplinarySummaryEvidence =
|
||||||
formData.disciplinaryRecordAccuser = props.data.disciplinaryRecordAccuser;
|
props.data.disciplinarySummaryEvidence;
|
||||||
formData.disciplinaryWitnesses = props.data.disciplinaryWitnesses;
|
formData.disciplinaryRecordAccuser = props.data.disciplinaryRecordAccuser;
|
||||||
formData.result = props.data.result;
|
formData.disciplinaryWitnesses = props.data.disciplinaryWitnesses;
|
||||||
formData.persons = props.data.persons ?? [];
|
formData.result = props.data.result;
|
||||||
formData.disciplinaryDateStart = props.data.disciplinaryDateStart ?? null;
|
formData.persons = props.data.persons ?? [];
|
||||||
formData.disciplinaryDateEnd = props.data.disciplinaryDateEnd ?? null;
|
formData.disciplinaryDateStart = props.data.disciplinaryDateStart ?? null;
|
||||||
formData.daysExtend = props.data.daysExtend ?? 0;
|
formData.disciplinaryDateEnd = props.data.disciplinaryDateEnd ?? null;
|
||||||
formData.disciplinaryDateInvestigation =
|
formData.daysExtend = props.data.daysExtend ?? 0;
|
||||||
props.data.disciplinaryDateInvestigation ?? null;
|
formData.disciplinaryDateInvestigation =
|
||||||
formData.disciplinaryDateResult = props.data.disciplinaryDateResult ?? null;
|
props.data.disciplinaryDateInvestigation ?? null;
|
||||||
disciplineDisciplinary_DocSummaryEvidences.value =
|
formData.disciplinaryDateResult =
|
||||||
props.data.disciplineDisciplinary_DocSummaryEvidences;
|
props.data.disciplinaryDateResult ?? null;
|
||||||
disciplineDisciplinary_DocRecordAccusers.value =
|
disciplineDisciplinary_DocSummaryEvidences.value =
|
||||||
props.data.disciplineDisciplinary_DocRecordAccusers;
|
props.data.disciplineDisciplinary_DocSummaryEvidences;
|
||||||
disciplineDisciplinary_DocWitnessess.value =
|
disciplineDisciplinary_DocRecordAccusers.value =
|
||||||
props.data.disciplineDisciplinary_DocWitnessess;
|
props.data.disciplineDisciplinary_DocRecordAccusers;
|
||||||
disciplineDisciplinary_DocOthers.value =
|
disciplineDisciplinary_DocWitnessess.value =
|
||||||
props.data.disciplineDisciplinary_DocOthers;
|
props.data.disciplineDisciplinary_DocWitnessess;
|
||||||
|
disciplineDisciplinary_DocOthers.value =
|
||||||
|
props.data.disciplineDisciplinary_DocOthers;
|
||||||
|
|
||||||
disciplineDisciplinary_DocRelevants.value =
|
disciplineDisciplinary_DocRelevants.value =
|
||||||
props.data.disciplineDisciplinary_DocRelevants;
|
props.data.disciplineDisciplinary_DocRelevants;
|
||||||
|
|
||||||
investigateDis.rowSent = formData.persons;
|
investigateDis.rowSent = formData.persons;
|
||||||
|
|
||||||
formData.disciplinaryStatusResult = props.data.disciplinaryStatusResult;
|
formData.disciplinaryStatusResult = props.data.disciplinaryStatusResult;
|
||||||
formData.disciplinaryCauseText = props.data.disciplinaryCauseText;
|
formData.disciplinaryCauseText = props.data.disciplinaryCauseText;
|
||||||
formData.disciplinaryResult = props.data.disciplinaryResult;
|
formData.disciplinaryResult = props.data.disciplinaryResult;
|
||||||
formData.disciplinaryExtendHistory = props.data.disciplinaryExtendHistory;
|
formData.disciplinaryExtendHistory = props.data.disciplinaryExtendHistory;
|
||||||
|
|
||||||
mainStore.rowsAdd = props.data.persons;
|
mainStore.rowsAdd = props.data.persons;
|
||||||
mainStore.rowsCheck = mainStore.rowsAdd.filter(
|
mainStore.rowsCheck = mainStore.rowsAdd.filter(
|
||||||
(item: any) => item.isSuspend === "NEW" && item.isSend === "NEW"
|
(item: any) => item.isSuspend === "NEW" && item.isSend === "NEW"
|
||||||
);
|
);
|
||||||
/** MAP รายชื่อกรรมการ หน้าหลัก */
|
/** MAP รายชื่อกรรมการ หน้าหลัก */
|
||||||
const dataMap = props.data.director.map((item: any) => ({
|
const dataMap = props.data.director.map((item: any) => ({
|
||||||
idRaw: item.id ? item.id : "-",
|
idRaw: item.id ? item.id : "-",
|
||||||
id: item.directorId ? item.directorId : "-",
|
id: item.directorId ? item.directorId : "-",
|
||||||
name: `${item.prefix}${item.firstName} ${item.lastName}`,
|
name: `${item.prefix}${item.firstName} ${item.lastName}`,
|
||||||
prefix: item.prefix ? item.prefix : "-",
|
prefix: item.prefix ? item.prefix : "-",
|
||||||
firstName: item.firstName ? item.firstName : "-",
|
firstName: item.firstName ? item.firstName : "-",
|
||||||
lastName: item.lastName ? item.lastName : "-",
|
lastName: item.lastName ? item.lastName : "-",
|
||||||
position: item.position ? item.position : "-",
|
position: item.position ? item.position : "-",
|
||||||
email: item.email ? item.email : "-",
|
email: item.email ? item.email : "-",
|
||||||
phone: item.phone ? item.phone : "-",
|
phone: item.phone ? item.phone : "-",
|
||||||
duty: item.duty ? item.duty : "-",
|
duty: item.duty ? item.duty : "-",
|
||||||
commandNo: item.commandNo ? item.commandNo : "-",
|
commandNo: item.commandNo ? item.commandNo : "-",
|
||||||
check: "props",
|
check: "props",
|
||||||
}));
|
}));
|
||||||
|
|
||||||
rows.value = dataMap;
|
rows.value = dataMap;
|
||||||
const dataList = dataMap.map((item: any) => item.id);
|
const dataList = dataMap.map((item: any) => item.id);
|
||||||
formData.directors = dataList;
|
formData.directors = dataList;
|
||||||
|
} else if (countNum.value === 2) {
|
||||||
|
disciplineDisciplinary_DocRelevants.value =
|
||||||
|
props.data.disciplineDisciplinary_DocRelevants;
|
||||||
|
} else if (countNum.value === 3) {
|
||||||
|
disciplineDisciplinary_DocSummaryEvidences.value =
|
||||||
|
props.data.disciplineDisciplinary_DocSummaryEvidences;
|
||||||
|
} else if (countNum.value === 4) {
|
||||||
|
disciplineDisciplinary_DocRecordAccusers.value =
|
||||||
|
props.data.disciplineDisciplinary_DocRecordAccusers;
|
||||||
|
} else if (countNum.value === 5) {
|
||||||
|
disciplineDisciplinary_DocWitnessess.value =
|
||||||
|
props.data.disciplineDisciplinary_DocWitnessess;
|
||||||
|
} else if (countNum.value === 6) {
|
||||||
|
disciplineDisciplinary_DocOthers.value =
|
||||||
|
props.data.disciplineDisciplinary_DocOthers;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function returnCount(num: number) {
|
||||||
|
countNum.value = num;
|
||||||
|
console.log(countNum.value)
|
||||||
|
}
|
||||||
|
|
||||||
async function addPerson(data: any) {
|
async function addPerson(data: any) {
|
||||||
await mainStore.fetchData(data);
|
await mainStore.fetchData(data);
|
||||||
toggleModal();
|
toggleModal();
|
||||||
|
|
@ -1685,6 +1710,7 @@ onMounted(async () => {
|
||||||
type="relevant"
|
type="relevant"
|
||||||
:fetchData="props.fetchData"
|
:fetchData="props.fetchData"
|
||||||
:is-readonly="isReadonly"
|
:is-readonly="isReadonly"
|
||||||
|
:return-count="returnCount"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<UploadFile
|
<UploadFile
|
||||||
|
|
@ -1695,6 +1721,7 @@ onMounted(async () => {
|
||||||
type="summaryEvidence"
|
type="summaryEvidence"
|
||||||
:fetchData="props.fetchData"
|
:fetchData="props.fetchData"
|
||||||
:is-readonly="isReadonly"
|
:is-readonly="isReadonly"
|
||||||
|
:return-count="returnCount"
|
||||||
/>
|
/>
|
||||||
<UploadFile
|
<UploadFile
|
||||||
title="อัปโหลดบันทึกถ้อยคำของผู้กล่าวหา"
|
title="อัปโหลดบันทึกถ้อยคำของผู้กล่าวหา"
|
||||||
|
|
@ -1704,6 +1731,7 @@ onMounted(async () => {
|
||||||
type="recordAccuser"
|
type="recordAccuser"
|
||||||
:fetchData="props.fetchData"
|
:fetchData="props.fetchData"
|
||||||
:is-readonly="isReadonly"
|
:is-readonly="isReadonly"
|
||||||
|
:return-count="returnCount"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<UploadFile
|
<UploadFile
|
||||||
|
|
@ -1714,6 +1742,7 @@ onMounted(async () => {
|
||||||
type="witnesses"
|
type="witnesses"
|
||||||
:fetchData="props.fetchData"
|
:fetchData="props.fetchData"
|
||||||
:is-readonly="isReadonly"
|
:is-readonly="isReadonly"
|
||||||
|
:return-count="returnCount"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<UploadFile
|
<UploadFile
|
||||||
|
|
@ -1724,6 +1753,7 @@ onMounted(async () => {
|
||||||
type="other"
|
type="other"
|
||||||
:fetchData="props.fetchData"
|
:fetchData="props.fetchData"
|
||||||
:is-readonly="isReadonly"
|
:is-readonly="isReadonly"
|
||||||
|
:return-count="returnCount"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -69,27 +69,27 @@ const saveOrder = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//ส่งไปออกคำสั่ง
|
//ส่งไปออกคำสั่ง
|
||||||
async function Ordersave(){
|
async function Ordersave() {
|
||||||
const persons = selected.value.map((r) => r.id);
|
const persons = selected.value.map((r) => r.id);
|
||||||
|
|
||||||
// if (props.title == "ส่งไปออกคำสั่งลงโทษทางวินัย") {
|
// if (props.title == "ส่งไปออกคำสั่งลงโทษทางวินัย") {
|
||||||
const body = {
|
const body = {
|
||||||
persons,
|
persons,
|
||||||
};
|
};
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.put(config.API.reportresult(idPath.value, type.value as string), body)
|
.put(config.API.reportresult(idPath.value, type.value as string), body)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
success($q, `${props.title}สำเร็จ`);
|
success($q, `${props.title}สำเร็จ`);
|
||||||
props.closeModal?.();
|
props.closeModal?.();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
props.getData?.();
|
props.getData?.();
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
// } else if (props.title == "ส่งไปออกคำสั่งงดโทษ/เพิ่มโทษ") {
|
// } else if (props.title == "ส่งไปออกคำสั่งงดโทษ/เพิ่มโทษ") {
|
||||||
// const body = {
|
// const body = {
|
||||||
// persons,
|
// persons,
|
||||||
|
|
@ -109,7 +109,7 @@ async function Ordersave(){
|
||||||
// hideLoader();
|
// hideLoader();
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
};
|
}
|
||||||
|
|
||||||
const emit = defineEmits([
|
const emit = defineEmits([
|
||||||
"update:filterKeyword2",
|
"update:filterKeyword2",
|
||||||
|
|
@ -122,28 +122,28 @@ const updateInput = (value: any) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
//รีเซ็ตค่าในช่องค้นหา
|
//รีเซ็ตค่าในช่องค้นหา
|
||||||
function Reset(){
|
function Reset() {
|
||||||
emit("update:filterKeyword2", "");
|
emit("update:filterKeyword2", "");
|
||||||
};
|
}
|
||||||
|
|
||||||
//----(ดึงข้อมูลประเภทคำสั่ง)------//
|
//----(ดึงข้อมูลประเภทคำสั่ง)------//
|
||||||
async function fecthTypeOption(){
|
async function fecthTypeOption() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.typeOrder())
|
.get(config.API.typeOrder())
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// if (props.title == "ส่งไปออกคำสั่ง") {
|
// if (props.title == "ส่งไปออกคำสั่ง") {
|
||||||
optionsType.value = res.data.result.filter(
|
optionsType.value = res.data.result.filter(
|
||||||
(e: OpType) =>
|
(e: OpType) =>
|
||||||
e.commandCode === "C-PM-19" ||
|
e.commandCode === "C-PM-19" ||
|
||||||
e.commandCode === "C-PM-20" ||
|
e.commandCode === "C-PM-20" ||
|
||||||
e.commandCode === "C-PM-27" ||
|
e.commandCode === "C-PM-27" ||
|
||||||
e.commandCode === "C-PM-28" ||
|
e.commandCode === "C-PM-28" ||
|
||||||
e.commandCode === "C-PM-29" ||
|
e.commandCode === "C-PM-29" ||
|
||||||
e.commandCode === "C-PM-30" ||
|
e.commandCode === "C-PM-30" ||
|
||||||
e.commandCode === "C-PM-31"
|
e.commandCode === "C-PM-31"
|
||||||
);
|
);
|
||||||
// }
|
// }
|
||||||
// else {
|
// else {
|
||||||
// optionsType.value = res.data.result.filter(
|
// optionsType.value = res.data.result.filter(
|
||||||
// (e: OpType) =>
|
// (e: OpType) =>
|
||||||
|
|
@ -157,13 +157,15 @@ async function fecthTypeOption(){
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
if (props.Modal === true) {
|
if (props.Modal === true) {
|
||||||
selected.value = [];
|
selected.value = [];
|
||||||
type.value = "";
|
type.value = "";
|
||||||
rows.value = props.data.persons
|
rows.value = props.data.persons.filter(
|
||||||
|
(item: any) => item.status === "NEW"
|
||||||
|
);
|
||||||
// if (props.title == "ส่งไปออกคำสั่งลงโทษทางวินัย") {
|
// if (props.title == "ส่งไปออกคำสั่งลงโทษทางวินัย") {
|
||||||
// rows.value = props.data.persons.filter(
|
// rows.value = props.data.persons.filter(
|
||||||
// (item: any) => item.status !== "REPORT"
|
// (item: any) => item.status !== "REPORT"
|
||||||
|
|
@ -193,7 +195,6 @@ watch(
|
||||||
<div class="row justify-between">
|
<div class="row justify-between">
|
||||||
<div class="col-5">
|
<div class="col-5">
|
||||||
<q-toolbar style="padding: 0">
|
<q-toolbar style="padding: 0">
|
||||||
|
|
||||||
<q-select
|
<q-select
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
|
|
@ -285,7 +286,7 @@ watch(
|
||||||
v-model="props.selected"
|
v-model="props.selected"
|
||||||
/>
|
/>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td v-for="col in props.cols" :key="col.name" :props="props" >
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -295,6 +296,9 @@ watch(
|
||||||
>
|
>
|
||||||
{{ props.row.organization }}
|
{{ props.row.organization }}
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else-if="col.name === 'salary'">
|
||||||
|
{{ props.row.salary.toLocaleString() }}
|
||||||
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ col.value }}
|
{{ col.value }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import type {
|
||||||
} from "@/modules/11_discipline/interface/request/result";
|
} from "@/modules/11_discipline/interface/request/result";
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
|
const countNum = ref<number>(1);
|
||||||
const mainStore = useDisciplineMainStore();
|
const mainStore = useDisciplineMainStore();
|
||||||
const modalPerson = ref<boolean>(false);
|
const modalPerson = ref<boolean>(false);
|
||||||
const toggleModal = () => (modalPerson.value = !modalPerson.value);
|
const toggleModal = () => (modalPerson.value = !modalPerson.value);
|
||||||
|
|
@ -114,6 +115,7 @@ function validateForm() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (hasError.every((result) => result === true)) {
|
if (hasError.every((result) => result === true)) {
|
||||||
|
countNum.value = 1
|
||||||
onSubmit();
|
onSubmit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -156,6 +158,7 @@ async function fetchDatadetail() {
|
||||||
watch(
|
watch(
|
||||||
() => props.data,
|
() => props.data,
|
||||||
async () => {
|
async () => {
|
||||||
|
if (countNum.value === 1) {
|
||||||
respondentType.value = props.data.respondentType;
|
respondentType.value = props.data.respondentType;
|
||||||
formData.oc = props.data.resultOc;
|
formData.oc = props.data.resultOc;
|
||||||
formData.disciplineType = props.data.resultDisciplineType;
|
formData.disciplineType = props.data.resultDisciplineType;
|
||||||
|
|
@ -166,7 +169,11 @@ watch(
|
||||||
mainStore.rowsAdd = props.data.persons;
|
mainStore.rowsAdd = props.data.persons;
|
||||||
await fetchDatadetail();
|
await fetchDatadetail();
|
||||||
await fetchOrganization();
|
await fetchOrganization();
|
||||||
|
}else if(countNum.value === 2){
|
||||||
|
formData.disciplineDisciplinary_DocResults =
|
||||||
|
props.data.disciplineDisciplinary_DocResults;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
function inputEdit(val: boolean) {
|
function inputEdit(val: boolean) {
|
||||||
|
|
@ -194,6 +201,7 @@ function uploadFile() {
|
||||||
.put(config.API.upLoadFileResult(id.value), Data)
|
.put(config.API.upLoadFileResult(id.value), Data)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||||
|
countNum.value = 2
|
||||||
props.fetchData();
|
props.fetchData();
|
||||||
// router.push(`/discipline/complaints`);
|
// router.push(`/discipline/complaints`);
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,10 @@ watch([() => props.modal], () => {
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div v-else-if="col.name === 'salary'">
|
||||||
|
{{ props.row.salary.toLocaleString() }}
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
{{ col.value }}
|
{{ col.value }}
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,10 @@ const props = defineProps({
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => "",
|
default: () => "",
|
||||||
},
|
},
|
||||||
|
returnCount: {
|
||||||
|
type: Function,
|
||||||
|
default: () => "",
|
||||||
|
},
|
||||||
isReadonly: {
|
isReadonly: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
},
|
||||||
|
|
@ -57,7 +61,17 @@ const props = defineProps({
|
||||||
*/
|
*/
|
||||||
async function uploadFile() {
|
async function uploadFile() {
|
||||||
console.log("test");
|
console.log("test");
|
||||||
|
if (props.type === "relevant") {
|
||||||
|
props.returnCount(2);
|
||||||
|
} else if (props.type === "summaryEvidence") {
|
||||||
|
props.returnCount(3);
|
||||||
|
} else if (props.type === "recordAccuser") {
|
||||||
|
props.returnCount(4);
|
||||||
|
} else if (props.type === "witnesses") {
|
||||||
|
props.returnCount(5);
|
||||||
|
} else if (props.type === "other") {
|
||||||
|
props.returnCount(6);
|
||||||
|
}
|
||||||
const Data = new FormData();
|
const Data = new FormData();
|
||||||
Data.append("file", file.value);
|
Data.append("file", file.value);
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue