รายการแต่งตั้ง-เลื่อน-ย้าย
This commit is contained in:
parent
64ac1b507a
commit
4c0df4ed71
3 changed files with 85 additions and 48 deletions
|
|
@ -250,12 +250,12 @@ const menuList = readonly<any[]>([
|
|||
path: "appoint-promote",
|
||||
role: "placement",
|
||||
},
|
||||
{
|
||||
key: 6.9,
|
||||
label: "รายการย้าย" /* */,
|
||||
path: "relocation",
|
||||
role: "placement",
|
||||
},
|
||||
// {
|
||||
// key: 6.9,
|
||||
// label: "รายการย้าย" /* */,
|
||||
// path: "relocation",
|
||||
// role: "placement",
|
||||
// },
|
||||
{
|
||||
key: 6.1,
|
||||
label: "รายการอื่นๆ" /* */,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ const fecthlistOthet = async () => {
|
|||
fullname: `${r.prefix ?? ""} ${r.firstname ?? ""} ${r.lastname ?? ""}`,
|
||||
}));
|
||||
console.log(rows.value);
|
||||
rows2.value = rows.value.filter((e: any) => e.orgName !== null);
|
||||
rows2.value = rows.value.filter((e: any) => e.orgName !== null && e.status !== 'REPORT'&& e.status !== 'DONE');
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue