แบบประเมิน => API ผลสัมฤทธิ์ของงาน
This commit is contained in:
parent
5b52f9998f
commit
a050534d1a
6 changed files with 245 additions and 77 deletions
|
|
@ -1,6 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
|
|
@ -127,8 +129,30 @@ function updateAchievement(index: number, data: any) {
|
|||
}
|
||||
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
closeDialog();
|
||||
dialogConfirm($q, async () => {
|
||||
try {
|
||||
showLoader();
|
||||
const formData = rows.value.map((e: any) => ({
|
||||
id: e.id,
|
||||
point: e.point,
|
||||
}));
|
||||
|
||||
const url =
|
||||
numpage.value === 1
|
||||
? config.API.kpiAchievementPoint("planned")
|
||||
: numpage.value === 2
|
||||
? config.API.kpiAchievementPoint("role")
|
||||
: numpage.value === 3
|
||||
? config.API.kpiAchievementPoint("special")
|
||||
: "";
|
||||
await http.post(url, formData);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
closeDialog();
|
||||
}
|
||||
});
|
||||
console.log(rows.value);
|
||||
}
|
||||
|
|
@ -198,7 +222,13 @@ function onSubmit() {
|
|||
{{ props.row.achievement }}
|
||||
</div>
|
||||
<div v-else-if="col.name === 'evaluationResults'">
|
||||
{{ (props.row.point / 5) * props.row.weight }}
|
||||
{{
|
||||
parseFloat(
|
||||
Number(
|
||||
(props.row.point / 5) * props.row.weight
|
||||
).toFixed(2)
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue