fixing remove import file
This commit is contained in:
parent
e541bbb6d2
commit
ed683d0bb3
24 changed files with 201 additions and 831 deletions
|
|
@ -140,6 +140,13 @@ interface RowDetailPositions {
|
|||
positionIsSelected: string;
|
||||
}
|
||||
|
||||
interface DataOption2 {
|
||||
id: string;
|
||||
name: string;
|
||||
note?: string;
|
||||
level?: number;
|
||||
}
|
||||
|
||||
interface NewPagination {
|
||||
descending: boolean;
|
||||
page: number;
|
||||
|
|
@ -147,9 +154,18 @@ interface NewPagination {
|
|||
sortBy: string;
|
||||
}
|
||||
|
||||
interface UploadType {
|
||||
id: string;
|
||||
fileName: string;
|
||||
fileSize: number;
|
||||
fileType: string;
|
||||
detail: string;
|
||||
}
|
||||
|
||||
export type {
|
||||
Pagination,
|
||||
DataOption,
|
||||
DataOption2,
|
||||
FormDataAgency,
|
||||
FormDataPosition,
|
||||
FormAgencyRef,
|
||||
|
|
@ -166,4 +182,5 @@ export type {
|
|||
NewPagination,
|
||||
DataDocument,
|
||||
DataOrgRevision,
|
||||
UploadType,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { ref, useAttrs } from "vue";
|
||||
import type { Pagination } from "@/modules/04_registry/interface/index/Main";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const table = ref<any>(null);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { ref, useAttrs } from "vue";
|
||||
|
||||
import HeaderTop from "@/modules/03_recruiting/components/top1.vue";
|
||||
import type { Pagination } from "@/modules/04_registry/interface/index/Main";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const table = ref<any>(null);
|
||||
|
|
|
|||
|
|
@ -254,14 +254,14 @@ const defaultEducation = ref<Education>({
|
|||
educationLevelHighId: null,
|
||||
});
|
||||
|
||||
async function changeData(system: String, val: any){
|
||||
async function changeData(system: String, val: any) {
|
||||
if (system == "information") defaultInformation.value = val;
|
||||
if (system == "address") defaultAddress.value = val;
|
||||
if (system == "famliy") defaultFamily.value = val;
|
||||
if (system == "occupation") defaultOccupation.value = val;
|
||||
if (system == "contact") defaultContact.value = val;
|
||||
if (system == "education") defaultEducation.value = val;
|
||||
};
|
||||
}
|
||||
|
||||
export {
|
||||
defaultInformation,
|
||||
|
|
|
|||
77
src/modules/03_recruiting/interface/request/Calendar.ts
Normal file
77
src/modules/03_recruiting/interface/request/Calendar.ts
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
interface DataNumObject {
|
||||
id: number;
|
||||
count: number;
|
||||
name: string;
|
||||
color: string;
|
||||
}
|
||||
|
||||
interface DataDateAddObject {
|
||||
year: number;
|
||||
holidayDate: Date | string;
|
||||
name: string;
|
||||
isSpecial: boolean;
|
||||
}
|
||||
|
||||
interface DataDateMonthObject {
|
||||
month: number;
|
||||
year: number;
|
||||
}
|
||||
|
||||
//ข้อมูล
|
||||
interface RequestItemsObject {
|
||||
createdAt?: Date;
|
||||
createdFullName: string;
|
||||
createdUserId: string;
|
||||
holidayDate: Date | string;
|
||||
id: string;
|
||||
isSpecial: boolean;
|
||||
lastUpdateFullName: string;
|
||||
lastUpdateUserId: string;
|
||||
lastUpdatedAt?: Date;
|
||||
name: string;
|
||||
originalDate: Date;
|
||||
}
|
||||
|
||||
interface DataDateRowObject {
|
||||
holidayDate: Date;
|
||||
name: string;
|
||||
isSpecial: boolean;
|
||||
id: string;
|
||||
}
|
||||
|
||||
interface DataDateListsObject {
|
||||
id: string;
|
||||
dateRange: [Date, Date];
|
||||
dataRangeRow: DataDateRowObject[];
|
||||
detail: string;
|
||||
isSpecial: boolean;
|
||||
}
|
||||
|
||||
//columns
|
||||
interface Columns {
|
||||
[index: number]: {
|
||||
name: string;
|
||||
align?: string;
|
||||
label: string;
|
||||
sortable?: boolean;
|
||||
field: string | ((row: any) => any);
|
||||
headerStyle?: string;
|
||||
style?: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface TabsObject {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export type {
|
||||
DataNumObject,
|
||||
DataDateAddObject,
|
||||
DataDateMonthObject,
|
||||
RequestItemsObject,
|
||||
DataDateRowObject,
|
||||
DataDateListsObject,
|
||||
Columns,
|
||||
TabsObject,
|
||||
};
|
||||
|
|
@ -10,9 +10,9 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
|
||||
import type { RequestPeriodCompete } from "@/modules/03_recruiting/interface/request/Period";
|
||||
import type {
|
||||
DataOption,
|
||||
DataOption2,
|
||||
UploadType,
|
||||
} from "@/modules/02_organizational/interface/index/Main";
|
||||
} from "@/modules/02_organization/interface/index/Main";
|
||||
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -37,10 +37,10 @@ const datePayment = ref<[Date, Date] | null>(null); //วันที่จ่
|
|||
const dateAnnouncement = ref<[Date, Date] | null>(null); //วันที่ประกาศ
|
||||
const dateExam = ref<Date | null>(null); //วันที่สอบ
|
||||
const dateAnnounce = ref<Date | null>(null); //วันที่ประกาศผล
|
||||
const positionPathOptions = ref<DataOption[]>([]);
|
||||
const organizationShortName = ref<DataOption>({ id: "", name: "" });
|
||||
const organizationName = ref<DataOption>({ id: "", name: "" });
|
||||
const organizationNameOptions = ref<DataOption[]>([]);
|
||||
const positionPathOptions = ref<DataOption2[]>([]);
|
||||
const organizationShortName = ref<DataOption2>({ id: "", name: "" });
|
||||
const organizationName = ref<DataOption2>({ id: "", name: "" });
|
||||
const organizationNameOptions = ref<DataOption2[]>([]);
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
const fileDocs = ref<UploadType[]>([]);
|
||||
const fileImgDataUpload = ref<File[]>([]);
|
||||
|
|
@ -339,11 +339,11 @@ function dateThaiRange(val: [Date, Date]) {
|
|||
}
|
||||
}
|
||||
|
||||
watch(organizationShortName, (count: DataOption, prevCount: DataOption) => {
|
||||
watch(organizationShortName, (count: DataOption2, prevCount: DataOption2) => {
|
||||
organizationNameOptions.value = [];
|
||||
});
|
||||
|
||||
watch(organizationName, (count: DataOption, prevCount: DataOption) => {
|
||||
watch(organizationName, (count: DataOption2, prevCount: DataOption2) => {
|
||||
positionPathOptions.value = [];
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
|
||||
import type { RequestPeriodDisable } from "@/modules/03_recruiting/interface/request/Period";
|
||||
import type {
|
||||
DataOption,
|
||||
DataOption2,
|
||||
UploadType,
|
||||
} from "@/modules/02_organizational/interface/index/Main";
|
||||
} from "@/modules/02_organization/interface/index/Main";
|
||||
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -40,10 +40,10 @@ const datePayment = ref<[Date, Date] | null>(null); //วันที่จ่
|
|||
const dateAnnouncement = ref<[Date, Date] | null>(null); //วันที่ประกาศ
|
||||
const dateExam = ref<Date | null>(null); //วันที่สอบ
|
||||
const dateAnnounce = ref<Date | null>(null); //วันที่ประกาศผล
|
||||
const positionPathOptions = ref<DataOption[]>([]);
|
||||
const organizationShortName = ref<DataOption>({ id: "", name: "" });
|
||||
const organizationName = ref<DataOption>({ id: "", name: "" });
|
||||
const organizationNameOptions = ref<DataOption[]>([]);
|
||||
const positionPathOptions = ref<DataOption2[]>([]);
|
||||
const organizationShortName = ref<DataOption2>({ id: "", name: "" });
|
||||
const organizationName = ref<DataOption2>({ id: "", name: "" });
|
||||
const organizationNameOptions = ref<DataOption2[]>([]);
|
||||
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
const fileDocs = ref<UploadType[]>([]);
|
||||
|
|
@ -337,11 +337,11 @@ function dateThaiRange(val: [Date, Date] | null) {
|
|||
}
|
||||
}
|
||||
|
||||
watch(organizationShortName, (count: DataOption, prevCount: DataOption) => {
|
||||
watch(organizationShortName, (count: DataOption2, prevCount: DataOption2) => {
|
||||
organizationNameOptions.value = [];
|
||||
});
|
||||
|
||||
watch(organizationName, (count: DataOption, prevCount: DataOption) => {
|
||||
watch(organizationName, (count: DataOption2, prevCount: DataOption2) => {
|
||||
positionPathOptions.value = [];
|
||||
});
|
||||
|
||||
|
|
@ -386,7 +386,7 @@ onMounted(async () => {
|
|||
dense
|
||||
lazy-rules
|
||||
:rules="[
|
||||
(val) =>
|
||||
(val:string) =>
|
||||
!!val || `${'กรุณากรอกชื่อรอบคัดเลือกคนพิการ/ชื่อประกาศ'}`,
|
||||
]"
|
||||
></q-input>
|
||||
|
|
@ -446,7 +446,7 @@ onMounted(async () => {
|
|||
lazy-rules
|
||||
input-class="text-right"
|
||||
:rules="[
|
||||
(val) => val >= 0 || `${'กรุณากรอกค่าธรรมเนียมให้ถูกต้อง'}`,
|
||||
(val:any) => val >= 0 || `${'กรุณากรอกค่าธรรมเนียมให้ถูกต้อง'}`,
|
||||
]"
|
||||
></q-input>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ import type {
|
|||
ResponsePayment,
|
||||
} from "@/modules/03_recruiting/interface/response/Period";
|
||||
import type {
|
||||
DataOption,
|
||||
DataOption2,
|
||||
UploadType,
|
||||
} from "@/modules/02_organizational/interface/index/Main";
|
||||
} from "@/modules/02_organization/interface/index/Main";
|
||||
|
||||
import ProfileTable from "@/modules/03_recruiting/components/Table1.vue";
|
||||
|
||||
|
|
@ -60,12 +60,12 @@ const dateAnnounce = ref<Date | null>(null); //วันประกาศผล
|
|||
const dateExam = ref<Date | null>(null); //วันที่สอบ
|
||||
const myFormPayment = ref<any>();
|
||||
const myFormPosition = ref<any>();
|
||||
const positionPathOptions = ref<DataOption[]>([]);
|
||||
const positionPathFilters = ref<DataOption[]>([]);
|
||||
const positionLevelOptions = ref<DataOption[]>([]);
|
||||
const positionLevelFilters = ref<DataOption[]>([]);
|
||||
const organizationShortName = ref<DataOption>();
|
||||
const organizationName = ref<DataOption>();
|
||||
const positionPathOptions = ref<DataOption2[]>([]);
|
||||
const positionPathFilters = ref<DataOption2[]>([]);
|
||||
const positionLevelOptions = ref<DataOption2[]>([]);
|
||||
const positionLevelFilters = ref<DataOption2[]>([]);
|
||||
const organizationShortName = ref<DataOption2>();
|
||||
const organizationName = ref<DataOption2>();
|
||||
const examTypeOptions = [
|
||||
{ name: "ทั่วไป", id: "normol" },
|
||||
{ name: "แพทย์", id: "docter" },
|
||||
|
|
@ -302,8 +302,8 @@ async function fetchPositionPath() {
|
|||
.get(config.API.positionPath)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: DataOption) => {
|
||||
let option: DataOption2[] = [];
|
||||
data.map((r: DataOption2) => {
|
||||
option.push({
|
||||
id: r.id.toString(),
|
||||
name: r.name.toString(),
|
||||
|
|
@ -329,8 +329,8 @@ async function fetchPositionLevel() {
|
|||
.get(config.API.positionLevel)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: DataOption) => {
|
||||
let option: DataOption2[] = [];
|
||||
data.map((r: DataOption2) => {
|
||||
option.push({
|
||||
id: r.id.toString(),
|
||||
name: r.name.toString(),
|
||||
|
|
@ -338,10 +338,10 @@ async function fetchPositionLevel() {
|
|||
});
|
||||
});
|
||||
positionLevelOptions.value = option.filter(
|
||||
(v: DataOption) => v.level === 0
|
||||
(v: DataOption2) => v.level === 0
|
||||
);
|
||||
positionLevelFilters.value = option.filter(
|
||||
(v: DataOption) => v.level === 0
|
||||
(v: DataOption2) => v.level === 0
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -363,14 +363,14 @@ function filterSelector(val: any, update: Function, refData: string) {
|
|||
case "positionLevel":
|
||||
update(() => {
|
||||
positionLevelOptions.value = positionLevelFilters.value.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
(v: DataOption2) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "position":
|
||||
update(() => {
|
||||
positionPathOptions.value = positionPathFilters.value.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
(v: DataOption2) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
|
|
@ -775,7 +775,7 @@ onMounted(async () => {
|
|||
:readonly="checkRoutePermisson"
|
||||
lazy-rules
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณากรอกชื่อรอบคัดเลือก/ชื่อประกาศ'}`,
|
||||
(val:string) => !!val || `${'กรุณากรอกชื่อรอบคัดเลือก/ชื่อประกาศ'}`,
|
||||
]"
|
||||
></q-input>
|
||||
</div>
|
||||
|
|
@ -1282,7 +1282,7 @@ onMounted(async () => {
|
|||
lazy-rules
|
||||
mask="###-#-#####-#"
|
||||
:rules="[
|
||||
(val) =>
|
||||
(val:any) =>
|
||||
(val && val.length > 0) ||
|
||||
'กรุณากรอกข้อมูลให้ครบ',
|
||||
]"
|
||||
|
|
@ -1298,7 +1298,7 @@ onMounted(async () => {
|
|||
dense
|
||||
lazy-rules
|
||||
:rules="[
|
||||
(val) =>
|
||||
(val:any) =>
|
||||
(val && val.length > 0) ||
|
||||
'กรุณากรอกข้อมูลให้ครบ',
|
||||
]"
|
||||
|
|
@ -1314,7 +1314,7 @@ onMounted(async () => {
|
|||
dense
|
||||
lazy-rules
|
||||
:rules="[
|
||||
(val) =>
|
||||
(val:any) =>
|
||||
(val && val.length > 0) ||
|
||||
'กรุณากรอกข้อมูลให้ครบ',
|
||||
]"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { checkPermission } from "@/utils/permissions";
|
|||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import type { DataNumObject } from "@/modules/01_metadata/interface/request/Calendar";
|
||||
import type { DataNumObject } from "@/modules/03_recruiting/interface/request/Calendar";
|
||||
|
||||
import TableCandidate from "@/modules/03_recruiting/components/TableCandidate.vue";
|
||||
import ExamFinished from "@/modules/03_recruiting/components/ExamFinished.vue";
|
||||
|
|
@ -234,7 +234,7 @@ async function changePage(
|
|||
|
||||
/** ดึงข้อมูล */
|
||||
async function fetchData(loading: boolean = true) {
|
||||
loading === true ?? showLoader();
|
||||
loading ?? showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.candidateOfPeriodExam(status.value, examId.value) +
|
||||
|
|
@ -274,7 +274,7 @@ async function fetchData(loading: boolean = true) {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loading === true ?? hideLoader();
|
||||
loading ?? hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -492,9 +492,9 @@ onMounted(() => {
|
|||
</div>
|
||||
<div class="q-py-xs">
|
||||
{{
|
||||
`${
|
||||
informaData.rank ? informaData.rank : informaData.prefix ?? ""
|
||||
}${informaData.firstName} ${informaData.lastName}`
|
||||
`${informaData.prefix ?? ""}${informaData.firstName} ${
|
||||
informaData.lastName
|
||||
}`
|
||||
}}
|
||||
</div>
|
||||
<div class="q-py-xs">
|
||||
|
|
@ -893,7 +893,6 @@ onMounted(() => {
|
|||
map-options
|
||||
:options="columnsHistory"
|
||||
option-value="name"
|
||||
|
||||
style="min-width: 140px"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,16 @@ interface FormPerson {
|
|||
statusMarital?: string;
|
||||
}
|
||||
|
||||
interface ChildrenFamily {
|
||||
id: string;
|
||||
childrenPrefixId: string | null;
|
||||
childrenFirstName: string | null;
|
||||
childrenLastName: string | null;
|
||||
childrenCareer: string | null;
|
||||
childrenLive: string | null;
|
||||
childrenCitizenId: string | null;
|
||||
}
|
||||
|
||||
interface FormChildren {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
|
|
@ -27,4 +37,4 @@ interface FormChildren {
|
|||
profileEmployeeId: string | null;
|
||||
}
|
||||
|
||||
export type { FormPerson, FormChildren };
|
||||
export type { FormPerson, FormChildren, ChildrenFamily };
|
||||
|
|
|
|||
|
|
@ -1,11 +1,17 @@
|
|||
//interface class array object {name string ,id number}
|
||||
|
||||
import type { childrenFamily } from "@/modules/04_registry/interface/response/Family";
|
||||
interface ChangeActive {
|
||||
name: string;
|
||||
id: number;
|
||||
}
|
||||
|
||||
interface childrenFamily {
|
||||
id: string;
|
||||
childrenPrefixId: string | null;
|
||||
childrenFirstName: string | null;
|
||||
childrenLastName: string | null;
|
||||
childrenCareer: string | null;
|
||||
childrenLive: string | null;
|
||||
childrenCitizenId: string | null;
|
||||
}
|
||||
//ข้อมูลส่วนตัว
|
||||
interface Information {
|
||||
idCard: string;
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ import type { QForm } from "quasar";
|
|||
import type {
|
||||
DataOption,
|
||||
DataOptioninfo,
|
||||
} from "@/modules/04_registry/components/profileType";
|
||||
} from "@/modules/05_placement/interface/index/ProfileType";
|
||||
import type {
|
||||
InformationOps,
|
||||
FormAddPerson,
|
||||
} from "@/modules/04_registry/interface/index/Main";
|
||||
} from "@/modules/05_placement/interface/index/ProfileType";
|
||||
|
||||
// import HeaderTop from "@/modules/08_registryEmployee/components/AddEmployee/HeaderTop.vue";
|
||||
|
||||
|
|
@ -429,7 +429,7 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-page-sticky>
|
||||
|
||||
<q-card flat bordered class="col-12">
|
||||
<q-card flat bordered class="col-12 q-pa-sm">
|
||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
<!-- <HeaderTop
|
||||
header="ข้อมูลส่วนตัว"
|
||||
|
|
|
|||
|
|
@ -46,6 +46,25 @@ interface DocList {
|
|||
fileName: string;
|
||||
}
|
||||
|
||||
interface FormAddPerson {
|
||||
birthDate: Date | null;
|
||||
prefix: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
citizenId: string;
|
||||
age: string | null;
|
||||
genderId: string | null;
|
||||
bloodId: string | null;
|
||||
nationality: string | null;
|
||||
ethnicity: string | null;
|
||||
statusId: string | null;
|
||||
religionId: string | null;
|
||||
tel: string | null;
|
||||
employeeType: string | null;
|
||||
employeeClass: string | null;
|
||||
profileType: string | null;
|
||||
}
|
||||
|
||||
const defaultInformation: Information = {
|
||||
cardid: null,
|
||||
age: null,
|
||||
|
|
@ -73,4 +92,5 @@ export type {
|
|||
DataOptioninfo,
|
||||
DocList,
|
||||
InformationOps,
|
||||
FormAddPerson,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
|
||||
/** import Type*/
|
||||
import type { DataOption } from "@/modules/04_registry/components/profileType";
|
||||
import type { DataOption } from "@/modules/07_insignia/interface/index/Main";
|
||||
import type { DataStructureTree } from "@/interface/main";
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,17 +7,12 @@ import { useResultDataStore } from "@/modules/07_insignia/storeResult";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
/**
|
||||
* import Type
|
||||
*/
|
||||
// import type { DataOption } from "@/modules/04_registry/components/profileType";
|
||||
/** import Type */
|
||||
import type { OptionData } from "@/modules/07_insignia/interface/index/Main";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
/**
|
||||
* use
|
||||
*/
|
||||
/** use */
|
||||
const $q = useQuasar();
|
||||
const myForm = ref<QForm>();
|
||||
const DataStore = useResultDataStore();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
|
||||
/** impotrType */
|
||||
import type { DataOption } from "@/modules/04_registry/components/profileType";
|
||||
import type { DataOption } from "@/modules/07_insignia/interface/index/Main";
|
||||
|
||||
/** impotrComponents */
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
|
|
|||
|
|
@ -145,6 +145,11 @@ interface Pagination {
|
|||
rowsPerPage: number;
|
||||
}
|
||||
|
||||
interface DataOption {
|
||||
id: string;
|
||||
name: string;
|
||||
zipCode?: string;
|
||||
}
|
||||
interface DataManageList {
|
||||
citizenId: string;
|
||||
dateSend: null | string | Date;
|
||||
|
|
@ -170,6 +175,7 @@ interface DataManageList {
|
|||
}
|
||||
|
||||
export type {
|
||||
DataOption,
|
||||
OptionData,
|
||||
OptionDataYear,
|
||||
OptionReport,
|
||||
|
|
|
|||
|
|
@ -1,446 +0,0 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import router from "@/router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useOrderPlacementDataStore } from "@/modules/10_order/store";
|
||||
import { useOrderStore } from "@/modules/11_discipline/store/OrderStore";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { DataOption1 } from "@/modules/10_order/interface/index/Main";
|
||||
import PopupHistory from "@/modules/10_order/components/PopupHistory.vue";
|
||||
import TableOrder from "@/modules/11_discipline/components/9_Order/TableOrder.vue";
|
||||
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const mixin = useCounterMixin();
|
||||
const stroe = useOrderStore();
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
|
||||
const commandCodes = ref<string[]>([
|
||||
"C-PM-19",
|
||||
"C-PM-20",
|
||||
"C-PM-25",
|
||||
"C-PM-26",
|
||||
"C-PM-27",
|
||||
"C-PM-28",
|
||||
"C-PM-29",
|
||||
"C-PM-30",
|
||||
"C-PM-31",
|
||||
"C-PM-32",
|
||||
]);
|
||||
|
||||
// รายการข้อมูลปีงบประมาณ
|
||||
const fiscalyear = ref<number | null>(0);
|
||||
const fiscalyearOP = ref<any>([{ id: 0, name: "ทั้งหมด" }]);
|
||||
const fiscalyearFilter1 = ref<any>([]);
|
||||
async function fiscalYearFilter() {
|
||||
await http.get(config.API.yearOptionsOrder()).then((res) => {
|
||||
const response = res.data.result;
|
||||
fiscalyearOP.value = [{ id: 0, name: "ทั้งหมด" }];
|
||||
response.map((r: any) => {
|
||||
fiscalyearOP.value.push({ id: r.id, name: r.name.toString() });
|
||||
});
|
||||
|
||||
fiscalyearFilter1.value = [{ id: 0, name: "ทั้งหมด" }];
|
||||
response.map((r: any) => {
|
||||
fiscalyearFilter1.value.push({
|
||||
id: r.id,
|
||||
name: r.name.toString(),
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// รายการข้อมูลประเภทคำสั่ง
|
||||
const OrderType = ref<string>("");
|
||||
const OrderTypeFilter1 = ref<any>([]);
|
||||
const OrderTypeOption = ref<DataOption1[]>([{ id: "", name: "ทั้งหมด" }]);
|
||||
|
||||
// รายการข้อมูลสถานะคำสั่ง
|
||||
const OrderStatus = ref<string>("ทั้งหมด");
|
||||
const OrderStatusOption = ref<DataOption1[]>([
|
||||
{ id: "ทั้งหมด", name: "ทั้งหมด" },
|
||||
]);
|
||||
const OrderStatusFilter1 = ref<DataOption1[]>([
|
||||
{ id: "ทั้งหมด", name: "ทั้งหมด" },
|
||||
]);
|
||||
const addedOrderStatusValues: string[] = [];
|
||||
|
||||
// ค้นหาในตาราง
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
|
||||
/** ล้างค่า input */
|
||||
function resetFilter() {
|
||||
filterKeyword.value = "";
|
||||
filterRef.value.focus();
|
||||
}
|
||||
|
||||
/** ประเภทครับสั่ง ฟิลเตอร์ */
|
||||
async function OrderTypeFilter() {
|
||||
await http
|
||||
.get(config.API.typeOrder())
|
||||
.then((res) => {
|
||||
const response = res.data.result;
|
||||
const filterRes = response.filter((e: any) =>
|
||||
commandCodes.value.includes(e.commandCode)
|
||||
);
|
||||
|
||||
OrderTypeOption.value = [{ id: "", name: "ทั้งหมด" }];
|
||||
OrderTypeOption.value.push(...filterRes);
|
||||
|
||||
OrderTypeFilter1.value = [{ id: "", name: "ทั้งหมด" }];
|
||||
OrderTypeFilter1.value.push(...filterRes);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
}
|
||||
|
||||
/** ฟังชั่นฟิลเตอร์ตามค่า ประเภท สถานะ ปี */
|
||||
async function searchFilterTable() {
|
||||
stroe.filterListOrder(OrderType.value, OrderStatus.value, fiscalyear.value);
|
||||
}
|
||||
|
||||
/** สถานะคำสั่ง ฟิลเตอร์ */
|
||||
async function OrderStatusFilter() {
|
||||
for (let data of stroe.mainData) {
|
||||
const OrderStatusValue = data.orderStatusName;
|
||||
|
||||
if (
|
||||
OrderStatusValue === null ||
|
||||
parseInt(OrderStatusValue) > parseInt(OrderStatusValue)
|
||||
) {
|
||||
OrderStatus.value = OrderStatusValue;
|
||||
}
|
||||
|
||||
if (!addedOrderStatusValues.includes(OrderStatusValue)) {
|
||||
OrderStatusFilter1.value.push({
|
||||
id: OrderStatusFilter1.value.length.toString(),
|
||||
name: OrderStatusValue,
|
||||
});
|
||||
addedOrderStatusValues.push(OrderStatusValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟิลเตอร์ข้อมูลจาก input
|
||||
* @param val ค่าที่ป้อนให้ input
|
||||
* @param update function จาก quasar
|
||||
* @param refData type ที่กำหนด ของ input นั้นๆ
|
||||
*/
|
||||
function filterSelector(val: any, update: Function, refData: string) {
|
||||
switch (refData) {
|
||||
case "fiscalyearOP":
|
||||
update(() => {
|
||||
fiscalyearOP.value = fiscalyearFilter1.value.filter(
|
||||
(v: any) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "OrderTypeOption":
|
||||
update(() => {
|
||||
OrderTypeOption.value = OrderTypeFilter1.value.filter(
|
||||
(v: any) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "OrderStatusOption":
|
||||
update(() => {
|
||||
OrderStatusOption.value = OrderStatusFilter1.value.filter(
|
||||
(v: any) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchOrderlist() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.listOrder())
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
const typeid = OrderTypeOption.value.map((e) => e.id);
|
||||
|
||||
const filterListOrder = data.filter((e: any) =>
|
||||
typeid.includes(e.orderTypeValue)
|
||||
);
|
||||
|
||||
stroe.fetchOrder(filterListOrder);
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
// สร้างคำสั่งใหม่
|
||||
function clickAdd() {
|
||||
router.push({ name: "disciplineOrderAdd" });
|
||||
}
|
||||
onMounted(async () => {
|
||||
await fiscalYearFilter();
|
||||
await OrderTypeFilter();
|
||||
await fetchOrderlist();
|
||||
await OrderStatusFilter();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
ออกคำสั่งลงโทษทางวินัย
|
||||
</div>
|
||||
<div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pa-md">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<q-select
|
||||
class="col-xs-12 col-sm-3 col-md-"
|
||||
v-model="fiscalyear"
|
||||
label="ปีงบประมาณ"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
:options="fiscalyearOP"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
lazy-rules
|
||||
use-input
|
||||
hide-bottom-space
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
@update:model-value="searchFilterTable"
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'fiscalyearOP'
|
||||
) "
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
<template v-if="fiscalyear !== 0" v-slot:append>
|
||||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="
|
||||
(fiscalyearOP = fiscalyearFilter1)((fiscalyear = 0)),
|
||||
searchFilterTable()
|
||||
"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
</q-select>
|
||||
<!-- use-input -->
|
||||
<div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-plus"
|
||||
@click="clickAdd"
|
||||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-space />
|
||||
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<q-select
|
||||
v-model="stroe.visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="stroe.columns"
|
||||
option-value="name"
|
||||
|
||||
style="min-width: 140px"
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-card bordered class="col-12 filter-card q-pa-sm">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div class="col-xs-12 col-sm-3 col-md-4">
|
||||
<q-select
|
||||
v-model="OrderType"
|
||||
label="ประเภท"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="OrderTypeOption"
|
||||
option-value="id"
|
||||
lazy-rules
|
||||
use-input
|
||||
hide-bottom-space
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
@update:model-value="searchFilterTable"
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'OrderTypeOption'
|
||||
) "
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
<template v-if="OrderType !== ''" v-slot:append>
|
||||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="
|
||||
(OrderTypeOption = OrderTypeFilter1),
|
||||
(OrderType = ''),
|
||||
searchFilterTable()
|
||||
"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-select
|
||||
v-model="OrderStatus"
|
||||
label="สถานะ"
|
||||
dense
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="OrderStatusOption"
|
||||
option-value="name"
|
||||
lazy-rules
|
||||
use-input
|
||||
hide-bottom-space
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
@update:model-value="searchFilterTable"
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'OrderStatusOption'
|
||||
) "
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
<template v-if="OrderStatus !== 'ทั้งหมด'" v-slot:append>
|
||||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="
|
||||
(OrderStatusOption = OrderStatusFilter1),
|
||||
(OrderStatus = 'ทั้งหมด'),
|
||||
searchFilterTable()
|
||||
"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-space />
|
||||
<div><PopupHistory :OrderTypeOption="OrderTypeOption" /></div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<TableOrder :filterTable="filterKeyword" />
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
.filter-card {
|
||||
background-color: #f1f1f1b0;
|
||||
}
|
||||
|
||||
.toggle-expired-account {
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
font-size: 15px;
|
||||
line-height: 150%;
|
||||
color: #35373c;
|
||||
}
|
||||
|
||||
.icon-color {
|
||||
color: #4154b3;
|
||||
}
|
||||
|
||||
.custom-header-table {
|
||||
max-height: 64vh;
|
||||
|
||||
.q-table tr:nth-child(odd) td {
|
||||
background: white;
|
||||
}
|
||||
|
||||
.q-table tr:nth-child(even) td {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.q-table thead tr {
|
||||
background: #ecebeb;
|
||||
}
|
||||
|
||||
.q-table thead tr th {
|
||||
position: sticky;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* this will be the loading indicator */
|
||||
.q-table thead tr:last-child th {
|
||||
/* height of all previous header rows */
|
||||
top: 48px;
|
||||
}
|
||||
|
||||
.q-table thead tr:first-child th {
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,312 +0,0 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
import router from "@/router";
|
||||
import { useOrderStore } from "@/modules/11_discipline/store/OrderStore";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
const OrderStore = useOrderStore();
|
||||
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
filterTable: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
|
||||
/** ข้อมูลที่เเสดงใน คอลัม */
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "center",
|
||||
label: "ลำดับ ",
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "orderName",
|
||||
align: "left",
|
||||
label: "คำสั่ง",
|
||||
sortable: true,
|
||||
field: "orderName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
|
||||
{
|
||||
name: "orderNo",
|
||||
align: "left",
|
||||
label: "เลขที่คำสั่ง",
|
||||
sortable: true,
|
||||
field: "orderNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "faultLevel",
|
||||
align: "left",
|
||||
label: "ระดับความผิด",
|
||||
sortable: true,
|
||||
field: "faultLevel",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "caseFault",
|
||||
align: "left",
|
||||
label: "กรณีความผิด",
|
||||
sortable: true,
|
||||
field: "caseFault",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fullName",
|
||||
align: "left",
|
||||
label: "รายชื่อผู้ที่ถูกลงโทษทางวินัย",
|
||||
sortable: true,
|
||||
field: "fullName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "result",
|
||||
align: "left",
|
||||
label: "ผลดำเนินการพิจารณา",
|
||||
sortable: true,
|
||||
field: "result",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "refRaw",
|
||||
align: "left",
|
||||
label: "อ้างอิงมาตราตามกฎหมาย",
|
||||
sortable: true,
|
||||
field: "refRaw",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
|
||||
{
|
||||
name: "orderTypeName",
|
||||
align: "left",
|
||||
label: "ประเภท",
|
||||
sortable: false,
|
||||
field: "orderTypeName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "orderDate",
|
||||
align: "left",
|
||||
label: "สั่ง ณ วันที่/วันที่คำสั่งมีผล",
|
||||
sortable: true,
|
||||
field: "orderDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a, b) => parseInt(a) - parseInt(b),
|
||||
},
|
||||
{
|
||||
name: "orderByOrganization",
|
||||
align: "left",
|
||||
label: "คำสั่งโดย",
|
||||
sortable: true,
|
||||
field: "orderByOrganization",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "signatoryBy",
|
||||
align: "left",
|
||||
label: "ผู้ลงนาม",
|
||||
sortable: true,
|
||||
field: "signatoryBy",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "orderStatusName",
|
||||
align: "center",
|
||||
label: "สถานะคำสั่ง",
|
||||
sortable: true,
|
||||
field: "orderStatusName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
/** หัวตาราง */
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"orderName",
|
||||
"orderNo",
|
||||
"faultLevel",
|
||||
"caseFault",
|
||||
"fullName",
|
||||
"result",
|
||||
"refRaw",
|
||||
"orderTypeName",
|
||||
"orderDate",
|
||||
"orderByOrganization",
|
||||
"signatoryBy",
|
||||
"orderStatusName",
|
||||
]);
|
||||
|
||||
/** pagination */
|
||||
const pagination = ref({
|
||||
descending: true,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/**
|
||||
* ฟังชั่น redirect
|
||||
* @param id id ออกคำสั่ง
|
||||
* @param status status
|
||||
*/
|
||||
function redirectToPage(id?: string, status?: string) {
|
||||
let step = 1;
|
||||
switch (status) {
|
||||
case "จัดทำร่างคำสั่ง":
|
||||
step = 1;
|
||||
break;
|
||||
case "บัญชีแนบท้าย":
|
||||
step = 2;
|
||||
break;
|
||||
case "เลือกผู้ได้รับสำเนาคำสั่ง":
|
||||
step = 3;
|
||||
break;
|
||||
default:
|
||||
step = 4;
|
||||
break;
|
||||
}
|
||||
router.push(`/discipline-order/detail/${id}?step=${step}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังชั่น redirect
|
||||
* @param id id ออกคำสั่ง
|
||||
* @param status status
|
||||
*/
|
||||
function redirectToDetailPage(id?: string, status?: string) {
|
||||
let step = 1;
|
||||
switch (status) {
|
||||
case "จัดทำร่างคำสั่ง":
|
||||
step = 1;
|
||||
break;
|
||||
case "บัญชีแนบท้าย":
|
||||
step = 2;
|
||||
break;
|
||||
case "เลือกผู้ได้รับสำเนาคำสั่ง":
|
||||
step = 3;
|
||||
break;
|
||||
default:
|
||||
step = 4;
|
||||
break;
|
||||
}
|
||||
router.push(`/discipline-order-detail/detail/${id}?step=${step}`);
|
||||
}
|
||||
|
||||
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
|
||||
onMounted(() => {
|
||||
OrderStore.columns = columns.value;
|
||||
OrderStore.visibleColumns = visibleColumns.value;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<d-table
|
||||
for="table"
|
||||
ref="table"
|
||||
:columns="OrderStore.columns"
|
||||
:rows="OrderStore.rows"
|
||||
:filter="props.filterTable"
|
||||
row-key="orderId"
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
class="custom-header-table"
|
||||
:visible-columns="OrderStore.visibleColumns"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width></q-th>
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="mdi-eye"
|
||||
color="info"
|
||||
@click="
|
||||
redirectToDetailPage(props.row.orderId, props.row.orderStatusName)
|
||||
"
|
||||
>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="edit"
|
||||
color="edit"
|
||||
@click="
|
||||
redirectToPage(props.row.orderId, props.row.orderStatusName)
|
||||
"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name === 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ?? "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue