โครงสร้างอัตรากำลัง => ปรับการ fetchDataTree
This commit is contained in:
parent
df58602563
commit
1378dec2b2
2 changed files with 15 additions and 3 deletions
|
|
@ -31,6 +31,11 @@ const props = defineProps({
|
||||||
require: true,
|
require: true,
|
||||||
default: () => "",
|
default: () => "",
|
||||||
},
|
},
|
||||||
|
fetchDataTable: {
|
||||||
|
type: Function,
|
||||||
|
require: true,
|
||||||
|
default: () => "",
|
||||||
|
},
|
||||||
dataNode: {
|
dataNode: {
|
||||||
type: Object,
|
type: Object,
|
||||||
require: true,
|
require: true,
|
||||||
|
|
@ -162,8 +167,7 @@ function onSubmit() {
|
||||||
),
|
),
|
||||||
body
|
body
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then(() => {
|
||||||
console.log(res);
|
|
||||||
props.edit?.(
|
props.edit?.(
|
||||||
props.dataNode?.orgTreeId,
|
props.dataNode?.orgTreeId,
|
||||||
type,
|
type,
|
||||||
|
|
@ -171,6 +175,11 @@ function onSubmit() {
|
||||||
props.dataNode?.orgRootCode
|
props.dataNode?.orgRootCode
|
||||||
);
|
);
|
||||||
closeClear();
|
closeClear();
|
||||||
|
props.fetchDataTable(
|
||||||
|
props?.dataNode?.orgTreeId,
|
||||||
|
props?.dataNode?.orgLevel,
|
||||||
|
false
|
||||||
|
);
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -231,7 +240,7 @@ const tittleName = computed(() => {
|
||||||
if (actionType.value === "ADD") {
|
if (actionType.value === "ADD") {
|
||||||
name = level.value === 0 ? "เพิ่มหน่วยงาน" : "เพิ่มส่วนราชการ";
|
name = level.value === 0 ? "เพิ่มหน่วยงาน" : "เพิ่มส่วนราชการ";
|
||||||
} else {
|
} else {
|
||||||
name = level.value === 0 ? "แก้ไขหน่วยงาน" : "แก้ไขเพิ่มส่วนราชการ";
|
name = level.value === 0 ? "แก้ไขหน่วยงาน" : "แก้ไขส่วนราชการ";
|
||||||
}
|
}
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
|
|
||||||
|
|
@ -285,6 +285,8 @@ function onClickDetail(id: string, level: number) {
|
||||||
* @param node ข้อมูล โครงสร้าง
|
* @param node ข้อมูล โครงสร้าง
|
||||||
*/
|
*/
|
||||||
async function onClickEdit(node: OrgTree) {
|
async function onClickEdit(node: OrgTree) {
|
||||||
|
console.log(node);
|
||||||
|
|
||||||
dialogAgency.value = !dialogAgency.value;
|
dialogAgency.value = !dialogAgency.value;
|
||||||
actionType.value = "EDIT";
|
actionType.value = "EDIT";
|
||||||
orgLevel.value = node.orgLevel;
|
orgLevel.value = node.orgLevel;
|
||||||
|
|
@ -585,6 +587,7 @@ watch(
|
||||||
:close="onClickAgency"
|
:close="onClickAgency"
|
||||||
v-model:orgLevel="orgLevel"
|
v-model:orgLevel="orgLevel"
|
||||||
:fetchDataTree="props.fetchDataTree"
|
:fetchDataTree="props.fetchDataTree"
|
||||||
|
:fetchDataTable="props.fetchDataTable"
|
||||||
v-model:actionType="actionType"
|
v-model:actionType="actionType"
|
||||||
:dataNode="dataNode"
|
:dataNode="dataNode"
|
||||||
:edit="edit"
|
:edit="edit"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue