รายละเอียดงานที่ได้รับมอบหมาย

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-30 11:53:08 +07:00
parent 0c05cc41a6
commit ec80361a81
2 changed files with 43 additions and 58 deletions

View file

@ -477,9 +477,6 @@ onMounted(async () => {
<q-img src="@/assets/avatar_user.jpg" v-else />
</q-avatar>
</div>
<!-- <div class="row text-center">
</div> -->
<div
v-if="$q.screen.gt.xs"
@ -588,23 +585,7 @@ onMounted(async () => {
>งใหประเมนรายงานผลสำเรจของงาน</q-tooltip
>
</q-btn>
<!-- <q-btn
v-if="
store.rolePerson == 'EVALUATOR' &&
store.dataEvaluation.evaluationStatus ==
'EVALUATING_EVALUATOR' &&
store.tabMain == '3'
"
unelevated
round
icon="mdi-send"
color="grey-2"
text-color="blue-6"
size="md"
@click="sendToSummary('SUMMARY')"
>
<q-tooltip>งไปสรปผลการประเม</q-tooltip>
</q-btn> -->
<q-btn
v-if="
store.rolePerson == 'USER' &&

View file

@ -3,7 +3,7 @@ import avatar from "@/assets/avatar_user.jpg";
import { ref, reactive, onMounted } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useRoute, useRouter } from "vue-router";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
@ -15,21 +15,12 @@ const profileId = ref<string>("");
const rows = ref<ListMain[]>([]);
const $q = useQuasar();
const mixin = useCounterMixin();
const {
messageError,
dialogConfirm,
findOrgName,
showLoader,
hideLoader,
date2Thai,
} = mixin;
const { messageError, findOrgName, showLoader, hideLoader, date2Thai } = mixin;
const filter = ref<string>("");
const mode = ref<any>($q.screen.gt.xs);
const profileImg = ref<string>("");
const router = useRouter();
const route = useRoute();
const idEva = ref<string>(route.params.id as string);
const formData = reactive<any>({
prefix: "",
firstName: "",
@ -42,16 +33,8 @@ const formData = reactive<any>({
});
const sizeImg = ref<string>("");
/** ข้อมูลที่เเสดงในตาราง */
const visibleColumns = ref<string[]>([
"no",
"date_start",
"date_finish",
"mentors",
"commander",
]);
/** หัวตาราง */
/** Table */
const filter = ref<string>("");
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -101,22 +84,25 @@ const columns = ref<QTableProps["columns"]>([
style: "font-size: 14px",
},
]);
const visibleColumns = ref<string[]>([
"no",
"date_start",
"date_finish",
"mentors",
"commander",
]);
function onResize(size: any) {
const width = size.width > 100 ? 100 : size.width;
sizeImg.value = `${width}px`;
}
function onMobile(type: string) {
router.push(`/registry/${type}`);
}
function getMain() {
showLoader();
http
.get(config.API.orgPosition + `/${idEva.value}`)
.get(config.API.profilePosition())
.then(async (res) => {
const data = res.data.result;
const data = await res.data.result;
formData.prefix = data.prefix;
formData.firstName = data.firstName;
formData.lastName = data.lastName;
@ -127,12 +113,15 @@ function getMain() {
formData.posLevelName = data.posLevelName;
formData.org = findOrgName(data);
profileId.value = data.profileId;
const promises = [];
promises.push(getList(data.profileId));
if (data.avatarName) {
getImg(data.profileId, data.avatarName);
promises.push(getImg(data.profileId, data.avatarName));
} else {
profileImg.value = avatar;
}
await getList(data.profileId);
await Promise.all(promises);
})
.catch((e) => {
messageError($q, e);
@ -143,17 +132,24 @@ function getMain() {
}
function getList(id: string) {
showLoader();
http
.get(config.API.probationMain(id))
.then((res) => {
const data = res.data.data;
rows.value = data;
})
.catch((e) => {})
.finally(() => {});
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
function getImg(id: string, pathName: string) {
http
async function getImg(id: string, pathName: string) {
showLoader();
await http
.get(config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, pathName))
.then((res) => {
profileImg.value = res.data.downloadUrl;
@ -161,7 +157,9 @@ function getImg(id: string, pathName: string) {
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
.finally(() => {
hideLoader();
});
}
function onDetail(id: string) {
@ -203,7 +201,7 @@ onMounted(async () => {
<div class="row">
<div class="col-2 text-center self-center">
<q-avatar :size="sizeImg" rounded>
<img
<q-img
:src="profileImg"
style="border-radius: 10px; object-fit: cover"
/>
@ -212,7 +210,7 @@ onMounted(async () => {
<div class="col-10 column justify-center no-wrap">
<div class="row text-grey-6">
<div class="col-4">ตำแหนงในสายงาน</div>
<div class="col-4">ระด</div>
<div class="col-4">ประเภทตำแหน</div>
<div class="col-4">งก</div>
</div>
<div class="row">
@ -220,7 +218,13 @@ onMounted(async () => {
{{ formData.position ? formData.position : "-" }}
</div>
<div class="col-4">
{{ formData.posLevelName ? formData.posLevelName : "-" }}
{{
formData.posTypeName
? formData.posLevelName
? `${formData.posTypeName}(${formData.posLevelName})`
: formData.posTypeName
: "-"
}}
</div>
<div class="col-4">
{{ formData.org ? formData.org : "-" }}