Merge branch 'develop' into dev-tee

This commit is contained in:
setthawutttty 2023-08-22 17:07:10 +07:00
commit bfaf2bfccc
5 changed files with 43 additions and 43 deletions

View file

@ -92,7 +92,6 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
}, },
{ {
name: "insigniaType", name: "insigniaType",
align: "left", align: "left",
@ -175,7 +174,6 @@ const Note = ref<string>("");
const titleModal = ref<string>(""); const titleModal = ref<string>("");
const actionModal = ref<string>(""); const actionModal = ref<string>("");
const person = ref<any>([]); const person = ref<any>([]);
const props = defineProps({ const props = defineProps({
tab: { tab: {
type: String, type: String,
@ -192,12 +190,11 @@ const props = defineProps({
}); });
onMounted(async () => { onMounted(async () => {
if (DataStore.typeOc == "") {
organization.value = DataStore.optionsTypeOc[2].id;
DataStore.typeOc = organization.value;
} else organization.value = DataStore.typeOc;
organizationOptions.value = DataStore.optionsTypeOc; organizationOptions.value = DataStore.optionsTypeOc;
organization.value = organizationOptions.value[2].id;
DataStore.typeOc = organization.value;
// if (props.fecthInsigniaAll) {
// await props.fecthInsigniaAll(props.roundId, props.tab);
// }
if (organization.value !== "" || organization.value !== undefined) { if (organization.value !== "" || organization.value !== undefined) {
if (props.fecthInsigniaByOc) { if (props.fecthInsigniaByOc) {
props.fecthInsigniaByOc( props.fecthInsigniaByOc(
@ -218,6 +215,7 @@ const changtypeOc = () => {
props.tab props.tab
); );
} }
DataStore.typeOc = organization.value;
}; };
const clickmodalAdd = () => { const clickmodalAdd = () => {
showLoader(); showLoader();
@ -324,8 +322,8 @@ const addlistperson = async (id: string) => {
// modalNote.value = true; // modalNote.value = true;
// }; // };
const clickmodalEdit = (props: any) => { const clickmodalEdit = (props: any) => {
insignia.value = ""; insignia.value = props.insigniaSend;
insigniaType.value = ""; insigniaType.value = props.insigniaLevel;
person.value = props; person.value = props;
console.log(person.value); console.log(person.value);
modalEdit.value = true; modalEdit.value = true;
@ -616,9 +614,8 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
{{ props.row.level }} {{ props.row.level }}
</q-td> </q-td>
<q-td key="salary" :props="props"> <q-td key="salary" :props="props">
{{ props.row.salary }} {{ Number(props.row.salary).toLocaleString() }}
</q-td> </q-td>
<q-td key="insigniaType" :props="props"> <q-td key="insigniaType" :props="props">
{{ props.row.insigniaType }} {{ props.row.insigniaType }}
</q-td> </q-td>

View file

@ -133,8 +133,7 @@ const columns = ref<QTableProps["columns"]>([
onMounted(async () => { onMounted(async () => {
organizationOptions.value = DataStore.optionsTypeOc; organizationOptions.value = DataStore.optionsTypeOc;
organization.value = organizationOptions.value[0].id; organization.value = DataStore.typeOc;
DataStore.typeOc = organization.value;
// if (props.fecthInsigniaAll) { // if (props.fecthInsigniaAll) {
// await props.fecthInsigniaAll(props.roundId, props.tab); // await props.fecthInsigniaAll(props.roundId, props.tab);
// } // }
@ -158,6 +157,7 @@ const changtypeOc = () => {
props.tab props.tab
); );
} }
DataStore.typeOc = organization.value;
}; };
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");

View file

@ -129,8 +129,7 @@ const columns = ref<QTableProps["columns"]>([
]); ]);
onMounted(async () => { onMounted(async () => {
organizationOptions.value = DataStore.optionsTypeOc; organizationOptions.value = DataStore.optionsTypeOc;
organization.value = organizationOptions.value[0].id; organization.value = DataStore.typeOc;
DataStore.typeOc = organization.value;
// if (props.fecthInsigniaAll) { // if (props.fecthInsigniaAll) {
// await props.fecthInsigniaAll(props.roundId, props.tab); // await props.fecthInsigniaAll(props.roundId, props.tab);
// } // }
@ -154,6 +153,7 @@ const changtypeOc = () => {
props.tab props.tab
); );
} }
DataStore.typeOc = organization.value;
}; };
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");

View file

@ -48,7 +48,7 @@ const fecthlistRound = async () => {
year: e.period_year, year: e.period_year,
name: `รอบการเสนอพระราชทานเครื่องราช ${e.period_name} ปี ${e.period_year} `, name: `รอบการเสนอพระราชทานเครื่องราช ${e.period_name} ปี ${e.period_year} `,
})); }));
console.log(optionRound.value); // console.log(optionRound.value);
// const lastIndex = optionRound.value.length; // const lastIndex = optionRound.value.length;
const lastValue = optionRound.value[0]; const lastValue = optionRound.value[0];
round.value = lastValue.id.toString(); round.value = lastValue.id.toString();
@ -95,21 +95,21 @@ const changround = () => {
fecthStat(round.value); fecthStat(round.value);
fecthInsigniaByOc(round.value, DataStore.typeOc, "officer", tab.value); fecthInsigniaByOc(round.value, DataStore.typeOc, "officer", tab.value);
}; };
const fecthInsigniaAll = async (periodId: string, tab: string) => { // const fecthInsigniaAll = async (periodId: string, tab: string) => {
// let data: any = []; // // let data: any = [];
// for (const item of DataStore.optionsTypeOc) { // // for (const item of DataStore.optionsTypeOc) {
// await http // // await http
// .get(config.API.insigniaList(periodId, item["id"], "officer", tab)) // // .get(config.API.insigniaList(periodId, item["id"], "officer", tab))
// .then((res) => { // // .then((res) => {
// // console.log(res); // // // console.log(res);
// data.push(res.data.result); // // data.push(res.data.result);
// }) // // })
// .catch((err) => { // // .catch((err) => {
// console.log(err); // // console.log(err);
// }); // // });
// } // // }
// console.log(data); // // console.log(data);
}; // };
const fecthInsigniaByOc = async ( const fecthInsigniaByOc = async (
roundId: string, roundId: string,
ocId: string, ocId: string,
@ -204,7 +204,6 @@ const fecthInsigniaByOc = async (
<tab1 <tab1
:tab="tab" :tab="tab"
:roundId="round" :roundId="round"
:fecthInsigniaAll="fecthInsigniaAll"
:fecthInsigniaByOc="fecthInsigniaByOc" :fecthInsigniaByOc="fecthInsigniaByOc"
/> />
</q-tab-panel> </q-tab-panel>
@ -212,7 +211,6 @@ const fecthInsigniaByOc = async (
<tab2 <tab2
:tab="tab" :tab="tab"
:roundId="round" :roundId="round"
:fecthInsigniaAll="fecthInsigniaAll"
:fecthInsigniaByOc="fecthInsigniaByOc" :fecthInsigniaByOc="fecthInsigniaByOc"
/> />
</q-tab-panel> </q-tab-panel>
@ -220,7 +218,6 @@ const fecthInsigniaByOc = async (
<tab3 <tab3
:tab="tab" :tab="tab"
:roundId="round" :roundId="round"
:fecthInsigniaAll="fecthInsigniaAll"
:fecthInsigniaByOc="fecthInsigniaByOc" :fecthInsigniaByOc="fecthInsigniaByOc"
/> />
</q-tab-panel> </q-tab-panel>

View file

@ -26,8 +26,8 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
name: e.fullName, name: e.fullName,
position: e.position, position: e.position,
level: e.rank, level: e.rank,
salary2: e.salary, salary: e.salary,
salary: Number(e.salary).toLocaleString(), salary2: Number(e.salary).toLocaleString(),
insigniaType: e.lastInsignia, insigniaType: e.lastInsignia,
insigniaSend: e.requestInsignia, insigniaSend: e.requestInsignia,
insigniaLevel: e.level, insigniaLevel: e.level,
@ -41,13 +41,19 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
} }
const filtertypeInsignia = async () => { const filtertypeInsignia = async () => {
typeinsignia.value = "all" typeinsignia.value = "all"
for (const data of listinsignia.value) { if (listinsignia.value.length !== 0) {
const Type = data.insigniaType; const double_name = [
if (Type !== null && !typeinsigniaValues.has(Type)) { ...new Set(listinsignia.value.map((item: any) => item.insigniaType)),
typeinsigniaOptions.value.push({ id: Type, name: Type }) ];
typeinsigniaValues.add(Type); for (let i = 1; i <= double_name.length; i++) {
const type = double_name[i - 1];
const listtype = {
id: type,
name: type,
};
typeinsigniaOptions.value.push(listtype)
} }
} } else typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }]
}; };
const searchFilterTable = async () => { const searchFilterTable = async () => {
if (typeinsignia.value !== undefined && typeinsignia.value !== null) { if (typeinsignia.value !== undefined && typeinsignia.value !== null) {