ปรับ บรรจุ
This commit is contained in:
parent
ad33e2df03
commit
c19d37bcc6
5 changed files with 21 additions and 6 deletions
|
|
@ -147,8 +147,8 @@ async function fetchDataTable(id: string, level: number = 0) {
|
|||
nodeId: id,
|
||||
position: props?.dataRow?.positionCandidate,
|
||||
typeCommand: props.typeCommand,
|
||||
posLevel: props.dataRow?.posLevelId,
|
||||
posType: props.dataRow?.posTypeId,
|
||||
posLevel: props.dataRow?.posLevelCandidateId,
|
||||
posType: props.dataRow?.posTypeCandidateId,
|
||||
isAll: isAll.value,
|
||||
isBlank: isBlank.value,
|
||||
};
|
||||
|
|
@ -158,12 +158,13 @@ async function fetchDataTable(id: string, level: number = 0) {
|
|||
.then((res) => {
|
||||
const dataMain: PositionMaim[] = [];
|
||||
posMasterMain.value = res.data.result.data;
|
||||
|
||||
res.data.result.data.forEach((e: PositionNo) => {
|
||||
const p = e.positions;
|
||||
if (p.length !== 0) {
|
||||
const a = p.find((el: Positions) => el.positionIsSelected === true);
|
||||
const { id, ...rest } = a ? a : p[0];
|
||||
const data = { ...e, ...rest };
|
||||
const data: any = { ...e, ...rest };
|
||||
dataMain.push(data);
|
||||
}
|
||||
});
|
||||
|
|
@ -195,6 +196,9 @@ async function fetchPosFind(level: number, id: string) {
|
|||
.post(config.API.orgPosFind, body)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
|
||||
console.log(props?.dataRow);
|
||||
|
||||
expanded.value = data;
|
||||
nodeId.value = id;
|
||||
positionId.value = props?.dataRow?.posmasterId;
|
||||
|
|
@ -214,7 +218,6 @@ async function onClickSubmit() {
|
|||
const dataPosMaster = await posMasterMain.value?.find(
|
||||
(e: any) => e.id === positionId.value
|
||||
);
|
||||
const dataNode = await filterNodeFn(nodes.value, nodeId.value);
|
||||
|
||||
if (selectedPos.value.length === 0) {
|
||||
dialogMessageNotify($q, "กรุณาเลือกตำแหน่ง");
|
||||
|
|
@ -224,8 +227,8 @@ async function onClickSubmit() {
|
|||
|
||||
const body = {
|
||||
personalId: props?.dataRow?.personalId,
|
||||
node: nodeLevel.value,
|
||||
nodeId: nodeId.value,
|
||||
node: dataPosMaster.node,
|
||||
nodeId: dataPosMaster.nodeId,
|
||||
orgRevisionId: orgRevisionId.value,
|
||||
positionId: selectedPos.value[0].id,
|
||||
posMasterNo: dataPosMaster.posMasterNo, //เลขที่ตำแหน่ง(เลขอย่่างเดียว)
|
||||
|
|
@ -274,6 +277,8 @@ watch(
|
|||
() => modal.value,
|
||||
async () => {
|
||||
if (modal.value) {
|
||||
console.log(props?.dataRow);
|
||||
|
||||
await fetchOrganizationActive();
|
||||
if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) {
|
||||
await fetchPosFind(props?.dataRow?.node, props?.dataRow?.nodeId);
|
||||
|
|
|
|||
|
|
@ -316,6 +316,11 @@ async function getTable() {
|
|||
statusId: data.statusId,
|
||||
draft: convertDraft(data.draft),
|
||||
typeCommand: data.typeCommand,
|
||||
posTypeCandidateId: data.posTypeCandidateId,
|
||||
posTypeCandidateName: data.posTypeCandidateName,
|
||||
posLevelCandidateId: data.posLevelCandidateId,
|
||||
posLevelCandidateName: data.posLevelCandidateName,
|
||||
posmasterId: data.posmasterId,
|
||||
|
||||
statusName: convertContainStatus(data.statusId),
|
||||
organizationName:
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ interface PositionMaim {
|
|||
positionIsSelected: boolean;
|
||||
positionName: string;
|
||||
positions: Positions[];
|
||||
node: number;
|
||||
nodeId: string;
|
||||
}
|
||||
|
||||
interface PositionNo {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ export const useSelectOrgStore = defineStore("selectorg", () => {
|
|||
positionIsSelected: e.positionIsSelected ? e.fullNameCurrentHolder : "-",
|
||||
isSit: e.isSit,
|
||||
positions: e.positions,
|
||||
node: e.node,
|
||||
nodeId: e.nodeId,
|
||||
}));
|
||||
|
||||
return listPosNo;
|
||||
|
|
|
|||
|
|
@ -362,6 +362,7 @@ onMounted(() => {
|
|||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue