Merge branch 'develop' into dev-tee

This commit is contained in:
setthawutttty 2023-09-01 17:51:39 +07:00
commit 5555706f20
25 changed files with 1242 additions and 1009 deletions

View file

@ -72,7 +72,8 @@ export default {
prevStep: (orderId: string) => `${order}/order/prev/${orderId}`,
executeOrder: (orderId: string) => `${order}/order/execute/${orderId}`,
createOrder: () => `${order}/order/detail`,
examroundOrder: (commandCode: string) => `${order}/order/detail/exam-round/${commandCode}`,
examroundOrder: (commandCode: string) =>
`${order}/order/detail/exam-round/${commandCode}`,
personsOrder: (orderId: string) => `${order}/order/persons/${orderId}`, //ข้อมูลเลือกรายชื่อออกคำสั่ง, ลบรายชื่อ
personsselectedOrder: (orderId: string) =>
`${order}/order/persons-selected/${orderId}`,
@ -99,6 +100,7 @@ export default {
receiveDataId: (id: string) => `${receive}/${id}`,
receivePosition: (id: string) => `${receive}/position/${id}`,
receiveDataPosition: () => `${receive}/use`,
receiveFile: (id: string) => `${receive}/upload/${id}`,
//tranfer ระบบคำขอโอน
transfer,
@ -108,13 +110,13 @@ export default {
transferUserId: (id: string) => `${transfer}/user/${id}`,
transferConfirmId: (id: string) => `${transfer}/confirm/${id}`,
// แต่งตั้ง-เลื่อน
placemenAppointment,
appointmentMain: () => `${placement}/appointment`,
appointmentByid: (id: string) => `${placement}/appointment/${id}`,
appointmentDelete: (id: string) => `${placement}/appointment/${id}`,
appointmentPosition: (id: string) => `${placement}/appointment/position/${id}`,
appointmentPosition: (id: string) =>
`${placement}/appointment/position/${id}`,
apppointmentReport: (id: string) => `${placement}/appointment/report/${id}`,
apppointmentPosition: () => `${placement}/appointment/use`,
@ -152,10 +154,8 @@ export default {
userPlacement: (id: string) => `${placement}/user/${id}`,
// orderForm
// orderForm
orderCPM: (type: string) => `${order}/order/${type}/detail`,
orderCPMUpdate: (type: string, id: string) => `${order}/order/${type}/detail/${id}`,
orderCPMUpdate: (type: string, id: string) =>
`${order}/order/${type}/detail/${id}`,
};

View file

@ -71,6 +71,7 @@ export default {
insigniaManageOrgAdd: () => `${insignia}/manage/org`,
insigniaManageOrgDashboard: (insigniaManageId: string) =>
`${insignia}/manage/org/dashboard/${insigniaManageId}`,
insigniaDowanload: (id: string) => `${insignia}/request/download/excel/${id}`,
// ยืม-คืนเครื่องราชฯ
insigniaManageBorrow: () => `${insignia}/manage/borrow`,

View file

@ -45,7 +45,7 @@ export default {
`${profile}search/new-employee/oc/${id}`,
profileSearchNewEmOcLeaveId: (id: string) =>
`${profile}search/new-employee/oc/leave/${id}`,
profileEmployeeTempId: (id: string) => `${profile}/employee/temp/${id}`,
profileEmployeeTempId: (id: string) => `${profile}employee/temp/${id}`,
profileCoupleId: (profileId: string) => `${profile}couple/${profileId}`,

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { ref, watch } from "vue";
const reason = ref<string>("");
const props = defineProps({
@ -17,11 +17,16 @@ const props = defineProps({
},
clickClose: {
type: Function,
default: () => { }
default: () => {},
},
savaForm: {
type: Function,
default: () => { }
default: () => {},
},
});
watch(props, () => {
if (props.modal === true) {
reason.value = "";
}
});
@ -29,7 +34,7 @@ const myForm = ref<any>();
const submit = () => {
myForm.value.validate().then((result: boolean) => {
if (result) {
props.savaForm(reason.value)
props.savaForm(reason.value);
}
});
};
@ -40,16 +45,31 @@ const submit = () => {
<q-card style="width: 500px; max-width: 500px">
<q-toolbar class="q-py-md">
<q-toolbar-title class="header-text">{{ props.title }}</q-toolbar-title>
<q-btn icon="close" unelevated round dense @click="clickClose"
style="color: #ff8080; background-color: #ffdede" />
<q-btn
icon="close"
unelevated
round
dense
@click="clickClose"
style="color: #ff8080; background-color: #ffdede"
/>
</q-toolbar>
<q-separator />
<q-form ref="myForm">
<q-card-section class="q-p-sm">
<div class="row col-12">
<q-input type="textarea" class="full-width inputgreen cursor-pointer" hide-bottom-space outlined dense
lazy-rules :rules="[(val) => !!val || `กรุณากรอก${label}`]" v-model="reason" :label="`${label}`" />
<q-input
type="textarea"
class="full-width inputgreen cursor-pointer"
hide-bottom-space
outlined
dense
lazy-rules
:rules="[(val) => !!val || `กรุณากรอก${label}`]"
v-model="reason"
:label="`${label}`"
/>
</div>
</q-card-section>
@ -60,7 +80,6 @@ const submit = () => {
<q-btn label="บันทึก" color="secondary" @click="submit" />
</q-toolbar>
</q-form>
</q-card>
</q-dialog>
</template>
</template>

View file

@ -946,10 +946,10 @@ const fetchData = async () => {
.then((res) => {
let data = res.data.result;
rows.value = [];
data.map((e: ResponseObject) => {
data.map((e: any) => {
rows.value.push({
id: e.id,
insignia: e.insignia,
insignia: e.insignia == null ? null : e.insignia.name,
insigniaId: e.insigniaId,
insigniaType: e.insigniaType,
year: e.year,

View file

@ -18,6 +18,7 @@ import type {
ResponseRow,
} from "@/modules/05_placement/interface/response/Receive";
const id = ref<string>("");
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin(); //
@ -39,7 +40,10 @@ const modal = ref<boolean>(false);
const popup = () => {
const row = filters.value.filter(
(r: ResponseRow) =>
(r.status == "WAITTING" || r.status == "PENDING" || r.status == "APPROVE") && r.positionNumber != null
(r.status == "WAITTING" ||
r.status == "PENDING" ||
r.status == "APPROVE") &&
r.positionNumber != null
);
rows2.value = row;
modal.value = true;
@ -73,6 +77,8 @@ const filterKeyword = ref<string>("");
const filterKeyword2 = ref<string>("");
const filterRef = ref<any>(null);
const files = ref<any>();
const nameFile = ref<string>("");
const fileUpload = ref<any>([]);
const fileDocDataUpload = ref<File[]>([]);
const listRecevice = ref<any[]>([]);
const filters = ref<ResponseRow[]>([]);
@ -267,6 +273,24 @@ onMounted(() => {
fecthlistRecevice();
});
const SaveData = async () => {
const formData = new FormData();
formData.append("File", files.value);
showLoader();
await http
.put(config.API.receiveFile(personalId.value), formData)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await clickCloseUpload();
hideLoader();
});
};
const fecthlistRecevice = async () => {
showLoader();
await http
@ -312,31 +336,33 @@ const fecthlistRecevice = async () => {
});
};
const fileUploadDoc = async (files: any) => {
files.forEach((file: any) => {
fileDocDataUpload.value.push(file);
});
};
// const fileUploadDoc = async (val: any) => {
// nameFile.value = val[0].name;
// fileUpload.value = val;
// };
const addUpload = async () => {
// showLoader();
// await http
// .post(config.API.listRoundInsignia())
// .then(() => {
// success($q, "");
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(async () => {
// hideLoader();
// });
};
const SaveData = async () => {
await addUpload();
await clickCloseUpload();
};
// const addUpload = async () => {
// if (fileUpload.value.length > 0) {
// const blob = fileUpload.value.slice(0, fileUpload.value[0].size);
// const newFile = new File(blob, nameFile.value, {
// type: fileUpload.value[0].type,
// });
// const formData = new FormData();
// formData.append("", newFile);
// showLoader();
// await http
// .put(config.API.receiveFile(personalId.value), formData)
// .then(() => {
// success($q, "");
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(async () => {
// hideLoader();
// });
// }
// };
const resetFilter = () => {
filterKeyword.value = "";
@ -372,6 +398,7 @@ const openModalTree = (id: string) => {
const openUpload = (id: string) => {
personalId.value = id;
modalupload.value = true;
console.log(personalId.value);
};
const openDelete = (id: string) => {
@ -682,12 +709,10 @@ const saveOrder = async () => {
<q-dialog v-model="modalupload">
<q-card style="width: 600px">
<DialogHeader title="อัพโหลดเอกสาร" :close="clickCloseUpload" />
<q-separator />
<q-separator />
<q-card-section class="q-pt-none">
<div class="col-12 row items-center q-col-gutter-sm">
<div class="col-12">
<q-file outlined dense v-model="files" @added="fileUploadDoc" label="อัพโหลดเอกสาร" lazy-rules>
<q-file outlined dense v-model="files" label="อัพโหลดเอกสาร" lazy-rules>
<!-- :rules="[
(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน',
]" -->
@ -700,7 +725,7 @@ const saveOrder = async () => {
</q-card-section>
<q-card-actions class="text-primary q-py-sm">
<q-space />
<q-btn flat round color="public" @click="SaveData" icon="mdi-content-save-outline">
<q-btn flat round color="public" @click="SaveData()" icon="mdi-content-save-outline">
<q-tooltip>นท</q-tooltip>
</q-btn>
</q-card-actions>

View file

@ -86,7 +86,7 @@ const save = () => {
const validateForm = () => {
return (
fileOrder.value !== null &&
fileOrder.value !== null &&
fileTailer.value !== null &&
order.value.trim() !== ""
);
};

View file

@ -28,19 +28,14 @@ const personalId = ref<string>(route.params.id.toString());
const person = ref<any>([]);
const assign = ref<any>([]);
const evaluate_no = ref<string>("");
const start_date = ref<Date>(new Date());
const date_finish = ref<Date>(new Date());
const evaluate_no = ref<any>("");
const start_date = ref<any>();
const date_finish = ref<any>();
const status = ref<boolean>(true);
const chairman = ref<any>([]);
const commander = ref<any>([]);
const mentors = ref<any>([{ name: "" }, { name: "" }]);
const round = ref<any>();
const props = defineProps({
tab: String,
});
onMounted(() => {
fecthAssign(assignId.value);
});
@ -49,15 +44,14 @@ const fecthAssign = async (id: string) => {
await http
.get(config.API.evaluateChairman(id))
.then(async (res: any) => {
person.value = res.data.data.person;
assign.value = res.data.data.assign;
evaluate_no.value = res.data.data.evaluate_no;
start_date.value = res.data.data.start_date;
date_finish.value = res.data.data.end_date;
chairman.value = res.data.data.chairman;
commander.value = res.data.data.commander;
mentors.value = res.data.data.mentors;
round.value = res.data.data.evaluate_no;
person.value = await res.data.data.person;
assign.value = await res.data.data.assign;
evaluate_no.value = await res.data.data.evaluate_no;
start_date.value = await res.data.data.start_date;
date_finish.value = await res.data.data.end_date;
chairman.value = await res.data.data.chairman;
commander.value = await res.data.data.commander;
mentors.value = await res.data.data.mentors;
})
.catch((e) => {
messageError($q, e);
@ -385,7 +379,7 @@ const putformData = () => {
</div>
<div class="col-12 text-top0 row items-center">
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
<span class="text-primary q-pr-sm">{{ "ครั้งที่ " + round }}</span>
<span class="text-primary q-pr-sm">{{ `ครั้งที่ ${evaluate_no}` }}</span>
ระหวางวนท
<span class="text-black q-px-sm">{{
date2Thai(start_date)
@ -416,7 +410,7 @@ const putformData = () => {
1.1. ความสามารถในการเรยนรงาน</q-item-label>
</q-item-section>
<q-item-section side>
<q-rating :disable="!status" v-model="learn_level" max="5" size="sm" color="grey"
<q-rating v-model="learn_level" max="5" size="sm" color="grey"
:color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก</q-tooltip>
@ -449,7 +443,7 @@ const putformData = () => {
ความสามารถในการปรบใชความรบงานในหนาท</q-item-label>
</q-item-section>
<q-item-section side>
<q-rating :disable="!status" v-model="apply_level" max="5" size="sm" color="grey"
<q-rating v-model="apply_level" max="5" size="sm" color="grey"
:color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก</q-tooltip>
@ -481,7 +475,7 @@ const putformData = () => {
1.3. ความสำเรจของงานทไดบมอบหมาย</q-item-label>
</q-item-section>
<q-item-section side>
<q-rating :disable="!status" v-model="success_level" max="5" size="sm" color="grey"
<q-rating v-model="success_level" max="5" size="sm" color="grey"
:color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก</q-tooltip>
@ -511,7 +505,7 @@ const putformData = () => {
<q-item-label>
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
1.4 นๆ
<q-checkbox :disable="!status" class="q-ml-sm" dense v-model="etc" @click="
<q-checkbox class="q-ml-sm" dense v-model="etc" @click="
(achievement_other.text = ''),
(achievement_other.level = 0)
" /></q-item-label>
@ -525,7 +519,7 @@ const putformData = () => {
<q-item dense tag="label" v-ripple>
<q-item-section class="q-ml-md">
<q-item-label>
<q-input :disable="!status" v-model="achievement_other.text" label="กรอกอื่นๆ" dense lazy-rules
<q-input v-model="achievement_other.text" label="กรอกอื่นๆ" dense lazy-rules
autogrow hide-bottom-space outlined class="bg-white" :rules="[
(val) =>
(val && val.length > 0) || 'กรุณากรอกข้อความ',
@ -533,7 +527,7 @@ const putformData = () => {
</q-item-label>
</q-item-section>
<q-item-section side>
<q-rating :disable="!status" v-model="achievement_other.level" max="5" size="sm" color="grey"
<q-rating v-model="achievement_other.level" max="5" size="sm" color="grey"
:color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก</q-tooltip>
@ -583,7 +577,7 @@ const putformData = () => {
<q-item-label>{{ list.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-rating :disable="!status" v-model="conduct_level[i]" :val="list.id" max="5" size="sm"
<q-rating v-model="conduct_level[i]" :val="list.id" max="5" size="sm"
color="grey" :color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก</q-tooltip>
@ -619,7 +613,7 @@ const putformData = () => {
<q-item-label>{{ list.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-rating :disable="!status" v-model="moral_level[i]" :val="list.id" max="5" size="sm" color="grey"
<q-rating v-model="moral_level[i]" :val="list.id" max="5" size="sm" color="grey"
:color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก</q-tooltip>
@ -655,7 +649,7 @@ const putformData = () => {
<q-item-label>{{ list.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-rating :disable="!status" v-model="discipline_level[i]" :val="list.id" max="5" size="sm"
<q-rating v-model="discipline_level[i]" :val="list.id" max="5" size="sm"
color="grey" :color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก</q-tooltip>
@ -683,7 +677,7 @@ const putformData = () => {
<div class="col-12 text-top0 row items-center q-pl-lg">
<q-icon name="mdi-label" color="grey-4" class="q-pr-sm" />
2.4 นๆ
<q-checkbox :disable="!status" class="q-ml-sm" dense v-model="etc2" @click="
<q-checkbox class="q-ml-sm" dense v-model="etc2" @click="
(behavio_orther.text = ''), (behavio_orther.level = 0)
" />
</div>
@ -692,7 +686,7 @@ const putformData = () => {
<q-item dense tag="label" v-ripple>
<q-item-section>
<q-item-label>
<q-input :disable="!status" v-model="behavio_orther.text" label="กรอกอื่นๆ" dense lazy-rules
<q-input v-model="behavio_orther.text" label="กรอกอื่นๆ" dense lazy-rules
autogrow hide-bottom-space outlined class="bg-white" :rules="[
(val) =>
(val && val.length > 0) || 'กรุณากรอกข้อความ',
@ -700,7 +694,7 @@ const putformData = () => {
</q-item-label>
</q-item-section>
<q-item-section side>
<q-rating :disable="!status" v-model="behavio_orther.level" max="5" size="sm" color="grey"
<q-rating v-model="behavio_orther.level" max="5" size="sm" color="grey"
:color-selected="ratingColors" label="ระดับการประเมินพฤติกรรม">
<template v-slot:tip-1>
<q-tooltip>ำกวาความคาดหวงมาก</q-tooltip>
@ -856,30 +850,30 @@ const putformData = () => {
<div class="row q-gutter-md align-center q-pl-md">
<div class="col-8">1. การปฐมนเทศ</div>
<div class="col">
<q-input outlined :disable="!status" dense type="number" v-model="orientation" />
<q-input outlined dense type="number" v-model="orientation" />
</div>
<div class="col">
<q-input outlined :disable="!status" dense type="number" v-model="orientation_percent" />
<q-input outlined dense type="number" v-model="orientation_percent" />
</div>
</div>
<q-separator class="q-my-xs" />
<div class="row q-gutter-md align-center q-pl-md">
<div class="col-8">2. การเรยนรวยตนเอง</div>
<div class="col">
<q-input outlined :disable="!status" dense type="number" v-model="self_learning" />
<q-input outlined dense type="number" v-model="self_learning" />
</div>
<div class="col">
<q-input outlined :disable="!status" dense type="number" v-model="self_learning_percent" />
<q-input outlined dense type="number" v-model="self_learning_percent" />
</div>
</div>
<q-separator class="q-my-xs" />
<div class="row q-gutter-md align-center q-pl-md">
<div class="col-8">3. การอบรมสมนารวมก</div>
<div class="col">
<q-input outlined :disable="!status" dense type="number" v-model="training_seminar" />
<q-input outlined dense type="number" v-model="training_seminar" />
</div>
<div class="col">
<q-input outlined :disable="!status" dense type="number" v-model="training_seminar_percent" />
<q-input outlined dense type="number" v-model="training_seminar_percent" />
</div>
</div>
<q-separator class="q-my-xs" />
@ -888,10 +882,10 @@ const putformData = () => {
4. การอบรมอ ตามทหนวยงานกำหนด (าม)
</div>
<div class="col">
<q-input outlined :disable="!status" dense type="number" v-model="other_training" />
<q-input outlined dense type="number" v-model="other_training" />
</div>
<div class="col">
<q-input outlined :disable="!status" dense type="number" v-model="other_training_percent" />
<q-input outlined dense type="number" v-model="other_training_percent" />
</div>
</div>
<!-- <q-list dense>
@ -1012,7 +1006,7 @@ const putformData = () => {
สรปผลการพฒนา
</div>
<div class="col-12">
<q-select :disable="!status" class="col-xs-12" dense v-model="develop_result" outlined
<q-select class="col-xs-12" dense v-model="develop_result" outlined
:options="develop_result_option" option-label="name" option-value="value"
label="เลือกสรุปผลการพัฒนา" map-options emit-value />
</div>
@ -1026,7 +1020,7 @@ const putformData = () => {
สรปผล การประเมนผลทดลองปฎหนาทราชการ
</div>
<div class="col-12">
<q-select :disable="!status" class="col-xs-12" dense v-model="evaluate_result" outlined
<q-select class="col-xs-12" dense v-model="evaluate_result" outlined
:options="evaluate_result_option" option-label="name" option-value="value"
label="เลือกสรุปผล การประเมินผลทดลองปฎิบัติหน้าที่ราชการ" map-options emit-value />
</div>
@ -1053,7 +1047,7 @@ const putformData = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input hide-bottom-space outlined :disable="!status" dense class="full-width datepicker col-3" :model-value="dateAutherise != null
<q-input hide-bottom-space outlined dense class="full-width datepicker col-3" :model-value="dateAutherise != null
? date2Thai(dateAutherise)
: null
" :label="`${'ลงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]">
@ -1077,7 +1071,7 @@ const putformData = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input hide-bottom-space :disable="!status" outlined dense class="full-width datepicker col-3" :model-value="dateAutherise != null
<q-input hide-bottom-space outlined dense class="full-width datepicker col-3" :model-value="dateAutherise != null
? date2Thai(dateAutherise)
: null
" :label="`${'ลงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]">
@ -1100,7 +1094,7 @@ const putformData = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input hide-bottom-space :disable="!status" outlined dense class="full-width datepicker col-3" :model-value="dateAutherise != null
<q-input hide-bottom-space outlined dense class="full-width datepicker col-3" :model-value="dateAutherise != null
? date2Thai(dateAutherise)
: null
" :label="`${'ลงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]">
@ -1131,7 +1125,7 @@ const putformData = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input :disable="!status" outlined dense class="full-width datepicker col-3" :model-value="dateAutherise != null
<q-input outlined dense class="full-width datepicker col-3" :model-value="dateAutherise != null
? date2Thai(dateAutherise)
: null
" :label="`${'ลงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]">

View file

@ -52,11 +52,11 @@ const fecthAssign = async (id: string) => {
date_start.value = assign.value.date_start;
date_finish.value = assign.value.date_finish;
director_id.value = res.data.data.commander.name;
director_id2.value = mentors.value[0].name;
director_id3.value = mentors.value[1].name;
director_id.value = res.data.data.chairman.name;
director_id2.value = res.data.data.commander.name;
director_id3.value = mentors.value[0].name;
commander.value.push(res.data.data.commander);
commander.value = res.data.data.commander;
optionDirector.value = mentors.value;
})
.catch((e) => {
@ -80,21 +80,25 @@ const fullname = ref<string>("");
const fecthResult = async (id: string) => {
await http
.get(config.API.createformReport(id))
.then((res: any) => {
let data = res.data.data.evaluate;
fullname.value = res.data.data.profile.name;
date_start.value = data.date_start;
date_finish.value = data.date_finish;
develop.value = Number(data.develop_complete);
result.value = Number(data.pass_result);
reson.value = data.reson;
chairman_dated.value = data.chairman_dated;
director1_dated.value = data.director1_dated;
director2_dated.value = data.director2_dated;
status.value = false;
action.value = "edit";
.then(async(res: any) => {
if (res.data.data != null) {
const data = await res.data.data.evaluate;
console.log("data ===>", data);
fullname.value = res.data.data.profile.name;
date_start.value = data.date_start;
date_finish.value = data.date_finish;
develop.value = await Number(data.develop_complete);
result.value = await Number(data.pass_result);
reson.value = await data.reson;
chairman_dated.value = await data.chairman_dated;
director1_dated.value = await data.director1_dated;
director2_dated.value = await data.director2_dated;
status.value = false;
action.value = "edit";
}
})
.catch((e) => {});
.catch((e) => { });
};
// part new
@ -185,27 +189,16 @@ const selectRuslt = () => {
<div class="toptitle text-dark col-12 row items-center q-gutter-md">
<div>แบบรายงานการประเมนฯ</div>
<!-- <q-space /> -->
<q-btn
v-if="!status"
size="12px"
flat
dense
icon="mdi-download"
color="primary"
>
<q-btn v-if="!status" size="12px" flat dense icon="mdi-download" color="primary">
<q-tooltip>ดาวนโหลด</q-tooltip>
<q-menu>
<q-list style="min-width: 150px">
<q-item clickable v-close-popup @click="clickdownloadFile('pdf')">
<q-item-section avatar
><q-icon color="red" name="mdi-file-pdf"
/></q-item-section>
<q-item-section avatar><q-icon color="red" name="mdi-file-pdf" /></q-item-section>
<q-item-section>ไฟล .PDF</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="clickdownloadFile('docx')">
<q-item-section avatar
><q-icon color="blue" name="mdi-file-word"
/></q-item-section>
<q-item-section avatar><q-icon color="blue" name="mdi-file-word" /></q-item-section>
<q-item-section>ไฟล .docx</q-item-section>
</q-item>
</q-list>
@ -214,14 +207,7 @@ const selectRuslt = () => {
<div v-if="action == 'edit'">
<div v-if="status == false">
<q-btn
dense
flat
round
color="primary"
@click="edit()"
icon="mdi-pencil-outline"
>
<q-btn dense flat round color="primary" @click="edit()" icon="mdi-pencil-outline">
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
</div>
@ -229,15 +215,8 @@ const selectRuslt = () => {
<q-btn dense flat round color="red" @click="cancel()" icon="mdi-undo">
<q-tooltip>ยกเล</q-tooltip>
</q-btn>
<q-btn
dense
flat
round
class="q-ml-sm"
color="public"
@click="saveEdit(assignId)"
icon="mdi-content-save-outline"
>
<q-btn dense flat round class="q-ml-sm" color="public" @click="saveEdit(assignId)"
icon="mdi-content-save-outline">
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</div>
@ -247,16 +226,8 @@ const selectRuslt = () => {
<div class="row col-12">
<div class="col-12 row q-col-gutter-md">
<div class="col-xs-12 col-sm-6">
<datepicker
menu-class-name="modalfix"
v-model="date_start"
:locale="'th'"
autoApply
borderless
:readonly="!status"
:enableTimePicker="false"
week-start="0"
>
<datepicker menu-class-name="modalfix" v-model="date_start" :locale="'th'" autoApply borderless
:readonly="!status" :enableTimePicker="false" week-start="0">
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -264,23 +235,10 @@ const selectRuslt = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
:disable="!status"
class="full-width datepicker"
:model-value="
date_start != null ? date2Thai(date_start) : null
"
:label="`${'ระหว่างวันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]"
>
<q-input outlined dense :disable="!status" class="full-width datepicker" :model-value="date_start != null ? date2Thai(date_start) : null
" :label="`${'ระหว่างวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]">
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
</q-icon>
</template>
</q-input>
@ -288,16 +246,8 @@ const selectRuslt = () => {
</datepicker>
</div>
<div class="col-xs-12 col-sm-6">
<datepicker
menu-class-name="modalfix"
v-model="date_finish"
:locale="'th'"
autoApply
:readonly="!status"
borderless
:enableTimePicker="false"
week-start="0"
>
<datepicker menu-class-name="modalfix" v-model="date_finish" :locale="'th'" autoApply :readonly="!status"
borderless :enableTimePicker="false" week-start="0">
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -305,23 +255,10 @@ const selectRuslt = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
:disable="!status"
class="full-width datepicker"
:model-value="
date_finish != null ? date2Thai(date_finish) : null
"
:label="`${'ถึงวันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]"
>
<q-input outlined dense :disable="!status" class="full-width datepicker" :model-value="date_finish != null ? date2Thai(date_finish) : null
" :label="`${'ถึงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]">
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
</q-icon>
</template>
</q-input>
@ -334,78 +271,35 @@ const selectRuslt = () => {
<div class="col-12 row q-mt-xs">
<div class="col-12 row q-col-gutter-md">
<div class="col-xs-12 col-sm-6">
<q-select
:rules="[
(val) =>
!!val ||
'กรุณาเลือกการพัฒนาในระหว่างทดลองปฏิบัติหน้าที่ราชการ',
]"
hide-bottom-space
:options="options"
class="col-xs-12 col-sm-6"
dense
borderless
:disable="!status"
emit-value
map-options
option-label="label"
option-value="value"
outlined
v-model="develop"
label="การพัฒนาในระหว่างทดลองปฏิบัติหน้าที่ราชการ"
/>
<q-select :rules="[
(val) =>
!!val ||
'กรุณาเลือกการพัฒนาในระหว่างทดลองปฏิบัติหน้าที่ราชการ',
]" hide-bottom-space :options="options" class="col-xs-12 col-sm-6" dense borderless :disable="!status"
emit-value map-options option-label="label" option-value="value" outlined v-model="develop"
label="การพัฒนาในระหว่างทดลองปฏิบัติหน้าที่ราชการ" />
</div>
<div class="col-xs-12 col-sm-6">
<div class="row">
<q-select
class="col-sm-12"
:rules="[
(val) =>
!!val ||
'กรุณาเลือกผลการประเมินการทดลองปฏิบัติหน้าที่ราชการ',
]"
hide-bottom-space
:options="optionsResult"
:disable="!status"
dense
borderless
emit-value
map-options
option-label="label"
option-value="value"
outlined
v-model="result"
label="ผลการประเมินการทดลองปฏิบัติหน้าที่ราชการ"
@update:model-value="selectRuslt"
/>
<q-select class="col-sm-12" :rules="[
(val) =>
!!val ||
'กรุณาเลือกผลการประเมินการทดลองปฏิบัติหน้าที่ราชการ',
]" hide-bottom-space :options="optionsResult" :disable="!status" dense borderless emit-value
map-options option-label="label" option-value="value" outlined v-model="result"
label="ผลการประเมินการทดลองปฏิบัติหน้าที่ราชการ" @update:model-value="selectRuslt" />
</div>
<div class="row q-mt-xs" v-if="result === 3">
<q-input
outlined
dense
v-model="expand_month"
label="จำนวนเดือน"
:rules="[(val) => !!val || 'กรุณากรอกจำนวนเดือน']"
type="number"
/>
<q-input outlined dense v-model="expand_month" label="จำนวนเดือน"
:rules="[(val) => !!val || 'กรุณากรอกจำนวนเดือน']" type="number" />
</div>
</div>
</div>
</div>
<div class="col-12 row q-mt-lg">
<div class="col-12">
<q-input
hide-bottom-space
dense
borderless
outlined
:disable="!status"
class="bg-white"
type="textarea"
v-model="reson"
label="เหตุผล"
:rules="[(val) => !!val || 'กรุณาระบุเหตุผล']"
/>
<q-input hide-bottom-space dense borderless outlined :disable="!status" class="bg-white" type="textarea"
v-model="reson" label="เหตุผล" :rules="[(val) => !!val || 'กรุณาระบุเหตุผล']" />
</div>
</div>
@ -419,27 +313,11 @@ const selectRuslt = () => {
ประธานคณะกรรมการประเมนผลการปฏหนาทราชการ
</div>
<div class="col-12 row q-col-gutter-md">
<q-select
class="col-xs-12 col-sm-8"
dense
v-model="director_id"
outlined
:options="commander"
label="ชื่อ-นามสกุล"
option-label="name"
disable
/>
<q-select class="col-xs-12 col-sm-8" dense v-model="director_id" outlined :options="commander"
label="ชื่อ-นามสกุล" option-label="name" disable />
<div class="col-xs-12 col-sm-4">
<datepicker
menu-class-name="modalfix"
v-model="chairman_dated"
:locale="'th'"
:readonly="!status"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<datepicker menu-class-name="modalfix" v-model="chairman_dated" :locale="'th'" :readonly="!status" autoApply
borderless :enableTimePicker="false" week-start="0">
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -447,23 +325,10 @@ const selectRuslt = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
:disable="!status"
class="full-width datepicker col-3"
:model-value="
chairman_dated != null ? date2Thai(chairman_dated) : null
"
:label="`${'ลงวันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]"
>
<q-input outlined dense :disable="!status" class="full-width datepicker col-3" :model-value="chairman_dated != null ? date2Thai(chairman_dated) : null
" :label="`${'ลงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]">
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
</q-icon>
</template>
</q-input>
@ -479,27 +344,11 @@ const selectRuslt = () => {
<!-- ความเหนของผอำนาจสงบรรจตามมาตรา 52 -->
</div>
<div class="col-12 row q-col-gutter-md">
<q-select
class="col-xs-12 col-sm-8"
dense
v-model="director_id2"
outlined
label="ชื่อ-นามสกุล"
:disable="!status"
:options="optionDirector"
option-label="name"
/>
<q-select class="col-xs-12 col-sm-8" dense v-model="director_id2" outlined label="ชื่อ-นามสกุล"
disable :options="optionDirector" option-label="name" />
<div class="col-xs-12 col-sm-4">
<datepicker
menu-class-name="modalfix"
v-model="director1_dated"
:locale="'th'"
autoApply
borderless
:readonly="!status"
:enableTimePicker="false"
week-start="0"
>
<datepicker menu-class-name="modalfix" v-model="director1_dated" :locale="'th'" autoApply borderless
:readonly="!status" :enableTimePicker="false" week-start="0">
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -507,25 +356,12 @@ const selectRuslt = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
:disable="!status"
class="full-width datepicker col-3"
:model-value="
director1_dated != null
? date2Thai(director1_dated)
: null
"
:label="`${'ลงวันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]"
>
<q-input outlined dense :disable="!status" class="full-width datepicker col-3" :model-value="director1_dated != null
? date2Thai(director1_dated)
: null
" :label="`${'ลงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]">
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
</q-icon>
</template>
</q-input>
@ -541,27 +377,11 @@ const selectRuslt = () => {
<!-- อำนาจสงบรรจตามมาตรา 52 -->
</div>
<div class="col-12 row q-col-gutter-md">
<q-select
class="col-xs-12 col-sm-8"
dense
v-model="director_id3"
outlined
label="ชื่อ-นามสกุล"
:options="optionDirector"
:disable="!status"
option-label="name"
/>
<q-select class="col-xs-12 col-sm-8" dense v-model="director_id3" outlined label="ชื่อ-นามสกุล"
:options="optionDirector" disable option-label="name" />
<div class="col-xs-12 col-sm-4">
<datepicker
menu-class-name="modalfix"
v-model="director2_dated"
:locale="'th'"
autoApply
:readonly="!status"
borderless
:enableTimePicker="false"
week-start="0"
>
<datepicker menu-class-name="modalfix" v-model="director2_dated" :locale="'th'" autoApply
:readonly="!status" borderless :enableTimePicker="false" week-start="0">
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -569,25 +389,12 @@ const selectRuslt = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
:disable="!status"
class="full-width datepicker col-3"
:model-value="
director2_dated != null
? date2Thai(director2_dated)
: null
"
:label="`${'ลงวันที่'}`"
:rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]"
>
<q-input outlined dense :disable="!status" class="full-width datepicker col-3" :model-value="director2_dated != null
? date2Thai(director2_dated)
: null
" :label="`${'ลงวันที่'}`" :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]">
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
<q-icon name="event" class="cursor-pointer" style="color: var(--q-primary)">
</q-icon>
</template>
</q-input>

View file

@ -41,7 +41,7 @@ const fecthAssign = async (id: string) => {
.get(config.API.formevaluate(id))
.then(async (res: any) => {
await fecthdataAssign(res.data.data);
fullname.value = res.data.data.person.name;
fullname.value = res.data.data.experimentee ? res.data.data.experimentee.name : "";
dataArrayNumber.value = 1;
})
.catch((e: any) => {

View file

@ -52,7 +52,7 @@ const fecthAssign = async (id: string) => {
await fecthdataAssign(res.data.data);
evaluate.value = assignStore.evaluate;
tabs.value = evaluate.value;
fullname.value = res.data.data.person.name;
fullname.value = res.data.data.experimentee ? res.data.data.experimentee.name : "";
dataArrayNumber.value = 1;
})
.catch((e: any) => {

View file

@ -47,7 +47,7 @@ const fecthAssign = async (id: string) => {
.then(async (res: any) => {
await fecthdataAssign(res.data.data);
evaluate.value = assignStore.evaluate;
fullname.value = res.data.data.person.name;
fullname.value = res.data.data.experimentee ? res.data.data.experimentee.name : "";
tabs.value = evaluate.value;
dataArrayNumber.value = 1;
})

View file

@ -94,7 +94,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "probation_status",
align: "left",
label: "สถานะทดลองงาน",
label: "สถานะการทดลองงาน",
sortable: true,
field: "probation_status",
headerStyle: "font-size: 14px",
@ -251,7 +251,7 @@ const findlist = async (id: string) => {
position: e.position,
level: e.positionEmployeeLevel,
organizationOrganization: e.oc,
status: statusProbation(e.probation),
status: e.probation,
}));
modal.value = true;
};
@ -306,14 +306,6 @@ const statusProbationMain = (val: number) => {
return " ";
}
};
const statusProbation = (val: boolean) => {
switch (val) {
case true:
return "ทดลองงาน";
default:
return " ";
}
};
//
const filterKeyword = ref<string>("");
@ -482,6 +474,9 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name == 'status'">
<q-icon v-if="col.value === true" name="mdi-check" color="positive" />
</div>
<div v-else>
{{ col.value }}
</div>

View file

@ -333,7 +333,7 @@ const downloadAttachment = async (type: string, id: string) => {
const data = res.data.result;
console.log(data);
let list: any[] = [];
downloadFile(res, `${id}.${type}`);
downloadFile(res, `${"รายชื่อผู้เกษียณอายุราชการ"}.${type}`);
})
.catch((e) => {
messageError($q, e);
@ -352,7 +352,6 @@ const downloadFile = (response: any, filename: string) => {
document.body.removeChild(link);
};
// const fetchReportCover = async (type: string, orderId: string) => {
// showLoader();
// await http

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { onMounted, ref, watch, reactive } from "vue";
import { onMounted, ref, computed, reactive } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import type { QTableProps } from "quasar";
@ -12,7 +12,14 @@ import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
const router = useRouter();
const mixin = useCounterMixin();
const { dialogConfirm, showLoader, hideLoader, messageError, success } = mixin;
const {
dialogConfirm,
showLoader,
hideLoader,
messageError,
success,
dialogMessageNotify,
} = mixin;
const $q = useQuasar();
const DataStore = useInsigniaDataStore();
@ -29,6 +36,7 @@ const visibleColumns = ref<string[]>([
"no",
"citizenId",
"name",
"employeeType",
"position",
"level",
"salary",
@ -51,7 +59,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "citizenId",
align: "left",
label: "เลขบัตรประชาชน",
label: "เลขประจำตัวประชาชน",
sortable: true,
field: "citizenId",
headerStyle: "font-size: 14px",
@ -66,6 +74,15 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "employeeType",
align: "left",
label: "สถานภาพ",
sortable: true,
field: "employeeType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "position",
align: "left",
@ -211,6 +228,14 @@ onMounted(async () => {
}
}
});
const checkStatus = computed(() => {
if (
DataStore.roleUser === "insignia1" &&
(DataStore.requestStatus == "st1" || DataStore.requestStatus == "st4")
) {
return true;
} else return false;
});
const changtypeOc = () => {
if (props.fecthInsigniaByOc) {
props.fecthInsigniaByOc(
@ -225,6 +250,8 @@ const changtypeOc = () => {
const clickmodalAdd = () => {
showLoader();
fecthlistRetire();
fecthInsignia();
insigniaType.value = "";
};
// fecth profile
const fecthlistRetire = async () => {
@ -257,14 +284,16 @@ const fecthlistperson = async (id: string) => {
criterias: data,
})
.then((res) => {
rows2.value = res.data.result.map((e: any) => ({
let data = res.data.result.map((e: any) => ({
id: e.id,
fullname: e.fullname == null ? "-" : e.fullname,
position: e.position == null ? "-" : e.position,
level: e.positionEmployeeLevel == null ? "-" : e.positionEmployeeLevel,
organizationOrganization: e.oc == null ? "-" : e.oc,
ocId: DataStore.convertOcid(e.oc),
}));
modalAdd.value = true;
rows2.value = data.filter((e: any) => e.ocId === DataStore.typeOc);
})
.catch((e) => {
messageError($q, e);
@ -274,20 +303,23 @@ const fecthlistperson = async (id: string) => {
});
};
const clickAdd = async (id: string) => {
dialogConfirm(
$q,
async () => {
await addlistperson(id);
},
"ยืนยันการเพิ่มรายชื่อขอพระราชทานเครื่องราชฯ",
"ต้องการยืนยันการเพิ่มรายชื่อขอพระราชทานเครื่องราชฯ นี้หรือไม่ ?"
);
if (insigniaType.value !== "") {
dialogConfirm(
$q,
async () => {
await addlistperson(id);
},
"ยืนยันการเพิ่มรายชื่อขอพระราชทานเครื่องราชฯ",
"ต้องการยืนยันการเพิ่มรายชื่อขอพระราชทานเครื่องราชฯ นี้หรือไม่ ?"
);
} else dialogMessageNotify($q, "กรุณาเลือกรายชื่อขอพระราชทานเครื่องราชฯ");
};
const addlistperson = async (id: string) => {
showLoader();
let data = {
profileId: id,
insigniaId: insigniaType.value,
insigniaPeriodId: props.roundId,
};
await http
@ -328,26 +360,47 @@ const downloadFile = (response: any, filename: string) => {
link.click();
document.body.removeChild(link);
};
const downloadReport = async (type: string = "pdf") => {
const downloadFileexcel = async () => {
showLoader();
await http
.get(config.API.reportInsignia("45", type, props.roundId!), {
.get(config.API.insigniaDowanload(DataStore.requestId), {
responseType: "blob",
})
.then(async (res) => {
downloadFile(
await downloadFile(
res,
`บัญชีแสดงรายชื่อผู้ขอพระราชทานเหรียญจักรพรรดิมาลา ${props.roundName}.${type}`
`รายชื่อข้าราชการสามัญฯ ${props.roundName}.xlsx`
);
})
.catch((e) => {
messageError($q, e);
.catch((err) => {
console.log(err);
messageError($q, err);
})
.finally(() => {
hideLoader();
});
};
// const downloadReport = async (type: string = "pdf") => {
// showLoader();
// await http
// .get(config.API.reportInsignia("45", type, props.roundId!), {
// responseType: "blob",
// })
// .then(async (res) => {
// console.log(res);
// downloadFile(
// res,
// ` ${props.roundName}.${type}`
// );
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
// };
const clickSave = () => {
dialogConfirm(
@ -479,7 +532,6 @@ const fecthInsignia = async () => {
messageError($q, e);
});
};
const nextPage = (id: string) => {
router.push(`/registry/${id}`);
};
@ -493,13 +545,13 @@ const resetFilter = () => {
filterRef.value.focus();
};
const pagination = ref({
sortBy: "desc",
sortBy: "name",
descending: false,
page: 1,
rowsPerPage: 10,
});
const pagination2 = ref({
sortBy: "desc",
sortBy: "name",
descending: false,
page: 1,
rowsPerPage: 10,
@ -558,10 +610,38 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
@update:model-value="DataStore.searchFilterTable"
/>
<div>
<q-btn size="md" icon="mdi-download" flat round color="primary">
<q-select
v-model="DataStore.employeeClass"
dense
outlined
lazy-rules
hide-bottom-space
:label="`${'สถานภาพ'}`"
emit-value
map-options
option-label="name"
:options="DataStore.employeeClassOps"
option-value="id"
:readonly="false"
:borderless="false"
style="min-width: 150px"
@update:model-value="
DataStore.selectEmployeeClass(DataStore.employeeClass)
"
/>
</div>
<div>
<q-btn
size="md"
icon="mdi-download"
flat
round
color="primary"
@click="downloadFileexcel"
>
<!-- @click="downloadReport('pdf')" -->
<q-tooltip>ดาวนโหลด</q-tooltip>
<q-menu>
<!-- <q-menu>
<q-list style="min-width: 150px">
<q-item clickable v-close-popup @click="downloadReport('pdf')">
<q-item-section avatar
@ -582,7 +662,7 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
<q-item-section>ไฟล .xlsx</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-menu> -->
</q-btn>
<q-btn
size="12px"
@ -591,6 +671,12 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
color="add"
icon="mdi-plus"
@click="clickmodalAdd"
v-if="
(DataStore.isLock == false &&
DataStore.requestStatus == 'st5' &&
DataStore.roleUser == 'admin') ||
checkStatus == true
"
>
<q-tooltip>เพ</q-tooltip>
</q-btn>
@ -655,7 +741,14 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
<q-th
auto-width
v-if="
(DataStore.isLock == false &&
DataStore.requestStatus == 'st5') ||
checkStatus == true
"
/>
</q-tr>
</template>
<template v-slot:body="props">
@ -673,6 +766,9 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
<q-td key="name" :props="props">
{{ props.row.name }}
</q-td>
<q-td key="employeeType" :props="props">
{{ props.row.employeeType }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position }}
</q-td>
@ -694,7 +790,15 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
<q-td key="dateSend" :props="props">
{{ props.row.dateSend }}
</q-td>
<q-td auto-width>
<q-td
auto-width
v-if="
(DataStore.isLock == false &&
DataStore.requestStatus == 'st5' &&
DataStore.roleUser == 'admin') ||
checkStatus == true
"
>
<q-btn
v-if="
roleUser == 'admin' ||
@ -790,6 +894,7 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
<q-card style="width: 850px; max-width: 80vw" class="q-pb-md">
<q-toolbar class="q-py-md">
<q-toolbar-title class="text-h6">เพมรายช </q-toolbar-title>
<q-btn
icon="close"
unelevated
@ -802,15 +907,33 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
<q-separator />
<div class="q-pa-md">
<q-toolbar style="padding: 0">
<q-select
v-model="insigniaType"
label="ปรเภทเครื่องราชฯ"
dense
emit-value
map-options
:options="insigniaOptions"
option-value="id"
option-label="name"
lazy-rules
hide-bottom-space
:readonly="false"
:borderless="false"
:outlined="true"
:hide-dropdown-icon="false"
style="min-width: 250px"
/>
<q-space />
<q-input
borderless
outlined
dense
debounce="300"
placeholder="ค้นหา"
style="width: 850px; max-width: auto"
v-model="filterKeyword2"
>
<!-- style="width: 850px; max-width: auto"? -->
<template v-slot:append>
<q-icon name="search" />
</template>

View file

@ -31,6 +31,7 @@ const visibleColumns = ref<string[]>([
"no",
"citizenId",
"name",
"employeeType",
"position",
"level",
"salary",
@ -52,7 +53,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "citizenId",
align: "left",
label: "เลขบัตรประชาชน",
label: "เลขประจำตัวประชาชน",
sortable: true,
field: "citizenId",
headerStyle: "font-size: 14px",
@ -67,6 +68,15 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "employeeType",
align: "left",
label: "สถานภาพ",
sortable: true,
field: "employeeType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "position",
align: "left",
@ -76,6 +86,7 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "level",
align: "left",
@ -172,7 +183,7 @@ const resetFilter = () => {
filterRef.value.focus();
};
const pagination = ref({
sortBy: "desc",
sortBy: "name",
descending: false,
page: 1,
rowsPerPage: 10,
@ -237,6 +248,27 @@ const closeReson = () => {
style="min-width: 150px"
@update:model-value="DataStore.searchFilterTable"
/>
<div>
<q-select
v-model="DataStore.employeeClass"
dense
outlined
lazy-rules
hide-bottom-space
:label="`${'สถานภาพ'}`"
emit-value
map-options
option-label="name"
:options="DataStore.employeeClassOps"
option-value="id"
:readonly="false"
:borderless="false"
style="min-width: 150px"
@update:model-value="
DataStore.selectEmployeeClass(DataStore.employeeClass)
"
/>
</div>
<q-space />
<q-input
@ -315,6 +347,9 @@ const closeReson = () => {
<q-td key="name" :props="props">
{{ props.row.name }}
</q-td>
<q-td key="employeeType" :props="props">
{{ props.row.employeeType }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position }}
</q-td>
@ -324,7 +359,6 @@ const closeReson = () => {
<q-td key="salary" :props="props">
{{ Number(props.row.salary).toLocaleString() }}
</q-td>
<q-td key="insigniaType" :props="props">
{{ props.row.insigniaType }}
</q-td>

View file

@ -32,6 +32,7 @@ const visibleColumns = ref<string[]>([
"no",
"citizenId",
"name",
"employeeType",
"position",
"level",
"salary",
@ -53,7 +54,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "citizenId",
align: "left",
label: "เลขบัตรประชาชน",
label: "เลขประจำตัวประชาชน",
sortable: true,
field: "citizenId",
headerStyle: "font-size: 14px",
@ -68,6 +69,15 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "employeeType",
align: "left",
label: "สถานภาพ",
sortable: true,
field: "employeeType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "position",
align: "left",
@ -171,7 +181,7 @@ const resetFilter = () => {
filterRef.value.focus();
};
const pagination = ref({
sortBy: "desc",
sortBy: "name",
descending: false,
page: 1,
rowsPerPage: 10,
@ -235,6 +245,27 @@ const closeReson = () => {
style="min-width: 150px"
@update:model-value="DataStore.searchFilterTable"
/>
<div>
<q-select
v-model="DataStore.employeeClass"
dense
outlined
lazy-rules
hide-bottom-space
:label="`${'สถานภาพ'}`"
emit-value
map-options
option-label="name"
:options="DataStore.employeeClassOps"
option-value="id"
:readonly="false"
:borderless="false"
style="min-width: 150px"
@update:model-value="
DataStore.selectEmployeeClass(DataStore.employeeClass)
"
/>
</div>
<q-space />
<q-input
@ -313,6 +344,9 @@ const closeReson = () => {
<q-td key="name" :props="props">
{{ props.row.name }}
</q-td>
<q-td key="employeeType" :props="props">
{{ props.row.employeeType }}
</q-td>
<q-td key="position" :props="props">
{{ props.row.position }}
</q-td>

View file

@ -73,7 +73,7 @@ const fecthOrg = async () => {
};
const pagination = ref({
sortBy: "desc",
sortBy: "name",
descending: false,
page: 1,
rowsPerPage: 10,

View file

@ -53,6 +53,7 @@ const checkRole = async () => {
} else {
roleUser.value = "admin";
}
DataStore.roleUser = roleUser.value;
}
};
@ -138,8 +139,9 @@ const changround = async () => {
const roundFilter = await optionRound.value.find(
(x: any) => round.value === x.id
);
roundName.value = `รอบการเสนอขอพระราชทานเครื่องราชปี ${roundFilter.year + 543
}`;
roundName.value = `รอบการเสนอขอพระราชทานเครื่องราชปี ${
roundFilter.year + 543
}`;
};
const requestNote = ref<string>("");
const requestStatus = ref<string>("");
@ -155,8 +157,10 @@ const fecthInsigniaByOc = async (
.then(async (res) => {
requestNote.value = res.data.result.requestNote;
requestStatus.value = res.data.result.requestStatus;
await DataStore.fetchData(res.data.result.items);
await DataStore.fetchDataInsignia(res.data.result);
// DataStore.isLock = await res.data.result.isLock;
// DataStore.requestId = await res.data.result.requestId;
})
.catch((err) => {
messageError($q, err);
@ -293,76 +297,173 @@ const requestSendNote = async () => {
<q-card bordered class="row col-12 q-mt-sm">
<div class="row col-12 items-center bg-grey-1">
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
<q-select borderless dense v-model="round" :options="optionRound" map-options emit-value option-value="id"
option-label="name" @update:model-value="changround" />
<q-select
borderless
dense
v-model="round"
:options="optionRound"
map-options
emit-value
option-value="id"
option-label="name"
@update:model-value="changround"
/>
<q-space />
<!-- สกจ. Freez อม -->
<q-btn v-if="roleUser == 'admin'" dense unelevated label="ล็อกข้อมูล" color="public" class="q-px-md q-ml-md"
@click="requestSendNote">
<q-btn
v-if="roleUser == 'admin' && DataStore.isLock !== true"
dense
unelevated
label="ล็อกข้อมูล"
color="public"
class="q-px-md q-ml-md"
@click="requestSendNote"
>
<q-tooltip>อกขอม</q-tooltip>
</q-btn>
</div>
<div class="col-12"><q-separator /></div>
<div v-if="roleUser == 'admin'" class="col-12 row bg-white">
<div class="fit q-px-md q-py-sm">
<div class="row col-12 q-col-gutter-sm fit">
<cardTop :amount="stat.orgAllCount" label="หน่วยงานทั้งหมด" color="#016987" />
<cardTop :amount="stat.orgSendCount" label="หน่วยงานที่ส่งรายชื่อเเล้ว" color="#02A998" />
<cardTop :amount="stat.orgNoSendCount" label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ" color="#2EA0FF" />
<cardTop :amount="stat.allUserUser" label="จำนวนคนที่ยื่นขอ" color="#4154B3" />
<cardTop
:amount="stat.orgAllCount"
label="หน่วยงานทั้งหมด"
color="#016987"
/>
<cardTop
:amount="stat.orgSendCount"
label="หน่วยงานที่ส่งรายชื่อเเล้ว"
color="#02A998"
/>
<cardTop
:amount="stat.orgNoSendCount"
label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ"
color="#2EA0FF"
/>
<cardTop
:amount="stat.allUserUser"
label="จำนวนคนที่ยื่นขอ"
color="#4154B3"
/>
</div>
</div>
</div>
</q-card>
<q-card flat bordered class="col-12 q-mt-sm" v-if="loading">
<div v-if="roleUser == 'insignia1' && requestStatus == 'st4'" class="q-pa-md q-gutter-sm">
<q-banner inline-actions bordered class="bg-orange-1 text-orange border-orange">
<div
v-if="roleUser == 'insignia1' && requestStatus == 'st4'"
class="q-pa-md q-gutter-sm"
>
<q-banner
inline-actions
bordered
class="bg-orange-1 text-orange border-orange"
>
<q-icon name="mdi-information-outline" size="20px" /> หมายเหต กล
{{ requestNote }}
</q-banner>
</div>
<div class="row col-12">
<q-tabs v-model="tab" dense class="text-grey" active-color="primary" active-class="bg-teal-1"
indicator-color="primary" align="left">
<q-tabs
v-model="tab"
dense
class="text-grey"
active-color="primary"
active-class="bg-teal-1"
indicator-color="primary"
align="left"
>
<q-tab name="pending" label="คนที่ยื่นขอ" />
<q-tab name="reject" label="คนที่ไม่ยื่นขอ" />
<q-tab name="delete" label="คนที่ถูกลบออก" />
<q-tab v-if="roleUser == 'admin'" name="organization" label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ" />
<q-tab
v-if="roleUser == 'admin'"
name="organization"
label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ"
/>
</q-tabs>
</div>
<q-separator />
<q-tab-panels v-model="tab" animated>
<q-tab-panel name="pending" class="q-pa-none">
<tab1 :tab="tab" :roundId="round" :roundName="roundName" :fecthInsigniaByOc="fecthInsigniaByOc"
:role-user="roleUser" :request-status="requestStatus" />
<tab1
:tab="tab"
:roundId="round"
:roundName="roundName"
:fecthInsigniaByOc="fecthInsigniaByOc"
:role-user="roleUser"
:request-status="requestStatus"
/>
</q-tab-panel>
<q-tab-panel name="reject" class="q-pa-none">
<tab2 :tab="tab" :roundId="round" :fecthInsigniaByOc="fecthInsigniaByOc" :role-user="roleUser" />
<tab2
:tab="tab"
:roundId="round"
:fecthInsigniaByOc="fecthInsigniaByOc"
:role-user="roleUser"
/>
</q-tab-panel>
<q-tab-panel name="delete" class="q-pa-none">
<tab3 :tab="tab" :roundId="round" :fecthInsigniaByOc="fecthInsigniaByOc" :role-user="roleUser" />
<tab3
:tab="tab"
:roundId="round"
:fecthInsigniaByOc="fecthInsigniaByOc"
:role-user="roleUser"
/>
</q-tab-panel>
<q-tab-panel v-if="roleUser == 'admin'" name="organization" class="q-pa-none">
<q-tab-panel
v-if="roleUser == 'admin'"
name="organization"
class="q-pa-none"
>
<tab4 :tab="tab" :roundId="round" :role-user="roleUser" />
</q-tab-panel>
</q-tab-panels>
<q-toolbar class="q-py-md text-right">
<q-space />
<q-btn v-if="roleUser == 'insignia1' &&
(requestStatus == 'st1' || requestStatus == 'st4')
" dense unelevated label="นทกขอม" color="public" class="q-px-md" @click="sendToDirector" />
<q-btn v-if="roleUser == 'insignia2' && requestStatus == 'st3'" dense unelevated label="ตีกลับ" color="orange"
class="q-px-md" @click="popupBackToEdit" />
<q-btn v-if="roleUser == 'insignia2' && requestStatus == 'st3'" dense unelevated label="อนุมัติ" color="positive"
class="q-px-md q-ml-md" @click="directorApproved" />
<q-btn
v-if="
roleUser == 'insignia1' &&
(requestStatus == 'st1' || requestStatus == 'st4')
"
dense
unelevated
label="บันทึกข้อมูล"
color="public"
class="q-px-md"
@click="sendToDirector"
/>
<q-btn
v-if="roleUser == 'insignia2' && requestStatus == 'st3'"
dense
unelevated
label="ตีกลับ"
color="orange"
class="q-px-md"
@click="popupBackToEdit"
/>
<q-btn
v-if="roleUser == 'insignia2' && requestStatus == 'st3'"
dense
unelevated
label="อนุมัติ"
color="positive"
class="q-px-md q-ml-md"
@click="directorApproved"
/>
</q-toolbar>
<DialogPopupReason :modal="modalPopupBackToEdit" title="หมายเหตุการตีกลับ" label="หมายเหตุ"
:click-close="closeModalPopupBackToEdit" :savaForm="backToEdit" />
<DialogPopupReason
:modal="modalPopupBackToEdit"
title="หมายเหตุการตีกลับ"
label="หมายเหตุ"
:click-close="closeModalPopupBackToEdit"
:savaForm="backToEdit"
/>
</q-card>
</template>

View file

@ -128,7 +128,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "citizenId",
align: "left",
label: "เลขบัตรประชาชน",
label: "เลขประจำตัวประชาชน",
field: "citizenId",
sortable: true,
sort: (a: string, b: string) =>
@ -350,6 +350,17 @@ const resetFilter = () => {
filter.value = "";
filterRef.value!.focus();
};
const pagination = ref({
sortBy: "name",
descending: false,
page: 1,
rowsPerPage: 10,
});
const paging = ref<boolean>(true);
const paginationLabel = (start: number, end: number, total: number) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
};
</script>
<template>
@ -498,6 +509,8 @@ const resetFilter = () => {
:visible-columns="visibleColumns"
:filter="filter"
row-key="name"
:pagination-label="paginationLabel"
v-model:pagination="pagination"
>
<template v-slot:body-cell="props">
<q-td :props="props">

View file

@ -6,6 +6,10 @@ const mixin = useCounterMixin();
const { date2Thai } = mixin;
export const useInsigniaDataStore = defineStore("insignia", () => {
const isLock = ref<boolean>(false)
const roleUser = ref<string>("")
const requestId = ref<string>("")
const requestStatus = ref<string>("")
let optionsTypeOc = ref<any>([]);
let typeOc = ref<string>("");
const agency = ref<string>("");
@ -13,6 +17,8 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
const listinsignia = ref<any>([]);
const typeinsignia = ref<number | string>("all");
let typeinsigniaOptions = ref<any>([{ id: "all", name: "ทั้งหมด" }]);
const employeeClass = ref<string>("all");
const employeeClassOps = ref<any>([{ name: "ทั้งหมด", id: "all" }, { name: "ข้าราชการ กทม.สามัญ", id: "officer" }, { name: "ลูกจ้างประจำ", id: "perm" }])
const typeReport = ref<string>("");
const titleReport = ref<string>("");
@ -24,7 +30,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
const fetchData = async (data: any) => {
if (data !== null) {
rows.value = await data.map((e: any) => ({
let datalist = await data.map((e: any) => ({
id: e.id,
citizenId: e.citizenId,
profileId: e.profileId,
@ -38,11 +44,18 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
insigniaLevel: e.level,
dateSend: date2Thai(e.requestDate),
requestNote: e.requestNote,
employeeType: profileType(e.profileType),
}));
listinsignia.value = await rows.value;
rows.value = await datalist
listinsignia.value = await datalist;
filtertypeInsignia();
} else rows.value = [];
};
const fetchDataInsignia = async (data: any) => {
isLock.value = data.isLock;
requestId.value = data.requestId;
requestStatus.value = data.requestStatus;
}
const fetchOption = (op: any) => {
if (agency.value !== null) {
typeOc.value = agency.value;
@ -81,6 +94,29 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
}
}
};
const selectEmployeeClass = (employeeClass: string) => {
if (employeeClass == "officer") {
let list = listinsignia.value.filter((e: any) => e.employeeType === "ข้าราชการ กทม.สามัญ")
rows.value = list
} else if (employeeClass === "perm") {
let list = listinsignia.value.filter((e: any) => e.employeeType === "ลูกจ้างประจำ")
rows.value = list
} else rows.value = listinsignia.value
}
const convertOcid = (oc: string) => {
let ocdata = optionsTypeOc.value.find((e: any) => e.name === oc)
if (ocdata) {
return ocdata.id
} else return ""
}
const profileType = (val: string) => {
switch (val) {
case "officer":
return "ข้าราชการ กทม.สามัญ";
case "employee":
return "ลูกจ้างประจำ";
}
}
return {
optionsTypeOc,
@ -93,7 +129,16 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
fetchOption,
searchFilterTable,
setTypeandTitle,
convertOcid,
typeReport,
titleReport,
selectEmployeeClass,
employeeClass,
employeeClassOps,
fetchDataInsignia,
isLock,
requestId,
roleUser,
requestStatus,
};
});

View file

@ -114,7 +114,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "citizenId",
align: "left",
label: "เลขบัตรประชาชน",
label: "เลขประจำตัวประชาชน",
field: "citizenId",
sortable: true,
sort: (a: string, b: string) =>
@ -358,6 +358,17 @@ const resetFilter = () => {
filter.value = "";
filterRef.value!.focus();
};
const pagination = ref({
sortBy: "name",
descending: false,
page: 1,
rowsPerPage: 10,
});
const paging = ref<boolean>(true);
const paginationLabel = (start: number, end: number, total: number) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
};
</script>
<template>
@ -598,6 +609,8 @@ const resetFilter = () => {
:visible-columns="visibleColumns"
:filter="filter"
row-key="name"
:pagination-label="paginationLabel"
v-model:pagination="pagination"
>
<template v-slot:body-cell="props">
<q-td :props="props">

View file

@ -416,8 +416,8 @@ const fecthExamRoundOption = async (commandCode: string) => {
};
const submit = async () => {
console.log(nameCommand.value);
console.log(CommandOption.value);
// console.log(nameCommand.value);
// console.log(CommandOption.value);
let signBy = null;
if (!nameCommand.value.length) {

View file

@ -172,9 +172,9 @@ const statuscode = computed(() => {
orderTypeCode.value === "c-pm-14" ||
orderTypeCode.value === "c-pm-21"
) {
return true;
return false;
}
return false;
return true;
});
const dialogDeleteData = async (id: string) => {
dialogRemove($q, () => deleteData(id));