Merge branch 'develop' into devTee
This commit is contained in:
commit
fbde55ca8e
8 changed files with 247 additions and 23 deletions
|
|
@ -5,6 +5,7 @@ import { useQuasar } from "quasar";
|
|||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import genReport from "@/plugins/genreport";
|
||||
import { useProbationDataStore } from "@/modules/05_placement/storeProbation";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
|
|
@ -13,7 +14,7 @@ import type {
|
|||
AppointTopicMain,
|
||||
} from "@/modules/05_placement/interface/index/Main";
|
||||
|
||||
import genReport from "@/plugins/genreport";
|
||||
import FormUploadFile from "@/modules/05_placement/components/probation/FormEvaluation/FormUploadFile.vue";
|
||||
|
||||
const $q = useQuasar();
|
||||
const isEdit = ref<boolean>(false);
|
||||
|
|
@ -86,6 +87,7 @@ const activityCount = ref<number>(2);
|
|||
const activity_desc = ref<string[]>(Array(activityCount.value).fill(""));
|
||||
const goal_desc = ref<string[]>(Array(activityCount.value).fill(""));
|
||||
const checkRule = ref<CheckboxItem[]>([]);
|
||||
const isCheckFile = ref<boolean>(false);
|
||||
|
||||
const isDatePicker2Readonly = computed(() => {
|
||||
return date_start.value === undefined;
|
||||
|
|
@ -167,13 +169,12 @@ interface CheckboxItem {
|
|||
status_select: number;
|
||||
checked: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* update edit
|
||||
* @param id personal id
|
||||
*/
|
||||
async function dataEdit(id: string) {
|
||||
// await myForm.value.validate().then((result: boolean) => {
|
||||
// if (result) {
|
||||
showLoader();
|
||||
const data = putDataEdit(id);
|
||||
http
|
||||
|
|
@ -185,10 +186,6 @@ async function dataEdit(id: string) {
|
|||
getAssign();
|
||||
hideLoader();
|
||||
});
|
||||
// } else {
|
||||
// dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ");
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1009,7 +1006,7 @@ function updateAppointMent() {
|
|||
...dataPerson,
|
||||
name: `${dataPerson.name} (${dataPerson.position}${
|
||||
dataPerson.positionLevel && dataPerson.positionType
|
||||
? + dataPerson.positionLevel
|
||||
? +dataPerson.positionLevel
|
||||
: ""
|
||||
})`,
|
||||
}));
|
||||
|
|
@ -1148,7 +1145,7 @@ onMounted(async () => {
|
|||
</q-menu>
|
||||
</q-btn>
|
||||
|
||||
<div v-if="!isEdit">
|
||||
<div v-if="!isEdit && !isCheckFile">
|
||||
<q-btn
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
|
|
@ -2878,8 +2875,20 @@ onMounted(async () => {
|
|||
</q-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<FormUploadFile
|
||||
:group="'มอบหมายงาน'"
|
||||
v-model:is-check-file="isCheckFile"
|
||||
:check-route-permisson="checkRoutePermisson"
|
||||
:data-permissions="
|
||||
probationStore.dataPermissions?.tab1.isEdit
|
||||
? probationStore.dataPermissions?.tab1.isEdit
|
||||
: false
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<q-separator v-show="routeName == 'probationWorkAdd'" />
|
||||
<div
|
||||
v-show="routeName == 'probationWorkAdd'"
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import config from "@/app.config";
|
|||
import criterion from "@/modules/05_placement/components/probation/Criterion.vue";
|
||||
import type { ListDataText } from "@/modules/05_placement/interface/index/Main";
|
||||
|
||||
import FormUploadFile from "@/modules/05_placement/components/probation/FormEvaluation/FormUploadFile.vue";
|
||||
|
||||
const router = useRouter();
|
||||
const routeName = router.currentRoute.value.name;
|
||||
|
||||
|
|
@ -68,6 +70,7 @@ const start_date = ref<Date>(new Date());
|
|||
const date_finish = ref<Date>(new Date());
|
||||
const status = ref<boolean>(true);
|
||||
const dataArr = ref<any>();
|
||||
const isCheckFile = ref<boolean>(false);
|
||||
|
||||
const behavio_strengthRules = [
|
||||
(val: any) => (val && val.length > 0) || "กรุณากรอกข้อมูลจุดเด่น",
|
||||
|
|
@ -298,10 +301,10 @@ onMounted(async () => {
|
|||
<div class="toptitle text-dark col-12 row items-center q-gutter-md">
|
||||
<div>แบบประเมินผล (ผู้บังคับบัญชา)</div>
|
||||
|
||||
<div v-if="status == false">
|
||||
<div v-if="!status">
|
||||
<q-btn
|
||||
v-if="
|
||||
!checkRoutePermisson && probationStore.dataPermissions?.tab4.isEdit
|
||||
!checkRoutePermisson && probationStore.dataPermissions?.tab4.isEdit && !isCheckFile
|
||||
"
|
||||
dense
|
||||
flat
|
||||
|
|
@ -1081,6 +1084,17 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<FormUploadFile
|
||||
:group="`ประเมินผลผู้บังคับบัญชาครั้งที่${props.tab?.charAt(4)}`"
|
||||
v-model:is-check-file="isCheckFile"
|
||||
:check-route-permisson="checkRoutePermisson"
|
||||
:data-permissions="
|
||||
probationStore.dataPermissions?.tab4.isEdit
|
||||
? probationStore.dataPermissions?.tab4.isEdit
|
||||
: false
|
||||
"
|
||||
/>
|
||||
|
||||
<!-- <Footer /> -->
|
||||
<q-toolbar class="text-primary" v-if="routeName == 'FormEvaluateAdd'">
|
||||
<q-space />
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import config from "@/app.config";
|
|||
import criterion from "@/modules/05_placement/components/probation/Criterion.vue";
|
||||
|
||||
import type { ListDataText } from "@/modules/05_placement/interface/index/Main";
|
||||
import FormUploadFile from "@/modules/05_placement/components/probation/FormEvaluation/FormUploadFile.vue";
|
||||
|
||||
const optionText = ref<ListDataText[]>([
|
||||
{ value: "1", label: "ต่ำกว่าความคาดหวังมาก (1)" },
|
||||
|
|
@ -94,6 +95,8 @@ const develop_result_option = ref<any>([
|
|||
{ name: "ไม่ผ่าน (ต่ำกว่าร้อยละ 60)", value: 0 },
|
||||
]);
|
||||
|
||||
const isCheckFile = ref<boolean>(false);
|
||||
|
||||
// score
|
||||
const score1 = computed(() => {
|
||||
if (
|
||||
|
|
@ -423,11 +426,11 @@ onMounted(async () => {
|
|||
<div class="row col-12 no-margin q-pa-sm">
|
||||
<div class="toptitle text-dark col-12 row items-center q-gutter-md">
|
||||
<div>แบบประเมินผล (คณะกรรมการ)</div>
|
||||
<div v-if="status == false">
|
||||
<div v-if="!status">
|
||||
<q-btn
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
probationStore.dataPermissions?.tab5.isEdit
|
||||
probationStore.dataPermissions?.tab5.isEdit && !isCheckFile
|
||||
"
|
||||
dense
|
||||
flat
|
||||
|
|
@ -1356,6 +1359,18 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<FormUploadFile
|
||||
|
||||
:group="`ประเมินผลคณะกรรมการครั้งที่${props.tab?.charAt(4)}`"
|
||||
:check-route-permisson="checkRoutePermisson"
|
||||
:data-permissions="
|
||||
probationStore.dataPermissions?.tab5.isEdit
|
||||
? probationStore.dataPermissions?.tab5.isEdit
|
||||
: false
|
||||
"
|
||||
v-model:is-check-file="isCheckFile"
|
||||
/>
|
||||
|
||||
<q-toolbar
|
||||
class="text-primary"
|
||||
v-if="routeName == 'probationFormAddevaluascore'"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import config from "@/app.config";
|
|||
import { useProbationDataStore } from "@/modules/05_placement/storeProbation";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
import FormUploadFile from "@/modules/05_placement/components/probation/FormEvaluation/FormUploadFile.vue";
|
||||
|
||||
const probationStore = useProbationDataStore();
|
||||
|
||||
const $q = useQuasar();
|
||||
|
|
@ -68,6 +70,8 @@ const props = defineProps({
|
|||
data: { type: Object, require: true },
|
||||
});
|
||||
|
||||
const isCheckFile = ref<boolean>(false);
|
||||
|
||||
/** get ข้อมูลรายการมอยหมาย เก็บไว้ตัวแปร
|
||||
* @param id personal id
|
||||
*/
|
||||
|
|
@ -791,6 +795,17 @@ onMounted(() => {
|
|||
</div>
|
||||
</q-form>
|
||||
|
||||
<FormUploadFile
|
||||
:group="`รายงานผลครั้งที่${props.tab?.charAt(4)}`"
|
||||
v-model:is-check-file="isCheckFile"
|
||||
:check-route-permisson="checkRoutePermisson"
|
||||
:data-permissions="
|
||||
probationStore.dataPermissions?.tab6.isEdit
|
||||
? probationStore.dataPermissions?.tab6.isEdit
|
||||
: false
|
||||
"
|
||||
/>
|
||||
|
||||
<q-toolbar
|
||||
class="text-primary"
|
||||
v-if="
|
||||
|
|
|
|||
|
|
@ -8,9 +8,11 @@ import { useRouter, useRoute } from "vue-router";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import criterion from "@/modules/05_placement/components/probation/Criterion.vue";
|
||||
import type { ListDataText } from "@/modules/05_placement/interface/index/Main";
|
||||
|
||||
import criterion from "@/modules/05_placement/components/probation/Criterion.vue";
|
||||
import FormUploadFile from "@/modules/05_placement/components/probation/FormEvaluation/FormUploadFile.vue";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const routeName = router.currentRoute.value.name;
|
||||
|
|
@ -42,6 +44,8 @@ const evaluate_id = ref<string>("");
|
|||
const evaluate_no = ref<number>(1);
|
||||
const dataArr = ref<any>();
|
||||
|
||||
const isCheckFile = ref<boolean>(false);
|
||||
|
||||
const checkArray = ref<number>(0);
|
||||
const list1_1 = ref<any[]>([]);
|
||||
const option = ref<any>([]);
|
||||
|
|
@ -373,10 +377,10 @@ onMounted(async () => {
|
|||
<div class="row col-12 no-margin q-pa-sm">
|
||||
<div class="toptitle text-dark col-12 row items-center q-gutter-md">
|
||||
<div>แบบบันทึกผล (ผู้ดูเเล)</div>
|
||||
<div v-if="status == false">
|
||||
<div v-if="!status">
|
||||
<q-btn
|
||||
v-if="
|
||||
!checkRoutePermisson && probationStore.dataPermissions?.tab2.isEdit
|
||||
!checkRoutePermisson && probationStore.dataPermissions?.tab2.isEdit && !isCheckFile
|
||||
"
|
||||
dense
|
||||
flat
|
||||
|
|
@ -1255,6 +1259,18 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<FormUploadFile
|
||||
:group="`บันทึกผลผู้ดูแลครั้งที่${props.tab?.charAt(4)}`"
|
||||
v-model:is-check-file="isCheckFile"
|
||||
:check-route-permisson="checkRoutePermisson"
|
||||
:data-permissions="
|
||||
probationStore.dataPermissions?.tab2.isEdit
|
||||
? probationStore.dataPermissions?.tab2.isEdit
|
||||
: false
|
||||
"
|
||||
/>
|
||||
|
||||
<q-toolbar
|
||||
class="text-primary"
|
||||
v-if="routeName == 'probationFormAddresult'"
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
|
||||
import criterion from "@/modules/05_placement/components/probation/Criterion.vue";
|
||||
import FormUploadFile from "@/modules/05_placement/components/probation/FormEvaluation/FormUploadFile.vue";
|
||||
|
||||
import type { ListDataText } from "@/modules/05_placement/interface/index/Main";
|
||||
|
||||
|
|
@ -35,6 +36,7 @@ const {
|
|||
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
const personalId = ref<string>(route.params.personalId.toString());
|
||||
const isCheckFile = ref<boolean>(false);
|
||||
|
||||
const start_date = ref<Date>(new Date());
|
||||
const date_finish = ref<Date>(new Date());
|
||||
|
|
@ -382,7 +384,7 @@ onMounted(async () => {
|
|||
<div v-if="status == false">
|
||||
<q-btn
|
||||
v-if="
|
||||
!checkRoutePermisson && probationStore.dataPermissions?.tab3.isEdit
|
||||
!checkRoutePermisson && probationStore.dataPermissions?.tab3.isEdit && !isCheckFile
|
||||
"
|
||||
dense
|
||||
flat
|
||||
|
|
@ -1268,6 +1270,17 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<FormUploadFile
|
||||
:group="`บันทึกผลผู้บังคับบัญชาครั้งที่${props.tab?.charAt(4)}`"
|
||||
v-model:is-check-file="isCheckFile"
|
||||
:check-route-permisson="checkRoutePermisson"
|
||||
:data-permissions="
|
||||
probationStore.dataPermissions?.tab3.isEdit
|
||||
? probationStore.dataPermissions?.tab3.isEdit
|
||||
: false
|
||||
"
|
||||
/>
|
||||
|
||||
<q-toolbar
|
||||
class="text-primary"
|
||||
v-if="routeName == 'probationFormAddresult'"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,146 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import axios from "axios";
|
||||
|
||||
import { useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
messageError,
|
||||
date2Thai,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
dialogConfirm,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const group = defineModel<string>("group", { required: true });
|
||||
const isCheckFile = defineModel<boolean>("isCheckFile", { required: true });
|
||||
const checkRoutePermisson = defineModel<boolean>("checkRoutePermisson", {
|
||||
required: true,
|
||||
});
|
||||
const dataPermissions = defineModel<boolean>("dataPermissions", {
|
||||
required: true,
|
||||
});
|
||||
|
||||
const assignId = ref<string>(route.params.form as string);
|
||||
const file = ref<any>();
|
||||
|
||||
function onUploadFiles() {
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.file("ทดลองงาน", group.value, assignId.value), {
|
||||
replace: true,
|
||||
fileList: [
|
||||
{
|
||||
fileName: file.value.name,
|
||||
},
|
||||
],
|
||||
})
|
||||
.then(async (res) => {
|
||||
const foundKey: string | undefined = Object.keys(res.data).find(
|
||||
(key) =>
|
||||
res.data[key]?.fileName !== undefined &&
|
||||
res.data[key]?.fileName !== ""
|
||||
);
|
||||
foundKey && (await uploadFileURL(res.data[foundKey]?.uploadUrl));
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function uploadFileURL(uploadUrl: string) {
|
||||
const Data = new FormData();
|
||||
Data.append("file", file.value);
|
||||
showLoader();
|
||||
await axios
|
||||
.put(uploadUrl, file.value, {
|
||||
headers: {
|
||||
"Content-Type": file.value.type,
|
||||
},
|
||||
})
|
||||
.then(async () => {
|
||||
await success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||
await fetchCheckfile();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
file.value = null;
|
||||
});
|
||||
}
|
||||
|
||||
/** function เช็คไฟล์*/
|
||||
async function fetchCheckfile() {
|
||||
isCheckFile.value = false;
|
||||
http
|
||||
.get(config.API.file("ทดลองงาน", group.value, assignId.value))
|
||||
.then(async (res) => {
|
||||
if (res.data.length >= 1) {
|
||||
isCheckFile.value = true;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchCheckfile();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div
|
||||
class="col-12"
|
||||
v-if="!checkRoutePermisson && dataPermissions && !isCheckFile"
|
||||
>
|
||||
<div class="col-12">
|
||||
<q-separator size="3px" color="grey-2" />
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-mt-md">
|
||||
<div class="col-12 row">
|
||||
<q-file
|
||||
class="col-12"
|
||||
outlined
|
||||
dense
|
||||
v-model="file"
|
||||
label="อัปโหลดเอกสาร"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" color="primary" />
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<q-btn
|
||||
v-if="file"
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="primary"
|
||||
icon="mdi-upload"
|
||||
@click="onUploadFiles"
|
||||
><q-tooltip>อัปโหลดเอกสาร</q-tooltip></q-btn
|
||||
>
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
@ -38,7 +38,7 @@ const {
|
|||
} = useCounterMixin();
|
||||
|
||||
const tab = ref<string>("save1");
|
||||
const tabs = ref<any[]>([{ no: 1 }, { no: 2 }]);
|
||||
const tabs = ref<any[]>([]);
|
||||
const dataArrayNumber = ref<number>(1);
|
||||
const evaluate = ref<any>([]);
|
||||
const assignId = ref<string>(route.params.form.toString());
|
||||
|
|
@ -59,8 +59,6 @@ async function fecthAssign(id: string) {
|
|||
.then((res) => {
|
||||
dataResult.value = res.data.result;
|
||||
fullName.value = res.data.result.person.name;
|
||||
console.log();
|
||||
|
||||
tabs.value = res.data.result.result.map((e: any, index: number) => {
|
||||
return { no: index + 1, ...e };
|
||||
});
|
||||
|
|
@ -121,9 +119,7 @@ onMounted(() => {
|
|||
:add-data="addData"
|
||||
:loop="tabs.length"
|
||||
:FileDownload="onDownloadFile"
|
||||
:checkPermission="
|
||||
probationStore?.dataPermissions?.tab6?.isEdit && tabs.length === 1
|
||||
"
|
||||
:checkPermission="false"
|
||||
/>
|
||||
|
||||
<q-tab-panels
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue