终端监测-所属公司变电站电压等级接口修改
This commit is contained in:
@@ -158,9 +158,10 @@
|
|||||||
clearable
|
clearable
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
placeholder="请选择所属供电公司"
|
placeholder="请选择所属供电公司"
|
||||||
|
@change="findSubstationVoltageLevel"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in areaOptionList"
|
v-for="item in powerCompanyList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
@@ -176,9 +177,11 @@
|
|||||||
clearable
|
clearable
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
placeholder="请选择所属变电站"
|
placeholder="请选择所属变电站"
|
||||||
|
filterable
|
||||||
|
@change="changeSubstation"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in areaOptionList"
|
v-for="item in substationList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
@@ -356,7 +359,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12" class="required_position">
|
<el-col :span="12" class="required_position">
|
||||||
<span class="required_icon_white">*</span>
|
<span class="required_icon_white">*</span>
|
||||||
<el-form-item label="所属前置机:" prop="frontEndMachine">
|
<el-form-item label="所属前置机:" prop="frontEndMachine">
|
||||||
<el-select
|
<el-select
|
||||||
@@ -464,7 +467,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12" class="required_position">
|
<el-col :span="12" class="required_position">
|
||||||
<span class="required_icon_white">*</span>
|
<span class="required_icon_white">*</span>
|
||||||
<el-form-item label="数据类型:" prop="dataType">
|
<el-form-item label="数据类型:" prop="dataType">
|
||||||
<el-select
|
<el-select
|
||||||
@@ -775,7 +778,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12" class="required_position">
|
<el-col :span="12" class="required_position">
|
||||||
<span class="required_icon_white">*</span>
|
<span class="required_icon_white">*</span>
|
||||||
<el-form-item label="其他附件:" class="no_required" prop="otherAttachments">
|
<el-form-item label="其他附件:" class="no_required" prop="otherAttachments">
|
||||||
<el-upload
|
<el-upload
|
||||||
@@ -819,6 +822,7 @@ import { queryByAllCode } from '@/api/system-boot/dictTree'
|
|||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import { uploadFile } from '@/api/system-boot/file'
|
import { uploadFile } from '@/api/system-boot/file'
|
||||||
import { addTerminalFormData, getSubstationVoltageLevel } from '@/api/supervision-boot/terminal/index'
|
import { addTerminalFormData, getSubstationVoltageLevel } from '@/api/supervision-boot/terminal/index'
|
||||||
|
import { getAreaList } from '@/api/common'
|
||||||
const emits = defineEmits(['onSubmit'])
|
const emits = defineEmits(['onSubmit'])
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
const dialogFormVisible = ref(false)
|
const dialogFormVisible = ref(false)
|
||||||
@@ -923,9 +927,32 @@ const electroplatingFunctionList = [
|
|||||||
|
|
||||||
//获取登陆用户姓名和部门
|
//获取登陆用户姓名和部门
|
||||||
const adminInfo = useAdminInfo()
|
const adminInfo = useAdminInfo()
|
||||||
//定义切换form类型
|
//定义所属供电公司数据
|
||||||
const selectFormType = ref('')
|
const powerCompanyList = ref([])
|
||||||
selectFormType.value = '0'
|
//获取所属供电公司,区域列表第三层数据
|
||||||
|
const getPowerCompanyList = async () => {
|
||||||
|
getAreaList().then(res => {
|
||||||
|
powerCompanyList.value = res.data[0].children[0].children
|
||||||
|
form.value.powerCompany = powerCompanyList.value[0]?.id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getPowerCompanyList()
|
||||||
|
//根据所选供电公司查询所选获取变电站与变电站电压等级
|
||||||
|
const substationList = ref([])
|
||||||
|
const findSubstationVoltageLevel = () => {
|
||||||
|
getSubstationVoltageLevel({ orgIds: [form.value.powerCompany] }).then(res => {
|
||||||
|
substationList.value = res.data
|
||||||
|
form.value.substation = substationList.value[0]?.id
|
||||||
|
form.value.substationVoltageLevel = substationList.value[0]?.voltageLevel
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//变电站选择的时候切换变电站电压等级
|
||||||
|
const changeSubstation = () => {
|
||||||
|
let obj = substationList.value.find(item => item.id == form.value.substation)
|
||||||
|
form.value.substationVoltageLevel = obj?.voltageLevel
|
||||||
|
}
|
||||||
|
findSubstationVoltageLevel()
|
||||||
|
changeSubstation()
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
form.value = {
|
form.value = {
|
||||||
reporter: '', //填报人
|
reporter: '', //填报人
|
||||||
@@ -965,7 +992,7 @@ const resetForm = () => {
|
|||||||
monitoringTerminalName: '', //监测终端名称
|
monitoringTerminalName: '', //监测终端名称
|
||||||
neutralPointWiringMethod: neutralPointWiringMethodList[0].id, // 中性点接线方式
|
neutralPointWiringMethod: neutralPointWiringMethodList[0].id, // 中性点接线方式
|
||||||
nextTerminalInspectionTime: '', // 下次终端定检时间
|
nextTerminalInspectionTime: '', // 下次终端定检时间
|
||||||
powerCompany: areaOptionList[0].id, //所属供电公司
|
powerCompany: powerCompanyList[0]?.value.id, //所属供电公司
|
||||||
simCardNumber: '', //SIM卡号
|
simCardNumber: '', //SIM卡号
|
||||||
substation: '', // 所属变电站
|
substation: '', // 所属变电站
|
||||||
substationVoltageLevel: voltageLevelList[0].id, // 变电站电压等级
|
substationVoltageLevel: voltageLevelList[0].id, // 变电站电压等级
|
||||||
@@ -1028,7 +1055,7 @@ const devReportForm = ref({
|
|||||||
monitoringTerminalName: '', //监测终端名称
|
monitoringTerminalName: '', //监测终端名称
|
||||||
neutralPointWiringMethod: neutralPointWiringMethodList[0].id, // 中性点接线方式
|
neutralPointWiringMethod: neutralPointWiringMethodList[0].id, // 中性点接线方式
|
||||||
nextTerminalInspectionTime: '', // 下次终端定检时间
|
nextTerminalInspectionTime: '', // 下次终端定检时间
|
||||||
powerCompany: areaOptionList[0].id, //所属供电公司
|
powerCompany: powerCompanyList.value[0]?.id, //所属供电公司
|
||||||
simCardNumber: '', //SIM卡号
|
simCardNumber: '', //SIM卡号
|
||||||
substation: '', // 所属变电站
|
substation: '', // 所属变电站
|
||||||
substationVoltageLevel: voltageLevelList[0].id, // 变电站电压等级
|
substationVoltageLevel: voltageLevelList[0].id, // 变电站电压等级
|
||||||
@@ -1321,7 +1348,7 @@ watch(
|
|||||||
(val, oldVal) => {
|
(val, oldVal) => {
|
||||||
//form数据变化时处理格式,根据tab切换判断处理的对象实体
|
//form数据变化时处理格式,根据tab切换判断处理的对象实体
|
||||||
//终端信息
|
//终端信息
|
||||||
if (selectFormType.value == '0' && val) {
|
if (val) {
|
||||||
for (let key in val) {
|
for (let key in val) {
|
||||||
if (devReportForm.value.hasOwnProperty(key)) {
|
if (devReportForm.value.hasOwnProperty(key)) {
|
||||||
devReportForm.value[key] = val[key] // 对相同的key进行赋值
|
devReportForm.value[key] = val[key] // 对相同的key进行赋值
|
||||||
@@ -1331,7 +1358,6 @@ watch(
|
|||||||
}
|
}
|
||||||
//处理填报日期时间格式
|
//处理填报日期时间格式
|
||||||
devReportForm.value.reportDate = window.XEUtils.toDateString(form.value.reportDate, 'yyyy-MM-dd')
|
devReportForm.value.reportDate = window.XEUtils.toDateString(form.value.reportDate, 'yyyy-MM-dd')
|
||||||
// console.log('处理好的表单++++++++++>',devReportForm.value)
|
|
||||||
}
|
}
|
||||||
//监测点信息
|
//监测点信息
|
||||||
else {
|
else {
|
||||||
@@ -1357,13 +1383,6 @@ onMounted(() => {
|
|||||||
console.log()
|
console.log()
|
||||||
})
|
})
|
||||||
|
|
||||||
//获取变电站与电压等级
|
|
||||||
const findSubstationVoltageLevel = () => {
|
|
||||||
getSubstationVoltageLevel({ orgIds: [adminInfo.$state.deptId] }).then(res => {
|
|
||||||
console.log(res, '获取变电站电压等级')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
findSubstationVoltageLevel()
|
|
||||||
// 上传报告
|
// 上传报告
|
||||||
const uploadRef = ref()
|
const uploadRef = ref()
|
||||||
const handleExceed: UploadProps['onExceed'] = files => {
|
const handleExceed: UploadProps['onExceed'] = files => {
|
||||||
@@ -1443,99 +1462,81 @@ const disabledDate = time => {
|
|||||||
const activeName = ref('0')
|
const activeName = ref('0')
|
||||||
//提交
|
//提交
|
||||||
const confirmForm = () => {
|
const confirmForm = () => {
|
||||||
console.log(form.value, '打印form对象')
|
|
||||||
// 先判断提交终端信息与监测点信息
|
|
||||||
|
|
||||||
// 提交终端信息
|
// 提交终端信息
|
||||||
if (selectFormType.value == '0') {
|
ruleFormRef.value.validate(valid => {
|
||||||
ruleFormRef.value.validate(valid => {
|
if (valid) {
|
||||||
if (valid) {
|
//整理上传文件的数据
|
||||||
//整理上传文件的数据
|
devReportForm.value.reporter = adminInfo.$state.id
|
||||||
// userType==0,1
|
devReportForm.value.orgId = adminInfo.$state.deptId
|
||||||
devReportForm.value.reporter = adminInfo.$state.id
|
let confirmFormData = JSON.parse(JSON.stringify(devReportForm.value))
|
||||||
devReportForm.value.orgId = adminInfo.$state.deptId
|
|
||||||
let confirmFormData = JSON.parse(JSON.stringify(devReportForm.value))
|
|
||||||
|
|
||||||
//1.判断是否上传
|
//1.判断是否上传
|
||||||
// if (!deviceFilePath.value) {
|
// if (!deviceFilePath.value) {
|
||||||
// activeName.value = '1'
|
// activeName.value = '1'
|
||||||
// return ElMessage({
|
// return ElMessage({
|
||||||
// message: '请上传终端台账信息',
|
// message: '请上传终端台账信息',
|
||||||
// type: 'warning'
|
// type: 'warning'
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
// if (!lineFilePath.value) {
|
if (!acceptanceInspectionReportSingle.value) {
|
||||||
// activeName.value = '2'
|
return ElMessage({
|
||||||
// return ElMessage({
|
message: '请上传验收检验报告单',
|
||||||
// message: '请上传监测点台账信息',
|
type: 'warning'
|
||||||
// type: 'warning'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
if (!acceptanceInspectionReportSingle.value) {
|
|
||||||
return ElMessage({
|
|
||||||
message: '请上传验收检验报告单',
|
|
||||||
type: 'warning'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (!acceptanceInspectionReport.value) {
|
|
||||||
return ElMessage({
|
|
||||||
message: '请上传验收检验报告',
|
|
||||||
type: 'warning'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (!typeExperimentReport.value) {
|
|
||||||
return ElMessage({
|
|
||||||
message: '请上传型式实验报告',
|
|
||||||
type: 'warning'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (!factoryInspectionReport.value) {
|
|
||||||
return ElMessage({
|
|
||||||
message: '请上传出厂检验报告',
|
|
||||||
type: 'warning'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (!performanceTestReport.value) {
|
|
||||||
return ElMessage({
|
|
||||||
message: '请上传性能检测报告',
|
|
||||||
type: 'warning'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (!informationSecurityTestReport.value) {
|
|
||||||
return ElMessage({
|
|
||||||
message: '请上传信息安全检测报告',
|
|
||||||
type: 'warning'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//提交终端信息
|
|
||||||
confirmFormData = {
|
|
||||||
...confirmFormData,
|
|
||||||
acceptanceInspectionReport: acceptanceInspectionReport.value, //验收检验报告
|
|
||||||
acceptanceInspectionReportSingle: acceptanceInspectionReportSingle.value, //验收检验报告单
|
|
||||||
deviceFilePath: deviceFilePath?.value, //终端台账信息
|
|
||||||
factoryInspectionReport: factoryInspectionReport.value, //出厂检验报告
|
|
||||||
informationSecurityTestReport: informationSecurityTestReport.value, //信息安全检测报告
|
|
||||||
lineFilePath: lineFilePath?.value, //监测点台账信息
|
|
||||||
performanceTestReport: performanceTestReport.value, //性能检测报告
|
|
||||||
typeExperimentReport: typeExperimentReport.value, //型式实验报告
|
|
||||||
otherAttachments: otherAttachments?.value //其他附件
|
|
||||||
}
|
|
||||||
console.log(confirmFormData, '打印提交表单111111111111')
|
|
||||||
addTerminalFormData(confirmFormData).then(res => {
|
|
||||||
console.log(res, '打印提交结果222222222222+++++++++')
|
|
||||||
ruleFormRef.value.resetFields()
|
|
||||||
resetForm()
|
|
||||||
close()
|
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
console.log('表单验证失败')
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
})
|
if (!acceptanceInspectionReport.value) {
|
||||||
}
|
return ElMessage({
|
||||||
//提交监测点信息
|
message: '请上传验收检验报告',
|
||||||
else {
|
type: 'warning'
|
||||||
}
|
})
|
||||||
|
}
|
||||||
|
if (!typeExperimentReport.value) {
|
||||||
|
return ElMessage({
|
||||||
|
message: '请上传型式实验报告',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (!factoryInspectionReport.value) {
|
||||||
|
return ElMessage({
|
||||||
|
message: '请上传出厂检验报告',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (!performanceTestReport.value) {
|
||||||
|
return ElMessage({
|
||||||
|
message: '请上传性能检测报告',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (!informationSecurityTestReport.value) {
|
||||||
|
return ElMessage({
|
||||||
|
message: '请上传信息安全检测报告',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//提交终端信息
|
||||||
|
confirmFormData = {
|
||||||
|
...confirmFormData,
|
||||||
|
acceptanceInspectionReport: acceptanceInspectionReport.value, //验收检验报告
|
||||||
|
acceptanceInspectionReportSingle: acceptanceInspectionReportSingle.value, //验收检验报告单
|
||||||
|
deviceFilePath: deviceFilePath?.value, //终端台账信息
|
||||||
|
factoryInspectionReport: factoryInspectionReport.value, //出厂检验报告
|
||||||
|
informationSecurityTestReport: informationSecurityTestReport.value, //信息安全检测报告
|
||||||
|
lineFilePath: lineFilePath?.value, //监测点台账信息
|
||||||
|
performanceTestReport: performanceTestReport.value, //性能检测报告
|
||||||
|
typeExperimentReport: typeExperimentReport.value, //型式实验报告
|
||||||
|
otherAttachments: otherAttachments?.value //其他附件
|
||||||
|
}
|
||||||
|
addTerminalFormData(confirmFormData).then(res => {
|
||||||
|
ruleFormRef.value.resetFields()
|
||||||
|
resetForm()
|
||||||
|
close()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('表单验证失败')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
defineExpose({ open })
|
defineExpose({ open })
|
||||||
</script>
|
</script>
|
||||||
@@ -1591,14 +1592,14 @@ defineExpose({ open })
|
|||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
color: #f56c6c;
|
color: #f56c6c;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
margin-right:10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
.required_icon_white{
|
.required_icon_white {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: -10px;
|
left: -10px;
|
||||||
padding-left:10px;
|
padding-left: 10px;
|
||||||
margin:8px 10px 0 10px;
|
margin: 8px 10px 0 10px;
|
||||||
}
|
}
|
||||||
.required_text {
|
.required_text {
|
||||||
// padding-left: 20px;
|
// padding-left: 20px;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!---终端入网检测-->
|
<!---终端入网检测-->
|
||||||
<template>
|
<template>
|
||||||
<TableHeader area datePicker ref="TableHeaderRef">
|
<TableHeader area datePicker ref="TableHeaderRef">
|
||||||
<!-- <template #select>
|
<!-- <template #select>
|
||||||
<el-form-item label="工程名称">
|
<el-form-item label="工程名称">
|
||||||
<el-input v-model="tableStore.table.params.searchValue" clearable></el-input>
|
<el-input v-model="tableStore.table.params.searchValue" clearable></el-input>
|
||||||
|
|||||||
Reference in New Issue
Block a user