终端监测-所属公司变电站电压等级接口修改
This commit is contained in:
@@ -158,9 +158,10 @@
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请选择所属供电公司"
|
||||
@change="findSubstationVoltageLevel"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in areaOptionList"
|
||||
v-for="item in powerCompanyList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
@@ -176,9 +177,11 @@
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请选择所属变电站"
|
||||
filterable
|
||||
@change="changeSubstation"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in areaOptionList"
|
||||
v-for="item in substationList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
@@ -819,6 +822,7 @@ import { queryByAllCode } from '@/api/system-boot/dictTree'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { uploadFile } from '@/api/system-boot/file'
|
||||
import { addTerminalFormData, getSubstationVoltageLevel } from '@/api/supervision-boot/terminal/index'
|
||||
import { getAreaList } from '@/api/common'
|
||||
const emits = defineEmits(['onSubmit'])
|
||||
const dictData = useDictData()
|
||||
const dialogFormVisible = ref(false)
|
||||
@@ -923,9 +927,32 @@ const electroplatingFunctionList = [
|
||||
|
||||
//获取登陆用户姓名和部门
|
||||
const adminInfo = useAdminInfo()
|
||||
//定义切换form类型
|
||||
const selectFormType = ref('')
|
||||
selectFormType.value = '0'
|
||||
//定义所属供电公司数据
|
||||
const powerCompanyList = ref([])
|
||||
//获取所属供电公司,区域列表第三层数据
|
||||
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 = () => {
|
||||
form.value = {
|
||||
reporter: '', //填报人
|
||||
@@ -965,7 +992,7 @@ const resetForm = () => {
|
||||
monitoringTerminalName: '', //监测终端名称
|
||||
neutralPointWiringMethod: neutralPointWiringMethodList[0].id, // 中性点接线方式
|
||||
nextTerminalInspectionTime: '', // 下次终端定检时间
|
||||
powerCompany: areaOptionList[0].id, //所属供电公司
|
||||
powerCompany: powerCompanyList[0]?.value.id, //所属供电公司
|
||||
simCardNumber: '', //SIM卡号
|
||||
substation: '', // 所属变电站
|
||||
substationVoltageLevel: voltageLevelList[0].id, // 变电站电压等级
|
||||
@@ -1028,7 +1055,7 @@ const devReportForm = ref({
|
||||
monitoringTerminalName: '', //监测终端名称
|
||||
neutralPointWiringMethod: neutralPointWiringMethodList[0].id, // 中性点接线方式
|
||||
nextTerminalInspectionTime: '', // 下次终端定检时间
|
||||
powerCompany: areaOptionList[0].id, //所属供电公司
|
||||
powerCompany: powerCompanyList.value[0]?.id, //所属供电公司
|
||||
simCardNumber: '', //SIM卡号
|
||||
substation: '', // 所属变电站
|
||||
substationVoltageLevel: voltageLevelList[0].id, // 变电站电压等级
|
||||
@@ -1321,7 +1348,7 @@ watch(
|
||||
(val, oldVal) => {
|
||||
//form数据变化时处理格式,根据tab切换判断处理的对象实体
|
||||
//终端信息
|
||||
if (selectFormType.value == '0' && val) {
|
||||
if (val) {
|
||||
for (let key in val) {
|
||||
if (devReportForm.value.hasOwnProperty(key)) {
|
||||
devReportForm.value[key] = val[key] // 对相同的key进行赋值
|
||||
@@ -1331,7 +1358,6 @@ watch(
|
||||
}
|
||||
//处理填报日期时间格式
|
||||
devReportForm.value.reportDate = window.XEUtils.toDateString(form.value.reportDate, 'yyyy-MM-dd')
|
||||
// console.log('处理好的表单++++++++++>',devReportForm.value)
|
||||
}
|
||||
//监测点信息
|
||||
else {
|
||||
@@ -1357,13 +1383,6 @@ onMounted(() => {
|
||||
console.log()
|
||||
})
|
||||
|
||||
//获取变电站与电压等级
|
||||
const findSubstationVoltageLevel = () => {
|
||||
getSubstationVoltageLevel({ orgIds: [adminInfo.$state.deptId] }).then(res => {
|
||||
console.log(res, '获取变电站电压等级')
|
||||
})
|
||||
}
|
||||
findSubstationVoltageLevel()
|
||||
// 上传报告
|
||||
const uploadRef = ref()
|
||||
const handleExceed: UploadProps['onExceed'] = files => {
|
||||
@@ -1443,15 +1462,10 @@ const disabledDate = time => {
|
||||
const activeName = ref('0')
|
||||
//提交
|
||||
const confirmForm = () => {
|
||||
console.log(form.value, '打印form对象')
|
||||
// 先判断提交终端信息与监测点信息
|
||||
|
||||
// 提交终端信息
|
||||
if (selectFormType.value == '0') {
|
||||
ruleFormRef.value.validate(valid => {
|
||||
if (valid) {
|
||||
//整理上传文件的数据
|
||||
// userType==0,1
|
||||
devReportForm.value.reporter = adminInfo.$state.id
|
||||
devReportForm.value.orgId = adminInfo.$state.deptId
|
||||
let confirmFormData = JSON.parse(JSON.stringify(devReportForm.value))
|
||||
@@ -1464,13 +1478,6 @@ const confirmForm = () => {
|
||||
// type: 'warning'
|
||||
// })
|
||||
// }
|
||||
// if (!lineFilePath.value) {
|
||||
// activeName.value = '2'
|
||||
// return ElMessage({
|
||||
// message: '请上传监测点台账信息',
|
||||
// type: 'warning'
|
||||
// })
|
||||
// }
|
||||
if (!acceptanceInspectionReportSingle.value) {
|
||||
return ElMessage({
|
||||
message: '请上传验收检验报告单',
|
||||
@@ -1520,9 +1527,7 @@ const confirmForm = () => {
|
||||
typeExperimentReport: typeExperimentReport.value, //型式实验报告
|
||||
otherAttachments: otherAttachments?.value //其他附件
|
||||
}
|
||||
console.log(confirmFormData, '打印提交表单111111111111')
|
||||
addTerminalFormData(confirmFormData).then(res => {
|
||||
console.log(res, '打印提交结果222222222222+++++++++')
|
||||
ruleFormRef.value.resetFields()
|
||||
resetForm()
|
||||
close()
|
||||
@@ -1533,10 +1538,6 @@ const confirmForm = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
//提交监测点信息
|
||||
else {
|
||||
}
|
||||
}
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user