终端检测重新发起

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

@@ -15,6 +15,17 @@ export const addTerminalFormData = (data: any) => {
})
}
/**
* 编辑终端信息表单数据(重新发起)
*/
export const updateTerminalFormData = (data: any) => {
return createAxios({
url: '/supervision-boot/deVReport/update',
method: 'POST',
data: data
})
}
/**
* 获取关联设备列表
*/

View File

@@ -1,30 +1,30 @@
<template>
<div style="width: 600px;">
<div style="width: 600px">
<el-select v-model="interval" style="min-width: 90px; width: 90px; margin-right: 10px" @change="timeChange">
<el-option v-for="item in timeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-date-picker
v-model="timeValue"
type="daterange"
:disabled="disabledPicker"
style="width: 210px; margin-right: 10px"
unlink-panels
:clearable="false"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD"
:shortcuts="shortcuts"
/>
<el-button :disabled="backDisabled" type="primary" :icon="DArrowLeft" @click="preClick"></el-button>
<el-button type="primary" :icon="VideoPause" @click="nowTime">当前</el-button>
<el-button :disabled="preDisabled" type="primary" :icon="DArrowRight" @click="next"></el-button>
<el-option v-for="item in timeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-date-picker
v-model="timeValue"
type="daterange"
:disabled="disabledPicker"
style="width: 220px; margin-right: 10px"
unlink-panels
:clearable="false"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD"
:shortcuts="shortcuts"
/>
<el-button :disabled="backDisabled" type="primary" :icon="DArrowLeft" @click="preClick"></el-button>
<el-button type="primary" :icon="VideoPause" @click="nowTime">当前</el-button>
<el-button :disabled="preDisabled" type="primary" :icon="DArrowRight" @click="next"></el-button>
</div>
</template>
<script lang="ts" setup>
import { DArrowLeft, VideoPause, DArrowRight } from '@element-plus/icons-vue'
import { ref, onMounted, nextTick,watch} from 'vue'
import { ref, onMounted, nextTick, watch } from 'vue'
const interval = ref(3)
const timeFlag = ref(1)
@@ -112,6 +112,7 @@ const timeChange = (e: number) => {
// 当前
const nowTime = () => {
console.log(interval.value,"000000000");
timeChange(interval.value)
}
// 上一个
@@ -142,7 +143,6 @@ const preClick = () => {
//按周
} else if (interval.value == 4) {
//根据开始时间推
let start = new Date(year, month - 1, date)
start.setDate(start.getDate() - 7)
startTime = formatTime(start)
@@ -179,7 +179,6 @@ const preClick = () => {
//下一个
const next = () => {
//向后
let startTime = timeValue.value[0]
let endTime = timeValue.value[1]
let year = parseInt(startTime.substring(0, 4))
@@ -499,7 +498,7 @@ function formatDate(date: Date): string {
const day = String(date.getDate()).padStart(2, '0')
return `${year}-${month}-${day}`
}
defineExpose({ timeValue, interval, timeFlag, setTimeOptions, setInterval, getYearOnYear, getMonthOnMonth ,timeChange})
defineExpose({ timeValue, interval, timeFlag, setTimeOptions, setInterval, getYearOnYear, getMonthOnMonth, timeChange })
</script>
<style scoped>

View File

@@ -9,7 +9,7 @@
label-position="left"
:inline="true"
>
<el-form-item label="日期" v-if="datePicker" style="grid-column: span 2; max-width: 600px;">
<el-form-item label="日期" v-if="datePicker" style="grid-column: span 2; max-width: 610px;">
<DatePicker ref="datePickerRef"></DatePicker>
</el-form-item>

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">