Compare commits

..

No commits in common. "dev" and "v1.1.35" have entirely different histories.
dev ... v1.1.35

14 changed files with 74 additions and 432 deletions

View file

@ -27,7 +27,6 @@ export default {
placementDefermentInfo: (id: string) => `${placement}/pass/deferment/${id}`,
placementDisclaimInfo: (id: string) => `${placement}/pass/disclaim/${id}`,
placementUpdatePass: `${placement}/pass/update-status`,
placementUpdateDraftStatus: `${placement}/update/draft-status`,
//personal
placementPersonalId: (personalId: string) =>

View file

@ -354,11 +354,6 @@ function onClose() {
<div class="col-12">
<div class="row col-12 q-col-gutter-sm">
<div class="col-12">
<div class="text-caption text-grey-8">
แลระบบจะตดตอกลบผานทางอเมลทานระบ กรณาตรวจสอบอเมลของทานเปนระยะ
</div>
</div>
<div class="col-xs-12 col-md-6 col-lg-6">
<q-input
dense
@ -368,11 +363,10 @@ function onClose() {
class="inputgreen"
hide-bottom-space
:rules="[
(val: string) => !!val || 'กรุณากรอกที่อยู่อีเมล',
(val: string) => {
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return emailPattern.test(val) || 'กรุณากรอกที่อยู่อีเมลในรูปแบบที่ถูกต้อง';
}
() =>
!!formData.email ||
!!formData.phone ||
'กรุณากรอกอีเมลหรือเบอร์โทรติดต่อกลับ',
]"
/>
</div>
@ -384,6 +378,12 @@ function onClose() {
v-model="formData.phone"
class="inputgreen"
hide-bottom-space
:rules="[
() =>
!!formData.email ||
!!formData.phone ||
'กรุณากรอกอีเมลหรือเบอร์โทรติดต่อกลับ',
]"
/>
</div>
</div>

View file

@ -402,7 +402,6 @@ const modalDialogSalary = ref<boolean>(false); //แสดง popup ตำแห
const isStatusEdit = ref<boolean>(false); //
const salaryId = ref<string>(""); //id
const dataLevel = ref<DataPosType[]>([]); //
const idCommandId = ref<boolean>(false); // commandId
const commandCodeOptions = ref<DataOption[]>(store.commandCodeData); //
const posTypeOptions = ref<DataOption[]>(store.posTypeData); // |
@ -659,7 +658,6 @@ async function onClickOpenDialog(
} else {
await fetchOptionGroup();
}
idCommandId.value = statusEdit ? (data.commandId ? true : false) : false;
commandCodeOptions.value = store.commandCodeData;
posTypeOptions.value = store.posTypeData;
posLevelOptions.value = store.posLevelData;
@ -980,7 +978,6 @@ onMounted(async () => {
<q-tooltip>ประวแกไขตำแหน/เงนเดอน</q-tooltip>
</q-btn>
<!-- :disable="(props.row.commandId !== null && props.row.commandId !== '') || props.row.commandType === 'C-PM-47'" -->
<q-btn
v-if="
!isLeave &&
@ -988,7 +985,11 @@ onMounted(async () => {
checkPermission($route)?.attrOwnership === 'OWNER'
"
flat
color="edit"
:disable="
(props.row.commandId !== null && props.row.commandId !== '') ||
props.row.commandType === 'C-PM-47'
"
:color="props.row.commandId ? 'grey' : 'edit'"
dense
round
icon="edit"
@ -1153,8 +1154,7 @@ onMounted(async () => {
<div class="row q-col-gutter-sm">
<div class="col-6">
<q-input
:class="classInput(!idCommandId)"
:readonly="idCommandId"
:class="classInput(true)"
outlined
dense
lazy-rules
@ -1174,8 +1174,7 @@ onMounted(async () => {
autoApply
year-picker
:enableTimePicker="false"
:class="classInput(!idCommandId)"
:disabled="idCommandId"
class="inputgreen"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
@ -1192,8 +1191,6 @@ onMounted(async () => {
: formData.commandYear + 543
"
label="ปี พ.ศ."
:class="classInput(!idCommandId)"
:readonly="idCommandId"
>
<template v-slot:prepend>
<q-icon

View file

@ -66,7 +66,6 @@ const keyword = ref<string>(""); //คำค้นหา
const modalCommand = ref<boolean>(false);
const command = ref<string>("");
const commandId = ref<string>("");
const idCommandId = ref<boolean>(false); //
const baseColumns = ref<QTableColumn[]>([
{
name: "commandDateAffect",
@ -639,7 +638,6 @@ async function onClickOpenDialog(
} else {
await fetchOptionGroup();
}
idCommandId.value = statusEdit && data.commandId ? true : false;
commandCodeOptions.value = store.commandCodeData;
posTypeOptions.value = store.posTypeData;
posLevelOptions.value = store.posLevelData;
@ -941,10 +939,6 @@ onMounted(async () => {
>
<q-tooltip>ประวแกไขตำแหน/เงนเดอน</q-tooltip>
</q-btn>
<!-- :disable="
(props.row.commandId !== null && props.row.commandId !== '') ||
props.row.commandType === 'C-PM-47'
" -->
<q-btn
v-if="
!isLeave &&
@ -952,7 +946,11 @@ onMounted(async () => {
checkPermission($route)?.attrOwnership === 'OWNER'
"
flat
color="edit"
:disable="
(props.row.commandId !== null && props.row.commandId !== '') ||
props.row.commandType === 'C-PM-47'
"
:color="props.row.commandId ? 'grey' : 'edit'"
dense
round
icon="edit"
@ -1121,8 +1119,7 @@ onMounted(async () => {
<div class="row q-col-gutter-sm">
<div class="col-6">
<q-input
:class="classInput(!idCommandId)"
:readonly="idCommandId"
:class="classInput(true)"
outlined
dense
lazy-rules
@ -1142,8 +1139,7 @@ onMounted(async () => {
autoApply
year-picker
:enableTimePicker="false"
:class="classInput(!idCommandId)"
:disable="idCommandId"
class="inputgreen"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
@ -1160,8 +1156,6 @@ onMounted(async () => {
: formData.commandYear + 543
"
label="ปี พ.ศ."
:class="classInput(!idCommandId)"
:readonly="idCommandId"
>
<template v-slot:prepend>
<q-icon

View file

@ -706,7 +706,6 @@ function classInput(val: boolean) {
hide-bottom-space
autocomplete="on"
name="organization"
:label="`${'หน่วยงาน'}`"
/>
</div>

View file

@ -3,7 +3,6 @@ import { ref, watch } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { calculateAge } from "@/utils/function";
import http from "@/plugins/http";
import config from "@/app.config";
@ -39,20 +38,6 @@ const props = defineProps({
const rows = ref<DataEducation[]>([]);
const personalForm = ref<DataPerson>();
const age = ref<string | null>(""); //
// ID
const currentProvinceName = ref<string>("");
const currentDistrictName = ref<string>("");
const currentSubDistrictName = ref<string>("");
const registProvinceName = ref<string>("");
const registDistrictName = ref<string>("");
const registSubDistrictName = ref<string>("");
// Cache
const provincesCache = ref<any[]>([]);
const districtsCache = ref<Map<string, any[]>>(new Map()); // key: provinceId, value: districts[]
const subDistrictsCache = ref<Map<string, any[]>>(new Map()); // key: districtId, value: subDistricts[]
/**หัวตาราง */
const columns = ref<QTableProps["columns"]>([
@ -102,20 +87,11 @@ const columns = ref<QTableProps["columns"]>([
* งกนดงขอมลรายละเอยด
*/
async function fetchData() {
// Reset
resetData();
showLoader();
await http
.get(config.API.getDatapersonal(props.personalId))
.then((res) => {
personalForm.value = res.data.result;
if (res.data.result.dateOfBirth) {
//
age.value = calculateAge(res.data.result.dateOfBirth);
} else {
age.value = null;
}
personalForm.value?.education.map((e: Education) => {
rows.value.push({
university: e.institute,
@ -131,159 +107,6 @@ async function fetchData() {
.finally(() => {
hideLoader();
});
// ID
await convertAddressIds();
}
/**
* Reset อมลทกครงทเปดคนใหม
*/
function resetData() {
// Reset
personalForm.value = undefined;
age.value = "";
rows.value = [];
// Reset
currentProvinceName.value = "";
currentDistrictName.value = "";
currentSubDistrictName.value = "";
registProvinceName.value = "";
registDistrictName.value = "";
registSubDistrictName.value = "";
}
/**
* งกนแปลง ID เปนชอจรงของทอย (แบบ optimize)
*/
async function convertAddressIds() {
if (!personalForm.value) return;
try {
//
await loadProvinces();
//
if (personalForm.value.currentProvinceId && personalForm.value.currentProvinceId.trim() !== "") {
currentProvinceName.value = getProvinceNameFromCache(
personalForm.value.currentProvinceId
);
if (personalForm.value.currentDistrictId && personalForm.value.currentDistrictId.trim() !== "") {
currentDistrictName.value = await getDistrictNameOptimized(
personalForm.value.currentProvinceId,
personalForm.value.currentDistrictId
);
if (personalForm.value.currentSubDistrictId && personalForm.value.currentSubDistrictId.trim() !== "") {
currentSubDistrictName.value = await getSubDistrictNameOptimized(
personalForm.value.currentDistrictId,
personalForm.value.currentSubDistrictId
);
}
}
}
//
if (personalForm.value.registProvinceId && personalForm.value.registProvinceId.trim() !== "") {
registProvinceName.value = getProvinceNameFromCache(
personalForm.value.registProvinceId
);
if (personalForm.value.registDistrictId && personalForm.value.registDistrictId.trim() !== "") {
registDistrictName.value = await getDistrictNameOptimized(
personalForm.value.registProvinceId,
personalForm.value.registDistrictId
);
if (personalForm.value.registSubDistrictId && personalForm.value.registSubDistrictId.trim() !== "") {
registSubDistrictName.value = await getSubDistrictNameOptimized(
personalForm.value.registDistrictId,
personalForm.value.registSubDistrictId
);
}
}
}
} catch (error) {
console.error("Error converting address IDs:", error);
}
}
/**
* โหลดขอมลจงหวดทงหมด (ครงเดยว)
*/
async function loadProvinces() {
if (provincesCache.value.length === 0) {
try {
const res = await http.get(config.API.province);
provincesCache.value = res.data.result;
} catch (error) {
console.error("Error loading provinces:", error);
}
}
}
/**
* งชอจงหวดจาก cache
*/
function getProvinceNameFromCache(provinceId: string): string {
const province = provincesCache.value.find(
(p: any) => p.id.toString() === provinceId
);
return province ? province.name : "-";
}
/**
* งชออำเภอแบบ optimize (เรยก API เฉพาะจงหวดทองการ)
* @param provinceId ID ของจงหว
* @param districtId ID ของอำเภอ
*/
async function getDistrictNameOptimized(
provinceId: string,
districtId: string
): Promise<string> {
try {
// cache districts province
if (!districtsCache.value.has(provinceId)) {
const res = await http.get(config.API.listDistrict(provinceId));
districtsCache.value.set(provinceId, res.data.result.districts);
}
const districts = districtsCache.value.get(provinceId) || [];
const district = districts.find((d: any) => d.id.toString() === districtId);
return district ? district.name : "-";
} catch (error) {
console.error("Error loading district:", error);
return "-";
}
}
/**
* งชอตำบลแบบ optimize (เรยก API เฉพาะอำเภอทองการ)
* @param districtId ID ของอำเภอ
* @param subDistrictId ID ของตำบล
*/
async function getSubDistrictNameOptimized(
districtId: string,
subDistrictId: string
): Promise<string> {
try {
// cache subDistricts district
if (!subDistrictsCache.value.has(districtId)) {
const res = await http.get(config.API.listSubDistrict(districtId));
subDistrictsCache.value.set(districtId, res.data.result.subDistricts);
}
const subDistricts = subDistrictsCache.value.get(districtId) || [];
const subDistrict = subDistricts.find(
(sd: any) => sd.id.toString() === subDistrictId
);
return subDistrict ? subDistrict.name : "-";
} catch (error) {
console.error("Error loading subdistrict:", error);
return "-";
}
}
/**
@ -308,7 +131,7 @@ function formBmaofficer(val: string) {
*/
async function close() {
props.close();
resetData(); // Reset dialog
rows.value = [];
}
/**
@ -347,58 +170,30 @@ watch(props, () => {
<div class="row q-pa-xs">
<div class="col-3 header-sub-text">
<div class="q-pb-sm">เลขประจำตวประชาชน</div>
<div class="q-pb-sm">/เดอน/เก</div>
<div class="q-pb-sm">อาย</div>
<div class="q-pb-sm">ญชาต</div>
<div>หมเลอด</div>
<div class="q-pb-md">เลขประจำตวประชาชน</div>
<div>/เดอน/เก</div>
</div>
<div class="col-4 sub-text">
<div class="q-pb-sm">
<div class="q-pb-md">
{{ personalForm?.idCard }}
</div>
<div class="q-pb-sm">
{{ date2Thai(personalForm?.dateOfBirth) }}
</div>
<div class="q-pb-sm">
{{ age ? age : "-" }}
</div>
<div class="q-pb-sm">
{{
personalForm?.nationality ? personalForm.nationality : "-"
}}
</div>
<div>
{{
personalForm?.bloodGroup ? personalForm.bloodGroup : "-"
}}
{{ date2Thai(personalForm?.dateOfBirth) }}
</div>
</div>
<div class="col-2 header-sub-text">
<div class="q-pb-sm">-นามสก</div>
<div class="q-pb-sm">เพศ</div>
<div class="q-pb-sm">เชอชาต</div>
<div class="q-pb-sm">ศาสนา</div>
<div>เบอรโทรศพท</div>
<div class="q-pb-md">-นามสก</div>
<div>เพศ</div>
</div>
<div class="col-3 sub-text">
<div class="q-pb-sm">
<div class="q-pb-md">
{{ personalForm?.fullName }}
</div>
<div class="q-pb-sm">
<div>
{{ personalForm?.gender }}
</div>
<div class="q-pb-sm">
{{ personalForm?.race ? personalForm.race : "-" }}
</div>
<div class="q-pb-sm">
{{ personalForm?.religion ? personalForm.religion : "-" }}
</div>
<div class="q-mt-sm">
{{ personalForm?.telephone ? personalForm.telephone : "-" }}
</div>
</div>
</div>
</q-card>
@ -408,90 +203,9 @@ watch(props, () => {
<q-card bordered class="card-panding">
<div class="row items-center q-pa-xs header-text">ลำเนา</div>
<div class="row q-pa-xs">
<!-- อยจจ -->
<div class="col-6">
<div class="q-pb-sm text-weight-medium text-primary">
อยจจ
</div>
<div class="row">
<div class="col-4 header-sub-text">
<div class="q-pb-sm">อย</div>
<div class="q-pb-sm">งหว</div>
<div class="q-pb-sm">เขต/อำเภอ</div>
<div class="q-pb-sm">แขวง/ตำบล</div>
<div>รหสไปรษณ</div>
</div>
<div class="col-8 sub-text">
<div class="q-pb-sm">
{{
personalForm?.currentAddress
? personalForm.currentAddress
: "-"
}}
</div>
<div class="q-pb-sm">
{{ currentProvinceName ? currentProvinceName : "-" }}
</div>
<div class="q-pb-sm">
{{ currentDistrictName ? currentDistrictName : "-" }}
</div>
<div class="q-pb-sm">
{{
currentSubDistrictName ? currentSubDistrictName : "-"
}}
</div>
<div class="q-mt-sm">
{{
personalForm?.currentZipCode
? personalForm.currentZipCode
: "-"
}}
</div>
</div>
</div>
</div>
<!-- อยตามทะเบยนบาน -->
<div class="col-6">
<div class="q-pb-sm text-weight-medium text-primary">
อยตามทะเบยนบาน
</div>
<div class="row">
<div class="col-4 header-sub-text">
<div class="q-pb-sm">อย</div>
<div class="q-pb-sm">งหว</div>
<div class="q-pb-sm">เขต/อำเภอ</div>
<div class="q-pb-sm">แขวง/ตำบล</div>
<div>รหสไปรษณ</div>
</div>
<div class="col-8 sub-text">
<div class="q-pb-sm">
{{
personalForm?.registAddress
? personalForm.registAddress
: "-"
}}
</div>
<div class="q-pb-sm">
{{ registProvinceName ? registProvinceName : "-" }}
</div>
<div class="q-pb-sm">
{{ registDistrictName ? registDistrictName : "-" }}
</div>
<div class="q-pb-sm">
{{
registSubDistrictName ? registSubDistrictName : "-"
}}
</div>
<div class="q-mt-sm">
{{
personalForm?.registZipCode
? personalForm.registZipCode
: "-"
}}
</div>
</div>
</div>
<div class="col-3 header-sub-text">อย</div>
<div class="col-9 sub-text">
{{ personalForm?.registAddress }}
</div>
</div>
</q-card>

View file

@ -967,28 +967,6 @@ function onUpdateStatus(id: string) {
);
}
function onUpdateDraftStatus(id: string) {
dialogConfirm(
$q,
async () => {
showLoader();
try {
await http.post(config.API.placementUpdateDraftStatus, {
personalId: id,
});
await success($q, "บันทึกสำเร็จ");
await getTable();
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
},
"ยืนยันการยกเลิกการส่งตัว",
"ต้องการยกเลิกการส่งตัวรายชื่อนี้ใช่หรือไม่ ?"
);
}
onMounted(async () => {
await getWorkFlow();
await getTable();
@ -1051,30 +1029,6 @@ onMounted(async () => {
</q-item-section>
<q-item-section>รายละเอยด</q-item-section>
</q-item>
<q-item
v-if="
checkPermission($route)?.attrIsUpdate &&
props.row.isDraft &&
props.row.statusId === 'PREPARE-CONTAIN' &&
(DataStore.isOfficer || checkPermission($route)?.attrOwnership == 'OWNER')
"
clickable
v-close-popup
@click="onUpdateDraftStatus(props.row.personalId)"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-icon
color="red"
size="xs"
name="mdi-account-arrow-left-outline"
/>
</q-item-section>
<q-item-section>ยกเลกการสงต</q-item-section>
</q-item>
<q-item
v-if="

View file

@ -151,7 +151,7 @@ async function fetchDataRetirement() {
firstNameTH: filter.value.firstNameTH.trim(),
lastNameTH: filter.value.lastNameTH.trim(),
});
const data: RetirementOld = response.data.result;
const data: RetirementOld = response.data.data;
pagination.value.rowsNumber = data.totalRecords;
rows.value = data.dataRecords;
} catch (error) {

View file

@ -213,9 +213,7 @@ function handleDelete(meetingId: string) {
dialogRemove($q, async () => {
showLoader();
try {
await http.delete(
config.API.evaluationMain() + `/del-meeting/${id.value}/${meetingId}`
);
await http.delete(config.API.evaluationMain() + `/del-meeting/${id.value}/${meetingId}`);
await props.fetchData();
await success($q, "ลบสำเร็จ");
} catch (error) {
@ -291,7 +289,7 @@ watch(
</template>
<template v-slot:body="props">
<q-tr :props="props">
<q-td auto-width>
<q-th auto-width>
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
flat
@ -303,7 +301,7 @@ watch(
>
<q-tooltip>ลบ</q-tooltip>
</q-btn>
</q-td>
</q-th>
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}

View file

@ -25,7 +25,6 @@ const {
dialogConfirm,
convertDateToAPI,
dialogRemove,
dialogMessageNotify,
} = useCounterMixin();
/**
@ -61,6 +60,7 @@ let formData = reactive<FormDataDetail>({
});
const commandVolume = ref<string>(""); //
const commandChapter = ref<string>(""); //
const isIdofficer = ref<boolean>(false); // .
const rows = ref<Array<DataOperators>>([]);
const columns = ref<QTableProps["columns"]>([
@ -113,22 +113,23 @@ const visibleColumns = ref<Array<string>>([
const modalAddOperator = ref<boolean>(false); //
/** ฟังก์ชันเช็ค สกจ.*/
async function fetchCheckIdofficer() {
await http
.get(config.API.checkIdofficer)
.then((res) => {
isIdofficer.value = res.data.result;
})
.catch((err) => {
messageError($q, err);
});
}
/**
* งกนบนทกขอมลรายละเอยดคำส
* และกำหนด isChangeData เป false
*/
async function onSubmit() {
// .
if (
store.isIdofficer &&
formData.isBangkok !== "BANGKOK" &&
formData.isBangkok !== "OFFICE"
) {
dialogMessageNotify($q, "กรุณาเลือกคำสั่ง");
return;
}
dialogConfirm($q, async () => {
showLoader();
await http
@ -155,7 +156,7 @@ async function onSubmit() {
});
}
/** ฟังกชันดึงข้อมูลรายชื่อเจ้าหน้าที่ดำเนินการ */
/** ฟังกชันดึงข้อมูลรายชื่อเจ้าหน้าที่ดำเนินการ */
async function fetchDataOperatorList() {
try {
const res = await http.get(
@ -214,6 +215,7 @@ function onDeleteData(id: string) {
onMounted(async () => {
try {
showLoader();
await fetchCheckIdofficer();
await fetchDataOperatorList();
formData.commandNo = props.formCommandList.commandNo;
formData.commandYear = props.formCommandList.commandYear;
@ -223,7 +225,7 @@ onMounted(async () => {
formData.issue = props.formCommandList.issue;
formData.commandAffectDate = props.formCommandList.commandAffectDate;
formData.commandExcecuteDate = props.formCommandList.commandExcecuteDate;
formData.isBangkok = !store.isIdofficer
formData.isBangkok = !isIdofficer.value
? null
: props.formCommandList.isBangkok;
commandCode.value = props.formCommandList.commandCode;
@ -488,7 +490,7 @@ onMounted(async () => {
<div
class="col-12 q-gutter-sm"
v-if="store.isIdofficer && commandCode !== 'C-PM-47'"
v-if="isIdofficer && commandCode !== 'C-PM-47'"
>
<q-radio
:disable="store.readonly"

View file

@ -292,10 +292,7 @@ function onConfirmOrder() {
if (
store?.dataCommand?.commandNo !== "" &&
store?.dataCommand?.commandAffectDate !== null &&
store?.dataCommand?.commandExcecuteDate !== null &&
(!store.isIdofficer ||
store?.dataCommand?.isBangkok === "BANGKOK" ||
store?.dataCommand?.isBangkok === "OFFICE")
store?.dataCommand?.commandExcecuteDate !== null
) {
dialogConfirm(
$q,
@ -319,10 +316,10 @@ function onConfirmOrder() {
"คุณต้องการยืนยันการส่งออกคำสั่งใช่หรือไม่?"
);
} else {
const messageWarning = !store.isIdofficer
? "ไม่สามารถดำเนินการต่อได้ กรุณากรอกเลขที่คำสั่ง วันที่ลงนาม และวันที่คำสั่งมีผลให้ครบ"
: "ไม่สามารถดำเนินการต่อได้ กรุณากรอกเลขที่คำสั่ง วันที่ลงนาม วันที่คำสั่งมีผล และเลือกคำสั่งให้ครบ";
dialogMessageNotify($q, messageWarning);
dialogMessageNotify(
$q,
"ไม่สามารถดำเนินการต่อได้ กรุณากรอกเลขที่คำสั่ง วันที่ลงนาม และวันที่คำสั่งมีผลให้ครบ"
);
}
}

View file

@ -7,8 +7,7 @@ export const useCommandDetail = defineStore("commandDetailStore", () => {
const readonly = ref<boolean>(false);
const dataCommand = ref<FormDataDetail>();
const status = ref<string>("");
const isSalary = ref<boolean>(false);
const isIdofficer = ref<boolean>(false);
const isSalary = ref<boolean>(false)
function checkStep(val: string) {
status.value = val;
switch (val) {
@ -40,7 +39,6 @@ export const useCommandDetail = defineStore("commandDetailStore", () => {
readonly,
status,
dataCommand,
isSalary,
isIdofficer,
isSalary
};
});

View file

@ -92,25 +92,12 @@ async function fetchDataCommandList() {
});
}
/** ฟังก์ชันเช็ค สกจ.*/
async function fetchCheckIdofficer() {
await http
.get(config.API.checkIdofficer)
.then((res) => {
store.isIdofficer = res.data.result;
})
.catch((err) => {
messageError($q, err);
});
}
/**
* ทำงานเม Components กเรยกใชงาน
* กำหนดค `store.readonly` เม route.name เป "commandViewDetailPage" จะอานขอมลไดอยางเดยว
*/
onMounted(async () => {
await fetchDataCommandList();
await fetchCheckIdofficer();
store.readonly =
route.name === "commandViewDetailPage" ||
formCommandList.status === "REPORTED" ||

View file

@ -111,16 +111,17 @@ async function fetchSummary() {
* งก DownloadReport
* @param list รายงานทองการดาวนโหลด
*/
async function getReport(valReport: string) {
async function getReport(list: string) {
const listFind = baseDocument.value.find(
(item: DataDocument) => item.val == list
)?.val;
const newReport = listFind === "report2" ? "report2-history" : listFind;
pdfSrc.value = undefined;
page.value = 1;
isLoadPDF.value = true;
if (valReport) {
if (newReport) {
await http
.post(config.API.orgReport(valReport), {
node: 0,
nodeId: organizationId.value,
})
.get(config.API.orgReport(newReport) + `/${organizationId.value}`)
.then(async (res) => {
const data = res.data.result;
detailReport.value = data;
@ -413,8 +414,10 @@ onMounted(async () => {
color="primary"
icon="download"
>
<q-tooltip> ดาวนโหลดรายงาน </q-tooltip>
<q-tooltip>
ดาวนโหลดรายงาน
</q-tooltip>
<q-menu>
<q-list style="min-width: 150px">
<q-item