diff --git a/src/views/pqs/supervise/terminalNetworkDetection/components/monitorpoint/addForm.vue b/src/views/pqs/supervise/terminalNetworkDetection/components/monitorpoint/addForm.vue index e6bf939f..7e05e599 100644 --- a/src/views/pqs/supervise/terminalNetworkDetection/components/monitorpoint/addForm.vue +++ b/src/views/pqs/supervise/terminalNetworkDetection/components/monitorpoint/addForm.vue @@ -39,10 +39,10 @@ - + - + - + - + - + - + - + - + { monitoringTerminalName: obj.monitoringTerminalName } } +//用户类型为2.新建/扩建非线性负荷用户 新建/扩建新能源发电站回显容量 +const getDataByUserType=(id:any)=>{ + getUserReportById(id).then(res => { + const obj = res.data + form.value = { + ...form.value, + shortCapacity: obj.userReportSubstationPO?.minShortCircuitCapacity, // 短路容量 + dealCapacity: obj.userReportSubstationPO?.userAgreementCapacity, //协议容量 + devCapacity: obj.userReportSubstationPO.pccEquipmentCapacity, //设备容量 + standardCapacity: obj.userReportSubstationPO?.baseShortCircuitCapacity //基准容量 + } + }) +} //定义切换form类型 const selectFormType = ref('') selectFormType.value = '0' @@ -558,8 +573,6 @@ const resetForm = () => { userNameList.value = res.data //初始化 let obj = res.data[0] - - console.log(obj,"99999999"); if (title.value != '重新发起') { form.value = { ...form.value, @@ -575,6 +588,7 @@ const resetForm = () => { objName: userNameList.value[0]?.projectName } } + getDataByUserType(obj.id) }) changevoltageDeviationLimit() } @@ -641,8 +655,7 @@ const changeUserName = () => { let obj: any = projectList.value.find((item: any) => { return form.value.userName == item.id }) - // console.log(userNameList.value,11111,projectList.value); - console.log(obj,"88888888"); + console.log(obj, '88888888') form.value = { ...form.value, city: obj?.city, @@ -657,6 +670,11 @@ const changeUserName = () => { objName: obj?.projectName, userStatus: obj?.userStatus + '' } + + //回显数据 2.新建/扩建非线性负荷用户 新建/扩建新能源发电站 + if (obj.userType == '2' || obj.userType == '3' || obj.userType == '4' || obj.userType == '5') { + getDataByUserType(obj.id) + } } //定义校验规则 const rules = ref({ @@ -874,34 +892,34 @@ const rules = ref({ ] }) const resendId = ref('') -const rowValue:any=ref({}) +const rowValue: any = ref({}) const open = (row: any) => { dialogFormVisible.value = true title.value = row.title //初始化数据 resetForm() nextTick(() => { - if (row.row) { - resendId.value = row.row.id - rowValue.value=row.row - getTempLineDetailsById({ id: row.row.id }).then(res => { - form.value = res.data - form.value.loadType = loadTypeList.value.filter((item: any) => item.name == res.data.loadType)[0]?.id - form.value.businessType = businessTypeList.value.filter( - (item: any) => item.name == res.data.businessType - )[0]?.id - mainWiringDiagram.value = JSON.parse(JSON.stringify(res.data.mainWiringDiagram)) - form.value.mainWiringDiagram = JSON.parse( - JSON.stringify([ - { - name: res.data.mainWiringDiagram.split('/')[2] - } - ]) - ) - }) - } else { - resendId.value = '' - } + if (row.row) { + resendId.value = row.row.id + rowValue.value = row.row + getTempLineDetailsById({ id: row.row.id }).then(res => { + form.value = res.data + form.value.loadType = loadTypeList.value.filter((item: any) => item.name == res.data.loadType)[0]?.id + form.value.businessType = businessTypeList.value.filter( + (item: any) => item.name == res.data.businessType + )[0]?.id + mainWiringDiagram.value = JSON.parse(JSON.stringify(res.data.mainWiringDiagram)) + form.value.mainWiringDiagram = JSON.parse( + JSON.stringify([ + { + name: res.data.mainWiringDiagram.split('/')[2] + } + ]) + ) + }) + } else { + resendId.value = '' + } }) } const close = () => { @@ -919,7 +937,7 @@ onMounted(() => { watch( () => projectList.value, (val, oldVal) => { - if(val&&val.length!=0&&resendId.value){ + if (val && val.length != 0 && resendId.value) { let obj: any = projectList.value.find((item: any) => { return rowValue.value.createBy == item.createBy })