เพิ่ม interface ให้ row รายการอื่นๆ
This commit is contained in:
parent
0f5879d250
commit
6104ca99bb
3 changed files with 79 additions and 27 deletions
|
|
@ -77,7 +77,6 @@ const fecthOther = async () => {
|
|||
title.value.organizationPositionOld = data.organizationPositionOld ?? "-";
|
||||
title.value.positionLevelOld = data.positionLevelOld ?? "-";
|
||||
title.value.positionTypeOld = data.positionTypeOld ?? "-";
|
||||
|
||||
responseData.value.profileId = data.profileId;
|
||||
responseData.value.createdAt = data.createdAt;
|
||||
responseData.value.date = data.date !== null ? new Date(data.date) : new Date();
|
||||
|
|
@ -141,7 +140,6 @@ const saveOther = async () => {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
console.log(e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fecthOther();
|
||||
|
|
@ -156,7 +154,6 @@ const getClass = (val: boolean) => {
|
|||
onMounted(async () => {
|
||||
if (keycloak.tokenParsed != null) {
|
||||
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
|
||||
console.log("roleAdmin===>", roleAdmin.value);
|
||||
}
|
||||
await fecthOther();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { useRouter } from "vue-router";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store"
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { listMain,listMainAPI,OpType } from "@/modules/05_placement/interface/response/OhterMain"
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
@ -18,11 +19,11 @@ const { showLoader, hideLoader, success, messageError, date2Thai, dialogRemove }
|
|||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const optionsType = ref<any[]>([]);
|
||||
const optionsType = ref<OpType[]>([]);
|
||||
const type = ref<string>("");
|
||||
const modal = ref<boolean>(false);
|
||||
const rows = ref<any>([]);
|
||||
const rows2 = ref<any>([]);
|
||||
const rows = ref<listMain[]>([]);
|
||||
const rows2 = ref<listMain[]>([]);
|
||||
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterKeyword2 = ref<string>("");
|
||||
|
|
@ -108,31 +109,31 @@ const fecthlistOthet = async () => {
|
|||
.get(config.API.otherMain())
|
||||
.then((res) => {
|
||||
let response = res.data.result;
|
||||
rows.value = response.map((r: any) => ({
|
||||
rows.value = response.map((r: listMainAPI) => ({
|
||||
createdAt: date2Thai(r.createdAt),
|
||||
date: new Date(),
|
||||
firstName: r.firstname ?? "",
|
||||
personalId: r.id ?? "",
|
||||
firstName: r.firstname ?? "-",
|
||||
personalId: r.id ?? "-",
|
||||
isActive: r.isActive ? r.isActive : false,
|
||||
lastName: r.lastname ?? "",
|
||||
organization: r.organization ?? "",
|
||||
organizationPositionOld: r.organizationPositionOld ?? "",
|
||||
posNo: r.posNo ?? "",
|
||||
position: r.position ?? "",
|
||||
positionLevel: r.positionLevel ?? "",
|
||||
positionLevelOld: r.positionLevelOld ?? "",
|
||||
positionNumberOld: r.positionNumberOld ?? "",
|
||||
positionTypeOld: r.positionTypeOld ?? "",
|
||||
prefix: r.prefix ?? "",
|
||||
reason: r.reason ?? "",
|
||||
lastName: r.lastname ?? "-",
|
||||
organization: r.organization ?? "-",
|
||||
organizationPositionOld: r.organizationPositionOld ?? "-",
|
||||
posNo: r.posNo ?? "-",
|
||||
position: r.position ?? "-",
|
||||
positionLevel: r.positionLevel ?? "-",
|
||||
positionLevelOld: r.positionLevelOld ?? "-",
|
||||
positionNumberOld: r.positionNumberOld ?? "-",
|
||||
positionTypeOld: r.positionTypeOld ?? "-",
|
||||
prefix: r.prefix ?? "-",
|
||||
reason: r.reason ?? "-",
|
||||
salary: r.salary ? r.salary : 0,
|
||||
status: r.status ?? "",
|
||||
status: r.status ?? "-",
|
||||
statustext: statusText(r.status ?? ""),
|
||||
fullname: `${r.prefix ?? ""}${r.firstname ?? ""} ${r.lastname ?? ""}`,
|
||||
}));
|
||||
rows2.value = rows.value.filter(
|
||||
(e: any) =>
|
||||
e.orgName !== null && e.status !== "REPORT" && e.status !== "DONE"
|
||||
(e: listMain) =>
|
||||
e.status !== "REPORT" && e.status !== "DONE"
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -150,7 +151,7 @@ const fecthTypeOption = async () => {
|
|||
.get(config.API.typeOrder())
|
||||
.then((res) => {
|
||||
optionsType.value = res.data.result.filter(
|
||||
(e: any) => e.commandCode === "C-PM-08" || e.commandCode === "C-PM-09"
|
||||
(e: OpType) => e.commandCode === "C-PM-08" || e.commandCode === "C-PM-09"
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -203,9 +204,9 @@ const clickDelete = (id: string) => {
|
|||
dialogRemove($q, () => deleteOther(id));
|
||||
};
|
||||
//----(เปิดหน้าถัดไป)------//
|
||||
const nextPage = (row: any) => {
|
||||
const nextPage = (id: string) => {
|
||||
router.push({
|
||||
path: `/other/detail/${row.personalId}`,
|
||||
path: `/other/detail/${id}`,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -276,7 +277,7 @@ onMounted(() => {
|
|||
<q-tr
|
||||
:props="props"
|
||||
class="cursor-pointer"
|
||||
@click="nextPage(props.row)"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue