closed: edit positions in current org structure (#1418)

This commit is contained in:
Warunee Tamkoo 2025-08-21 10:36:16 +07:00
parent 8e56123e12
commit 7cb580060b
9 changed files with 85 additions and 31 deletions

View file

@ -52,7 +52,10 @@ const levelTree = ref<number>(0);
*/
async function fetchTree() {
showLoader();
const id: string = store.activeId ? store.activeId?.toString() : "";
const id: string =
(store.typeOrganizational === "draft"
? store.activeId
: store.historyDnaOrgId) ?? "";
await http
.get(config.API.orgByid(id))
.then((res) => {
@ -116,7 +119,10 @@ const reqMaster = reactive<FilterMaster>({
page: 1,
pageSize: 10,
keyword: "",
revisionId: store.activeId,
revisionId:
store.typeOrganizational === "draft"
? store.activeId
: store.historyDnaOrgId,
});
const totalRow = ref<number>(0);
const selectedPos = ref<PosMaster[]>([]);
@ -178,7 +184,12 @@ function onClickConfirm() {
$q,
async () => {
const body: Inherit = {
draftRevisionId:
store.typeOrganizational === "draft"
? store.draftId
: store.activeId,
draftPositionId: props.rowId,
publishRevisionId: reqMaster.revisionId,
publishPositionId: selectedPos.value[0].id,
};
showLoader();
@ -238,7 +249,9 @@ watch([() => reqMaster.page, () => reqMaster.pageSize], async () => {
<q-dialog v-model="modal" full-width persistent>
<q-card>
<Header
:tittle="'เลือกตำแหน่งที่ต้องการสืบทอดจากโครงสร้างปัจจุบัน'"
:tittle="`เลือกตำแหน่งที่ต้องการสืบทอดจากโครงสร้าง${
store.typeOrganizational === 'draft' ? 'ปัจจุบัน' : 'ก่อนหน้า'
}`"
:close="
() => {
(modal = false), (filterTree = '');