เเก้ไข UI detailLeave

comment code retirement
This commit is contained in:
AnandaTon 2023-11-16 17:57:48 +07:00
parent b0cd3af1ad
commit ee2eba56a1
13 changed files with 470 additions and 266 deletions

View file

@ -8,11 +8,13 @@ import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
import http from "@/plugins/http";
import config from "@/app.config";
/** use */
const $q = useQuasar();
const selected = ref<ResponseItems[]>([]);
const mixin = useCounterMixin();
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
/** คอลัมน์ */
const columns2 = ref<QTableProps["columns"]>([
{
name: "no",
@ -70,6 +72,7 @@ const columns2 = ref<QTableProps["columns"]>([
},
]);
/** คอลัมน์ที่แสดง */
const visibleColumns2 = ref<string[]>([
"no",
"fullname",
@ -80,6 +83,7 @@ const visibleColumns2 = ref<string[]>([
"statustext",
]);
/** props*/
const props = defineProps({
modal: Boolean,
closeModal: Function,
@ -88,6 +92,9 @@ const props = defineProps({
filterKeyword2: String,
});
/**
* งกนการ Selected Data
*/
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
@ -103,6 +110,7 @@ const saveOrder = () => {
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
);
};
//
const Ordersave = async () => {
const id = selected.value.map((r) => r.id);
@ -129,6 +137,7 @@ const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
const updateInput = (value: any) => {
emit("update:filterKeyword2", value);
};
//
const Reset = () => {
emit("update:filterKeyword2", "");

View file

@ -10,11 +10,11 @@ import config from "@/app.config";
import DialogSendToCommand from "@/modules/06_retirement/components/DismissOrder/DialogSendToCommand.vue";
import type { ResponseData } from "@/modules/06_retirement/interface/response/out";
/** use */
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin();
const transferStore = useTransferDataStore();
const {
date2Thai,
messageError,
@ -24,8 +24,9 @@ const {
dialogMessage,
} = mixin;
const { statusText } = transferStore;
const modal = ref<boolean>(false);
/** คอลัมน์ที่แสดง */
const visibleColumns = ref<string[]>([
"no",
"fullname",
@ -35,11 +36,13 @@ const visibleColumns = ref<string[]>([
"createdAt",
"statustext",
]);
//
const filterKeyword = ref<string>("");
const filterKeyword2 = ref<string>("");
const filterRef = ref<any>(null);
//
const rows = ref<ResponseData[]>([]);
const rows2 = ref<ResponseData[]>([]);
const filters = ref<ResponseData[]>([]);

View file

@ -3,20 +3,20 @@ import { onMounted, ref } from "vue";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import CurrencyInput from "@/components/CurruncyInput.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import keycloak from "@/plugins/keycloak";
/**Import type */
import type { QForm } from "quasar";
import type { ResponseDataDetail } from "@/modules/06_retirement/interface/response/expulsion";
/** use */
const $q = useQuasar();
const route = useRoute();
const router = useRouter();
const mixin = useCounterMixin();
const dataId = route.params.id.toString();
const {
date2Thai,
@ -27,6 +27,9 @@ const {
success,
} = mixin;
/**
* กำหนดคาตวแปร
*/
const myForm = ref<QForm | null>(null);
const roleAdmin = ref<boolean>(false);
const edit = ref<boolean>(false);
@ -38,7 +41,6 @@ const salary = ref<number>(0);
const organization = ref<string>("");
const date = ref<Date | null>(null);
const reason = ref<string>("");
const responseData = ref<ResponseDataDetail>({
personId: "",
avataPath: "",
@ -56,6 +58,7 @@ const responseData = ref<ResponseDataDetail>({
fullname: "",
});
/** Hook */
onMounted(async () => {
if (keycloak.tokenParsed != null) {
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
@ -63,7 +66,7 @@ onMounted(async () => {
await getData();
});
//
// API
const getData = async () => {
showLoader();
await http
@ -106,11 +109,17 @@ const getData = async () => {
});
};
/**
* งก Cancle
*/
const clickCancel = async () => {
await getData();
edit.value = false;
};
/**
* งก Save
*/
const conditionSave = async () => {
if (myForm.value !== null) {
myForm.value.validate().then((success) => {
@ -130,6 +139,9 @@ const conditionSave = async () => {
}
};
/**
* งก Saveจาก API
*/
const saveData = async () => {
const body = {
organization: organization.value,
@ -157,6 +169,10 @@ const saveData = async () => {
});
};
/**
* Function เพ Class เวลา Edit
* @param val เมอเปนEdit จะเปลยน Class
*/
const getClass = (val: boolean) => {
return {
"full-width inputgreen cursor-pointer": val,