เเก้ไข 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",
|
||||
|
|
@ -79,6 +82,7 @@ const visibleColumns2 = ref<string[]>([
|
|||
"statustext",
|
||||
]);
|
||||
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
modal: Boolean,
|
||||
closeModal: Function,
|
||||
|
|
@ -93,7 +97,7 @@ const checkSelected = computed(() => {
|
|||
}
|
||||
});
|
||||
|
||||
//popup ยืนยันส่งัว
|
||||
//popup ยืนยันส่ง
|
||||
const saveOrder = () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -102,6 +106,7 @@ const saveOrder = () => {
|
|||
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
|
||||
);
|
||||
};
|
||||
|
||||
//ส่งไปออกคำสั่ง
|
||||
const Ordersave = async () => {
|
||||
const id = selected.value.map((r) => r.id);
|
||||
|
|
@ -128,6 +133,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/Discharged/DialogSendToCommand.vue";
|
||||
import type { ResponseData } from "@/modules/06_retirement/interface/response/discharged";
|
||||
|
||||
/** use */
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const transferStore = useTransferDataStore();
|
||||
|
||||
const {
|
||||
date2Thai,
|
||||
messageError,
|
||||
|
|
@ -26,6 +26,8 @@ const {
|
|||
const { statusText } = transferStore;
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
|
||||
/** คอลัมน์ที่แสดง */
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"fullname",
|
||||
|
|
@ -47,6 +49,7 @@ const visibleColumns2 = ref<string[]>([
|
|||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const filters = ref<ResponseData[]>([]);
|
||||
const filterRef = ref<any>(null);
|
||||
const resetFilter = () => {
|
||||
filterKeyword.value = "";
|
||||
|
|
@ -54,9 +57,11 @@ const resetFilter = () => {
|
|||
filterRef.value.focus();
|
||||
};
|
||||
|
||||
/** ข้อมูลตาราง (จำลอง)*/
|
||||
const rows = ref<ResponseData[]>([]);
|
||||
const rows2 = ref<ResponseData[]>([]);
|
||||
const filters = ref<ResponseData[]>([]);
|
||||
|
||||
/** คอลัมน์ */
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -125,6 +130,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
const openModal = () => (modal.value = true);
|
||||
const closeModal = () => (modal.value = false);
|
||||
|
||||
/** Hook */
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
});
|
||||
|
|
@ -147,6 +153,7 @@ const openModalOrder = () => {
|
|||
rows2.value = row;
|
||||
};
|
||||
|
||||
/** Fnction เรียกข้อมูลจาก API */
|
||||
const getData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -189,6 +196,10 @@ const getData = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* ฟังก์ชั่นลบข้อมูล
|
||||
* @param id ไอดีของข้อมูล
|
||||
*/
|
||||
const clickDelete = async (id: string) => {
|
||||
dialogMessage(
|
||||
$q,
|
||||
|
|
@ -201,7 +212,7 @@ const clickDelete = async (id: string) => {
|
|||
async () => await getData()
|
||||
);
|
||||
};
|
||||
|
||||
//ฟังก์ชั่นลบของมูลโดยการส่ง Api
|
||||
const deleteData = async (id: string) => {
|
||||
await http
|
||||
.delete(config.API.dischargeByid(id))
|
||||
|
|
@ -216,6 +227,9 @@ const deleteData = async (id: string) => {
|
|||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Setting Pagination
|
||||
*/
|
||||
const pagination = ref({
|
||||
sortBy: "createdAt",
|
||||
descending: true,
|
||||
|
|
|
|||
|
|
@ -8,15 +8,15 @@ 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/discharged";
|
||||
|
||||
/** use */
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
const dataId = route.params.id.toString();
|
||||
const {
|
||||
date2Thai,
|
||||
|
|
@ -31,6 +31,9 @@ const myForm = ref<QForm | null>(null);
|
|||
const roleAdmin = ref<boolean>(false);
|
||||
const edit = ref<boolean>(false);
|
||||
|
||||
/**
|
||||
* กำหนดค่าตัวแปร
|
||||
*/
|
||||
const organizationPositionOld = ref<string>("");
|
||||
const positionTypeOld = ref<string>("");
|
||||
const positionLevelOld = ref<string>("");
|
||||
|
|
@ -39,7 +42,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: "",
|
||||
|
|
@ -57,6 +59,7 @@ const responseData = ref<ResponseDataDetail>({
|
|||
fullname: "",
|
||||
});
|
||||
|
||||
/** Hook */
|
||||
onMounted(async () => {
|
||||
if (keycloak.tokenParsed != null) {
|
||||
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
|
||||
|
|
@ -64,6 +67,7 @@ onMounted(async () => {
|
|||
await getData();
|
||||
});
|
||||
|
||||
/** Fnction เรียกข้อมูลจาก API */
|
||||
const getData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -105,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) => {
|
||||
|
|
@ -155,6 +165,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