谐波普测-普测计划新增&终端退运-历史记录

This commit is contained in:
zhujiyan
2024-06-03 09:17:00 +08:00
parent c7025c615f
commit d9f02ef5ff
15 changed files with 1009 additions and 607 deletions

View File

@@ -4,21 +4,21 @@
class="cn-operate-dialog"
v-model="dialogVisible"
:title="title"
style="max-width: 450px; "
style="max-width: 450px"
top="30vh"
>
<el-scrollbar>
<el-form :inline="false" :model="formData" label-width="120px" :rules="rules" ref="formRef">
<el-form-item label="设备类型" prop="deviceType">
<el-radio-group v-model="formData.deviceType" @change="changeType">
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
<!-- <el-form-item label="设备类型" prop="deviceType">
<el-radio-group v-model="form.deviceType" :disabled="title == '监测点退运'" @change="changeType">
<el-radio border label="1">监测装置</el-radio>
<el-radio border label="2">监测点</el-radio>
</el-radio-group>
</el-form-item>
</el-form-item> -->
<el-form-item label="设备" prop="deviceId">
<el-tree-select
v-model="formData.deviceId"
v-model="form.deviceId"
:data="data"
filterable
:default-expand-all="true"
@@ -28,7 +28,7 @@
<el-form-item label="退役原因" prop="propertyNo">
<!-- <el-input
v-model='formData.propertyNo'
v-model='form.propertyNo'
clearable
placeholder='请输入退役原因'
/> -->
@@ -37,7 +37,7 @@
clearable
:autosize="{ minRows: 2, maxRows: 4 }"
placeholder="请输入退役原因"
v-model="formData.propertyNo"
v-model="form.propertyNo"
></el-input>
</el-form-item>
</el-form>
@@ -69,10 +69,10 @@ const formRef = ref()
const dialogVisible = ref(false)
// 注意不要和表单ref的命名冲突
const formData = reactive({
const form = ref({
id: '',
deviceId: '',
deviceType: '',
deviceType: '1',
propertyNo: ''
})
@@ -90,7 +90,6 @@ const resetForm = () => {
const open = async (text: string, tempData?: any) => {
title.value = text
if (tempData) {
if (tempData.deviceType == 1) {
//先加载装置数据并赋值
@@ -118,28 +117,30 @@ const open = async (text: string, tempData?: any) => {
data.value = lineList.value
}
// 表单赋值
for (let key in formData) {
formData[key] = tempData[key]
for (let key in form.value) {
form.value[key] = tempData[key]
}
formData.deviceType = formData.deviceType + ''
form.value.deviceType = form.value.deviceType + ''
} else {
//终端
await getTerminalSelectTree(4).then(res => {
deviceList.value = res.data
})
//监测点
getTerminalSelectTree(6).then(res => {
await getTerminalSelectTree(6).then(res => {
lineList.value = res.data
})
sourceData.value = deviceList.value
data.value = deviceList.value
resetForm()
// 在此处恢复默认表单
for (let key in formData) {
formData[key] = ''
for (let key in form.value) {
form.value[key] = ''
}
formData.deviceType = '1'
form.value.deviceType = '1'
}
form.value.deviceType = text == '监测点退运' ? '2' : '1'
changeType(form.value.deviceType)
dialogVisible.value = true
}
@@ -149,13 +150,13 @@ const open = async (text: string, tempData?: any) => {
const submit = () => {
formRef.value.validate(async (valid: any) => {
if (valid) {
if (formData.id) {
await quitRunningDeviceUpdate(formData)
if (form.value.id) {
await quitRunningDeviceUpdate(form.value)
ElMessage.success('重新发起成功')
tableStore.index()
dialogVisible.value = false
} else {
await addRunningDevice(formData)
await addRunningDevice(form.value)
//查询进线数据避免一直处于loading状态
ElMessage.success('申请成功')
tableStore.index()
@@ -175,7 +176,7 @@ const changeType = (event: any) => {
} else {
sourceData.value = lineList.value
}
formData.deviceId = ''
form.value.deviceId = ''
data.value = sourceData.value
}

View File

@@ -1,201 +1,38 @@
<!--待办事项列表-->
<template>
<div class='default-main'>
<TableHeader date-picker>
<template v-slot:select>
<!-- <el-form-item label='任务名称'>-->
<!-- <el-input-->
<!-- v-model='tableStore.table.params.searchValue'-->
<!-- clearable-->
<!-- placeholder='请输入任务名称'-->
<!-- />-->
<!-- </el-form-item>-->
</template>
<template #operation>
<el-button icon='el-icon-Plus' type='primary' @click='add'>新增</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
<!--弹框-->
<device-quit-popup ref='deviceQuitPopup' />
<div class="default-main">
<el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="终端状态管理" name="0">
<terminal v-if="activeName == '0'" />
</el-tab-pane>
<el-tab-pane label="监测点退运" name="1">
<monitor v-if="activeName == '1'" />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script setup lang='ts'>
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useRouter } from 'vue-router'
import DeviceQuitPopup from '@/views/pqs/supervise/retire/deviceQuitPopup.vue'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import { cancelQuitRunningDevice } from '@/api/supervision-boot/device/quitRunningDev'
<script setup lang="ts">
import { onMounted, reactive, ref, provide } from 'vue'
import { mainHeight } from '@/utils/layout'
import terminal from './terminal.vue'
import monitor from './monitor.vue'
defineOptions({
name: 'supervision/retire'
})
const { push } = useRouter()
const deviceQuitPopup = ref()
const tableStore = new TableStore({
url: '/supervision-boot/quitRunningDevice/list',
method: 'POST',
column: [
{ title: '序号', type: 'seq', width: 80 },
{
title: '设备类型', field: 'deviceType', minWidth: 130,
render: 'tag',
custom: {
1: 'primary',
2: 'primary'
},
replaceValue: {
1: '装置',
2: '监测点'
}
},
{ title: '供电公司', field: 'gdName', minWidth: 130 },
{ title: '变电站', field: 'subName', minWidth: 130 },
{ title: '设备名称', field: 'deviceName', minWidth: 130 },
{ title: '退役原因', field: 'propertyNo', minWidth: 130 },
{
title: '设备状态', field: 'deviceStatus', minWidth: 130,
render: 'tag',
custom: {
0: 'success',
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info'
},
replaceValue: {
0: '运行',
1: '检修',
2: '停运',
3: '调试',
4: '退运'
}
},
{
field: 'status', title: '审核状态', minWidth: 100,
render: 'tag',
custom: {
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{ field: 'createTime', title: '开始时间', minWidth: 170 },
{
title: '操作',
align: 'center',
minWidth: '150',
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleAudit(row.processInstanceId,row.historyInstanceId)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.status !== 3
},
click: row => {
deviceQuitPopup.value.open('重新发起退运', 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: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
//新增退运设备信息
const add = () => {
deviceQuitPopup.value.open('新增退运')
}
/** 流程实例详情 */
const handleAudit = (instanceId: string,historyIds:string) => {
push({
name: 'BpmProcessInstanceDetail',
query: {
id: instanceId,
historyIds:historyIds
}
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelQuitRunningDevice(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
const activeName = ref('1')
const layout = mainHeight(63) as any
</script>
<style lang="scss" scoped>
.bars_w {
width: 100%;
height: 500px;
}
:deep(.el-tabs__content) {
height: v-bind('layout.height');
overflow-y: auto;
}
</style>

View File

@@ -0,0 +1,201 @@
<!--待办事项列表-->
<template>
<div class='default-main'>
<TableHeader date-picker>
<template v-slot:select>
<!-- <el-form-item label='任务名称'>-->
<!-- <el-input-->
<!-- v-model='tableStore.table.params.searchValue'-->
<!-- clearable-->
<!-- placeholder='请输入任务名称'-->
<!-- />-->
<!-- </el-form-item>-->
</template>
<template #operation>
<el-button icon='el-icon-Plus' type='primary' @click='add'>新增</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
<!--弹框-->
<device-quit-popup ref='deviceQuitPopup' />
</div>
</template>
<script setup lang='ts'>
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useRouter } from 'vue-router'
import DeviceQuitPopup from '@/views/pqs/supervise/retire/deviceQuitPopup.vue'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import { cancelQuitRunningDevice } from '@/api/supervision-boot/device/quitRunningDev'
defineOptions({
name: 'supervision/retire'
})
const { push } = useRouter()
const deviceQuitPopup = ref()
const tableStore = new TableStore({
url: '/supervision-boot/quitRunningDevice/list',
method: 'POST',
column: [
{ title: '序号', type: 'seq', width: 80 },
{
title: '设备类型', field: 'deviceType', minWidth: 130,
render: 'tag',
custom: {
1: 'primary',
2: 'primary'
},
replaceValue: {
1: '装置',
2: '监测点'
}
},
{ title: '供电公司', field: 'gdName', minWidth: 130 },
{ title: '变电站', field: 'subName', minWidth: 130 },
{ title: '设备名称', field: 'deviceName', minWidth: 130 },
{ title: '退役原因', field: 'propertyNo', minWidth: 130 },
{
title: '设备状态', field: 'deviceStatus', minWidth: 130,
render: 'tag',
custom: {
0: 'success',
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info'
},
replaceValue: {
0: '运行',
1: '检修',
2: '停运',
3: '调试',
4: '退运'
}
},
{
field: 'status', title: '审核状态', minWidth: 100,
render: 'tag',
custom: {
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{ field: 'createTime', title: '开始时间', minWidth: 170 },
{
title: '操作',
align: 'center',
minWidth: '150',
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleAudit(row.processInstanceId,row.historyInstanceId)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.status !== 3
},
click: row => {
deviceQuitPopup.value.open('重新发起退运', 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: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
//新增退运设备信息
const add = () => {
deviceQuitPopup.value.open('监测点退运')
}
/** 流程实例详情 */
const handleAudit = (instanceId: string,historyInstanceId:string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelQuitRunningDevice(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
</script>

View File

@@ -0,0 +1,201 @@
<!--待办事项列表-->
<template>
<div class='default-main'>
<TableHeader date-picker>
<template v-slot:select>
<!-- <el-form-item label='任务名称'>-->
<!-- <el-input-->
<!-- v-model='tableStore.table.params.searchValue'-->
<!-- clearable-->
<!-- placeholder='请输入任务名称'-->
<!-- />-->
<!-- </el-form-item>-->
</template>
<template #operation>
<el-button icon='el-icon-Plus' type='primary' @click='add'>新增</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
<!--弹框-->
<device-quit-popup ref='deviceQuitPopup' />
</div>
</template>
<script setup lang='ts'>
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useRouter } from 'vue-router'
import DeviceQuitPopup from '@/views/pqs/supervise/retire/deviceQuitPopup.vue'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import { cancelQuitRunningDevice } from '@/api/supervision-boot/device/quitRunningDev'
defineOptions({
name: 'supervision/retire'
})
const { push } = useRouter()
const deviceQuitPopup = ref()
const tableStore = new TableStore({
url: '/supervision-boot/quitRunningDevice/list',
method: 'POST',
column: [
{ title: '序号', type: 'seq', width: 80 },
{
title: '设备类型', field: 'deviceType', minWidth: 130,
render: 'tag',
custom: {
1: 'primary',
2: 'primary'
},
replaceValue: {
1: '装置',
2: '监测点'
}
},
{ title: '供电公司', field: 'gdName', minWidth: 130 },
{ title: '变电站', field: 'subName', minWidth: 130 },
{ title: '设备名称', field: 'deviceName', minWidth: 130 },
{ title: '退役原因', field: 'propertyNo', minWidth: 130 },
{
title: '设备状态', field: 'deviceStatus', minWidth: 130,
render: 'tag',
custom: {
0: 'success',
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info'
},
replaceValue: {
0: '运行',
1: '检修',
2: '停运',
3: '调试',
4: '退运'
}
},
{
field: 'status', title: '审核状态', minWidth: 100,
render: 'tag',
custom: {
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{ field: 'createTime', title: '开始时间', minWidth: 170 },
{
title: '操作',
align: 'center',
minWidth: '150',
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleAudit(row.processInstanceId,row.historyInstanceId)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.status !== 3
},
click: row => {
deviceQuitPopup.value.open('重新发起退运', 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: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
//新增退运设备信息
const add = () => {
deviceQuitPopup.value.open('新增退运')
}
/** 流程实例详情 */
const handleAudit = (instanceId: string,historyInstanceId:string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelQuitRunningDevice(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
</script>