no message

This commit is contained in:
setthawutttty 2023-11-10 11:27:24 +07:00
parent 906b948ad8
commit adfc25b38b
3 changed files with 60 additions and 49 deletions

View file

@ -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,