no message
This commit is contained in:
parent
7dbbfd5fcf
commit
fd1f5ce8e4
5 changed files with 140 additions and 31 deletions
|
|
@ -3,12 +3,19 @@
|
||||||
*/
|
*/
|
||||||
import env from "../index";
|
import env from "../index";
|
||||||
const insignia = `${env.API_URI}/insignia`;
|
const insignia = `${env.API_URI}/insignia`;
|
||||||
|
const Organization = `${env.API_URI}/Organization`
|
||||||
export default {
|
export default {
|
||||||
getRoundInsignia: (id: string) => `${insignia}/period/${id}`,
|
getRoundInsignia: (id: string) => `${insignia}/period/${id}`,
|
||||||
listRoundInsignia: (type: string) => `${insignia}/period/${type}`,
|
listRoundInsignia: (type: string) => `${insignia}/period/${type}`,
|
||||||
editRoundInsignia: (id: string) => `${insignia}/period/${id}`,
|
editRoundInsignia: (id: string) => `${insignia}/period/${id}`,
|
||||||
RoundInsignia: (id: string) => `${insignia}/period/${id}`,
|
RoundInsignia: (id: string) => `${insignia}/period/${id}`,
|
||||||
|
requestInsignia: (insigniaPeriodId: string) => `${insignia}/request/${insigniaPeriodId}`,
|
||||||
|
// Type
|
||||||
|
typeOc: () => `${Organization}/history/type/หน่วยงาน`,
|
||||||
|
|
||||||
|
|
||||||
// manage
|
// manage
|
||||||
insigniaManage: (type: string) => `${insignia}/manage/${type}`,
|
insigniaManage: (type: string) => `${insignia}/manage/${type}`,
|
||||||
|
insigniaList: (insigniaPeriodId: any, ocId: string, role: string, status: any) => `${insignia}/request/${insigniaPeriodId}/${ocId}/${role}/${status}`
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ const {
|
||||||
dateToISO,
|
dateToISO,
|
||||||
showLoader,
|
showLoader,
|
||||||
hideLoader,
|
hideLoader,
|
||||||
|
dialogConfirm,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const $q = useQuasar(); //ใช้ noti quasar
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
|
|
@ -232,6 +233,32 @@ const clickProposals = (file: string) => {
|
||||||
window.open(file);
|
window.open(file);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const clickListInsignia = async (propsId: string) => {
|
||||||
|
dialogConfirm(
|
||||||
|
$q,
|
||||||
|
async () => {
|
||||||
|
await getRequest(propsId);
|
||||||
|
},
|
||||||
|
"ยืนยันการคำนวณราชชื่อผู้ได้รับเครื่องราช",
|
||||||
|
"ต้องการยืนยันการคำนวณราชชื่อผู้ได้รับเครื่องราชนี้หรือไม่ ?"
|
||||||
|
);
|
||||||
|
};
|
||||||
|
const getRequest = async (id: string) => {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.requestInsignia(id))
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
success($q, "ยืนยันสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
await fetchData();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// ค้นหาในตาราง
|
// ค้นหาในตาราง
|
||||||
const filterKeyword = ref<string>("");
|
const filterKeyword = ref<string>("");
|
||||||
|
|
@ -338,6 +365,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
||||||
</q-th>
|
</q-th>
|
||||||
<q-th auto-width />
|
<q-th auto-width />
|
||||||
<q-th auto-width />
|
<q-th auto-width />
|
||||||
|
<q-th auto-width />
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
|
|
@ -390,6 +418,19 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
||||||
@click="clickEdit(props.row)"
|
@click="clickEdit(props.row)"
|
||||||
/>
|
/>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
<q-td auto-width>
|
||||||
|
<q-btn
|
||||||
|
dense
|
||||||
|
size="12px"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="primary"
|
||||||
|
@click="clickListInsignia(props.row.id)"
|
||||||
|
icon="mdi-account-star"
|
||||||
|
>
|
||||||
|
<q-tooltip>ผู้ได้รับเครื่องราชฯ</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
</q-td>
|
||||||
<q-td auto-width>
|
<q-td auto-width>
|
||||||
<q-btn
|
<q-btn
|
||||||
dense
|
dense
|
||||||
|
|
@ -436,8 +477,6 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
||||||
</q-card>
|
</q-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<style lang="scss" scope>
|
<style lang="scss" scope>
|
||||||
.filter-card {
|
.filter-card {
|
||||||
background-color: #f1f1f1b0;
|
background-color: #f1f1f1b0;
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,14 @@ import { onMounted, ref, watch } from "vue";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
|
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogRemove, dialogConfirm } = mixin;
|
const { dialogRemove, dialogConfirm } = mixin;
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
const DataStore = useInsigniaDataStore();
|
||||||
|
|
||||||
const modalNote = ref<boolean>(false);
|
const modalNote = ref<boolean>(false);
|
||||||
const organization = ref<number>(1);
|
const organization = ref<number>(1);
|
||||||
|
|
@ -187,6 +191,39 @@ const titleModal = ref<string>("");
|
||||||
const actionModal = ref<string>("");
|
const actionModal = ref<string>("");
|
||||||
const person = ref<any>([]);
|
const person = ref<any>([]);
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
tab: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
roundId: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
onMounted(async () => {
|
||||||
|
console.log(props);
|
||||||
|
|
||||||
|
organizationOptions.value = DataStore.optionsTypeOc;
|
||||||
|
console.log(organizationOptions.value);
|
||||||
|
await fecthInsignia();
|
||||||
|
});
|
||||||
|
|
||||||
|
const fecthInsignia = async () => {
|
||||||
|
for (const item of DataStore.optionsTypeOc) {
|
||||||
|
console.log(item.index);
|
||||||
|
|
||||||
|
// await http
|
||||||
|
// .get(
|
||||||
|
// config.API.insigniaList(props.roundId, item["id"], "officer", props.tab)
|
||||||
|
// )
|
||||||
|
// .then((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// })
|
||||||
|
// .catch((err) => {
|
||||||
|
// console.log(err);
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const clickAction = (props: any, action: string) => {
|
const clickAction = (props: any, action: string) => {
|
||||||
Note.value = "";
|
Note.value = "";
|
||||||
person.value = props;
|
person.value = props;
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,12 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref, watch } from "vue";
|
import { onMounted, ref, watch } from "vue";
|
||||||
import type { QTableProps } from "quasar";
|
|
||||||
import type {
|
|
||||||
FormMainProbation,
|
|
||||||
FormMainProbation2,
|
|
||||||
} from "@/modules/05_placement/interface/request/Main";
|
|
||||||
import type { DataOption1 } from "@/modules/05_placement/interface/index/Main";
|
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import DialogHeader from "@/modules/07_insignia/components/DialogHeader.vue";
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import type { resMain } from "@/modules/06_retirement/interface/response/Main";
|
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||||
|
|
||||||
import cardTop from "@/modules/07_insignia/components/2_Manage/StatCard.vue";
|
import cardTop from "@/modules/07_insignia/components/2_Manage/StatCard.vue";
|
||||||
import tab1 from "@/modules/07_insignia/components/2_Manage/Tab1.vue";
|
import tab1 from "@/modules/07_insignia/components/2_Manage/Tab1.vue";
|
||||||
|
|
@ -20,20 +14,20 @@ import tab2 from "@/modules/07_insignia/components/2_Manage/Tab2.vue";
|
||||||
import tab3 from "@/modules/07_insignia/components/2_Manage/Tab3.vue";
|
import tab3 from "@/modules/07_insignia/components/2_Manage/Tab3.vue";
|
||||||
import tab4 from "@/modules/07_insignia/components/2_Manage/Tab4.vue";
|
import tab4 from "@/modules/07_insignia/components/2_Manage/Tab4.vue";
|
||||||
|
|
||||||
const Note = ref<string>("");
|
const DataStore = useInsigniaDataStore();
|
||||||
const addNote = ref<boolean>(false);
|
|
||||||
const saveWriteNote = ref<any[]>([]);
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { messageError, date2Thai, showLoader, hideLoader, dialogMessage } =
|
const { messageError, date2Thai, showLoader, hideLoader, dialogMessage } =
|
||||||
mixin;
|
mixin;
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const $q = useQuasar(); //ใช้ noti quasar
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
|
|
||||||
|
const loading = ref<boolean>(false);
|
||||||
const round = ref<string>("");
|
const round = ref<string>("");
|
||||||
|
const optionRound = ref<any>([]);
|
||||||
|
// const typeOc = ref<string>("kljkljk");
|
||||||
|
const optiontypeOc = ref<any>([]);
|
||||||
|
|
||||||
const optionRound = ref<DataOption1[]>([]);
|
const tab = ref<any>("pending");
|
||||||
|
|
||||||
const tab = ref<any>("haveInsignia");
|
|
||||||
const stat = ref<any>({
|
const stat = ref<any>({
|
||||||
total: 0,
|
total: 0,
|
||||||
sendName: 0,
|
sendName: 0,
|
||||||
|
|
@ -42,20 +36,48 @@ const stat = ref<any>({
|
||||||
disclaim: 0,
|
disclaim: 0,
|
||||||
});
|
});
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
console.log(DataStore.optionsTypeOc);
|
||||||
|
|
||||||
await fecthlistRound();
|
await fecthlistRound();
|
||||||
|
await fecthType();
|
||||||
});
|
});
|
||||||
const fecthlistRound = async () => {
|
const fecthlistRound = async () => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.listRoundInsignia("insignia"))
|
.get(config.API.listRoundInsignia("insignia"))
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
optionRound.value = res.data.result.map((e) => ({
|
optionRound.value = res.data.result.map((e: any) => ({
|
||||||
id: e.period_id,
|
id: e.period_id,
|
||||||
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);
|
||||||
|
// const lastIndex = optionRound.value.length;
|
||||||
|
const lastValue = optionRound.value[0];
|
||||||
|
round.value = lastValue.id.toString();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
// messageError($q, err);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const fecthType = async () => {
|
||||||
|
await http
|
||||||
|
.get(config.API.typeOc())
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
optiontypeOc.value = res.data.result.map((e: any) => ({
|
||||||
|
id: e.organizationId,
|
||||||
|
name: e.organizationName,
|
||||||
|
}));
|
||||||
|
console.log(typeof optiontypeOc.value);
|
||||||
|
DataStore.optionsTypeOc = optiontypeOc.value;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
// messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
loading.value = true;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -105,7 +127,7 @@ const fecthlistRound = async () => {
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
<q-card flat bordered class="col-12 q-mt-sm">
|
<q-card flat bordered class="col-12 q-mt-sm" v-if="loading">
|
||||||
<div class="row col-12">
|
<div class="row col-12">
|
||||||
<q-tabs
|
<q-tabs
|
||||||
v-model="tab"
|
v-model="tab"
|
||||||
|
|
@ -116,25 +138,25 @@ const fecthlistRound = async () => {
|
||||||
indicator-color="primary"
|
indicator-color="primary"
|
||||||
align="left"
|
align="left"
|
||||||
>
|
>
|
||||||
<q-tab name="haveInsignia" label="ผู้ที่ได้รับพระราชทานเครื่องราชฯ" />
|
<q-tab name="pending" label="ผู้ที่ได้รับพระราชทานเครื่องราชฯ" />
|
||||||
<q-tab name="personNotapply" label="คนที่ไม่ยื่นขอ" />
|
<q-tab name="reject" label="คนที่ไม่ยื่นขอ" />
|
||||||
<q-tab name="personRemoved" label="คนที่ถูกลบออก" />
|
<q-tab name="delete" label="คนที่ถูกลบออก" />
|
||||||
<q-tab name="nonInsignia" label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ" />
|
<q-tab name="organization" label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ" />
|
||||||
</q-tabs>
|
</q-tabs>
|
||||||
</div>
|
</div>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-tab-panels v-model="tab" animated>
|
<q-tab-panels v-model="tab" animated>
|
||||||
<q-tab-panel name="haveInsignia">
|
<q-tab-panel name="pending">
|
||||||
<tab1 />
|
<tab1 :tab="tab" :roundId="round" />
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
<q-tab-panel name="personNotapply">
|
<q-tab-panel name="reject">
|
||||||
<tab2 />
|
<tab2 :tab="tab" />
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
<q-tab-panel name="personRemoved">
|
<q-tab-panel name="delete">
|
||||||
<tab3 />
|
<tab3 :tab="tab" />
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
<q-tab-panel name="nonInsignia">
|
<q-tab-panel name="organization">
|
||||||
<tab4 />
|
<tab4 :tab="tab" />
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
</q-tab-panels>
|
</q-tab-panels>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
|
import { ref, } from "vue";
|
||||||
|
|
||||||
export const useInsigniaDataStore = defineStore("insignia", () => {
|
export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
return {};
|
let optionsTypeOc = ref<any>([]);
|
||||||
|
return {
|
||||||
|
optionsTypeOc
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue