no message
This commit is contained in:
parent
906b948ad8
commit
adfc25b38b
3 changed files with 60 additions and 49 deletions
|
|
@ -1,11 +1,13 @@
|
|||
<script setup lang="ts">
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import Form from "@/modules/11_discipline/components/1_Complaint/Form.vue";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
// บันทึกข้อมูล
|
||||
const onSubmit = async () => {
|
||||
// post
|
||||
/** บันทึกข้อมูล */
|
||||
async function onSubmit () {
|
||||
|
||||
/** post */
|
||||
console.log("add");
|
||||
router.push(`/discipline/complaints`);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,15 +3,44 @@ import { ref, onMounted, reactive, watch } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
// import Type
|
||||
/** import Type */
|
||||
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
|
||||
import type {
|
||||
FormData,
|
||||
MyObjectComplaintsRef,
|
||||
} from "@/modules/11_discipline/interface/request/complaint";
|
||||
// importStroe
|
||||
|
||||
/** importStroe*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, dialogConfirm } = mixin;
|
||||
const complainstStore = useComplainstDataStore();
|
||||
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
|
||||
const { selectComplainantTpye, filterSelector } = complainstStore; // function จาก store complainstStore
|
||||
|
||||
// validateForm
|
||||
const complainantTypeRef = ref<Object | null>(null);
|
||||
const complainantRef = ref<Object | null>(null);
|
||||
const officeRef = ref<Object | null>(null);
|
||||
const agencyRef = ref<Object | null>(null);
|
||||
const topicComplaintRef = ref<Object | null>(null);
|
||||
const detailRef = ref<Object | null>(null);
|
||||
const datereceiveRef = ref<Object | null>();
|
||||
const dateconsiderationRef = ref<Object | null>(null);
|
||||
const offenseDescriptionRef = ref<Object | null>(null);
|
||||
const considerationLevelRef = ref<Object | null>(null);
|
||||
const datewarnRef = ref<Object | null>(null);
|
||||
const receivecomplaintsRef = ref<Object | null>(null);
|
||||
const petitionerRef = ref<Object | null>(null);
|
||||
const filesRef = ref<Object | null>(null);
|
||||
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
|
|
@ -22,17 +51,26 @@ const props = defineProps({
|
|||
default: () => "",
|
||||
},
|
||||
});
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, dialogConfirm } = mixin; //function จาก stores หลัก
|
||||
|
||||
const complainstStore = useComplainstDataStore();
|
||||
const { selectComplainantTpye, filterSelector } = complainstStore; // function จาก store complainstStore
|
||||
/** ข้อมูล form*/
|
||||
const formData = reactive<FormData>({
|
||||
complainantType: "",
|
||||
complainant: "",
|
||||
office: "",
|
||||
agency: "",
|
||||
topicComplaint: "",
|
||||
detail: "",
|
||||
datereceive: null,
|
||||
dateconsideration: null,
|
||||
offenseDescription: "",
|
||||
considerationLevel: "",
|
||||
datewarn: null,
|
||||
receivecomplaints: "",
|
||||
petitioner: "",
|
||||
files: null,
|
||||
});
|
||||
|
||||
// options ทั้งหมด
|
||||
|
||||
|
||||
const offenseDescriptiontoptions = ref<DataOption[]>([
|
||||
{ id: "0", name: "ยังไม่ระบุ" },
|
||||
{ id: "1", name: "ไม่ร้ายแรง" },
|
||||
|
|
@ -52,24 +90,9 @@ const receivecomplaintstoptions = ref<DataOption[]>([
|
|||
{ id: "5", name: "โทรศัพท์" },
|
||||
{ id: "6", name: "บอกกล่าว" },
|
||||
]);
|
||||
// ข้อมูล form
|
||||
const formData = reactive<FormData>({
|
||||
complainantType: "",
|
||||
complainant: "",
|
||||
office: "",
|
||||
agency: "",
|
||||
topicComplaint: "",
|
||||
detail: "",
|
||||
datereceive: null,
|
||||
dateconsideration: null,
|
||||
offenseDescription: "",
|
||||
considerationLevel: "",
|
||||
datewarn: null,
|
||||
receivecomplaints: "",
|
||||
petitioner: "",
|
||||
files: null,
|
||||
});
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
|
||||
|
||||
|
||||
|
||||
// เลือกผู้ร้องเรียน
|
||||
async function selectComplainant(val: string) {
|
||||
|
|
@ -143,21 +166,7 @@ function selectLevel(val: string) {
|
|||
}
|
||||
}
|
||||
|
||||
// validateForm
|
||||
const complainantTypeRef = ref<Object | null>(null);
|
||||
const complainantRef = ref<Object | null>(null);
|
||||
const officeRef = ref<Object | null>(null);
|
||||
const agencyRef = ref<Object | null>(null);
|
||||
const topicComplaintRef = ref<Object | null>(null);
|
||||
const detailRef = ref<Object | null>(null);
|
||||
const datereceiveRef = ref<Object | null>();
|
||||
const dateconsiderationRef = ref<Object | null>(null);
|
||||
const offenseDescriptionRef = ref<Object | null>(null);
|
||||
const considerationLevelRef = ref<Object | null>(null);
|
||||
const datewarnRef = ref<Object | null>(null);
|
||||
const receivecomplaintsRef = ref<Object | null>(null);
|
||||
const petitionerRef = ref<Object | null>(null);
|
||||
const filesRef = ref<Object | null>(null);
|
||||
|
||||
|
||||
const objectComplaintsRef: MyObjectComplaintsRef = {
|
||||
complainantType: complainantTypeRef,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ onMounted(async () => {
|
|||
async function fetchListComplaints() {
|
||||
const listData: DataList[] = [
|
||||
{
|
||||
id:'001',
|
||||
id: "001",
|
||||
subject: "ทุจริตในหน้าที่",
|
||||
detail: "มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน",
|
||||
complainant: "นางศิรินภา คงน้อย",
|
||||
|
|
@ -35,7 +35,7 @@ async function fetchListComplaints() {
|
|||
considerationDeadlineDate: new Date("2023-12-02"),
|
||||
},
|
||||
{
|
||||
id:'002',
|
||||
id: "002",
|
||||
subject: "ทุจริตในหน้าที่",
|
||||
detail: "มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน",
|
||||
complainant: "นายแก้ว คำ",
|
||||
|
|
@ -45,7 +45,7 @@ async function fetchListComplaints() {
|
|||
considerationDeadlineDate: new Date("2023-12-02"),
|
||||
},
|
||||
{
|
||||
id:'003',
|
||||
id: "003",
|
||||
subject: "ทุจริตในหน้าที่",
|
||||
detail:
|
||||
"มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue