ปิด input หน่วยงานที่พิจารณา
This commit is contained in:
parent
2598fda26a
commit
9f82a3b2ef
2 changed files with 43 additions and 45 deletions
|
|
@ -1,91 +1,83 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, reactive, ref, watch } from "vue";
|
import { onMounted, ref, watch } from "vue";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
import { useRouter, useRoute } from "vue-router";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
|
/**import component*/
|
||||||
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
||||||
import FormInvestigatefacts from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue"; //สืบสวนข้อเท็จจริง
|
import FormInvestigatefacts from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue"; //สืบสวนข้อเท็จจริง
|
||||||
import FormDisciplinary from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue"; // สอบสวนความผิดทางวินัย
|
import FormDisciplinary from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue"; // สอบสวนความผิดทางวินัย
|
||||||
import type { FormData } from "@/modules/11_discipline/interface/request/disciplinary";
|
import type { FormData } from "@/modules/11_discipline/interface/request/disciplinary";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
|
||||||
|
/**import store*/
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useInvestigateDisStore } from "@/modules/11_discipline/store/InvestigateDisStore";
|
import { useInvestigateDisStore } from "@/modules/11_discipline/store/InvestigateDisStore";
|
||||||
import { useQuasar } from "quasar";
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const store = useInvestigateDisStore();
|
const store = useInvestigateDisStore();
|
||||||
const { dialogConfirm, success } = mixin;
|
const { dialogConfirm, success, messageError, showLoader, hideLoader } = mixin;
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const id = ref<string>(route.params.id as string);
|
const id = ref<string>(route.params.id as string);
|
||||||
|
|
||||||
/** ข้อมูล v-model ของฟอร์ม */
|
|
||||||
// const data = reactive<FormData>({
|
|
||||||
// complaint: "",
|
|
||||||
// respondentType: "",
|
|
||||||
// dateInvestigate: null,
|
|
||||||
// dateAllegation: null,
|
|
||||||
// dateEvident: null,
|
|
||||||
// casefault: "",
|
|
||||||
// typefault: "",
|
|
||||||
// faultLevel: "",
|
|
||||||
// refLaw: "",
|
|
||||||
// detailComplaint: "",
|
|
||||||
// whereInvestigate: "",
|
|
||||||
// trueDetail: "",
|
|
||||||
// evidence: "",
|
|
||||||
// recordAccuser: "",
|
|
||||||
// witnesses: "",
|
|
||||||
// InvestResults: "",
|
|
||||||
// filesEvidence: null,
|
|
||||||
// filesRecordAccuser: null,
|
|
||||||
// filesWitnesses: null,
|
|
||||||
// filesEtc: null,
|
|
||||||
// complaintStatus: "NEW",
|
|
||||||
// organizationId: "",
|
|
||||||
// consideredAgency: "",
|
|
||||||
// });
|
|
||||||
|
|
||||||
const data = ref<object>();
|
const data = ref<object>();
|
||||||
|
|
||||||
/** function fetchData สอบสวนคาวมผิดทางวินัย*/
|
/** function fetchData สอบสวนคาวมผิดทางวินัย*/
|
||||||
async function fetchDetailDisciplinary() {
|
async function fetchDetailDisciplinary() {
|
||||||
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.disciplineDisciplinaryById(id.value))
|
.get(config.API.disciplineDisciplinaryById(id.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
data.value = res.data.result;
|
data.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** function fetchData สืบสวนข้อเท็จจริง*/
|
/** function fetchData สืบสวนข้อเท็จจริง*/
|
||||||
async function fetchDetailInvestigate() {
|
async function fetchDetailInvestigate() {
|
||||||
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.disciplineInvestigateById(id.value))
|
.get(config.API.disciplineInvestigateById(id.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
data.value = res.data.result;
|
data.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** function fetchData เรื่องร้องเรียน*/
|
/** function fetchData เรื่องร้องเรียน*/
|
||||||
async function fetchDetailComplaints() {
|
async function fetchDetailComplaints() {
|
||||||
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.disciplineComplaintsById(id.value))
|
.get(config.API.disciplineComplaintsById(id.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
data.value = res.data.result;
|
data.value = res.data.result;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* function บันทักข้อมูล
|
||||||
|
* @param data ข้อมูล ใน form
|
||||||
|
*/
|
||||||
async function onSubmitDisciplinary(data: any) {
|
async function onSubmitDisciplinary(data: any) {
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
await http
|
await http
|
||||||
.put(config.API.disciplineDisciplinaryById(id.value), data)
|
.put(config.API.disciplineDisciplinaryById(id.value), data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
@ -93,7 +85,18 @@ async function onSubmitDisciplinary(data: any) {
|
||||||
})
|
})
|
||||||
.catch((err) => {})
|
.catch((err) => {})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
await fetchDetailDisciplinary();
|
const fetchFunction =
|
||||||
|
store.tabMenu === "disciplinary"
|
||||||
|
? fetchDetailDisciplinary
|
||||||
|
: store.tabMenu === "investigatefacts"
|
||||||
|
? fetchDetailInvestigate
|
||||||
|
: store.tabMenu === "complaints"
|
||||||
|
? fetchDetailComplaints
|
||||||
|
: null;
|
||||||
|
|
||||||
|
if (fetchFunction) {
|
||||||
|
await fetchFunction();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -172,11 +175,6 @@ watch(
|
||||||
if (fetchFunction) {
|
if (fetchFunction) {
|
||||||
await fetchFunction();
|
await fetchFunction();
|
||||||
}
|
}
|
||||||
// if (store.tabMenu === "disciplinary") {
|
|
||||||
// await fetchDetailDisciplinary();
|
|
||||||
// } else if (store.tabMenu === "investigatefacts") {
|
|
||||||
// await fetchDetailInvestigate();
|
|
||||||
// } else if (store.tabMenu === "complaints") await fetchDetailComplaints();
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -571,7 +571,7 @@ onMounted(async () => {
|
||||||
lazy-rules
|
lazy-rules
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-3" id="consideredAgency">
|
<!-- <div class="col-xs-12 col-sm-3" id="consideredAgency">
|
||||||
<q-select
|
<q-select
|
||||||
ref="consideredAgencyRef"
|
ref="consideredAgencyRef"
|
||||||
for="selectAgency"
|
for="selectAgency"
|
||||||
|
|
@ -600,7 +600,7 @@ onMounted(async () => {
|
||||||
</q-item>
|
</q-item>
|
||||||
</template>
|
</template>
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="formData.respondentType !== 'ORGANIZATION'"
|
v-if="formData.respondentType !== 'ORGANIZATION'"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue