修改冀北现场问题
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<div class="actionButtons">
|
||||
<el-button type="primary" icon="el-icon-Check" class="md8" @click="onsubmit" v-if="showSaveButton">保存</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">
|
||||
@@ -29,7 +30,13 @@
|
||||
<Area ref="areaRef" v-model="form.deptId" style="width: 100%" @changeValue="changeArea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名称" prop="assessName">
|
||||
<el-input v-model="form.assessName" placeholder="用户名称" clearable show-word-limit maxlength="32"/>
|
||||
<el-input
|
||||
v-model="form.assessName"
|
||||
placeholder="用户名称"
|
||||
clearable
|
||||
show-word-limit
|
||||
maxlength="32"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户电压等级" prop="userScale">
|
||||
<el-select v-model="form.userScale" clearable placeholder="请选择电压等级">
|
||||
@@ -47,8 +54,8 @@
|
||||
v-model.trim="form.agreedCapacity"
|
||||
show-word-limit
|
||||
placeholder="请输入值"
|
||||
max="9999"
|
||||
min="0"
|
||||
:max="9999"
|
||||
:min="0"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否包含电容器" prop="withCapacitor">
|
||||
@@ -78,6 +85,19 @@
|
||||
<el-option label="否" value="01"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="预测评估关联">
|
||||
<el-select v-model="assessMentId" filterable clearable placeholder="请选择预测评估关联">
|
||||
<el-option
|
||||
v-for="option in userList.filter(
|
||||
item =>
|
||||
item.secondAssessmentId == null || item.secondAssessmentId == form.assessId
|
||||
)"
|
||||
:key="option.id"
|
||||
:label="option.projectName"
|
||||
:value="option.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="系统参数维护" :name="2">
|
||||
@@ -143,8 +163,8 @@
|
||||
v-model.trim="form.powersupplyCapacity"
|
||||
show-word-limit
|
||||
placeholder="请输入值"
|
||||
min="0"
|
||||
max="9999"
|
||||
:min="0"
|
||||
:max="9999"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="最小短路容量(MVA)" prop="minshortcircuitCapacity">
|
||||
@@ -153,8 +173,8 @@
|
||||
v-model.trim="form.minshortcircuitCapacity"
|
||||
show-word-limit
|
||||
placeholder="请输入值"
|
||||
min="0"
|
||||
max="9999"
|
||||
:min="0"
|
||||
:max="9999"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="PCC点名称" prop="lineId">
|
||||
@@ -184,8 +204,8 @@
|
||||
v-model.trim="form.lineLen"
|
||||
show-word-limit
|
||||
placeholder="请输入值"
|
||||
max="9999"
|
||||
min="0"
|
||||
:max="9999"
|
||||
:min="0"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="回路数" prop="lineNum">
|
||||
@@ -194,8 +214,8 @@
|
||||
v-model.trim="form.lineNum"
|
||||
show-word-limit
|
||||
placeholder="请输入值"
|
||||
max="9999"
|
||||
min="0"
|
||||
:max="9999"
|
||||
:min="0"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="PCC点电网电阻" prop="lineGridreactance">
|
||||
@@ -204,8 +224,8 @@
|
||||
v-model.trim="form.lineGridreactance"
|
||||
show-word-limit
|
||||
placeholder="请输入值"
|
||||
max="9999"
|
||||
min="0"
|
||||
:max="9999"
|
||||
:min="0"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="PCC电电网电抗" prop="lineGridresistance">
|
||||
@@ -214,14 +234,19 @@
|
||||
v-model.trim="form.lineGridresistance"
|
||||
show-word-limit
|
||||
placeholder="请输入值"
|
||||
max="9999"
|
||||
min="0"
|
||||
:max="9999"
|
||||
:min="0"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-collapse-item>
|
||||
<div v-if="form.assessId">
|
||||
<tabFrom :assessId="form.assessId" :isWindfarm="form.isWindfarm" :isWithCapacitor="form.withCapacitor" :disabled="formDisabled"/>
|
||||
<tabFrom
|
||||
:assessId="form.assessId"
|
||||
:isWindfarm="form.isWindfarm"
|
||||
:isWithCapacitor="form.withCapacitor"
|
||||
:disabled="formDisabled"
|
||||
/>
|
||||
</div>
|
||||
</el-collapse>
|
||||
</div>
|
||||
@@ -238,30 +263,29 @@ 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 ,userEdit} from '@/api/advance-boot/assess'
|
||||
import { cableList, getBusBarSelect, getMonitorSelect, userAdd, userGetInfo, userEdit } from '@/api/advance-boot/assess'
|
||||
import { selectUserAssessMentList, bindAssessmentId } from '@/api/device-boot/Business'
|
||||
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([]) //变电站列表
|
||||
const busList: any = ref([]) //generatrix列表
|
||||
const linetypeList: any = ref([]) //线路类型
|
||||
const pccList: any = ref([]) //pcc列表
|
||||
|
||||
|
||||
const userList: any = ref([]) //用户列表
|
||||
const route = useRoute()
|
||||
const isViewMode = ref(route.query.mode === 'view')
|
||||
|
||||
const assessMentId = ref('')
|
||||
// 根据 isViewMode 控制表单的禁用状态
|
||||
const formDisabled = ref(isViewMode.value)
|
||||
|
||||
// 或者在保存按钮上根据模式控制显示
|
||||
const showSaveButton = !isViewMode.value
|
||||
|
||||
|
||||
const form: any = ref({
|
||||
assessId: '',
|
||||
deptId: dictData.state.area[0].id,
|
||||
@@ -313,11 +337,11 @@ const rules = {
|
||||
}
|
||||
|
||||
const windfarmCapacityLabel = computed(() => {
|
||||
if (form.value.isWindfarm === '01') {
|
||||
return '风电场装机容量(MW)'
|
||||
} else {
|
||||
return '用户有功容量(MW)'
|
||||
}
|
||||
if (form.value.isWindfarm === '01') {
|
||||
return '风电场装机容量(MW)'
|
||||
} else {
|
||||
return '用户有功容量(MW)'
|
||||
}
|
||||
})
|
||||
|
||||
const form1 = ref()
|
||||
@@ -327,27 +351,31 @@ const form2 = ref()
|
||||
const onsubmit = () => {
|
||||
form1.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
form2.value.validate((valid2: any) => {
|
||||
form2.value.validate(async (valid2: any) => {
|
||||
if (valid2) {
|
||||
if(form.value.assessId){
|
||||
userEdit(form.value).then((res: any) => {
|
||||
if (form.value.assessId) {
|
||||
await 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({
|
||||
} else {
|
||||
await userAdd(form.value).then((res: any) => {
|
||||
form.value.assessId = res.data
|
||||
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '新增成功!'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
await bindAssessmentId({
|
||||
userReportId: form.value.assessId,
|
||||
assessMentId: assessMentId.value || 'null'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -355,6 +383,8 @@ const onsubmit = () => {
|
||||
}
|
||||
|
||||
const info = async (id?: string) => {
|
||||
// 获取关联用户
|
||||
|
||||
// 获取电站
|
||||
await getSubstationSelect().then(res => {
|
||||
powerstationList.value = res.data
|
||||
@@ -364,15 +394,28 @@ const info = async (id?: string) => {
|
||||
linetypeList.value = res.data
|
||||
})
|
||||
if (id) {
|
||||
userGetInfo({ assessId: id }).then(async (res: any) => {
|
||||
await userGetInfo({ assessId: id }).then(async (res: any) => {
|
||||
form.value = res.data
|
||||
await changePowerstation(res.data.powerstationId, false)
|
||||
})
|
||||
}
|
||||
getUserList(true)
|
||||
}
|
||||
const getUserList = async (e?: any) => {
|
||||
selectUserAssessMentList({ orgId: form.value.deptId, secondAssessmentId: form.value.assessId || '' }).then(res => {
|
||||
userList.value = res.data
|
||||
console.log('🚀 ~ getUserList ~ e:', e)
|
||||
if (e) {
|
||||
assessMentId.value = res.data.filter(item => item.secondAssessmentId == form.value.assessId)[0]?.id || ''
|
||||
} else {
|
||||
assessMentId.value = ''
|
||||
}
|
||||
})
|
||||
}
|
||||
// 地市切换
|
||||
const changeArea = (e: any) => {
|
||||
form.value.deptName = e.label
|
||||
getUserList()
|
||||
}
|
||||
// 点击变电站
|
||||
const changePowerstation = (e: any, flag: boolean = true) => {
|
||||
@@ -404,12 +447,9 @@ const LineChange = (e: any) => {
|
||||
form.value.lineName = data.name
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
info(query?.id)
|
||||
})
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.actionButtons {
|
||||
@@ -450,5 +490,3 @@ onMounted(() => {
|
||||
min-width: 120px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
@@ -102,7 +102,8 @@ import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
|
||||
import { cableList, batchDel } from '@/api/advance-boot/assess'
|
||||
import { useRouter } from 'vue-router'
|
||||
import Form from './form.vue'
|
||||
|
||||
import { selectUserList, bindAssessmentId } from '@/api/device-boot/Business'
|
||||
import { forEach } from 'min-dash'
|
||||
defineOptions({
|
||||
name: 'runManage/addUser'
|
||||
})
|
||||
@@ -223,11 +224,10 @@ const tableStore: any = new TableStore({
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.deptId = tableStore.table.params.deptIndex
|
||||
|
||||
tableStore.table.params.deptId = tableStore.table.params.deptIndex
|
||||
},
|
||||
|
||||
loadCallback: () => { }
|
||||
loadCallback: () => {}
|
||||
})
|
||||
tableStore.table.params.assessName = ''
|
||||
tableStore.table.params.deptId = ''
|
||||
@@ -242,9 +242,9 @@ const route = useRoute()
|
||||
// 监听路由变化
|
||||
watch(
|
||||
() => route.query,
|
||||
(newQuery) => {
|
||||
newQuery => {
|
||||
tableStore.index()
|
||||
},
|
||||
}
|
||||
// { immediate: true }
|
||||
)
|
||||
|
||||
@@ -272,11 +272,19 @@ const del = () => {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
batchDel(tableStore.table.selection.map(item => item.assessId)).then(res => {
|
||||
let ids = tableStore.table.selection.map(item => item.assessId)
|
||||
batchDel(ids).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
ids.forEach(item => {
|
||||
bindAssessmentId({
|
||||
userReportId: item,
|
||||
assessMentId: null
|
||||
})
|
||||
})
|
||||
|
||||
tableStore.index()
|
||||
})
|
||||
})
|
||||
@@ -286,7 +294,4 @@ onMounted(() => {
|
||||
tableStore.index()
|
||||
Info()
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user