终端检测重新发起

This commit is contained in:
zhujiyan
2024-06-03 15:49:04 +08:00
parent 6c0d7e3d0d
commit 041acae264
5 changed files with 90 additions and 125 deletions

View File

@@ -591,7 +591,11 @@ import type { ComponentSize, FormInstance, FormRules } from 'element-plus'
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 {
addTerminalFormData,
getSubstationVoltageLevel,
updateTerminalFormData
} from '@/api/supervision-boot/terminal/index'
import { getAllDeptList } from '@/api/common'
import { getTerminalDetailsById } from '@/api/supervision-boot/terminal/index'
import { nodeAllList } from '@/api/device-boot/Business'
@@ -775,11 +779,6 @@ const changeSubstation = async () => {
let obj = substationList.value.find((item: any) => item.id == form.value.substation)
form.value.substationVoltageLevel = obj?.voltageLevel
}
const containerRef = ref<HTMLElement | null>(null)
const handleClick = (e: MouseEvent) => {
e.preventDefault()
}
const resetForm: any = async () => {
form.value = {
reporter: '', //填报人
@@ -1342,12 +1341,13 @@ const disabledDate = time => {
return time.getTime() < Date.now() - 8.64e7 // 8.64e7 毫秒数代表一天
}
const activeName = ref('0')
const resendId = ref('')
const open = async (row: any) => {
await getPowerCompanyList()
title.value = row.title
dialogFormVisible.value = true
if (row.row) {
resendId.value = row.row.id
await getTerminalDetailsById({ id: row.row.id }).then((res: any) => {
form.value = { customSubstaionFlag: '0', ...res.data, ...res.data.supervisionTempDeviceReport }
let list = [
@@ -1369,7 +1369,7 @@ const open = async (row: any) => {
]
}
}
form.value.orgId = adminInfo.$state.deptName
form.value.id = row.row.id
deviceFilePath.value = res.data.deviceFilePath
acceptanceInspectionReportSingle.value = res.data.acceptanceInspectionReportSingle
acceptanceInspectionReport.value = res.data.acceptanceInspectionReport
@@ -1398,42 +1398,6 @@ const confirmForm = () => {
devReportForm.value.reporter = adminInfo.$state.id
devReportForm.value.orgId = adminInfo.$state.deptId
let confirmFormData = JSON.parse(JSON.stringify(devReportForm.value))
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,
@@ -1460,6 +1424,21 @@ const confirmForm = () => {
})
} else {
console.log(confirmFormData)
form.value.orgId = adminInfo.$state.deptName
confirmFormData.supervisionTempDeviceReportParam.commissioningTime =
confirmFormData.supervisionTempDeviceReportParam.commissioningTime.replace('T', ' ')
confirmFormData.id = resendId.value
updateTerminalFormData(confirmFormData).then((res: any) => {
if (res.code == 'A0000') {
ElMessage({
message: '重新发起成功',
type: 'success'
})
ruleFormRef.value.resetFields()
resetForm()
close()
}
})
}
} else {
console.log('表单验证失败')

View File

@@ -108,38 +108,38 @@ const tableStore = new TableStore({
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleAudit(row.processInstanceId)
handleAudit(row.processInstanceId,row.historyInstanceId)
}
},
// {
// 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)
// }
// }
{
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)
}
}
]
}
],
@@ -186,40 +186,16 @@ onMounted(() => {
})
/** 处理审批按钮 */
const handleAudit = (instanceId: any) => {
const handleAudit = (instanceId: any,historyInstanceId:any) => {
push({
name: 'BpmProcessInstanceDetail',
query: {
id: instanceId
id: instanceId,
historyInstanceId
}
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
</script>
<style scoped lang="scss">