เเก้ไข UI detailLeave
comment code retirement
This commit is contained in:
parent
b0cd3af1ad
commit
ee2eba56a1
13 changed files with 470 additions and 266 deletions
|
|
@ -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", "");
|
||||
|
|
|
|||
|
|
@ -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[]>([]);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue