设备退运工作流完成
This commit is contained in:
29
src/api/supervision-boot/device/quitRunningDev.ts
Normal file
29
src/api/supervision-boot/device/quitRunningDev.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
import { SUPERVISION_BOOT } from '@/utils/constantRequest'
|
||||
|
||||
const MAPPING_PATH = SUPERVISION_BOOT + '/quitRunningDevice'
|
||||
|
||||
|
||||
/**
|
||||
* 新增设备退运
|
||||
*/
|
||||
export const addRunningDevice = (data: any) => {
|
||||
return createAxios({
|
||||
url: MAPPING_PATH + '/add',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据id获取设备的详细数据
|
||||
*/
|
||||
export const getRunningDeviceById = (id: any) => {
|
||||
return createAxios({
|
||||
url: MAPPING_PATH + '/getById?id='+id,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
@@ -1,65 +1,65 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="填报人">
|
||||
<div class='default-main'>
|
||||
<el-descriptions :column='2' border>
|
||||
<el-descriptions-item label='填报人'>
|
||||
{{ detailData.reporter }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="填报日期">
|
||||
<el-descriptions-item label='填报日期'>
|
||||
{{ formatDate(detailData.reportDate, 'YYYY-MM-DD') }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="填报部门">
|
||||
<el-descriptions-item label='填报部门'>
|
||||
{{ detailData.orgName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工程预期投产日期">
|
||||
<el-descriptions-item label='工程预期投产日期'>
|
||||
{{ formatDate(detailData.expectedProductionDate, 'YYYY-MM-DD') }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="用户性质">
|
||||
<el-descriptions-item label='用户性质'>
|
||||
{{
|
||||
userTypeList.find(item => {
|
||||
return item.value == detailData.userType
|
||||
})?.label
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属地市">
|
||||
<el-descriptions-item label='所属地市'>
|
||||
{{ detailData.city }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="归口管理部门">
|
||||
<el-descriptions-item label='归口管理部门'>
|
||||
{{ detailData.responsibleDepartment }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="用户状态">
|
||||
<el-descriptions-item label='用户状态'>
|
||||
{{
|
||||
userStateList.find(item => {
|
||||
return item.value == detailData.userStatus
|
||||
})?.label
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="变电站">
|
||||
<el-descriptions-item label='变电站'>
|
||||
{{ detailData.substation }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工程名">
|
||||
<el-descriptions-item label='工程名'>
|
||||
{{ detailData.projectName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="用户协议容量" v-if="detailData.userType == 0 || detailData.userType == 1">
|
||||
<el-descriptions-item label='用户协议容量' v-if='detailData.userType == 0 || detailData.userType == 1'>
|
||||
{{ proviteData.agreementCapacity }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="电压等级">
|
||||
<el-descriptions-item label='电压等级'>
|
||||
{{
|
||||
voltageLevelList.find(item => {
|
||||
return item.id == detailData.voltageLevel
|
||||
})?.name
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="非线性设备类型" v-if="detailData.userType == 0 || detailData.userType == 1">
|
||||
<el-descriptions-item label='非线性设备类型' v-if='detailData.userType == 0 || detailData.userType == 1'>
|
||||
{{ proviteData.nonlinearDeviceType ? proviteData.nonlinearDeviceType : '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预测评估单位">
|
||||
<el-descriptions-item label='预测评估单位'>
|
||||
{{ detailData.evaluationDept }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预测评估结论">
|
||||
<el-descriptions-item label='预测评估结论'>
|
||||
{{ detailData.evaluationConclusion }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
label="非线性负荷类型"
|
||||
label='非线性负荷类型'
|
||||
v-if="
|
||||
detailData.userType == '2' ||
|
||||
detailData.userType == '3' ||
|
||||
@@ -69,51 +69,51 @@
|
||||
>
|
||||
{{ proviteData.nonlinearLoadType }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="是否需要治理">
|
||||
<span v-if="detailData.userType == 0 || detailData.userType == 1">
|
||||
<el-descriptions-item label='是否需要治理'>
|
||||
<span v-if='detailData.userType == 0 || detailData.userType == 1'>
|
||||
{{ proviteData.needGovernance == 0 ? '否' : '是' }}
|
||||
</span>
|
||||
<span
|
||||
v-if="
|
||||
v-if='
|
||||
detailData.userType == 2 ||
|
||||
detailData.userType == 3 ||
|
||||
detailData.userType == 4 ||
|
||||
detailData.userType == 5
|
||||
"
|
||||
'
|
||||
>
|
||||
{{ proviteData.needGovernance == 0 ? '否' : '是' }}
|
||||
</span>
|
||||
<span v-if="detailData.userType == 6">{{ proviteData.needGovernance == 0 ? '否' : '是' }}</span>
|
||||
<span v-if='detailData.userType == 6'>{{ proviteData.needGovernance == 0 ? '否' : '是' }}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="是否开展背景测试">
|
||||
<span v-if="detailData.userType == 0 || detailData.userType == 1">
|
||||
<el-descriptions-item label='是否开展背景测试'>
|
||||
<span v-if='detailData.userType == 0 || detailData.userType == 1'>
|
||||
{{ proviteData.backgroundTestPerformed == 0 ? '否' : '是' }}
|
||||
</span>
|
||||
<span
|
||||
v-if="
|
||||
v-if='
|
||||
detailData.userType == 2 ||
|
||||
detailData.userType == 3 ||
|
||||
detailData.userType == 4 ||
|
||||
detailData.userType == 5
|
||||
"
|
||||
'
|
||||
>
|
||||
{{ proviteData.backgroundTestPerformed == 0 ? '否' : '是' }}
|
||||
</span>
|
||||
<span v-if="detailData.userType == 6">
|
||||
<span v-if='detailData.userType == 6'>
|
||||
{{ proviteData.backgroundTestPerformed == 0 ? '否' : '是' }}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="是否开展抗扰度测试" v-if="detailData.userType == 6">
|
||||
<el-descriptions-item label='是否开展抗扰度测试' v-if='detailData.userType == 6'>
|
||||
<span>
|
||||
{{ proviteData.antiInterferenceTest == 0 ? '否' : '是' }}
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="PCC点" v-if="detailData.userType != 0 && detailData.userType != 1">
|
||||
<el-descriptions-item label='PCC点' v-if='detailData.userType != 0 && detailData.userType != 1'>
|
||||
{{ proviteData?.pccPoint }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
label="PCC供电设备容量"
|
||||
label='PCC供电设备容量'
|
||||
v-if="
|
||||
detailData.userType == '2' ||
|
||||
detailData.userType == '3' ||
|
||||
@@ -124,7 +124,7 @@
|
||||
{{ proviteData.pccEquipmentCapacity }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
label="基准短路容量"
|
||||
label='基准短路容量'
|
||||
v-if="
|
||||
detailData.userType == '2' ||
|
||||
detailData.userType == '3' ||
|
||||
@@ -135,18 +135,18 @@
|
||||
{{ proviteData.baseShortCircuitCapacity }}
|
||||
</el-descriptions-item>
|
||||
{{ proviteData }}
|
||||
<el-descriptions-item label="评估类型" v-if="detailData.userType != 0 && detailData.userType != 1">
|
||||
<el-descriptions-item label='评估类型' v-if='detailData.userType != 0 && detailData.userType != 1'>
|
||||
{{
|
||||
evaluationTypeList.find(item => {
|
||||
return item.id == proviteData?.evaluationType
|
||||
})?.name
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预测评估评审单位" v-if="detailData.userType != 0 && detailData.userType != 1">
|
||||
<el-descriptions-item label='预测评估评审单位' v-if='detailData.userType != 0 && detailData.userType != 1'>
|
||||
{{ proviteData?.evaluationChekDept }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
label="系统最小短路容量"
|
||||
label='系统最小短路容量'
|
||||
v-if="
|
||||
detailData.userType == '2' ||
|
||||
detailData.userType == '3' ||
|
||||
@@ -157,7 +157,7 @@
|
||||
{{ proviteData?.minShortCircuitCapacity }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
label="用户用电协议容量"
|
||||
label='用户用电协议容量'
|
||||
v-if="
|
||||
detailData.userType == '2' ||
|
||||
detailData.userType == '3' ||
|
||||
@@ -167,96 +167,112 @@
|
||||
>
|
||||
{{ proviteData?.userAgreementCapacity }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="行业" v-if="detailData.userType == 6">
|
||||
<el-descriptions-item label='行业' v-if='detailData.userType == 6'>
|
||||
{{
|
||||
industryList.find(item => {
|
||||
return item.id == proviteData.industry
|
||||
})?.name
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="敏感装置名称" v-if="detailData.userType == 6">
|
||||
<el-descriptions-item label='敏感装置名称' v-if='detailData.userType == 6'>
|
||||
{{ proviteData.deviceName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="供电电源数量" v-if="detailData.userType == 6">
|
||||
<el-descriptions-item label='供电电源数量' v-if='detailData.userType == 6'>
|
||||
{{ proviteData.powerSupplyCount }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="敏感电能质量指标" v-if="detailData.userType == 6">
|
||||
<el-descriptions-item label='敏感电能质量指标' v-if='detailData.userType == 6'>
|
||||
{{
|
||||
energyQualityIndexList.find(item => {
|
||||
return item.id == proviteData.energyQualityIndex
|
||||
})?.name
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="可研报告">
|
||||
<span v-if="detailData.userType == 0 || detailData.userType == 1">
|
||||
<el-descriptions-item label='可研报告'>
|
||||
<span v-if='detailData.userType == 0 || detailData.userType == 1'>
|
||||
<el-icon><Link /></el-icon>
|
||||
<a :href="proviteData.feasibilityReport.url">{{ proviteData.feasibilityReport.name }}</a>
|
||||
<a :href='proviteData.feasibilityReport.url'>{{ proviteData.feasibilityReport.name }}</a>
|
||||
</span>
|
||||
<span
|
||||
v-if="
|
||||
v-if='
|
||||
detailData.userType == 2 ||
|
||||
detailData.userType == 3 ||
|
||||
detailData.userType == 4 ||
|
||||
detailData.userType == 5
|
||||
"
|
||||
'
|
||||
>
|
||||
<el-icon><Link /></el-icon>
|
||||
<a :href="proviteData.feasibilityReport.url">{{ proviteData.feasibilityReport.name }}</a>
|
||||
<a :href='proviteData.feasibilityReport.url'>{{ proviteData.feasibilityReport.name }}</a>
|
||||
</span>
|
||||
<span v-if="detailData.userType == 6">
|
||||
<span v-if='detailData.userType == 6'>
|
||||
<el-icon><Link /></el-icon>
|
||||
<a :href="proviteData.feasibilityReport.url">{{ proviteData.feasibilityReport.name }}</a>
|
||||
<a :href='proviteData.feasibilityReport.url'>{{ proviteData.feasibilityReport.name }}</a>
|
||||
</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="项目初步设计说明书">
|
||||
<el-icon><Link /></el-icon>
|
||||
<a :href="proviteData?.preliminaryDesignDescription.url">
|
||||
<el-descriptions-item label='项目初步设计说明书'>
|
||||
<el-icon>
|
||||
<Link />
|
||||
</el-icon>
|
||||
<a :href='proviteData?.preliminaryDesignDescription.url'>
|
||||
{{ proviteData?.preliminaryDesignDescription.name }}
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预测评估报告">
|
||||
<el-icon><Link /></el-icon>
|
||||
<a :href="proviteData?.predictionEvaluationReport.url">
|
||||
<el-descriptions-item label='预测评估报告'>
|
||||
<el-icon>
|
||||
<Link />
|
||||
</el-icon>
|
||||
<a :href='proviteData?.predictionEvaluationReport.url'>
|
||||
{{ proviteData?.predictionEvaluationReport.name }}
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预测评估评审意见报告">
|
||||
<el-icon><Link /></el-icon>
|
||||
<a :href="proviteData?.predictionEvaluationReviewOpinions.url">
|
||||
<el-descriptions-item label='预测评估评审意见报告'>
|
||||
<el-icon>
|
||||
<Link />
|
||||
</el-icon>
|
||||
<a :href='proviteData?.predictionEvaluationReviewOpinions.url'>
|
||||
{{ proviteData?.predictionEvaluationReviewOpinions.name }}
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
label="用户接入变电站主接线示意图"
|
||||
v-if="detailData.userType != 0 && detailData.userType != 1"
|
||||
label='用户接入变电站主接线示意图'
|
||||
v-if='detailData.userType != 0 && detailData.userType != 1'
|
||||
>
|
||||
<el-icon><Link /></el-icon>
|
||||
<a :href="proviteData?.substationMainWiringDiagram.url">
|
||||
<el-icon>
|
||||
<Link />
|
||||
</el-icon>
|
||||
<a :href='proviteData?.substationMainWiringDiagram.url'>
|
||||
{{ proviteData?.substationMainWiringDiagram.name }}
|
||||
</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="主要敏感设备清单" v-if="detailData.userType == 6">
|
||||
<el-icon><Link /></el-icon>
|
||||
<a :href="proviteData?.sensitiveDevices.url">{{ proviteData?.sensitiveDevices.name }}</a>
|
||||
<el-descriptions-item label='主要敏感设备清单' v-if='detailData.userType == 6'>
|
||||
<el-icon>
|
||||
<Link />
|
||||
</el-icon>
|
||||
<a :href='proviteData?.sensitiveDevices.url'>{{ proviteData?.sensitiveDevices.name }}</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="抗扰度测试报告" v-if="detailData.userType == 6">
|
||||
<el-icon><Link /></el-icon>
|
||||
<a :href="proviteData?.antiInterferenceReport.url">{{ proviteData?.antiInterferenceReport.name }}</a>
|
||||
<el-descriptions-item label='抗扰度测试报告' v-if='detailData.userType == 6'>
|
||||
<el-icon>
|
||||
<Link />
|
||||
</el-icon>
|
||||
<a :href='proviteData?.antiInterferenceReport.url'>{{ proviteData?.antiInterferenceReport.name }}</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="背景电能质量测试报告" v-if="detailData.userType == 6">
|
||||
<el-icon><Link /></el-icon>
|
||||
<a :href="proviteData?.powerQualityReport.url">{{ proviteData?.powerQualityReport.name }}</a>
|
||||
<el-descriptions-item label='背景电能质量测试报告' v-if='detailData.userType == 6'>
|
||||
<el-icon>
|
||||
<Link />
|
||||
</el-icon>
|
||||
<a :href='proviteData?.powerQualityReport.url'>{{ proviteData?.powerQualityReport.name }}</a>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="其他附件">
|
||||
<el-icon><Link /></el-icon>
|
||||
<a :href="proviteData?.additionalAttachments.url">{{ proviteData?.additionalAttachments.name }}</a>
|
||||
<el-descriptions-item label='其他附件'>
|
||||
<el-icon>
|
||||
<Link />
|
||||
</el-icon>
|
||||
<a :href='proviteData?.additionalAttachments.url'>{{ proviteData?.additionalAttachments.name }}</a>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, provide, ref, getCurrentInstance, reactive, watch, unref, nextTick } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
<script lang='ts' setup>
|
||||
import { onMounted, ref, reactive } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { getUserReportById } from '@/api/supervision-boot/userReport/form'
|
||||
@@ -264,12 +280,13 @@ import { getDictTreeById } from '@/api/system-boot/dictTree'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { getFileNameAndFilePath } from '@/api/system-boot/file'
|
||||
import { Link } from '@element-plus/icons-vue'
|
||||
|
||||
defineOptions({ name: 'BpmUserReportDetail' })
|
||||
|
||||
const { query } = useRoute() // 查询参数
|
||||
|
||||
const props = defineProps({
|
||||
id: propTypes.number.def(undefined)
|
||||
id: propTypes.string.def(undefined)
|
||||
})
|
||||
const detailLoading = ref(false) // 表单的加载中
|
||||
const detailData = ref<any>({}) // 详情数据
|
||||
@@ -501,11 +518,12 @@ onMounted(() => {
|
||||
getInfo()
|
||||
})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
<style lang='scss'>
|
||||
.default-main {
|
||||
height: calc(100vh - 100px);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
::v-deep.el-icon svg {
|
||||
margin: 5px !important;
|
||||
position: absolute !important;
|
||||
|
||||
@@ -46,11 +46,7 @@ const { push } = useRouter()
|
||||
|
||||
const TableHeaderRef = ref()
|
||||
const tableRef = ref()
|
||||
const interferenceType = dictData.getBasicData('Interference_Source')
|
||||
const areaOptionList = dictData.getBasicData('jibei_area')
|
||||
|
||||
const istatusList = dictData.getBasicData('On-network_Status')
|
||||
|
||||
const addRef = ref()
|
||||
const AuditRef = ref()
|
||||
const ruleFormRef = ref()
|
||||
|
||||
@@ -1,7 +1,108 @@
|
||||
<template>
|
||||
<!--工作流view的路径:/pqs/supervise/retire/detail-->
|
||||
<h1>详细信息回显</h1>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -38,18 +38,46 @@ const { push } = useRouter()
|
||||
const deviceQuitPopup = ref()
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/bpm-boot/bpm/task/doneList',
|
||||
url: '/supervision-boot/quitRunningDevice/list',
|
||||
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,
|
||||
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',
|
||||
@@ -64,11 +92,8 @@ const tableStore = new TableStore({
|
||||
4: '已取消'
|
||||
}
|
||||
},
|
||||
{ title: '审批建议', field: 'reason', minWidth: 150 },
|
||||
{ title: '耗时(s)', field: 'durationInMillis', minWidth: 150,
|
||||
formatter: (obj: any) => {
|
||||
return formatPast2(obj.row.durationInMillis)
|
||||
} },
|
||||
{ field: 'createTime', title: '开始时间', minWidth: 170 },
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
@@ -78,12 +103,12 @@ const tableStore = new TableStore({
|
||||
buttons: [
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '流程历史',
|
||||
title: '流程详情',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
// handleAudit(row.processInstance.id)
|
||||
handleAudit(row.processInstanceId)
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -111,5 +136,14 @@ const add = () => {
|
||||
deviceQuitPopup.value.open('新增退运')
|
||||
}
|
||||
|
||||
/** 处理审批按钮 */
|
||||
const handleAudit = (instanceId: any) => {
|
||||
push({
|
||||
name: 'BpmProcessInstanceDetail',
|
||||
query: {
|
||||
id: instanceId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -321,8 +321,7 @@ const getProcessInstance = async () => {
|
||||
})
|
||||
} else {
|
||||
// 注意:data.processDefinition.formCustomViewPath 是组件的全路径,例如说:/crm/contract/detail/index.vue
|
||||
// BusinessFormComponent.value = registerComponent(data.processDefinition.formCustomViewPath)
|
||||
BusinessFormComponent.value = registerComponent('/pqs/supervise/interfere/components/undocumented/detail')
|
||||
BusinessFormComponent.value = registerComponent(data.processDefinition.formCustomViewPath)
|
||||
}
|
||||
|
||||
// 加载流程图
|
||||
|
||||
Reference in New Issue
Block a user