รายการแต่งตั้ง-เลื่อน-ย้าย

This commit is contained in:
setthawutttty 2023-08-30 16:08:44 +07:00
parent 64ac1b507a
commit 4c0df4ed71
3 changed files with 85 additions and 48 deletions

View file

@ -93,7 +93,7 @@ const fecthlistappointment = async () => {
rows.value = response.map((e: any) => ({
personalId: e.id,
citizenId: e.citizenId,
fullname: e.prefix+e.firstname + " " + e.lastname,
fullname: e.prefix + e.firstname + " " + e.lastname,
organizationName:
e.organizationName +
" " +
@ -107,12 +107,17 @@ const fecthlistappointment = async () => {
positionNumber: e.positionNumber,
positionPath: e.positionPath,
status: status(e.status),
createdAt:date2Thai(e.createdAt),
createdAt: date2Thai(e.createdAt),
birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth),
}));
// console.log(rows.value);
rows2.value = rows.value.filter((e: any) => e.orgName !== null && e.status !== 'ส่งรายชื่อไปออกคำสั่ง'&& e.status !== 'ออกคำสั่งเสร็จแล้ว');
rows2.value = rows.value.filter(
(e: any) =>
e.orgName !== null &&
e.status !== "ส่งรายชื่อไปออกคำสั่ง" &&
e.status !== "ออกคำสั่งเสร็จแล้ว"
);
})
.catch((e) => {
console.log(typeof e);
@ -127,7 +132,10 @@ const fecthTypeOption = async () => {
.get(config.API.typeOrder())
.then((res) => {
optionsType.value = res.data.result.filter(
(e: any) => e.commandCode === "C-PM-05" || e.commandCode === "C-PM-06"
(e: any) =>
e.commandCode === "C-PM-05" ||
e.commandCode === "C-PM-06" ||
e.commandCode === "C-PM-07"
);
})
.catch((e) => {
@ -173,7 +181,6 @@ const columns = ref<QTableProps["columns"]>([
field: "organizationName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "birthday",
@ -252,7 +259,6 @@ const columns2 = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const openModalTree = (id: string) => {
@ -279,35 +285,64 @@ const deleteAppoint = async (id: string) => {
hideLoader();
});
};
const clickAddlist = () => {
dialogConfirm($q, () => createdAppoint());
};
const createdAppoint = async () => {
let pId: string[] = [];
selected.value.forEach((e: any) => {
pId.push(e.personalId);
});
let data = {
id: pId,
};
console.log(data);
showLoader();
await http
.put(config.API.apppointmentReport(type.value), data)
.then((res: any) => {
console.log(res);
success($q, "บันทึกสำเร็จ");
})
.catch((e: any) => {
console.log(e);
messageError($q, e);
})
.finally(() => {
hideLoader();
fecthlistappointment();
selected.value = [];
modal.value = false;
if (type.value == "c6de09ef-c1f8-4a39-aa31-c7ed88df01d9") {
let pId: string[] = [];
selected.value.forEach((e: any) => {
pId.push(e.personalId);
});
let data = {
id: pId,
};
console.log(data);
showLoader();
await http
.post(config.API.relocationMainReport(), data)
.then((res: any) => {
console.log(res);
success($q, "บันทึกสำเร็จ");
})
.catch((e) => {
console.log(e);
messageError($q, e);
})
.finally(async () => {
hideLoader();
fecthlistappointment();
selected.value = [];
modal.value = false;
});
} else {
let pId: string[] = [];
selected.value.forEach((e: any) => {
pId.push(e.personalId);
});
let data = {
id: pId,
};
console.log(data);
showLoader();
await http
.put(config.API.apppointmentReport(type.value), data)
.then((res: any) => {
console.log(res);
success($q, "บันทึกสำเร็จ");
})
.catch((e: any) => {
console.log(e);
messageError($q, e);
})
.finally(() => {
hideLoader();
fecthlistappointment();
selected.value = [];
modal.value = false;
});
}
};
const closeModalTree = async () => {
@ -340,11 +375,10 @@ const pagination = ref({
page: 1,
rowsPerPage: 10,
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
รายการแตงต-เลอน
รายการแตงต-เลอน-าย
</div>
<q-card flat bordered class="col-12 q-mt-sm">
<q-separator />
@ -363,7 +397,7 @@ const pagination = ref({
color="add"
icon="mdi-account-arrow-right"
>
<q-tooltip>งไปออกคำสงแตงต-เลอน</q-tooltip>
<q-tooltip>งไปออกคำสงแตงต-เลอน-าย</q-tooltip>
</q-btn>
<q-space />
@ -413,7 +447,6 @@ const pagination = ref({
row-key="citizenId"
:visible-columns="visibleColumns"
v-model:pagination="pagination"
>
<template v-slot:header="props">
<q-tr :props="props">
@ -503,7 +536,10 @@ const pagination = ref({
</q-td>
<q-td auto-width>
<q-btn
v-if="props.row.status !== 'ส่งรายชื่อไปออกคำสั่ง' && props.row.status !== 'ออกคำสั่งแล้ว'"
v-if="
props.row.status !== 'ส่งรายชื่อไปออกคำสั่ง' &&
props.row.status !== 'ออกคำสั่งแล้ว'
"
icon="mdi-dots-vertical"
size="12px"
color="grey-7"
@ -532,9 +568,7 @@ const pagination = ref({
name="mdi-bookmark-outline"
/>
</q-item-section>
<q-item-section
>เลอกหนวยงาน/ตำแหน</q-item-section
>
<q-item-section>เลอกหนวยงาน/ตำแหน</q-item-section>
</q-item>
<q-item
clickable
@ -565,7 +599,10 @@ const pagination = ref({
<q-dialog v-model="modal">
<q-card style="width: 1200px; max-width: 80vw">
<DialogHeader title="ส่งไปรายการแต่งตั้ง - เลื่อน" :close="clickClose" />
<DialogHeader
title="ส่งไปรายการแต่งตั้ง - เลื่อน - ย้าย"
:close="clickClose"
/>
<q-separator />
<q-card-section class="q-pt-none">
<div class="row justify-between">
@ -576,7 +613,7 @@ const pagination = ref({
dense
v-model="type"
:options="optionsType"
label="คำสั่งแต่งตั่ง - เลื่อน"
label="คำสั่งแต่งตั่ง - เลื่อน - ย้าย"
style="width: 400px; max-width: auto"
emit-value
map-options