เครื่องราช เพิ่ม ()

This commit is contained in:
setthawutttty 2023-10-25 12:54:49 +07:00
parent c91ad3092d
commit ff16be68f3
11 changed files with 120 additions and 74 deletions

View file

@ -130,7 +130,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "insigniaType",
align: "left",
label: "ประเภทเครื่องราชฯ ปัจจุบัน",
label: "ชั้นตราเครื่องราชฯ ปัจจุบัน",
sortable: true,
field: "insigniaType",
headerStyle: "font-size: 14px",

View file

@ -111,7 +111,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "insigniaType",
align: "left",
label: "ประเภทเครื่องราชฯ ปัจจุบัน",
label: "ชั้นตราเครื่องราชฯ ปัจจุบัน",
sortable: true,
field: "insigniaType",
headerStyle: "font-size: 14px",

View file

@ -111,7 +111,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "insigniaType",
align: "left",
label: "ประเภทเครื่องราชฯ ปัจจุบัน",
label: "ชั้นตราเครื่องราชฯ ปัจจุบัน",
sortable: true,
field: "insigniaType",
headerStyle: "font-size: 14px",

View file

@ -1,10 +1,11 @@
<script setup lang="ts">
import { ref, watch,onMounted } from "vue";
import { ref, watch, onMounted } from "vue";
import { QForm, useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import type { DataOption } from "@/modules/04_registry/components/profileType";
import type { ItemType } from "@/modules/07_insignia/interface/request/Main";
import DialogHeader from "@/components/DialogHeader.vue";
const $q = useQuasar();
@ -32,8 +33,9 @@ const listPerson = ref<any>([]);
const OrgList = ref<DataOption[]>([]);
const filterOrgList = ref<any>([]);
const insigniaNoteProfileId = ref<string>("");
const filterSelectRound = ref<any>()
const selectRound = ref<any>()
const filterSelectRound = ref<any>();
const selectRound = ref<any>();
const type = ref<any>();
//
const clearData = () => {
receivedate.value = null;
@ -70,19 +72,23 @@ const props = defineProps({
type: String,
},
selectRoundOption: {
type: Array,
type: Array,
},
filterSelectRoundOption: {
type: Array,
type: Array,
},
profileId: {
type: String,
default: "",
},
type: {
type: Array,
},
});
// props dialog
watch(props, () => {
type.value = props.type;
if (props.modal == true && props.roundId != "all") {
roundNo.value = props.roundId;
fecthlistInsignia();
@ -97,32 +103,31 @@ watch(props, () => {
//
const fecthlistInsignia = async () => {
if(roundNo.value !== ''&& roundNo.value !== null){
if (roundNo.value !== "" && roundNo.value !== null) {
showLoader();
let data = {
insigniaTypeId: props.typeId,
insigniaNoteId: roundNo.value,
insigniaId: "",
};
await http
.post(config.API.noteSearch(), data)
.then((res) => {
listPerson.value = res.data.result;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
cardid.value = "";
fullName.value = "";
brand.value = "";
OrganazationId.value = "";
reason.value = "";
hideLoader();
});
};
let data = {
insigniaTypeId: props.typeId,
insigniaNoteId: roundNo.value,
insigniaId: "",
};
await http
.post(config.API.noteSearch(), data)
.then((res) => {
listPerson.value = res.data.result;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
cardid.value = "";
fullName.value = "";
brand.value = "";
OrganazationId.value = "";
reason.value = "";
hideLoader();
});
}
};
//
const fetchOrgList = async () => {
@ -144,7 +149,7 @@ const fetchOrgList = async () => {
// ];
// } else {
OrgList.value = orgArr;
filterOrgList.value = OrgList.value
filterOrgList.value = OrgList.value;
// }
})
.catch((err) => {
@ -222,7 +227,11 @@ const searchcardid = async () => {
if (node) {
fullName.value = `${node.prefix} ${node.fullName}`;
brand.value = node.requestInsignia;
brand.value = `${node.requestInsignia} (${
type.value.find((item: any) => item.name === node.requestInsignia)
?.shortName || ""
})`;
insigniaNoteProfileId.value = node.id;
insigniaNoteProfileId.value = node.id;
} else {
notifyError($q, "ไม่พบข้อมูลการได้รับในรอบนี้");
@ -252,28 +261,27 @@ const clearReturnDate = () => {
const filterSelector = (val: any, update: Function, name: any) => {
update(() => {
const needle = val.toLowerCase();
if (name === 'filterOrgList') {
OrganazationId.value = ''
if (name === "filterOrgList") {
OrganazationId.value = "";
filterOrgList.value = OrgList.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
}
if (name === 'filterSelectRoundOption') {
roundNo.value = ''
if (name === "filterSelectRoundOption") {
roundNo.value = "";
filterSelectRound.value = selectRound.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
}
}
)
}
});
};
const setValue = () => {
filterSelectRound.value = props.filterSelectRoundOption
selectRound.value = props.selectRoundOption
}
filterSelectRound.value = props.filterSelectRoundOption;
selectRound.value = props.selectRoundOption;
};
onMounted(() => {
setValue();
});
setValue();
});
</script>
<template>

View file

@ -22,7 +22,7 @@ const selectRoundOption = ref<OptionDataYear[]>([]);
const filterSelectRoundOption = ref<any>([]);
const selectRoundAllOption = ref<OptionDataYear[]>([]);
const filterSelectRoundAllOption = ref<OptionDataYear[]>([]);
const type = ref<any[]>(DataStore.type)
const modal = ref<boolean>(false);
const action = ref<string>("");
const profileId = ref<string>("");
@ -578,7 +578,7 @@ const clearInsigniaFilters = (name: string) => {
</q-tab-panel>
</q-tab-panels>
<DialogForm :modal="modal" :close="close" :close-and-fecth="closeAndFecth"
<DialogForm :modal="modal" :close="close" :close-and-fecth="closeAndFecth" :type="type"
:round-id="selectRound == '0' ? 'all' : selectRound" :action="action" :profile-id="profileId"
v-model:selectRoundOption="selectRoundOption" v-model:filterSelectRoundOption="filterSelectRoundOption"
:type-id="tab" />