修改技术监督bug

This commit is contained in:
GGJ
2024-06-18 09:03:53 +08:00
parent 8233b13927
commit f33aed9b89
18 changed files with 233 additions and 178 deletions

View File

@@ -246,7 +246,6 @@
<el-form-item for="-" label="干扰源类型:" prop="loadType">
<el-select
v-model="form.loadType"
clearable
style="width: 100%"
placeholder="请选择干扰源类型"
@change="changeLoadType"
@@ -260,7 +259,7 @@
</el-select>
</el-form-item>
<el-form-item for="-" label="干扰源类别:" prop="businessType">
<el-select v-model="form.businessType" clearable style="width: 100%" placeholder="请选择干扰源类别">
<el-select v-model="form.businessType" style="width: 100%" placeholder="请选择干扰源类别">
<el-option
v-for="item in businessTypeList"
:key="item.id"
@@ -370,7 +369,7 @@ import { getDeviceList } from '@/api/supervision-boot/terminal/index'
import { addMointorPointFormData, getList, updateMointorPointFormData } from '@/api/supervision-boot/monitorpoint/index'
import { queryByAllCode } from '@/api/system-boot/dictTree'
import { getUserReportById } from '@/api/supervision-boot/userReport/form'
import { object } from 'vue-types'
import { getDictTreeById } from '@/api/system-boot/dictTree'
const emits = defineEmits(['onSubmit'])
const dictData = useDictData()
const dialogFormVisible = ref(false)
@@ -583,8 +582,7 @@ const resetForm = () => {
ptType: ptTypeList[0].id, //接线方式
num: numList[0].id //线路号
}
let obj = {}
getList(obj).then(res => {
getList({}).then(res => {
projectList.value = res.data
userNameList.value = res.data
//初始化
@@ -599,10 +597,11 @@ const resetForm = () => {
orgId: obj?.orgId,
orgName: obj?.orgName,
expectedProductionDate: obj?.expectedProductionDate,
userName: userNameList.value[0]?.projectName,
userName: userNameList.value[0]?.id,
userId: userNameList.value[0]?.id,
objName: userNameList.value[0]?.projectName
}
changeUserName()
}
})
changevoltageDeviationLimit()
@@ -662,15 +661,16 @@ getTreeList()
const changeLoadType = async () => {
businessTypeList.value = loadTypeList.value.find(item => {
return item.id == form.value.loadType
}).children
form.value.businessType = businessTypeList.value[0]?.id
})?.children
// form.value.businessType = businessTypeList.value[0]?.id
}
//选择关联干扰源回显数据
const changeUserName = () => {
let obj: any = projectList.value.find((item: any) => {
return form.value.userName == item.id
})
console.log(obj, '88888888')
// console.log('🚀 ~ letobj:any=projectList.value.find ~ projectList.value.find:', projectList.value)
// console.log(obj, '88888888')
form.value = {
...form.value,
city: obj?.city,
@@ -689,7 +689,7 @@ const changeUserName = () => {
//回显数据
if (obj.userType == '2' || obj.userType == '3' || obj.userType == '4' || obj.userType == '5') {
getUserReportById(obj.id).then(res => {
console.log(res.data, '继续查询数据')
// console.log(res.data, '继续查询数据')
const obj = res.data
form.value = {
...form.value,
@@ -698,7 +698,47 @@ const changeUserName = () => {
devCapacity: obj.userReportSubstationPO?.pccEquipmentCapacity, //终端容量
standardCapacity: obj.userReportSubstationPO?.baseShortCircuitCapacity //基准容量
}
getDictTree(obj.userReportSubstationPO?.nonlinearLoadType)
})
} else if (obj.userType == '0' || obj.userType == '1') {
getUserReportById(obj.id).then(res => {
// console.log(res.data, '继续查询数据')
const obj = res.data
form.value = {
...form.value,
shortCapacity: 0, // 短路容量
dealCapacity: obj.userReportProjectPO?.agreementCapacity, //协议容量
devCapacity: 0, //终端容量
standardCapacity: 0 //基准容量
}
getDictTree(obj.userReportProjectPO?.nonlinearDeviceType)
})
} else if (obj.userType == '6') {
getUserReportById(obj.id).then(res => {
// console.log(res.data, '继续查询数据')
const obj = res.data
form.value = {
...form.value,
shortCapacity: 0, // 短路容量
dealCapacity: 0, //协议容量
devCapacity: 0, //终端容量
standardCapacity: 0 //基准容量
}
getDictTree()
})
}
}
const getDictTree = (e?: string) => {
if (e) {
getDictTreeById(e).then(res => {
form.value.loadType = res.data.pids.split(',')[1] || ''
form.value.businessType = res.data.pids.split(',')[2] || ''
changeLoadType()
})
} else {
form.value.businessType = ''
form.value.loadType = ''
businessTypeList.value = []
}
}
//定义校验规则
@@ -918,16 +958,17 @@ const rules = ref({
})
const resendId = ref('')
const rowValue: any = ref({})
const open = (row: any) => {
const open = async (row: any) => {
resetForm()
dialogFormVisible.value = true
title.value = row.title
//初始化数据
resetForm()
nextTick(() => {
nextTick(async () => {
if (row.row) {
resendId.value = row.row.id
rowValue.value = row.row
getTempLineDetailsById({ id: row.row.id }).then(res => {
await 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(
@@ -955,9 +996,7 @@ const close = () => {
emits('onSubmit')
resetForm()
}
onMounted(() => {
console.log()
})
onMounted(() => {})
watch(
() => projectList.value,
@@ -966,7 +1005,7 @@ watch(
let obj: any = projectList.value.find((item: any) => {
return rowValue.value.createBy == item.createBy
})
console.log(projectList.value, '000000', obj, rowValue.value.createBy)
// console.log(projectList.value, '000000', obj, rowValue.value.createBy)
form.value = {
...form.value,
reporter: obj?.reporter,
@@ -994,7 +1033,7 @@ const uploadFileName = val => {
}
//移除文件上传
const removeFile = (file: any, uploadFiles: any) => {
console.log(file, uploadFiles)
// console.log(file, uploadFiles)
}
//监测点台账信息
const lineFilePath = ref('')
@@ -1059,7 +1098,7 @@ const confirmForm = () => {
})
} else {
confirmFormData.id = resendId.value
console.log(confirmFormData, '99999999999')
// console.log(confirmFormData, '99999999999')
updateMointorPointFormData(confirmFormData).then(res => {
if (res.code == 'A0000') {
ElMessage({
@@ -1073,7 +1112,7 @@ const confirmForm = () => {
})
}
} else {
console.log('表单验证失败')
// // console.log('表单验证失败')
return false
}
})

View File

@@ -265,12 +265,12 @@ onMounted(() => {
}
::v-deep.el-icon svg {
margin: 5px !important;
position: absolute !important;
top: 20px !important;
// margin: 5px !important;
// position: absolute !important;
// top: 20px !important;
}
.elView {
cursor: pointer;
margin-right: 5px;
margin-right: 10px;
}
</style>