fixing insignia
This commit is contained in:
parent
dea45644d0
commit
cc1927a2f4
8 changed files with 64 additions and 54 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref, computed, reactive, watch } from "vue";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import { useQuasar, QForm, is } from "quasar";
|
||||
|
||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
|
@ -77,6 +77,7 @@ const modalEdit = ref<boolean>(false); //popup แก้ไขเครื่อ
|
|||
const modalPersonal = ref<boolean>(false); //popup ข้อมูลราชการ
|
||||
const rowid = ref<string>(""); // id ที่ต้องการ
|
||||
const organization = ref<string>(""); //หน่วยงาน
|
||||
const isDeputy = ref<boolean>(false); //เลือกสำนักปลัดหรือไม่
|
||||
|
||||
/** หมายเหตุ*/
|
||||
const dialogNote = ref<boolean>(false); //หมายเหตุ
|
||||
|
|
@ -315,13 +316,17 @@ const checkStatus = computed(() => {
|
|||
});
|
||||
|
||||
/** เลือกหน่วยงาน*/
|
||||
function changtypeOc() {
|
||||
async function changtypeOc() {
|
||||
if (organization.value !== null) {
|
||||
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === organization.value && v.isDeputy === true
|
||||
) > -1);
|
||||
props.fecthInsigniaByOc?.(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
}
|
||||
DataStore.typeOc = organization.value;
|
||||
|
|
@ -441,7 +446,8 @@ async function addlistperson(id: string) {
|
|||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
}
|
||||
modalAdd.value = false;
|
||||
|
|
@ -536,7 +542,8 @@ async function clickSave() {
|
|||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
success($q, "แก้ไขเครื่องราชฯ ที่ยื่นขอสำเร็จ");
|
||||
modalEdit.value = false;
|
||||
|
|
@ -589,7 +596,8 @@ async function listreject(profileId: string, reason: string) {
|
|||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
|
|
@ -646,7 +654,8 @@ async function listdelete(id: string, reason: string) {
|
|||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closemodelPopupDelete();
|
||||
|
|
@ -884,11 +893,16 @@ onMounted(async () => {
|
|||
|
||||
if (organization.value !== "" || organization.value !== undefined) {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === organization.value && v.isDeputy === true
|
||||
) > -1);
|
||||
|
||||
props.fecthInsigniaByOc(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
DataStore.mainTab = props.tab;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import { onMounted, ref, watch } from "vue";
|
|||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||
import { useroleUserDataStore } from "@/stores/roleUser";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** import Type*/
|
||||
|
|
@ -17,7 +16,6 @@ import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
|||
const mixin = useCounterMixin();
|
||||
const { onSearchDataTable } = mixin;
|
||||
/** useStore*/
|
||||
const roleDataStore = useroleUserDataStore();
|
||||
const DataStore = useInsigniaDataStore();
|
||||
const props = defineProps({
|
||||
tab: {
|
||||
|
|
@ -38,6 +36,7 @@ const organization = ref<string>("1");
|
|||
const filterOrganizationOP = ref<OptionData[]>([]); //หน่วยงาน
|
||||
const typeinsigniaOptions = ref<OptionData[]>(DataStore.typeinsigniaOptions); //ประเภทเครื่องราย
|
||||
const employeeClassOps = ref<OptionData[]>(DataStore.employeeClassOps); //ประเภทข้ารายกาช
|
||||
const isDeputy = ref<boolean>(false); //เลือกสำนักปลัดหรือไม่
|
||||
|
||||
/** หัวตาราง*/
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -156,13 +155,18 @@ const visibleColumns = ref<string[]>([
|
|||
]);
|
||||
|
||||
/** function เลือกหน่วยงาน */
|
||||
function changtypeOc() {
|
||||
async function changtypeOc() {
|
||||
if (organization.value !== null) {
|
||||
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === organization.value && v.isDeputy === true
|
||||
) > -1);
|
||||
|
||||
props.fecthInsigniaByOc?.(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
}
|
||||
DataStore.typeOc = organization.value;
|
||||
|
|
@ -268,11 +272,16 @@ onMounted(async () => {
|
|||
organization.value = await DataStore.typeOc;
|
||||
if (organization.value !== "" || organization.value !== undefined) {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
await props.fecthInsigniaByOc(
|
||||
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === organization.value && v.isDeputy === true
|
||||
) > -1);
|
||||
|
||||
props.fecthInsigniaByOc(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
DataStore.mainTab = props.tab;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ const typeinsigniaOptions = ref<OptionData[]>(DataStore.typeinsigniaOptions); //
|
|||
const employeeClassOps = ref<OptionData[]>(DataStore.employeeClassOps); //ประเภทข้ารายกาช
|
||||
const filterOrganizationOP = ref<OptionData[]>([]); // //หน่วยงาน
|
||||
const organization = ref<string>("1");
|
||||
const organizationOptions = ref<OptionData[]>([{ id: "1", name: "ทั้งหมด" }]);
|
||||
const isDeputy = ref<boolean>(false); //เลือกสำนักปลัดหรือไม่
|
||||
|
||||
/** หัวตาราง*/
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -158,11 +158,16 @@ const visibleColumns = ref<string[]>([
|
|||
/** function เลือกหน่วยงาน */
|
||||
async function changtypeOc() {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
await props.fecthInsigniaByOc(
|
||||
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === organization.value && v.isDeputy === true
|
||||
) > -1);
|
||||
|
||||
props.fecthInsigniaByOc(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
}
|
||||
DataStore.typeOc = organization.value;
|
||||
|
|
@ -277,11 +282,16 @@ onMounted(async () => {
|
|||
organization.value = await DataStore.typeOc;
|
||||
if (organization.value !== "" || organization.value !== undefined) {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
await props.fecthInsigniaByOc(
|
||||
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
||||
(v: OptionData) => v.id === organization.value && v.isDeputy === true
|
||||
) > -1);
|
||||
|
||||
props.fecthInsigniaByOc(
|
||||
props.roundId,
|
||||
organization.value,
|
||||
"officer",
|
||||
props.tab
|
||||
props.tab,
|
||||
isDeputy.value
|
||||
);
|
||||
DataStore.mainTab = props.tab;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
interface OptionData {
|
||||
id: string | number;
|
||||
name: string;
|
||||
isDeputy?: boolean;
|
||||
}
|
||||
|
||||
interface OptionDataList {
|
||||
id:string
|
||||
id: string;
|
||||
val: string | number;
|
||||
name: string;
|
||||
}
|
||||
|
|
@ -233,5 +234,5 @@ export type {
|
|||
Pagination,
|
||||
DataManageList,
|
||||
ResOrg,
|
||||
OptionDataList
|
||||
OptionDataList,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ async function fetchListOrg(id: string) {
|
|||
(item: DataStructureTree) => ({
|
||||
id: item.orgTreeId,
|
||||
name: item.orgName,
|
||||
isDeputy: item.isDeputy,
|
||||
})
|
||||
);
|
||||
|
||||
|
|
@ -231,13 +232,14 @@ async function fecthInsigniaByOc(
|
|||
roundId: string,
|
||||
ocId: string,
|
||||
role: string,
|
||||
status: string
|
||||
status: string,
|
||||
isDeputy: boolean = false
|
||||
) {
|
||||
DataStore.rows = [];
|
||||
if (roundId && ocId && role && status) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.insigniaList(roundId, ocId, role, status))
|
||||
.get(config.API.insigniaList(roundId, ocId, role, status, isDeputy))
|
||||
.then(async (res) => {
|
||||
requestNote.value = res.data.result.requestNote;
|
||||
requestStatus.value = res.data.result.requestStatus;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue