fix ชื่อ-นามสกุล

This commit is contained in:
AnandaTon 2023-09-19 17:42:17 +07:00
parent 4966b1d2e2
commit 1c57374868
12 changed files with 833 additions and 1082 deletions

View file

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