check statusjson ประกาศเกษียณอายุราชการ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-08-23 13:55:11 +07:00
parent 393f94297e
commit e183754ccf
5 changed files with 169 additions and 137 deletions

View file

@ -50,6 +50,7 @@
round
color="add"
icon="mdi-plus"
:disable="checkjson == true"
>
<q-tooltip>เพ</q-tooltip>
</q-btn>
@ -275,7 +276,7 @@
</template>
<script setup lang="ts">
import { onMounted, ref, useAttrs, reactive, watch } from "vue";
import { onMounted, ref, useAttrs, reactive, watch, computed } from "vue";
import type { QTableProps } from "quasar";
import type {
FormMainProbation,
@ -355,9 +356,9 @@ const tab = ref<any>("officer");
const visibleColumns2 = ref<string[]>(["no", "name", "retireNumber"]);
const yearOptions = reactive<any[]>([]);
const filteryear = () => {
console.log(yearOptions);
// console.log(yearOptions);
yearOptions.push({ id: currentYear, name: currentYear + 543 });
console.log(yearOptions[0].id);
// console.log(yearOptions[0].id);
fiscalyear.value = yearOptions[0].id;
fetchRetirement(type.value, currentYear);
};
@ -367,7 +368,7 @@ const fetchRetirement = async (type: string, year: any) => {
await http
.get(config.API.retirement(type, year))
.then((res) => {
console.log(res);
// console.log(res);
rows.value = [];
let data = res.data.result;
rows.value = data.map((items: any) => ({
@ -378,9 +379,11 @@ const fetchRetirement = async (type: string, year: any) => {
total: items.total,
round: items.round,
typeReport: typeReportChangeName(items.typeReport),
json: items.json,
}));
actionOption.value = rows.value;
rows.value.sort((a, b) => a.round - b.round);
checkststus(rows.value);
})
.catch((e) => {
messageError($q, e);
@ -540,7 +543,7 @@ const cerateRetirement = async (data: object) => {
});
};
const clickSelect = async (action: string) => {
console.log(action);
// console.log(action);
// console.log(radio.value);
$q.dialog({
title: "ยืนยันการแก้ไขข้อมูลประกาศเกษียณ",
@ -558,7 +561,7 @@ const clickSelect = async (action: string) => {
retireHistoryId: action,
option: radio.value,
};
console.log(data);
// console.log(data);
await cerateRetirement(data);
})
@ -569,6 +572,14 @@ const clickSelect = async (action: string) => {
const clickClose = async () => {
modal.value = false;
};
const checkjson = ref<boolean>();
const checkststus = (data: any) => {
let jsonfasle = rows.value.find((e: any) => e.json == false);
if (jsonfasle) {
checkjson.value = true;
} else checkjson.value = false;
};
const fiscalyear = ref<number>();
// const fiscalyearOP = ref<any>([
// { id: 1, name: "" },
@ -608,7 +619,7 @@ watch(type, () => {
fetchRetirement(type.value, currentYear);
});
const typeReportChangeName = (val: string) => {
console.log(val);
// console.log(val);
switch (val) {
case "EDIT":
return "ประกาศแก้ไขเกษียณ";