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";
|
||||
const insignia = `${env.API_URI}/insignia`;
|
||||
const Organization = `${env.API_URI}/Organization`
|
||||
export default {
|
||||
getRoundInsignia: (id: string) => `${insignia}/period/${id}`,
|
||||
listRoundInsignia: (type: string) => `${insignia}/period/${type}`,
|
||||
editRoundInsignia: (id: string) => `${insignia}/period/${id}`,
|
||||
RoundInsignia: (id: string) => `${insignia}/period/${id}`,
|
||||
requestInsignia: (insigniaPeriodId: string) => `${insignia}/request/${insigniaPeriodId}`,
|
||||
// Type
|
||||
typeOc: () => `${Organization}/history/type/หน่วยงาน`,
|
||||
|
||||
|
||||
// manage
|
||||
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,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
|
|
@ -232,6 +233,32 @@ const clickProposals = (file: string) => {
|
|||
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>("");
|
||||
|
|
@ -338,6 +365,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
</q-th>
|
||||
<q-th auto-width />
|
||||
<q-th auto-width />
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
|
|
@ -390,6 +418,19 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
@click="clickEdit(props.row)"
|
||||
/>
|
||||
</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-btn
|
||||
dense
|
||||
|
|
@ -436,8 +477,6 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
</q-card>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<style lang="scss" scope>
|
||||
.filter-card {
|
||||
background-color: #f1f1f1b0;
|
||||
|
|
|
|||
|
|
@ -3,10 +3,14 @@ import { onMounted, ref, watch } from "vue";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } 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 { dialogRemove, dialogConfirm } = mixin;
|
||||
const $q = useQuasar();
|
||||
const DataStore = useInsigniaDataStore();
|
||||
|
||||
const modalNote = ref<boolean>(false);
|
||||
const organization = ref<number>(1);
|
||||
|
|
@ -187,6 +191,39 @@ const titleModal = ref<string>("");
|
|||
const actionModal = ref<string>("");
|
||||
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) => {
|
||||
Note.value = "";
|
||||
person.value = props;
|
||||
|
|
|
|||
|
|
@ -1,18 +1,12 @@
|
|||
<script setup lang="ts">
|
||||
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 { useRouter } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import DialogHeader from "@/modules/07_insignia/components/DialogHeader.vue";
|
||||
|
||||
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 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 tab4 from "@/modules/07_insignia/components/2_Manage/Tab4.vue";
|
||||
|
||||
const Note = ref<string>("");
|
||||
const addNote = ref<boolean>(false);
|
||||
const saveWriteNote = ref<any[]>([]);
|
||||
const DataStore = useInsigniaDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, date2Thai, showLoader, hideLoader, dialogMessage } =
|
||||
mixin;
|
||||
const router = useRouter();
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
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>("haveInsignia");
|
||||
const tab = ref<any>("pending");
|
||||
const stat = ref<any>({
|
||||
total: 0,
|
||||
sendName: 0,
|
||||
|
|
@ -42,20 +36,48 @@ const stat = ref<any>({
|
|||
disclaim: 0,
|
||||
});
|
||||
onMounted(async () => {
|
||||
console.log(DataStore.optionsTypeOc);
|
||||
|
||||
await fecthlistRound();
|
||||
await fecthType();
|
||||
});
|
||||
const fecthlistRound = async () => {
|
||||
await http
|
||||
.get(config.API.listRoundInsignia("insignia"))
|
||||
.then((res: any) => {
|
||||
optionRound.value = res.data.result.map((e) => ({
|
||||
optionRound.value = res.data.result.map((e: any) => ({
|
||||
id: e.period_id,
|
||||
year: 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) => {
|
||||
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>
|
||||
|
|
@ -105,7 +127,7 @@ const fecthlistRound = async () => {
|
|||
</div>
|
||||
</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">
|
||||
<q-tabs
|
||||
v-model="tab"
|
||||
|
|
@ -116,25 +138,25 @@ const fecthlistRound = async () => {
|
|||
indicator-color="primary"
|
||||
align="left"
|
||||
>
|
||||
<q-tab name="haveInsignia" label="ผู้ที่ได้รับพระราชทานเครื่องราชฯ" />
|
||||
<q-tab name="personNotapply" label="คนที่ไม่ยื่นขอ" />
|
||||
<q-tab name="personRemoved" label="คนที่ถูกลบออก" />
|
||||
<q-tab name="nonInsignia" label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ" />
|
||||
<q-tab name="pending" label="ผู้ที่ได้รับพระราชทานเครื่องราชฯ" />
|
||||
<q-tab name="reject" label="คนที่ไม่ยื่นขอ" />
|
||||
<q-tab name="delete" label="คนที่ถูกลบออก" />
|
||||
<q-tab name="organization" label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ" />
|
||||
</q-tabs>
|
||||
</div>
|
||||
<q-separator />
|
||||
<q-tab-panels v-model="tab" animated>
|
||||
<q-tab-panel name="haveInsignia">
|
||||
<tab1 />
|
||||
<q-tab-panel name="pending">
|
||||
<tab1 :tab="tab" :roundId="round" />
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="personNotapply">
|
||||
<tab2 />
|
||||
<q-tab-panel name="reject">
|
||||
<tab2 :tab="tab" />
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="personRemoved">
|
||||
<tab3 />
|
||||
<q-tab-panel name="delete">
|
||||
<tab3 :tab="tab" />
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="nonInsignia">
|
||||
<tab4 />
|
||||
<q-tab-panel name="organization">
|
||||
<tab4 :tab="tab" />
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</q-card>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref, } from "vue";
|
||||
|
||||
export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||
return {};
|
||||
let optionsTypeOc = ref<any>([]);
|
||||
return {
|
||||
optionsTypeOc
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue