จัดโค้ดวินัย
This commit is contained in:
parent
71d3b54ef0
commit
7262000680
37 changed files with 492 additions and 697 deletions
|
|
@ -1,12 +1,9 @@
|
|||
div
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive, watch } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
|
||||
// import DialogAddPersonal from "@/components/Dialogs/AddPersonal.vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useInvestigateDisStore } from "@/modules/11_discipline/store/InvestigateDisStore";
|
||||
import { useDisciplineResultStore } from "@/modules/11_discipline/store/ResultStore";
|
||||
|
|
@ -23,12 +20,17 @@ import type {
|
|||
const mainStore = useDisciplineMainStore();
|
||||
const modalPerson = ref<boolean>(false);
|
||||
const toggleModal = () => (modalPerson.value = !modalPerson.value);
|
||||
const investigateDis = useInvestigateDisStore();
|
||||
// const { fecthDirector } = investigateDis;
|
||||
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||
const dataStore = useDisciplineResultStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, hideLoader, dialogConfirm, success, messageError,showLoader,dialogRemove } = mixin;
|
||||
const {
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
success,
|
||||
messageError,
|
||||
showLoader,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
|
|
@ -38,6 +40,7 @@ const isSave = ref<boolean>(false); // มีการแก้ไขรอบ
|
|||
const respondentType = ref<string>("");
|
||||
const organizationId = ref<string>("");
|
||||
const consideredAgency = ref<string>("");
|
||||
const organizationOption = ref<DataOption[]>([]);
|
||||
/** ตัวแปร ref สำหรับแสดง validate */
|
||||
const detailRef = ref<Object | null>(null);
|
||||
|
||||
|
|
@ -57,11 +60,6 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const ArrayFile = reactive<FileArray>({
|
||||
id: "",
|
||||
fileName: "",
|
||||
pathName: "",
|
||||
});
|
||||
/** ข้อมูล v-model ของฟอร์ม */
|
||||
const formData = reactive<FormData>({
|
||||
resultDescription: "",
|
||||
|
|
@ -78,19 +76,6 @@ const objectdisciplinary: FormRef = {
|
|||
resultDescription: detailRef,
|
||||
};
|
||||
|
||||
const organizationOption = ref<DataOption[]>([]);
|
||||
|
||||
async function addPerson(data: any) {
|
||||
await mainStore.fetchData(data);
|
||||
console.log(mainStore.rowsAdd);
|
||||
toggleModal();
|
||||
}
|
||||
|
||||
function handleSave(returnData: any) {
|
||||
addPerson(returnData);
|
||||
toggleModal();
|
||||
}
|
||||
|
||||
/** function เรียกรายชื่อหน่วยงาน*/
|
||||
async function fetchOrganization() {
|
||||
await http
|
||||
|
|
@ -171,7 +156,8 @@ watch(
|
|||
formData.oc = props.data.resultOc;
|
||||
formData.disciplineType = props.data.resultDisciplineType;
|
||||
formData.titleType = props.data.resultTitleType;
|
||||
formData.disciplineDisciplinary_DocResults = props.data.disciplineDisciplinary_DocResults;
|
||||
formData.disciplineDisciplinary_DocResults =
|
||||
props.data.disciplineDisciplinary_DocResults;
|
||||
formData.year = props.data.resultYear ?? 0;
|
||||
mainStore.rowsAdd = props.data.persons;
|
||||
await fetchDatadetail();
|
||||
|
|
@ -191,13 +177,6 @@ function changeFormData() {
|
|||
isSave.value = true;
|
||||
}
|
||||
|
||||
// function deletePerson(id: string) {
|
||||
// changeFormData();
|
||||
// const dataRow = mainStore.rowsAdd;
|
||||
// const updatedRows = dataRow.filter((item: any) => item.id !== id);
|
||||
// mainStore.rowsAdd = updatedRows;
|
||||
// }
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
|
|
@ -210,7 +189,6 @@ function uploadFile() {
|
|||
http
|
||||
.put(config.API.upLoadFileResult(id.value), Data)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||
props.fetchData();
|
||||
// router.push(`/discipline/complaints`);
|
||||
|
|
@ -250,8 +228,6 @@ function confirmDelete(docid: string) {
|
|||
props.fetchData();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {});
|
||||
</script>
|
||||
<template>
|
||||
<div class="row q-col-gutter-sm">
|
||||
|
|
@ -335,19 +311,6 @@ onMounted(async () => {});
|
|||
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
|
||||
>
|
||||
ผู้ถูกร้องเรียน
|
||||
<!-- <q-btn
|
||||
v-if="!isReadonly"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="add"
|
||||
class="q-ml-sm"
|
||||
@click="toggleModal"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มผู้ถูกร้องเรียน</q-tooltip>
|
||||
</q-btn> -->
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-xs-12 q-pa-sm">
|
||||
|
|
@ -375,7 +338,6 @@ onMounted(async () => {});
|
|||
col.label
|
||||
}}</span>
|
||||
</q-th>
|
||||
<!-- <q-th auto-width></q-th> -->
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
|
|
@ -414,20 +376,6 @@ onMounted(async () => {});
|
|||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<!-- <q-td auto-width>
|
||||
<q-btn
|
||||
v-if="!isReadonly"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="red"
|
||||
class="q-ml-sm"
|
||||
icon="mdi-delete-outline"
|
||||
@click="deletePerson(props.row.id)"
|
||||
><q-tooltip>ลบผู้ถูกร้องเรียน</q-tooltip></q-btn
|
||||
>
|
||||
</q-td> -->
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
|
|
@ -535,15 +483,6 @@ onMounted(async () => {});
|
|||
>
|
||||
</div>
|
||||
</q-card>
|
||||
<!-- <DialogAddPersonal
|
||||
title="ผู้ถูกร้องเรียน"
|
||||
:mainData="mainStore.rowsAdd"
|
||||
:modal="modalPerson"
|
||||
btn-title="เพิ่มรายชื่อผู้ถูกร้องเรียน"
|
||||
:close="toggleModal"
|
||||
:save="addPerson"
|
||||
@returnData="handleSave"
|
||||
/> -->
|
||||
</form>
|
||||
</div>
|
||||
<!-- อัพโหลดไฟล์ -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue