修改 电网一张图bug 技术监督新增 重新发起页面绘制

This commit is contained in:
GGJ
2024-06-02 17:55:37 +08:00
parent 91fa1f60e3
commit c7025c615f
16 changed files with 668 additions and 463 deletions

View File

@@ -1,7 +1,7 @@
<template>
<el-dialog
v-model="dialogFormVisible"
title="终端信息"
:title="title"
width="65%"
:append-to-body="true"
:before-close="close"
@@ -405,8 +405,8 @@
<el-form-item for="-" label="对时功能:" prop="timeSyncFunction">
<!-- 默认值 开启 -->
<el-radio-group v-model="form.timeSyncFunction">
<el-radio value="1">开启</el-radio>
<el-radio value="0">关闭</el-radio>
<el-radio :value="1">开启</el-radio>
<el-radio :value="0">关闭</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item for="-" label="电镀功能:" prop="electroplatingFunction">
@@ -446,7 +446,6 @@
</el-form-item>
<!-- </div> -->
<el-divider content-position="left">附件材料</el-divider>
<!-- <div id="part3" class="form-two"> -->
<el-form-item for="-" label="信息安全检测报告:" class="uploadFile" prop="informationSecurityTestReport">
<el-upload
v-model:file-list="form.informationSecurityTestReport"
@@ -573,8 +572,6 @@
</template>
</el-upload>
</el-form-item>
<!-- </div> -->
<!-- </el-tabs> -->
</el-form>
<template #footer>
<div class="dialog-footer">
@@ -596,13 +593,14 @@ import { useAdminInfo } from '@/stores/adminInfo'
import { uploadFile } from '@/api/system-boot/file'
import { addTerminalFormData, getSubstationVoltageLevel } from '@/api/supervision-boot/terminal/index'
import { getAllDeptList } from '@/api/common'
import { formatDate } from '@/utils/formatTime'
import { getTerminalDetailsById } from '@/api/supervision-boot/terminal/index'
import { nodeAllList } from '@/api/device-boot/Business'
const emits = defineEmits(['onSubmit'])
const dictData = useDictData()
const dialogFormVisible = ref(false)
const form: any = ref({})
const ruleFormRef = ref(null)
const ruleFormRef: any = ref(null)
const title = ref('')
// acceptType .xls,.xlsx
const acceptType = ''
//字典获取所属地市
@@ -668,6 +666,7 @@ const terminalModelList = [
name: '离线'
}
]
const substationList: any = ref([])
//字典获取通讯类型
const frontTypeList = dictData.getBasicData('Front_Type')
//定义通讯状态下拉框数据
@@ -706,18 +705,18 @@ const summonFlagList = [
//定义电镀功能下拉框数据
const electroplatingFunctionList = [
{
id: '0',
id: 0,
name: '关闭'
},
{
id: '1',
id: 1,
name: '开启'
}
]
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
//获取所属前置机数据
const frontEndMachineList = ref([])
const frontEndMachineList: any = ref([])
const getFrontEndMachineList = () => {
nodeAllList().then(res => {
frontEndMachineList.value = res.data
@@ -727,7 +726,7 @@ const changeSubstationFlag = () => {
console.log(form.value.customSubstaionFlag)
//处理所属变电站手都输入/下拉数据
if (form.value.customSubstaionFlag == '0') {
form.value.substationName = substationList.value.find(item => {
form.value.substationName = substationList.value.find((item: any) => {
return form.value.substation == item.id
})?.name
} else {
@@ -740,7 +739,7 @@ watch(
() => form.value.substation,
(val, oldVal) => {
if (val) {
form.value.substationName = substationList.value.find(item => {
form.value.substationName = substationList.value.find((item: any) => {
return form.value.substation == item.id
})?.name
}
@@ -752,7 +751,7 @@ watch(
)
getFrontEndMachineList()
//定义所属供电公司数据
const powerCompanyList = ref([])
const powerCompanyList: any = ref([])
//获取所属供电公司,区域列表第三层数据
const getPowerCompanyList = async () => {
getAllDeptList().then(res => {
@@ -763,7 +762,7 @@ const getPowerCompanyList = async () => {
})
}
//根据所选供电公司查询所选获取变电站与变电站电压等级
const substationList = ref([])
const findSubstationVoltageLevel = async () => {
getSubstationVoltageLevel({ orgIds: [form.value.powerCompany] }).then(res => {
substationList.value = res.data
@@ -773,7 +772,7 @@ const findSubstationVoltageLevel = async () => {
}
//变电站选择的时候切换变电站电压等级
const changeSubstation = async () => {
let obj = substationList.value.find(item => item.id == form.value.substation)
let obj = substationList.value.find((item: any) => item.id == form.value.substation)
form.value.substationVoltageLevel = obj?.voltageLevel
}
const containerRef = ref<HTMLElement | null>(null)
@@ -781,7 +780,7 @@ const containerRef = ref<HTMLElement | null>(null)
const handleClick = (e: MouseEvent) => {
e.preventDefault()
}
const resetForm = async () => {
const resetForm: any = async () => {
form.value = {
reporter: '', //填报人
reportDate: new Date(), //填报日期
@@ -831,7 +830,7 @@ const resetForm = async () => {
terminalSecretKey: '', //终端秘钥
terminalType: terminalTypeList[0].id, // 终端型号
terminalWiringMethodType: terminalWiringMethodTypeList[0].id, // 终端接线方式类型
timeSyncFunction: '0', // 对时功能
timeSyncFunction: 0, // 对时功能
voltageTransformerType: voltageTransformerTypeList[0].id //电压互感器类型
}
form.value.reporter = adminInfo.$state.name
@@ -841,7 +840,7 @@ const resetForm = async () => {
//初始化数据
resetForm()
//终端信息表单格式
const devReportForm = ref({
const devReportForm: any = ref({
reporter: '', //填报人
reportDate: new Date(), //填报日期
orgId: '', //填报部门
@@ -893,7 +892,7 @@ const devReportForm = ref({
terminalSecretKey: '', //终端秘钥
terminalType: terminalTypeList[0].id, // 终端型号
terminalWiringMethodType: terminalWiringMethodTypeList[0].id, // 终端接线方式类型
timeSyncFunction: '0', // 对时功能
timeSyncFunction: 0, // 对时功能
voltageTransformerType: voltageTransformerTypeList[0].id //电压互感器类型
}
})
@@ -1344,9 +1343,43 @@ const disabledDate = time => {
}
const activeName = ref('0')
const open = async () => {
getPowerCompanyList()
const open = async (row: any) => {
await getPowerCompanyList()
title.value = row.title
dialogFormVisible.value = true
if (row.row) {
await getTerminalDetailsById({ id: row.row.id }).then((res: any) => {
form.value = { customSubstaionFlag: '0', ...res.data, ...res.data.supervisionTempDeviceReport }
let list = [
'deviceFilePath',
'acceptanceInspectionReportSingle',
'acceptanceInspectionReport',
'typeExperimentReport',
'factoryInspectionReport',
'performanceTestReport',
'informationSecurityTestReport',
'otherAttachments'
]
for (let k of list) {
if (res.data[k]) {
form.value[k] = [
{
name: res.data[k].split('/')[2]
}
]
}
}
form.value.orgId = adminInfo.$state.deptName
deviceFilePath.value = res.data.deviceFilePath
acceptanceInspectionReportSingle.value = res.data.acceptanceInspectionReportSingle
acceptanceInspectionReport.value = res.data.acceptanceInspectionReport
typeExperimentReport.value = res.data.typeExperimentReport
factoryInspectionReport.value = res.data.factoryInspectionReport
performanceTestReport.value = res.data.performanceTestReport
informationSecurityTestReport.value = res.data.informationSecurityTestReport
otherAttachments.value = res.data.otherAttachments
})
}
}
const close = async () => {
//重置表单内容
@@ -1413,17 +1446,21 @@ const confirmForm = () => {
typeExperimentReport: typeExperimentReport.value, //型式实验报告
otherAttachments: otherAttachments?.value //其他附件
}
addTerminalFormData(confirmFormData).then(res => {
if (res.code == 'A0000') {
ElMessage({
message: '新增成功',
type: 'success'
})
ruleFormRef.value.resetFields()
resetForm()
close()
}
})
if (title.value == '终端信息') {
addTerminalFormData(confirmFormData).then((res: any) => {
if (res.code == 'A0000') {
ElMessage({
message: '新增成功',
type: 'success'
})
ruleFormRef.value.resetFields()
resetForm()
close()
}
})
} else {
console.log(confirmFormData)
}
} else {
console.log('表单验证失败')
return false

View File

@@ -34,11 +34,11 @@ const tableStore = new TableStore({
method: 'POST',
column: [
{ title: '序号', type: 'seq', width: 80 },
{ field: 'orgName', title: '填报部门名称' , minWidth: 170 },
{ field: 'orgName', title: '填报部门名称', minWidth: 170 },
{ field: 'substationName', title: '所属变电站', minWidth: 170 },
{ field: 'monitoringTerminalName', title: '设备名称', minWidth: 170 },
{ field: 'monitoringTerminalCode', title: '设备编号', minWidth: 170 },
{ field: 'reportDate', title: '填报日期', minWidth: 170},
{ field: 'reportDate', title: '填报日期', minWidth: 170 },
{ field: 'reporter', title: '填报人', minWidth: 80 },
{
field: 'status',
@@ -74,7 +74,7 @@ const tableStore = new TableStore({
// { field: 'otherAttachments', title: '其他附件', minWidth: 170 },
// { field: 'orgName', title: '填报部门名称'},
// { field: 'performanceTestReport', title: '性能检测报告', minWidth: 170 },
// {
// field: 'userStatus',
// title: '用户状态',
@@ -110,13 +110,42 @@ const tableStore = new TableStore({
click: row => {
handleAudit(row.processInstanceId)
}
}
},
// {
// name: 'edit',
// title: '重新发起',
// type: 'warning',
// icon: 'el-icon-Open',
// render: 'basicButton',
// disabled: row => {
// return row.status == 1 || row.status == 2
// },
// click: row => {
// addForms.value.open({
// title: '重新发起',
// row: row
// })
// }
// },
// {
// name: 'cancel',
// title: '取消',
// type: 'danger',
// icon: 'el-icon-Open',
// render: 'basicButton',
// disabled: row => {
// return row.status == 3 || row.status == 2 || row.status == 4
// },
// click: row => {
// // cancelLeave(row)
// }
// }
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
// tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
@@ -129,9 +158,10 @@ provide('tableStore', tableStore)
const addForms = ref()
const addFormModel = () => {
setTimeout(() => {
addForms.value.open()
}, 0);
addForms.value.open({
title: '终端信息'
})
}, 0)
}
const exportEvent = () => {