comment code retirement

This commit is contained in:
AnandaTon 2023-11-17 14:21:53 +07:00
parent 45fc4848ac
commit 45ef9649e1
15 changed files with 295 additions and 64 deletions

View file

@ -6,12 +6,14 @@ import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
/** Use */
const $q = useQuasar(); // noti quasar
const mixin = useCounterMixin();
const { messageError, success, showLoader, hideLoader, dialogConfirm } = mixin;
const route = useRoute();
const retireld_params = route.params.id;
/** props*/
const props = defineProps({
retireld: String,
profileId: String,
@ -27,6 +29,7 @@ const retireld = ref<any>();
const type = ref<any>();
const filter = ref<string>("");
/** คอลัมน์ */
const columns = ref<any["columns"]>([
{
name: "index",
@ -78,6 +81,7 @@ watch(modal, () => {
fecthlistRetire();
}
});
// fecth profile
const fecthlistRetire = async () => {
showLoader();
@ -93,6 +97,7 @@ const fecthlistRetire = async () => {
messageError($q, e);
});
};
//
const findlist = async (id: string) => {
let data = [{}];
@ -154,6 +159,9 @@ const updateListData = (retireld: string, pId: string) => {
props.UpdateListId(retireld, pId);
};
/**
* Setiting Pagination
*/
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "fullname",

View file

@ -10,6 +10,7 @@ import config from "@/app.config";
import DialogHeader from "@/components/DialogHeader.vue";
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
/** Use */
const route = useRoute();
const router = useRouter();
const $q = useQuasar();
@ -26,6 +27,7 @@ const {
} = mixin;
const myForm = ref<QForm | null>(null);
/** ตัวแปร */
const retireld_params = route.params.retirementId;
const modalNote = ref<boolean>(false);
const note = ref<string>("");
@ -37,7 +39,14 @@ const statusUpload = ref<boolean>();
const modalEdit = ref<boolean>(false);
const textReport = ref<string>("");
const employeeType = ref<string>("OFFICER");
const action = ref<string>("");
const fileUpload = ref<any>(null);
const round = ref<number>();
const typeReport = ref<string>("");
const statusReport = ref<boolean>();
const dataProfile = ref<Object>([]);
/** คอลัมน์ที่แสดง */
const columns = ref<any["columns"]>([]);
const rows = ref<any>([]);
const visibleColumns = ref<string[]>([
@ -55,22 +64,20 @@ const visibleColumns = ref<string[]>([
"bureau",
]);
const action = ref<string>("");
const fileUpload = ref<any>(null);
/** Hook */
onMounted(() => {
retireld.value = retireld_params.toString();
fecthlistprofile(retireld.value);
});
/**
* งกนป Dialog
*/
const closeDialog = () => {
modalNote.value = false;
modalUpload.value = false;
};
const round = ref<number>();
const typeReport = ref<string>("");
const statusReport = ref<boolean>();
const dataProfile = ref<Object>([]);
// fecthlist
const fecthlistprofile = async (id: string) => {
showLoader();
@ -121,6 +128,7 @@ const fecthlistprofile = async (id: string) => {
messageError($q, e);
})
.finally(() => {
//
columns.value = [
{
name: "order",
@ -243,6 +251,7 @@ const fecthCheck = async (id: string) => {
messageError($q, err);
});
};
// DelProfile
const clickDelete = () => {
dialogRemove(
@ -269,6 +278,7 @@ const clickDelete = () => {
"ต้องการลบข้อมูลนี้ใช่หรือไม่ ?"
);
};
//
const saveNote = () => {
dialogConfirm(
@ -296,19 +306,23 @@ const saveNote = () => {
);
};
// ListId
const UpdateListId = (retireld: string, pId: string) => {
profileId.value = pId;
fecthlistprofile(retireld);
};
//
const backHistory = () => {
window.history.back();
};
const visibleNote = computed(() => {
if (note.value === "" || note.value === undefined) {
return true;
}
});
//
const modalUpload = ref<boolean>(false);
const signDate = ref<Date | null>(null);
@ -352,6 +366,7 @@ const uploadFile = async (event: any, signDate: any) => {
});
}
};
// downloadAttachment
const downloadAttachment = async (type: string, id: string) => {
showLoader();
@ -369,6 +384,7 @@ const downloadAttachment = async (type: string, id: string) => {
hideLoader();
});
};
// downloadFile
const downloadFile = (response: any, filename: string) => {
const link = document.createElement("a");
@ -379,6 +395,7 @@ const downloadFile = (response: any, filename: string) => {
link.click();
document.body.removeChild(link);
};
//
const saveEdiitReport = (reason: string) => {
const formdata = new FormData();
@ -403,15 +420,18 @@ const saveEdiitReport = (reason: string) => {
"ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?"
);
};
// popup
const openmodalEditReport = () => {
modalEdit.value = true;
};
// popup
const closemodalEditReport = () => {
modalEdit.value = false;
};
/** Setting Pagination */
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "order",

View file

@ -6,11 +6,13 @@ import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
/** Use */
const $q = useQuasar();
const mixin = useCounterMixin();
const { dialogConfirm, messageError } = mixin;
const router = useRouter();
/** Prop */
const props = defineProps({
type: {
type: String,
@ -63,6 +65,7 @@ const clickAdd = () => {
}
}
};
//
const clickSelect = async (action: string) => {
dialogConfirm(
@ -81,6 +84,7 @@ const clickSelect = async (action: string) => {
"ต้องการแก้ไขข้อมูลประกาศเกษียณใช่หรือไม่ ?"
);
};
// API
const cerateRetirement = async (data: object) => {
await http