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