终端监测-所属公司变电站电压等级接口修改
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"
|
||||||
@@ -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,15 +1462,10 @@ 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) {
|
||||||
//整理上传文件的数据
|
//整理上传文件的数据
|
||||||
// userType==0,1
|
|
||||||
devReportForm.value.reporter = adminInfo.$state.id
|
devReportForm.value.reporter = adminInfo.$state.id
|
||||||
devReportForm.value.orgId = adminInfo.$state.deptId
|
devReportForm.value.orgId = adminInfo.$state.deptId
|
||||||
let confirmFormData = JSON.parse(JSON.stringify(devReportForm.value))
|
let confirmFormData = JSON.parse(JSON.stringify(devReportForm.value))
|
||||||
@@ -1464,13 +1478,6 @@ const confirmForm = () => {
|
|||||||
// type: 'warning'
|
// type: 'warning'
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
// if (!lineFilePath.value) {
|
|
||||||
// activeName.value = '2'
|
|
||||||
// return ElMessage({
|
|
||||||
// message: '请上传监测点台账信息',
|
|
||||||
// type: 'warning'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
if (!acceptanceInspectionReportSingle.value) {
|
if (!acceptanceInspectionReportSingle.value) {
|
||||||
return ElMessage({
|
return ElMessage({
|
||||||
message: '请上传验收检验报告单',
|
message: '请上传验收检验报告单',
|
||||||
@@ -1520,9 +1527,7 @@ const confirmForm = () => {
|
|||||||
typeExperimentReport: typeExperimentReport.value, //型式实验报告
|
typeExperimentReport: typeExperimentReport.value, //型式实验报告
|
||||||
otherAttachments: otherAttachments?.value //其他附件
|
otherAttachments: otherAttachments?.value //其他附件
|
||||||
}
|
}
|
||||||
console.log(confirmFormData, '打印提交表单111111111111')
|
|
||||||
addTerminalFormData(confirmFormData).then(res => {
|
addTerminalFormData(confirmFormData).then(res => {
|
||||||
console.log(res, '打印提交结果222222222222+++++++++')
|
|
||||||
ruleFormRef.value.resetFields()
|
ruleFormRef.value.resetFields()
|
||||||
resetForm()
|
resetForm()
|
||||||
close()
|
close()
|
||||||
@@ -1533,10 +1538,6 @@ const confirmForm = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//提交监测点信息
|
|
||||||
else {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
defineExpose({ open })
|
defineExpose({ open })
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user