Merge branch 'develop' into working

# Conflicts:
#	src/modules/06_retirement/components/ListRetirement/TableList.vue
This commit is contained in:
Tanyalak 2023-07-27 18:25:08 +07:00
commit 4bdbd6c0bc
34 changed files with 24901 additions and 1830 deletions

View file

@ -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

View file

@ -10,7 +10,7 @@ import { useRouter } from "vue-router";
const router = useRouter();
const route = useRoute();
const $q = useQuasar(); // noti quasar
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, success } = mixin;
const type_params = route.params.type;
@ -22,6 +22,142 @@ const note = ref<string>("");
const retireProfileId = ref<string>("");
const retireld = ref<string>();
const profileId = ref<string>("");
const filter = ref<string>("");
const columns = ref<any["columns"]>([
{
name: "order",
label: "ลำดับ",
title: "ลำดับ",
field: "order",
align: "left",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
/* {
name: "fixname",
align: "left",
label: "คำนำหน้านาม",
title: "คำนำหน้านาม",
field: "fixname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
}, */
{
name: "name",
align: "left",
label: "ชื่อ - นามสกุล",
title: "ชื่อ - นามสกุล",
field: "name",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "organizationOrganization",
align: "left",
label: "สังกัด",
title: "สังกัด",
field: "organizationOrganization",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionType",
align: "left",
label: "ตำแหน่ง (ประเภท)",
title: "ตำแหน่ง",
subtitle: "ประเภท",
field: "positionType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "position",
align: "left",
label: "ตำแหน่ง (ทางการบริหาร)",
title: "ตำแหน่ง",
subtitle: "ทางการบริหาร",
field: "position",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionLavel",
align: "left",
label: "ตำแหน่ง (ในสายงาน/ระดับ)",
title: "ตำแหน่ง",
subtitle: "ในสายงาน/ระดับ",
field: "positionLavel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionNumber",
align: "left",
label: "ตำแหน่ง (เลขที่) ",
title: "ตำแหน่ง",
subtitle: "เลขที่",
field: "positionNumber",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "govGroup",
align: "left",
label: "ส่วนราชการ (ระดับฝ่าย/กลุ่มงาน/ส่วน)",
title: "ส่วนราชการ",
subtitle: "ระดับฝ่าย/กลุ่มงาน/ส่วน",
field: "govGroup",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "govOffice",
align: "left",
label: "ส่วนราชการ (ระดับสถาบัน/สำนักงาน/กอง)",
title: "ส่วนราชการ",
subtitle: "ระดับสถาบัน/สำนักงาน/กอง",
field: "govOffice",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "bureau",
align: "left",
label: "หน่วยงาน",
title: "หน่วยงาน",
field: "bureau",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const rows = ref<any>([
// {
// fixname: "",
// name: " ",
// brand: "",
// positionType: "",
// positionManager: "",
// positionLavel: "",
// positionNumber: ".2",
// govGroup: "",
// govOffice: "",
// bureau: "",
// },
]);
const visibleColumns = ref<string[]>([
"order",
"fixname",
"name",
"organizationOrganization",
"positionType",
"position",
"positionLavel",
"positionNumber",
"govGroup",
"govOffice",
"bureau",
]);
onMounted(() => {
// console.log(route.params);
@ -31,7 +167,7 @@ onMounted(() => {
fecthlist(retireld_params);
}
});
// fecthlist
const fecthlistprofile = async (type: any, year: any) => {
showLoader();
await http
@ -41,6 +177,7 @@ const fecthlistprofile = async (type: any, year: any) => {
retireld.value = res.data.result.id;
rows.value = res.data.result.profile.map((e: any) => ({
id: e.id,
profileId: e.profileId,
order: e.order,
fixname: e.prefix,
name: e.fullName,
@ -59,10 +196,10 @@ const fecthlistprofile = async (type: any, year: any) => {
hideLoader();
});
};
const fecthlist = async (id: any) => {
const fecthlist = async (retireld: any) => {
showLoader();
await http
.get(config.API.listRetire(id))
.get(config.API.listRetire(retireld))
.then((res: any) => {
// retireld.value = res.data.result.id;
rows.value = res.data.result.map((e: any) => ({
@ -87,172 +224,11 @@ const fecthlist = async (id: any) => {
hideLoader();
});
};
const columns = ref<any["columns"]>([
{
name: "order",
required: true,
label: "ลำดับ",
field: "order",
align: "left",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
/* {
name: "fixname",
align: "left",
label: "คำนำหน้านาม",
field: "fixname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
}, */
{
name: "name",
align: "left",
label: "ชื่อ - นามสกุล",
field: "name",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "organizationOrganization",
align: "left",
label: "สังกัด",
field: "organizationOrganization",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionType",
align: "left",
label: "ตำแหน่ง",
sublabel: "ประเภท",
field: "positionType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "position",
align: "left",
label: "ตำแหน่ง ",
sublabel: "ทางการบริหาร",
field: "position",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionLavel",
align: "left",
label: "ตำแหน่ง ",
sublabel: "ในสายงาน/ระดับ",
field: "positionLavel",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "positionNumber",
align: "left",
label: "ตำแหน่ง ",
sublabel: "เลขที่",
field: "positionNumber",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "govGroup",
align: "left",
label: "ส่วนราชการ ",
sublabel: "ระดับฝ่าย/กลุ่มงาน/ส่วน",
field: "govGroup",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "govOffice",
align: "left",
label: "ส่วนราชการ ",
sublabel: "ระดับสถาบัน/สำนักงาน/กอง",
field: "govOffice",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "bureau",
align: "left",
label: "หน่วยงาน",
field: "bureau",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "note",
align: "left",
label: "",
field: "",
},
{
name: "button",
align: "left",
label: "",
field: "",
},
]);
const rows = ref<any>([
// {
// fixname: "",
// name: " ",
// brand: "",
// positionType: "",
// positionManager: "",
// positionLavel: "",
// positionNumber: ".2",
// govGroup: "",
// govOffice: "",
// bureau: "",
// },
// {
// fixname: "",
// name: " ",
// brand: "",
// positionType: "",
// positionManager: "",
// positionLavel: "",
// positionNumber: ".2",
// govGroup: "",
// govOffice: "",
// bureau: "",
// },
// {
// fixname: "",
// name: " ",
// brand: "",
// positionType: "",
// positionManager: "",
// positionLavel: "",
// positionNumber: ".2",
// govGroup: "",
// govOffice: "",
// bureau: "",
// },
]);
const visibleColumns = ref<any>([
"order",
"fixname",
"name",
"organizationOrganization",
"positionType",
"position",
"positionLavel",
"positionNumber",
"govGroup",
"govOffice",
"bureau",
"note",
"button",
]);
const filter = ref<string>("");
// DelProfile
const clickDelete = (prop: any) => {
// console.log(prop.id);
console.log(prop);
let retireProfileId = prop.profileId;
$q.dialog({
title: "ยืนยันการลบข้อมูล",
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
@ -264,31 +240,28 @@ const clickDelete = (prop: any) => {
})
.onOk(async () => {
await http
.delete(config.API.profileRetire(prop.id))
.delete(config.API.profileRetire(retireProfileId))
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
.finally(async () => {
if (retireld_params === undefined) {
fecthlistprofile(type_params, year_params);
} else fecthlist(retireld_params);
await fecthlistprofile(type_params, year_params);
} else await fecthlist(retireld_params);
});
})
.onCancel(() => {})
.onDismiss(() => {});
};
const backHistory = () => {
window.history.back();
};
const fetchReason = async (val: string) => {
// note
const fetchReason = async (prop: string) => {
await http
.get(config.API.reasonId(val))
.get(config.API.reasonId(prop))
.then((res: any) => {
// console.log(res.data.result);
console.log(res.data.result);
note.value = res.data.result.reason;
retireProfileId.value = res.data.result.id;
})
@ -319,29 +292,31 @@ const saveNote = () => {
.catch((e) => {
messageError($q, e);
})
.finally(() => {
fecthlist(retireld_params);
.finally(async () => {
await fecthlist(retireld_params);
modalNote.value = false;
});
})
.onCancel(() => {})
.onDismiss(() => {});
};
const UpdateListId = (retireld: string, pId: string) => {
profileId.value = pId;
fecthlist(retireld);
console.log("profileId", profileId.value);
};
const backHistory = () => {
window.history.back();
};
const visibleNote = computed(() => {
if (note.value === "" || note.value === undefined) {
return true;
}
});
const UpdateListId = (retireld: string, pId: string) => {
profileId.value = pId
fecthlist(retireld)
console.log("profileId",profileId.value);
};
// const saveList = () => {
// $q.dialog({
// title: "",
// title: "",
// message: "?",
// cancel: {
// flat: true,
@ -406,7 +381,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
:profile-id="profileId"
:UpdateListId="UpdateListId"
/>
<!-- <q-btn flat round color="blue-12" icon="save" @click="saveList">
<!-- <q-btn flat round style="color: #016987;" icon="save" @click="saveList">
<q-tooltip>นทกขอม</q-tooltip>
</q-btn> -->
<q-btn color="primary" flat round icon="download">
@ -462,7 +437,12 @@ const paginationLabel = (start: number, end: number, total: number) => {
options-cover
style="min-width: 150px"
class="gt-xs q-ml-sm"
/>
>
<!-- <template v-slot:option="{ opt }">
<div>{{ opt.label }}</div>
<div class="sublabel">{{ opt.sublabel }}</div>
</template> -->
</q-select>
</q-tabs>
</div>
@ -473,7 +453,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
bordered
:rows="rows"
:columns="columns"
row-key="name"
row-key="order"
class="custom-header-table"
:filter="filter"
:visible-columns="visibleColumns"
@ -485,12 +465,14 @@ const paginationLabel = (start: number, end: number, total: number) => {
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<div class="text-grey-7 text-weight-medium">
<span class="row">{{ col.label }}</span>
<span class="row">{{ col.title }}</span>
<span class="row" style="font-size: 12px">{{
col.sublabel
col.subtitle
}}</span>
</div>
</q-th>
<q-th auto-width />
<q-th auto-width />
</q-tr>
</template>
<template v-slot:body="props">
@ -550,7 +532,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
<q-tooltip>อมลทะเบยนประว</q-tooltip>
</q-btn>
</q-td>
<q-td>
<q-td auto-width>
<q-btn
flat
round