ทะเบียนประวัติ: ข้อมูลอื่นๆ, ผลประเมินฯ (refactor)
This commit is contained in:
parent
0d7f6cdbde
commit
6e7351d4c1
3 changed files with 13 additions and 52 deletions
|
|
@ -365,12 +365,8 @@ function onSubmit() {
|
|||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
myForm.value?.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
addEditData(isEdit.value);
|
||||
modal.value = false;
|
||||
}
|
||||
});
|
||||
addEditData(isEdit.value);
|
||||
modal.value = false;
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||
|
|
@ -587,7 +583,7 @@ onMounted(async () => {
|
|||
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form greedy ref="myForm" @submit="onSubmit">
|
||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
<DialogHeader
|
||||
tittle="ผลการประเมินการปฏิบัติราชการ"
|
||||
:close="clickClose"
|
||||
|
|
|
|||
|
|
@ -127,22 +127,10 @@ function validateForm() {
|
|||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const hasError = [];
|
||||
for (const key in objectRef) {
|
||||
if (Object.prototype.hasOwnProperty.call(objectRef, key)) {
|
||||
const property = objectRef[key];
|
||||
if (property.value && typeof property.value.validate === "function") {
|
||||
const isValid = property.value.validate();
|
||||
hasError.push(isValid);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasError.every((result) => result === true)) {
|
||||
if (edit.value) {
|
||||
editData();
|
||||
} else {
|
||||
saveData();
|
||||
}
|
||||
if (edit.value) {
|
||||
editData();
|
||||
} else {
|
||||
saveData();
|
||||
}
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
|
|
@ -228,12 +216,6 @@ async function getData() {
|
|||
// });
|
||||
// }
|
||||
|
||||
const infoRows = [
|
||||
{ title: "รายละเอียด", value: "" },
|
||||
{ title: "ล้างมลทิน", value: "" },
|
||||
{ title: "เลขที่คำสั่ง", value: "" },
|
||||
{ title: "เอกสารอ้างอิง (ลงวันที่)", value: "" },
|
||||
];
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
|
|
@ -467,7 +449,7 @@ onMounted(() => {
|
|||
<!-- dialog add edit -->
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="min-width: 600px">
|
||||
<form @submit.prevent="validateForm">
|
||||
<q-form greedy @submit.prevent @validation-success="validateForm">
|
||||
<q-card-section class="flex justify-between" style="padding: 0">
|
||||
<DialogHeader tittle="อื่นๆ" :close="closeDialog" />
|
||||
</q-card-section>
|
||||
|
|
@ -541,7 +523,7 @@ onMounted(() => {
|
|||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</form>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@ import { ref, watch, reactive } from "vue";
|
|||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
import type {
|
||||
RowList,
|
||||
} from "@/modules/04_registryNew/interface/index/other";
|
||||
import type { RowList } from "@/modules/04_registryNew/interface/index/other";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
@ -93,7 +91,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
function getHistory() {
|
||||
showLoader();
|
||||
http.get(config.API.profileNewOtherHisById(id.value))
|
||||
http
|
||||
.get(config.API.profileNewOtherHisById(id.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
rows.value = [];
|
||||
|
|
@ -201,23 +200,7 @@ watch(modal, (status) => {
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div v-if="col.name === 'no'">
|
||||
{{
|
||||
(formFilter.page - 1) * formFilter.pageSize +
|
||||
props.rowIndex +
|
||||
1
|
||||
}}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.name == 'refCommandDate' ||
|
||||
col.name == 'date' ||
|
||||
col.name == 'createdAt'
|
||||
"
|
||||
>
|
||||
{{ col.value == null ? null : date2Thai(col.value) }}
|
||||
</div>
|
||||
<div v-else>
|
||||
<div>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue