设备退运工作流完成
This commit is contained in:
@@ -1,7 +1,108 @@
|
||||
<template>
|
||||
<!--工作流view的路径:/pqs/supervise/retire/detail-->
|
||||
<h1>详细信息回显</h1>
|
||||
<!--工作流view的路径:/pqs/supervise/retire/detail-->
|
||||
<div class='default-main'>
|
||||
<!-- <h1>详细信息回显</h1>-->
|
||||
<el-descriptions :column='2' border>
|
||||
<el-descriptions-item label='供电公司'>
|
||||
{{ detailData.gdName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label='变电站'>
|
||||
{{ detailData.subName }}
|
||||
</el-descriptions-item>
|
||||
<template v-if='detailData.deviceType == 1'>
|
||||
<el-descriptions-item label='设备名称'>
|
||||
{{ detailData.deviceName }}
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-descriptions-item label='母线'>
|
||||
{{ detailData.volName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label='监测点'>
|
||||
{{ detailData.deviceName }}
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
<el-descriptions-item label='运行状态'>
|
||||
<el-tag :type='getDeviceStatusType(detailData.deviceStatus)'>
|
||||
{{ getDeviceStatus(detailData.deviceStatus) }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label='资产编号'>
|
||||
{{ detailData.propertyNo }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { onMounted, ref } from 'vue'
|
||||
|
||||
defineOptions({ name: 'QuitRunningDeviceDetail' })
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { getRunningDeviceById } from '@/api/supervision-boot/device/quitRunningDev'
|
||||
|
||||
const { query } = useRoute() // 查询参数
|
||||
|
||||
const props = defineProps({
|
||||
id: propTypes.string.def(undefined)
|
||||
})
|
||||
const detailLoading = ref(false) // 表单的加载中
|
||||
const detailData = ref({}) // 详情数据
|
||||
const queryId = query.id// 从 URL 传递过来的 id 编号
|
||||
const getDeviceStatus = (status: number) => {
|
||||
if (status === 0) {
|
||||
return '运行'
|
||||
}
|
||||
if (status === 1) {
|
||||
return '检修'
|
||||
}
|
||||
if (status === 2) {
|
||||
return '停运'
|
||||
}
|
||||
if (status === 3) {
|
||||
return '调试'
|
||||
}
|
||||
if (status === 4) {
|
||||
return '退运'
|
||||
}
|
||||
return '运行'
|
||||
}
|
||||
|
||||
const getDeviceStatusType = (status: number) => {
|
||||
if (status === 0) {
|
||||
return 'success'
|
||||
}
|
||||
if (status === 1) {
|
||||
return 'warning'
|
||||
}
|
||||
if (status === 2) {
|
||||
return 'danger'
|
||||
}
|
||||
if (status === 3) {
|
||||
return 'warning'
|
||||
}
|
||||
if (status === 4) {
|
||||
return 'info'
|
||||
}
|
||||
return 'success'
|
||||
}
|
||||
|
||||
/** 获得数据 */
|
||||
const getInfo = async () => {
|
||||
detailLoading.value = true
|
||||
try {
|
||||
// detailData.value = await LeaveApi.getLeave()
|
||||
await getRunningDeviceById(props.id || queryId).then(res => {
|
||||
detailData.value = res.data
|
||||
})
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
defineExpose({ open: getInfo }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getInfo()
|
||||
})
|
||||
|
||||
</script>
|
||||
@@ -1,35 +1,23 @@
|
||||
<template>
|
||||
<el-dialog draggable class='cn-operate-dialog' v-model='dialogVisible' :title='title'
|
||||
style='max-width: 450px;height: 320px' top="30vh">
|
||||
style='max-width: 450px;height: 320px' 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'>
|
||||
<el-radio border label='1'>设备</el-radio>
|
||||
<el-radio border label='2'>监测点</el-radio>
|
||||
<el-radio-group v-model='formData.deviceType' @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 label='设备' prop='deviceId'>
|
||||
<!-- <el-select-->
|
||||
<!-- v-model='formData.deviceId'-->
|
||||
<!-- clearable-->
|
||||
<!-- placeholder='请选择设备'-->
|
||||
<!-- style='width: 100%'-->
|
||||
<!-- >-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for='category in categoryList'-->
|
||||
<!-- :key='category.id'-->
|
||||
<!-- :label='category.name'-->
|
||||
<!-- :value='category.id'-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<el-tree-select
|
||||
v-model="value"
|
||||
:data="data"
|
||||
v-model='formData.deviceId'
|
||||
:data='data'
|
||||
filterable
|
||||
style="width: 240px"
|
||||
:default-expand-all='true'
|
||||
style='width: 260px'
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
@@ -57,90 +45,15 @@
|
||||
import { ref, inject, reactive, nextTick } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import TableStore from '@/utils/tableStore' // 若不是列表页面弹框可删除
|
||||
import { getFormSimpleList } from '@/api/bpm-boot/form'
|
||||
import { getCategorySimpleList } from '@/api/bpm-boot/category'
|
||||
import { addModel, updateModel } from '@/api/bpm-boot/model'
|
||||
import { getTerminalSelectTree } from '@/api/device-boot/Business'
|
||||
import { addRunningDevice } from '@/api/supervision-boot/device/quitRunningDev'
|
||||
|
||||
|
||||
const value = ref()
|
||||
|
||||
const sourceData = [
|
||||
{
|
||||
value: '1',
|
||||
label: 'Level one 1',
|
||||
children: [
|
||||
{
|
||||
value: '1-1',
|
||||
label: 'Level two 1-1',
|
||||
children: [
|
||||
{
|
||||
value: '1-1-1',
|
||||
label: 'Level three 1-1-1',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: 'Level one 2',
|
||||
children: [
|
||||
{
|
||||
value: '2-1',
|
||||
label: 'Level two 2-1',
|
||||
children: [
|
||||
{
|
||||
value: '2-1-1',
|
||||
label: 'Level three 2-1-1',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: '2-2',
|
||||
label: 'Level two 2-2',
|
||||
children: [
|
||||
{
|
||||
value: '2-2-1',
|
||||
label: 'Level three 2-2-1',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: 'Level one 3',
|
||||
children: [
|
||||
{
|
||||
value: '3-1',
|
||||
label: 'Level two 3-1',
|
||||
children: [
|
||||
{
|
||||
value: '3-1-1',
|
||||
label: 'Level three 3-1-1',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: '3-2',
|
||||
label: 'Level two 3-2',
|
||||
children: [
|
||||
{
|
||||
value: '3-2-1',
|
||||
label: 'Level three 3-2-1',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
const data = ref(sourceData)
|
||||
const filterMethod = (value) => {
|
||||
data.value = [...sourceData].filter((item) => item.label.includes(value))
|
||||
}
|
||||
const filterNodeMethod = (value, data) => data.label.includes(value)
|
||||
|
||||
//下拉数据源
|
||||
const sourceData = ref()
|
||||
const deviceList = ref()
|
||||
const lineList = ref()
|
||||
const data = ref()
|
||||
const title = ref('')
|
||||
const tableStore = inject('tableStore') as TableStore
|
||||
const formRef = ref()
|
||||
@@ -151,7 +64,7 @@ const formData = reactive({
|
||||
id: '',
|
||||
deviceId: '',
|
||||
deviceType: '',
|
||||
propertyNo: '',
|
||||
propertyNo: ''
|
||||
})
|
||||
|
||||
//form表单校验规则
|
||||
@@ -165,17 +78,21 @@ const resetForm = () => {
|
||||
}
|
||||
}
|
||||
|
||||
const open = async (text: string, data?: any) => {
|
||||
const open = async (text: string, tempData?: any) => {
|
||||
title.value = text
|
||||
//终端
|
||||
await getTerminalSelectTree(4)
|
||||
await getTerminalSelectTree(4).then(res => {
|
||||
deviceList.value = res.data
|
||||
})
|
||||
//监测点
|
||||
await getTerminalSelectTree(6)
|
||||
getTerminalSelectTree(6).then(res => {
|
||||
lineList.value = res.data
|
||||
})
|
||||
|
||||
if (data) {
|
||||
if (tempData) {
|
||||
// 表单赋值
|
||||
for (let key in formData) {
|
||||
formData[key] = data[key]
|
||||
formData[key] = tempData[key]
|
||||
}
|
||||
} else {
|
||||
resetForm()
|
||||
@@ -184,6 +101,8 @@ const open = async (text: string, data?: any) => {
|
||||
formData[key] = ''
|
||||
}
|
||||
formData.deviceType = '1'
|
||||
sourceData.value = deviceList.value
|
||||
data.value = deviceList.value
|
||||
}
|
||||
dialogVisible.value = true
|
||||
}
|
||||
@@ -196,12 +115,12 @@ const submit = () => {
|
||||
formRef.value.validate(async (valid: any) => {
|
||||
if (valid) {
|
||||
if (formData.id) {
|
||||
await updateModel(formData)
|
||||
// await updateModel(formData)
|
||||
ElMessage.success('更新成功')
|
||||
tableStore.index()
|
||||
dialogVisible.value = false
|
||||
} else {
|
||||
await addModel(formData).then(res => {
|
||||
await addRunningDevice(formData).then(res => {
|
||||
formData.id = res.data
|
||||
//查询进线数据,避免一直处于loading状态
|
||||
ElMessage.success('保存成功')
|
||||
@@ -214,6 +133,20 @@ const submit = () => {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备类型切换
|
||||
*/
|
||||
|
||||
const changeType = (event: any) => {
|
||||
if (event == 1) {
|
||||
sourceData.value = deviceList.value
|
||||
} else {
|
||||
sourceData.value = lineList.value
|
||||
}
|
||||
formData.deviceId = ''
|
||||
data.value = sourceData.value
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<!--待办事项列表-->
|
||||
<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>
|
||||
<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'>
|
||||
@@ -32,84 +32,118 @@ import { dateFormatter, formatPast2 } from '@/utils/formatTime'
|
||||
import DeviceQuitPopup from '@/views/pqs/supervise/retire/deviceQuitPopup.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'businessUser'
|
||||
name: 'businessUser'
|
||||
})
|
||||
const { push } = useRouter()
|
||||
const deviceQuitPopup = ref()
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/bpm-boot/bpm/task/doneList',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '序号', type: 'seq', width: 80 },
|
||||
{ title: '流程名称', field: 'processInstance.name', minWidth: 130 },
|
||||
{ title: '发起人', field: 'processInstance.startUser.name', minWidth: 130 },
|
||||
{ title: '发起部门', field: 'processInstance.startUser.deptName', minWidth: 130 },
|
||||
{ title: '当前任务', field: 'name', minWidth: 130 },
|
||||
{ title: '发起时间', field: 'createTime', minWidth: 170 },
|
||||
{ title: '结束时间', field: 'endTime', minWidth: 170 },
|
||||
{
|
||||
title: '审批状态', field: 'status', minWidth: 130,
|
||||
render: 'tag',
|
||||
custom: {
|
||||
1: 'primary',
|
||||
2: 'success',
|
||||
3: 'danger',
|
||||
4: 'warning'
|
||||
},
|
||||
replaceValue: {
|
||||
1: '审批中',
|
||||
2: '审批通过',
|
||||
3: '审批不通过',
|
||||
4: '已取消'
|
||||
}
|
||||
},
|
||||
{ title: '审批建议', field: 'reason', minWidth: 150 },
|
||||
{ title: '耗时(s)', field: 'durationInMillis', minWidth: 150,
|
||||
formatter: (obj: any) => {
|
||||
return formatPast2(obj.row.durationInMillis)
|
||||
} },
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
minWidth: '150',
|
||||
fixed: 'right',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
url: '/supervision-boot/quitRunningDevice/list',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '序号', type: 'seq', width: 80 },
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '流程历史',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
// handleAudit(row.processInstance.id)
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
for (let key in tableStore.table.params) {
|
||||
if (tableStore.table.params[key] === '') {
|
||||
delete tableStore.table.params[key]
|
||||
}
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
for (let key in tableStore.table.params) {
|
||||
if (tableStore.table.params[key] === '') {
|
||||
delete tableStore.table.params[key]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// 加载数据
|
||||
tableStore.index()
|
||||
// 加载数据
|
||||
tableStore.index()
|
||||
})
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
//新增退运设备信息
|
||||
const add = () => {
|
||||
deviceQuitPopup.value.open('新增退运')
|
||||
deviceQuitPopup.value.open('新增退运')
|
||||
}
|
||||
|
||||
/** 处理审批按钮 */
|
||||
const handleAudit = (instanceId: any) => {
|
||||
push({
|
||||
name: 'BpmProcessInstanceDetail',
|
||||
query: {
|
||||
id: instanceId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user