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