เลขที่ตำแหน่ง => ตำแหน่งเลขที่

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-06-26 14:15:54 +07:00
parent 599a9c2c75
commit c1bb3651ab
47 changed files with 155 additions and 127 deletions

View file

@ -60,6 +60,7 @@ const lazy = ref(nodes);
const expanded = ref<string[]>([]);
/** Position*/
const positionUse = ref<string[]>([]);
const positionNo = ref<DataPositionNo[]>();
const positionId = ref<string>("");
const seletcId = ref<string>("");
@ -171,7 +172,18 @@ async function fetchDataTable(id: string, level: number = 0) {
}
});
positionNo.value = store.fetchPosNo(dataMain);
let posMain = store.fetchPosNo(dataMain);
if (props.dataRow?.posmasterId) {
const newUse = positionUse.value.filter(
(e) => e !== props.dataRow?.posmasterId
);
positionNo.value = posMain.filter((e: any) => !newUse.includes(e.id));
} else {
positionNo.value = posMain.filter(
(e: any) => !positionUse.value.includes(e.id)
);
}
})
.catch((err) => {
messageError($q, err);
@ -230,7 +242,7 @@ async function onClickSubmit() {
nodeId: dataPosMaster.nodeId,
orgRevisionId: orgRevisionId.value,
positionId: selectedPos.value[0].id,
posMasterNo: dataPosMaster.posMasterNo, //()
posMasterNo: dataPosMaster.posMasterNo, //()
positionName: selectedPos.value[0].positionName, //
positionField: selectedPos.value[0].positionField, //
posTypeId: selectedPos.value[0].posTypeId, //
@ -278,7 +290,7 @@ watch(
async () => {
if (modal.value) {
await fetchOrganizationActive();
console.log(props?.dataRow);
await fetchPositionUes();
if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) {
await fetchPosFind(props?.dataRow?.node, props?.dataRow?.nodeId);
@ -289,6 +301,17 @@ watch(
}
);
function fetchPositionUes() {
http
.get(config.API.placementPositionUse())
.then((res) => {
positionUse.value = res.data.result;
})
.catch((err) => {
messageError($q, err);
});
}
const itemTaps = ref<string[]>();
function filterItemsTaps(data: TreeMain[]) {
let orgTreeIds: string[] = [];