联调二级评估
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<div class="actionButtons">
|
||||
<el-button type="primary" icon="el-icon-Check" class="md8" @click="onsubmit">保存</el-button>
|
||||
<el-button type="primary" icon="el-icon-Check" class="md8" @click="onsubmit" v-if="showSaveButton">保存</el-button>
|
||||
<back-component style="margin: 8px" />
|
||||
|
||||
</div>
|
||||
<div :style="pageHeight" style="overflow-y: auto">
|
||||
<el-collapse v-model="activeNames" class="pl10 pr10">
|
||||
@@ -14,6 +15,7 @@
|
||||
class="form-four"
|
||||
:rules="rules"
|
||||
label-width="auto"
|
||||
:disabled="formDisabled"
|
||||
>
|
||||
<el-form-item label="所在地市" prop="deptId">
|
||||
<!-- <el-select v-model="form.deptId" clearable placeholder="请选择所在地市">
|
||||
@@ -30,7 +32,7 @@
|
||||
<el-input v-model="form.assessName" placeholder="用户名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="电压等级" prop="userScale">
|
||||
<el-select v-model="form.userScale" clearable placeholder="请选择变电站">
|
||||
<el-select v-model="form.userScale" clearable placeholder="请选择电压等级">
|
||||
<el-option
|
||||
v-for="item in voltageleveloption"
|
||||
:key="item.id"
|
||||
@@ -60,7 +62,7 @@
|
||||
<el-option label="其他" value="03"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户有功功率(MW)" prop="windfarmCapacity">
|
||||
<el-form-item :label="windfarmCapacityLabel" prop="windfarmCapacity">
|
||||
<el-input-number
|
||||
style="width: 100%"
|
||||
v-model="form.windfarmCapacity"
|
||||
@@ -84,6 +86,7 @@
|
||||
class="form-four"
|
||||
:rules="rules"
|
||||
label-width="auto"
|
||||
:disabled="formDisabled"
|
||||
>
|
||||
<el-form-item label="接入变电站" prop="powerstationId">
|
||||
<el-select
|
||||
@@ -204,7 +207,7 @@
|
||||
</el-form>
|
||||
</el-collapse-item>
|
||||
<div v-if="form.assessId">
|
||||
<tabFrom :assessId="form.assessId" />
|
||||
<tabFrom :assessId="form.assessId" :isWindfarm="form.isWindfarm" :isWithCapacitor="form.withCapacitor" :disabled="formDisabled"/>
|
||||
</div>
|
||||
</el-collapse>
|
||||
</div>
|
||||
@@ -216,17 +219,17 @@ import BackComponent from '@/components/icon/back/index.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import Area from '@/components/form/area/index.vue'
|
||||
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { getSubstationSelect } from '@/api/device-boot/line'
|
||||
import tabFrom from './tabFrom.vue'
|
||||
import { cableList, getBusBarSelect, getMonitorSelect, userAdd, userGetInfo } from '@/api/advance-boot/assess'
|
||||
import { cableList, getBusBarSelect, getMonitorSelect, userAdd, userGetInfo ,userEdit} from '@/api/advance-boot/assess'
|
||||
const activeNames = ref([1, 2, 3, 4, 5, 6, 7])
|
||||
const dictData = useDictData()
|
||||
const pageHeight = mainHeight(70)
|
||||
const areaOptionList = dictData.getBasicData('jibei_area')
|
||||
const { query } = useRoute() // 查询参数
|
||||
const { query} = useRoute() // 查询参数
|
||||
//字典获取电压等级
|
||||
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
const powerstationList: any = ref([]) //变电站列表
|
||||
@@ -234,6 +237,17 @@ const busList: any = ref([]) //generatrix列表
|
||||
const linetypeList: any = ref([]) //线路类型
|
||||
const pccList: any = ref([]) //pcc列表
|
||||
|
||||
|
||||
const route = useRoute()
|
||||
const isViewMode = ref(route.query.mode === 'view')
|
||||
|
||||
// 根据 isViewMode 控制表单的禁用状态
|
||||
const formDisabled = ref(isViewMode.value)
|
||||
|
||||
// 或者在保存按钮上根据模式控制显示
|
||||
const showSaveButton = !isViewMode.value
|
||||
|
||||
|
||||
const form: any = ref({
|
||||
assessId: '',
|
||||
deptId: dictData.state.area[0].id,
|
||||
@@ -284,17 +298,41 @@ const rules = {
|
||||
lineGridresistance: [{ required: true, message: '请输入PCC点电网电抗', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
const windfarmCapacityLabel = computed(() => {
|
||||
if (form.value.isWindfarm === '01') {
|
||||
return '风电场装机容量(MW)'
|
||||
} else {
|
||||
return '用户有功功率(MW)'
|
||||
}
|
||||
})
|
||||
|
||||
const form1 = ref()
|
||||
const form2 = ref()
|
||||
|
||||
// 保存
|
||||
const onsubmit = () => {
|
||||
form1.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
form2.value.validate((valid2: any) => {
|
||||
if (valid2) {
|
||||
userAdd(form.value).then((res: any) => {
|
||||
if(form.value.assessId){
|
||||
userEdit(form.value).then((res: any) => {
|
||||
form.value.assessId = res.data
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '编辑成功!'
|
||||
})
|
||||
})
|
||||
}else{
|
||||
userAdd(form.value).then((res: any) => {
|
||||
form.value.assessId = res.data
|
||||
})
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '新增成功!'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -330,7 +368,7 @@ const changePowerstation = (e: any, flag: boolean = true) => {
|
||||
form.value.lineName = ''
|
||||
}
|
||||
let data = powerstationList.value.filter((item: any) => item.id == e)[0]
|
||||
form.value.powerstationName = data.voltageName
|
||||
form.value.powerstationName = data.name
|
||||
form.value.powerstationScale = data.voltageLevel
|
||||
getBusBarSelect({ stationId: data.id }).then(res => {
|
||||
busList.value = res.data
|
||||
@@ -342,7 +380,7 @@ const changePowerstation = (e: any, flag: boolean = true) => {
|
||||
// 点击母线
|
||||
const changeBus = (e: any) => {
|
||||
let data = busList.value.filter((item: any) => item.id == e)[0]
|
||||
form.value.busName = data.voltageName
|
||||
form.value.busName = data.name
|
||||
form.value.busScale = data.voltageLevel
|
||||
}
|
||||
// 点击pcc
|
||||
@@ -351,10 +389,12 @@ const LineChange = (e: any) => {
|
||||
form.value.lineName = data.name
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
console.log(123, query?.id)
|
||||
info(query?.id)
|
||||
})
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.actionButtons {
|
||||
@@ -395,3 +435,5 @@ onMounted(() => {
|
||||
min-width: 120px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user