เลขที่ตำแหน่ง => ตำแหน่งเลขที่
This commit is contained in:
parent
599a9c2c75
commit
c1bb3651ab
47 changed files with 155 additions and 127 deletions
|
|
@ -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[] = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue