Form Evaluate,Saveresult
This commit is contained in:
parent
99f56a89f2
commit
9796c301cb
5 changed files with 1609 additions and 377 deletions
|
|
@ -12,20 +12,20 @@ const { messageError, success, showLoader, hideLoader } = mixin;
|
|||
const route = useRoute();
|
||||
|
||||
const type_params = route.params.type;
|
||||
const id = route.params.id;
|
||||
const retireld_params = route.params.id;
|
||||
const props = defineProps({
|
||||
retireld: String,
|
||||
listId: String,
|
||||
profileId: String,
|
||||
UpdateListId: {
|
||||
type: Function,
|
||||
default: () => console.log("UpdateListId"),
|
||||
},
|
||||
type: Function,
|
||||
default: () => console.log("UpdateListId"),
|
||||
},
|
||||
});
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const retireld = ref<any>();
|
||||
const type = ref<any>();
|
||||
const listId = ref(props.listId);
|
||||
const filter = ref<string>("");
|
||||
|
||||
const columns = ref<any["columns"]>([
|
||||
{
|
||||
|
|
@ -63,13 +63,6 @@ const columns = ref<any["columns"]>([
|
|||
field: "organizationOrganization",
|
||||
align: "left",
|
||||
},
|
||||
{
|
||||
name: "funtion",
|
||||
required: true,
|
||||
label: "",
|
||||
field: "funtion",
|
||||
align: "left",
|
||||
},
|
||||
]);
|
||||
const rows = ref<any>([
|
||||
// {
|
||||
|
|
@ -115,10 +108,8 @@ const rows = ref<any>([
|
|||
// affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒",
|
||||
// },
|
||||
]);
|
||||
const filter = ref<string>("");
|
||||
watch(modal, () => {
|
||||
// console.log(props);
|
||||
|
||||
watch(modal, () => {
|
||||
if (modal.value === true) {
|
||||
retireld.value = props.retireld;
|
||||
if (type_params === "officer") {
|
||||
|
|
@ -128,16 +119,15 @@ watch(modal, () => {
|
|||
fecthlistRetire();
|
||||
}
|
||||
});
|
||||
const updateListData = (retireld: string, pId: string) => {
|
||||
props.UpdateListId(retireld, pId);
|
||||
};
|
||||
// fecth profile
|
||||
const fecthlistRetire = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileOrganizRoot)
|
||||
.then((res) => {
|
||||
// console.log(res);
|
||||
|
||||
const id = res.data.result[0].id;
|
||||
// console.log(id);
|
||||
if (id !== "") {
|
||||
findlist(id);
|
||||
}
|
||||
|
|
@ -146,13 +136,11 @@ const fecthlistRetire = async () => {
|
|||
messageError($q, e);
|
||||
});
|
||||
};
|
||||
|
||||
const findlist = async (id: string) => {
|
||||
let data = [{}];
|
||||
if (type.value === "officer") {
|
||||
data = [{ criteriaType: "is_retire", criteriaValue: "false" }];
|
||||
} else if (type.value === "all") {
|
||||
// console.log("all");
|
||||
data = [
|
||||
{ criteriaType: "is_retire", criteriaValue: "false" },
|
||||
{ criteriaType: "employee_class", criteriaValue: "perm" },
|
||||
|
|
@ -181,15 +169,16 @@ const findlist = async (id: string) => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
// putlist
|
||||
const clickAdd = (props: any) => {
|
||||
// console.log("props===>",props.row.id)
|
||||
if (retireld.value == undefined) {
|
||||
retireld.value = id;
|
||||
retireld.value = retireld_params;
|
||||
}
|
||||
|
||||
let data: any = props.row.id;
|
||||
|
||||
console.log("retireld & profileId",retireld.value, data);
|
||||
// console.log("retireld & profileId", retireld.value, data);
|
||||
|
||||
$q.dialog({
|
||||
title: "ยืนยันการเพิ่มข้อมูล",
|
||||
|
|
@ -219,6 +208,11 @@ const clickAdd = (props: any) => {
|
|||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
// update retireld
|
||||
const updateListData = (retireld: string, pId: string) => {
|
||||
props.UpdateListId(retireld, pId);
|
||||
};
|
||||
|
||||
const paging = ref<boolean>(true);
|
||||
const pagination = ref({
|
||||
sortBy: "fullname",
|
||||
|
|
@ -296,6 +290,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<span class="row text-black">{{ col.label }}</span>
|
||||
</div>
|
||||
</q-th>
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
|
|
@ -314,7 +309,6 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<q-td key="organizationOrganization" :props="props">
|
||||
{{ props.row.organizationOrganization }}
|
||||
</q-td>
|
||||
|
||||
<q-td>
|
||||
<q-btn
|
||||
outline
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue