fix ชื่อ-นามสกุล
This commit is contained in:
parent
4966b1d2e2
commit
1c57374868
12 changed files with 833 additions and 1082 deletions
|
|
@ -970,6 +970,7 @@ onMounted(async () => {
|
|||
await fetchOrganizationAgencyCode();
|
||||
await fetchPosition();
|
||||
await fetchData();
|
||||
await nodeTree();
|
||||
});
|
||||
|
||||
const onSelected = async (id: string) => {
|
||||
|
|
@ -1647,7 +1648,6 @@ const clickAdd = async () => {
|
|||
isActive.value = false;
|
||||
isCondition.value = false;
|
||||
conditionNote.value = "";
|
||||
await nodeTree();
|
||||
};
|
||||
|
||||
/**เมื่อเลือกใหม่
|
||||
|
|
|
|||
|
|
@ -231,9 +231,7 @@ const getData = async () => {
|
|||
salary: r.salary ? r.salary : 0,
|
||||
status: r.status ?? "",
|
||||
statustext: statusText(r.status ?? ""),
|
||||
fullname: `${r.prefix ?? ""} ${r.firstName ?? ""} ${
|
||||
r.lastName ?? ""
|
||||
}`,
|
||||
fullname: `${r.prefix ?? ""}${r.firstName ?? ""} ${r.lastName ?? ""}`,
|
||||
});
|
||||
});
|
||||
rows.value = list;
|
||||
|
|
|
|||
|
|
@ -221,9 +221,7 @@ const getData = async () => {
|
|||
salary: r.salary ? r.salary : 0,
|
||||
status: r.status ?? "",
|
||||
statustext: statusText(r.status ?? ""),
|
||||
fullname: `${r.prefix ?? ""} ${r.firstName ?? ""} ${
|
||||
r.lastName ?? ""
|
||||
}`,
|
||||
fullname: `${r.prefix ?? ""}${r.firstName ?? ""} ${r.lastName ?? ""}`,
|
||||
});
|
||||
});
|
||||
rows.value = list;
|
||||
|
|
|
|||
|
|
@ -41,6 +41,17 @@ const columns = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
align: "left",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
sortable: true,
|
||||
field: "fullname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "realReason",
|
||||
align: "left",
|
||||
|
|
@ -148,6 +159,7 @@ onMounted(async () => {
|
|||
}
|
||||
});
|
||||
|
||||
//นำข้อมูลจาก API มาแสดง
|
||||
const fecthlist = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -158,6 +170,7 @@ const fecthlist = async () => {
|
|||
data.map((r: ResponseItems) => {
|
||||
list.push({
|
||||
datetext: r.createdAt !== null ? date2Thai(r.createdAt) : "-",
|
||||
fullname: r.fullname ?? "",
|
||||
createdAt: new Date(r.createdAt),
|
||||
futureWork: !!r.futureWork,
|
||||
futureWorkReason: r.futureWorkReason ?? "",
|
||||
|
|
@ -184,6 +197,8 @@ const fecthlist = async () => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
//เซฟเพื่อส่งไปออกคำสั่ง
|
||||
const saveAppoint = async () => {
|
||||
await myForm.value!.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
|
|
@ -218,6 +233,8 @@ const validationDate = (thaiDate: string | null) => {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
//แปลงเดือนจากตัวเลขเป็นภาษาอ่าน
|
||||
const convertThaiDateToNumeric = (thaiDate: string) => {
|
||||
const parts = thaiDate.split(" ");
|
||||
if (parts.length !== 3) return null;
|
||||
|
|
@ -326,6 +343,15 @@ const openModalCalendar = (rows: any) => {
|
|||
>
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="fullname"
|
||||
:props="props"
|
||||
@click="
|
||||
router.push(`/exit-Interview/questionnair/${props.row.id}`)
|
||||
"
|
||||
>
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="realReason"
|
||||
:props="props"
|
||||
|
|
@ -425,6 +451,7 @@ const openModalCalendar = (rows: any) => {
|
|||
</div>
|
||||
</q-card>
|
||||
|
||||
<!-- dialog กำหนดวันหนัดหมายสัมภาษณ์ -->
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 800px">
|
||||
<q-form ref="myForm">
|
||||
|
|
|
|||
|
|
@ -228,9 +228,7 @@ const getData = async () => {
|
|||
salary: r.salary ? r.salary : 0,
|
||||
status: r.status ?? "",
|
||||
statustext: statusText(r.status ?? ""),
|
||||
fullname: `${r.prefix ?? ""} ${r.firstName ?? ""} ${
|
||||
r.lastName ?? ""
|
||||
}`,
|
||||
fullname: `${r.prefix ?? ""}${r.firstName ?? ""} ${r.lastName ?? ""}`,
|
||||
});
|
||||
});
|
||||
rows.value = list;
|
||||
|
|
|
|||
|
|
@ -9,18 +9,20 @@ import config from "@/app.config";
|
|||
const router = useRouter();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, success ,date2Thai} = mixin;
|
||||
const { showLoader, hideLoader, messageError, success, date2Thai } = mixin;
|
||||
|
||||
const rows = ref<any>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "prefix",
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "คำนำหน้า",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "prefix",
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
|
|
@ -87,6 +89,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"prefix",
|
||||
"fullname",
|
||||
"positionType",
|
||||
|
|
@ -104,17 +107,15 @@ const fectListDecased = async () => {
|
|||
await http
|
||||
.get(config.API.listDeceased())
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
rows.value = res.data.result.map((e: any) => ({
|
||||
personalId: e.id,
|
||||
prefix: e.prefix,
|
||||
fullname: e.firstName + " " + e.lastName,
|
||||
fullname: `${e.prefix ?? ""}${e.firstName ?? ""} ${e.lastName ?? ""}`,
|
||||
positionType: e.positionType,
|
||||
position: e.positionLine,
|
||||
positionLevel: e.positionLevel,
|
||||
positionExecutive: e.positionExecutive,
|
||||
oc: e.organization,
|
||||
createdAt:date2Thai(e.createdAt),
|
||||
createdAt: date2Thai(e.createdAt),
|
||||
}));
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -125,8 +126,6 @@ const fectListDecased = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
|
|
@ -219,11 +218,8 @@ const pagination = ref({
|
|||
class="cursor-pointer"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
<!-- <q-td key="no" :props="props">
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td> -->
|
||||
<q-td key="prefix" :props="props">
|
||||
{{ props.row.prefix }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props">
|
||||
{{ props.row.fullname }}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,11 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
import type { requestSendNoti,DataCopyOrder,ResponseOrganiz } from "@/modules/06_retirement/interface/response/Deceased";
|
||||
import type {
|
||||
requestSendNoti,
|
||||
DataCopyOrder,
|
||||
ResponseOrganiz,
|
||||
} from "@/modules/06_retirement/interface/response/Deceased";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
|
@ -26,14 +30,11 @@ const props = defineProps({
|
|||
});
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const next = () => props.next();
|
||||
const previous = () => props.previous();
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||
|
||||
|
||||
|
||||
const myForm = ref<QForm | null>(null);
|
||||
const filterRef = ref<QInput>();
|
||||
const filter = ref<string>("");
|
||||
|
|
@ -157,23 +158,22 @@ const editRows = ref<DataCopyOrder[]>([]);
|
|||
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
// await getList();
|
||||
});
|
||||
|
||||
const getList = async () => {
|
||||
showLoader();
|
||||
await http.get(config.API.detailByidDeceased(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result
|
||||
console.log(data)
|
||||
}).catch((e) => {
|
||||
await http
|
||||
.get(config.API.detailByidDeceased(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
const listModal = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -203,14 +203,12 @@ const listModal = async (id: string) => {
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
const getData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.detailByidDeceased(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
// console.log(data);
|
||||
let list: DataCopyOrder[] = [];
|
||||
data.map((r: any) => {
|
||||
let selectCopyOrder = [];
|
||||
|
|
@ -222,9 +220,9 @@ const getData = async () => {
|
|||
}
|
||||
|
||||
list.push({
|
||||
id:r.id,
|
||||
id: r.id,
|
||||
personalId: r.profileId ?? "",
|
||||
name:`${r.prefix}${r.firstName} ${r.lastName}`,
|
||||
name: `${r.prefix}${r.firstName} ${r.lastName}`,
|
||||
idCard: r.citizenId ?? "",
|
||||
position: r.positionName ?? "",
|
||||
unit: r.organizationName ?? "-",
|
||||
|
|
@ -252,22 +250,22 @@ const getData = async () => {
|
|||
};
|
||||
|
||||
const saveData = async () => {
|
||||
showLoader();
|
||||
const persons = selectedModal.value.map(item => ({ profileId: item.profileId }));
|
||||
const dataToSend = { Persons: persons };
|
||||
await http
|
||||
.put(config.API.detailByidDeceased(profileId.value), dataToSend)
|
||||
.then((res) => {
|
||||
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
clickClose();
|
||||
getData();
|
||||
hideLoader();
|
||||
});
|
||||
showLoader();
|
||||
const persons = selectedModal.value.map((item) => ({
|
||||
profileId: item.profileId,
|
||||
}));
|
||||
const dataToSend = { Persons: persons };
|
||||
await http
|
||||
.put(config.API.detailByidDeceased(profileId.value), dataToSend)
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
clickClose();
|
||||
getData();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const resetFilter = () => {
|
||||
|
|
@ -299,11 +297,7 @@ const clickAdd = async () => {
|
|||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
console.log(id)
|
||||
dialogRemove(
|
||||
$q,
|
||||
() => deleteData(id),
|
||||
);
|
||||
dialogRemove($q, () => deleteData(id));
|
||||
};
|
||||
|
||||
const nodeTree = async () => {
|
||||
|
|
@ -339,7 +333,6 @@ const deleteData = async (id: string) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
// hideLoader();
|
||||
await getData();
|
||||
});
|
||||
};
|
||||
|
|
@ -367,7 +360,7 @@ const fetchSaveCopyOrder = async () => {
|
|||
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.notiDeceased(profileId.value), {Persons:list})
|
||||
.put(config.API.notiDeceased(profileId.value), { Persons: list })
|
||||
.then((res: any) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
next();
|
||||
|
|
@ -377,7 +370,7 @@ const fetchSaveCopyOrder = async () => {
|
|||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
getData()
|
||||
getData();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -387,7 +380,7 @@ const updateData = (row: DataCopyOrder) => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
|
|
@ -510,7 +503,6 @@ const updateData = (row: DataCopyOrder) => {
|
|||
</q-select>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
|
|
@ -537,7 +529,7 @@ const updateData = (row: DataCopyOrder) => {
|
|||
color="public"
|
||||
@click="saveDataCopyOrder"
|
||||
class="q-px-md"
|
||||
>
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -625,7 +617,6 @@ const updateData = (row: DataCopyOrder) => {
|
|||
:filter="filterModal"
|
||||
row-key="profileId"
|
||||
selection="multiple"
|
||||
|
||||
v-model:selected="selectedModal"
|
||||
>
|
||||
<template v-slot:header-selection="scope">
|
||||
|
|
|
|||
|
|
@ -1,3 +1,89 @@
|
|||
<script setup lang="ts">
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
const fullName = ref<string>("");
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const detail = ref<any>([]);
|
||||
|
||||
onMounted(() => {
|
||||
fectdata();
|
||||
});
|
||||
|
||||
//นำข้อมูลจาก API มาแสดง
|
||||
const fectdata = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.detailDeceased(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
detail.value = data;
|
||||
fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
//กลับไปหน้า registry
|
||||
const redirectToRegistry = (id: string) => {
|
||||
router.push(`/registry/${id}`);
|
||||
};
|
||||
|
||||
//เปิดdetail ของ deceased
|
||||
const openDeceased = (id: string) => {
|
||||
router.push(`/deceased/detail/${id}`);
|
||||
};
|
||||
|
||||
//ไปหน้าถัดไป
|
||||
const nextPage = (page: string) => {
|
||||
window.open(page, "_blank");
|
||||
};
|
||||
|
||||
//downloadFile
|
||||
const downloadFile = (response: any, filename: string) => {
|
||||
const link = document.createElement("a");
|
||||
var fileName = filename;
|
||||
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
||||
link.setAttribute("download", fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
|
||||
const fileDownload = async (type: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.DeceasedReport(type, profileId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
downloadFile(
|
||||
res,
|
||||
`รายละเอียดบันทึกเวียนแจ้งการถึงแก่กรรม-${fullName}.${type}`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
|
|
@ -146,86 +232,7 @@
|
|||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
|
||||
const fullName = ref<string>("");
|
||||
const profileId = ref<string>(route.params.id.toString());
|
||||
const detail = ref<any>([]);
|
||||
|
||||
onMounted(() => {
|
||||
console.log(profileId.value);
|
||||
fectdata();
|
||||
});
|
||||
const fectdata = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.detailDeceased(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
detail.value = data;
|
||||
fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`;
|
||||
console.log(detail.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const redirectToRegistry = (id: string) => {
|
||||
console.log(id);
|
||||
router.push(`/registry/${id}`);
|
||||
};
|
||||
const openDeceased = (id: string) => {
|
||||
router.push(`/deceased/detail/${id}`);
|
||||
};
|
||||
const nextPage = (page: string) => {
|
||||
window.open(page, "_blank");
|
||||
};
|
||||
const downloadFile = (response: any, filename: string) => {
|
||||
const link = document.createElement("a");
|
||||
var fileName = filename;
|
||||
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
||||
link.setAttribute("download", fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
|
||||
const fileDownload = async (type: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.DeceasedReport(type, profileId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
downloadFile(
|
||||
res,
|
||||
`รายละเอียดบันทึกเวียนแจ้งการถึงแก่กรรม-${fullName}.${type}`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scope>
|
||||
.q-img {
|
||||
border-radius: 5px;
|
||||
|
|
|
|||
|
|
@ -10,10 +10,11 @@ import config from "@/app.config";
|
|||
import type { QTableProps } from "quasar";
|
||||
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
|
||||
|
||||
const RetirementData = useRetirementDataStore();
|
||||
const { statusText } = RetirementData;
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const RetirementData = useRetirementDataStore();
|
||||
const { messageError, date2Thai, showLoader, hideLoader, success } = mixin;
|
||||
|
||||
const rows = ref<ResponseItems[]>([]);
|
||||
|
|
@ -157,17 +158,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "prefix",
|
||||
align: "left",
|
||||
label: "คำนำหน้า",
|
||||
sortable: true,
|
||||
field: "prefix",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
align: "left",
|
||||
|
|
@ -250,7 +240,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
"prefix",
|
||||
"fullname",
|
||||
"positionTypeOld",
|
||||
"positionLevelOld",
|
||||
|
|
@ -324,8 +313,8 @@ const fecthlist = async () => {
|
|||
salary: r.salary ? r.salary : 0,
|
||||
sendDate: new Date(),
|
||||
status: r.status ?? "",
|
||||
statustext: status(r.status ?? ""),
|
||||
fullname: `${r.firstName ?? ""} ${r.lastName ?? ""}`,
|
||||
statustext: statusText(r.status ?? ""),
|
||||
fullname: `${r.prefix ?? ""}${r.firstName ?? ""} ${r.lastName ?? ""}`,
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -340,7 +329,7 @@ const fecthlist = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
//บันทึกคำสั่ง
|
||||
//ส่งไปออกคำสั่ง
|
||||
const saveOrder = async () => {
|
||||
const id = selected.value.map((r) => r.id);
|
||||
const body = {
|
||||
|
|
@ -351,8 +340,6 @@ const saveOrder = async () => {
|
|||
await http
|
||||
.post(config.API.resignReport, body)
|
||||
.then((res: any) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(data);
|
||||
success($q, "ส่งไปออกคำสั่งลาออกสำเร็จ");
|
||||
closeModal();
|
||||
})
|
||||
|
|
@ -365,28 +352,6 @@ const saveOrder = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
//แปลงข้อความ status
|
||||
const status = (val: string) => {
|
||||
switch (val) {
|
||||
case "WAITTING":
|
||||
return "รอดำเนินการ";
|
||||
case "PENDING":
|
||||
return "เลือกตำแหน่งแล้ว";
|
||||
case "APPROVE":
|
||||
return "อนุมัติ";
|
||||
case "REJECT":
|
||||
return "ยับยั้ง";
|
||||
case "DELETE":
|
||||
return "ยกเลิกการลาออก";
|
||||
case "REPORT":
|
||||
return "ส่งรายชื่อไปออกคำสั่ง";
|
||||
case "DONE":
|
||||
return "ออกคำสั่งเสร็จแล้ว";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
};
|
||||
|
||||
const pagination = ref({
|
||||
sortBy: "datetext",
|
||||
descending: true,
|
||||
|
|
@ -478,9 +443,6 @@ const pagination = ref({
|
|||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="prefix" :props="props">
|
||||
{{ props.row.prefix }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props">
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -11,12 +11,7 @@ import CurrencyInput from "@/components/CurruncyInput.vue";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
||||
import type {
|
||||
ResponseItems,
|
||||
TypeFile,
|
||||
} from "@/modules/06_retirement/interface/response/Main";
|
||||
|
||||
import type { TypeFile } from "@/modules/06_retirement/interface/response/Main";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
|
|
@ -149,7 +144,6 @@ const fetchData = async (id: string) => {
|
|||
.get(config.API.resingByid(id))
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
console.log(data);
|
||||
let list: TypeFile[] = [];
|
||||
if (data.docs.length > 0) {
|
||||
data.docs.map((doc: TypeFile) => {
|
||||
|
|
@ -172,29 +166,6 @@ const fetchData = async (id: string) => {
|
|||
location.value = data.location ?? "";
|
||||
status.value = data.status ?? "";
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const rowsFileDownload = ref<TypeFile[]>([
|
||||
{ fileName: "หนังสือลาออกจากราขการ", pathName: "" },
|
||||
]);
|
||||
const downloadAttachment = async (type: string, id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.reportResignList(type, id), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
console.log(data);
|
||||
let list: TypeFile[] = [];
|
||||
downloadFile(res, `หนังสือลาออกจากราขการ.${type}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
|
|
@ -327,8 +298,6 @@ const saveData = async () => {
|
|||
await http
|
||||
.put(config.API.resingByid(id.value), formData)
|
||||
.then((res: any) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(data);
|
||||
success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
|
||||
edit.value = false;
|
||||
})
|
||||
|
|
@ -551,57 +520,6 @@ const statusOrder = (val: boolean) => {
|
|||
</d-table>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<!-- <q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
แบบฟอร์มหนังสือขอลาออกจากราชการ
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
:rows="rowsFileDownload"
|
||||
:columns="columns"
|
||||
row-key="fileName"
|
||||
hide-header
|
||||
hide-bottom
|
||||
>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="fileName" :props="props">
|
||||
{{ props.row.fileName }}
|
||||
</q-td>
|
||||
<q-td key="btnMicrosoft" :props="props">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="red"
|
||||
icon="picture_as_pdf"
|
||||
@click="downloadAttachment('pdf', id)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="blue"
|
||||
icon="mdi-file-word"
|
||||
@click="downloadAttachment('docx', id)"
|
||||
>
|
||||
<q-tooltip>ไฟล์ WORD</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</q-card> -->
|
||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-dark">
|
||||
|
|
@ -774,7 +692,7 @@ const statusOrder = (val: boolean) => {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row ">
|
||||
<div class="col-xs-6 col-sm-3 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
|
|
@ -790,7 +708,7 @@ const statusOrder = (val: boolean) => {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row ">
|
||||
<div class="col-xs-6 col-sm-3 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
|
|
@ -806,7 +724,7 @@ const statusOrder = (val: boolean) => {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row ">
|
||||
<div class="col-xs-6 col-sm-3 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
|
|
@ -822,22 +740,8 @@ const statusOrder = (val: boolean) => {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row ">
|
||||
<div class="col-xs-6 col-sm-3 row">
|
||||
<div class="col-12">
|
||||
<!-- <q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="salary"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'เงินเดือน'}`"
|
||||
type="number"
|
||||
/> -->
|
||||
|
||||
<CurrencyInput
|
||||
v-model="salary"
|
||||
:edit="edit"
|
||||
|
|
@ -849,7 +753,7 @@ const statusOrder = (val: boolean) => {
|
|||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-xs-4 row ">
|
||||
<div class="col-xs-4 row">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
|
|
@ -867,7 +771,7 @@ const statusOrder = (val: boolean) => {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4 row ">
|
||||
<div class="col-xs-4 row">
|
||||
<div class="col-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
|
|
@ -884,7 +788,7 @@ const statusOrder = (val: boolean) => {
|
|||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:readonly="!edit"
|
||||
:readonly="!edit"
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
|
|
@ -915,7 +819,7 @@ const statusOrder = (val: boolean) => {
|
|||
</datepicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4 row ">
|
||||
<div class="col-xs-4 row">
|
||||
<div class="col-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
|
|
@ -932,7 +836,7 @@ const statusOrder = (val: boolean) => {
|
|||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:readonly="!edit"
|
||||
:readonly="!edit"
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
|
|
@ -1021,9 +925,6 @@ const statusOrder = (val: boolean) => {
|
|||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<!-- :rules="[
|
||||
(val) => !!val || `${'กรุณาเลือก วันสุดท้ายที่ยับยั้ง'}`,
|
||||
]" -->
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -35,6 +35,7 @@ interface ResponseItems {
|
|||
suggestion: string;
|
||||
status: string;
|
||||
datetext: string | null;
|
||||
fullname: string;
|
||||
appointDate: any;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue