diff --git a/src/views/pqs/supervise/harmonicSurvey/components/planAdd.vue b/src/views/pqs/supervise/harmonicSurvey/components/planAdd.vue index c2594770..ab364627 100644 --- a/src/views/pqs/supervise/harmonicSurvey/components/planAdd.vue +++ b/src/views/pqs/supervise/harmonicSurvey/components/planAdd.vue @@ -213,12 +213,12 @@ const treeData = ref() const loadData = () => { initDetpStataionTree({ orgId: dictData.state.area[0].id }).then(res => { treeList.value = res.data - initDetpStataionTree({ orgId: '02d1b4e1680413eb72f3fa63d46c496c' }).then(res => { - treeListCgy.value = res.data - setTimeout(() => { - changeArea() - }, 10) - }) + // initDetpStataionTree({ orgId: '02d1b4e1680413eb72f3fa63d46c496c' }).then(res => { + // treeListCgy.value = res.data + setTimeout(() => { + changeArea() + }, 10) + // }) }) } @@ -242,7 +242,7 @@ const submitFn = async (flag: boolean) => { } addForm.saveOrCheckflag = '1' - await addSurveyPlan(addForm).then(res => { + await addSurveyPlan(addForm).then(res => { cancelFn() ElMessage.success('保存成功!') emit('onsubmit') @@ -263,7 +263,7 @@ const submitFn = async (flag: boolean) => { emit('onsubmit') }) } else { - await updateSurveyPlan(addForm).then(res => { + await updateSurveyPlan(addForm).then(res => { cancelFn() ElMessage.success('重新发起成功!') emit('onsubmit') @@ -283,14 +283,30 @@ const changeArea = () => { treeList.value.forEach((item: any) => { if (item.id == form.value.deptId) { list.push(item) - if (item.id != treeListCgy.value[0].id && item.name != '冀北电力有限公司' && item.name != '超高压') { - list.push(...treeListCgy.value) - } + } else { - list.push(item.children.filter((v: any) => v.id == form.value.deptId)[0]) - if (form.value.deptId != treeListCgy.value[0].id) { - list.push(...treeListCgy.value) + if (item.children.filter((v: any) => v.id == form.value.deptId).length == 0) { + item.children.forEach((v: any) => { + list.push(v.children.filter((K: any) => K.id == form.value.deptId)[0]) + }) + // list.push(item.children.filter((v: any) => { + // return (v.children.filter((k: any) => { + // if( k.id == form.value.deptId){ + // return k + // } + // })) + // })) + console.log("🚀 ~ list.push ~ list:", list) + + + } else { + list.push(item.children.filter((v: any) => v.id == form.value.deptId)[0]) } + + + // if (form.value.deptId != treeListCgy.value[0].id) { + // list.push(...treeListCgy.value) + // } } }) treeData.value = list diff --git a/src/views/pqs/voltageSags/sagGovern/businessUser/index.vue b/src/views/pqs/voltageSags/sagGovern/businessUser/index.vue index 9f8df2bd..861773ca 100644 --- a/src/views/pqs/voltageSags/sagGovern/businessUser/index.vue +++ b/src/views/pqs/voltageSags/sagGovern/businessUser/index.vue @@ -2,12 +2,12 @@