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