普测计划
This commit is contained in:
17
src/api/supervision-boot/survey/plan.ts
Normal file
17
src/api/supervision-boot/survey/plan.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
import { SUPERVISION_BOOT } from '@/utils/constantRequest'
|
||||
|
||||
const MAPPING_PATH = SUPERVISION_BOOT + '/surveyPlan'
|
||||
|
||||
|
||||
/**
|
||||
* 根据id获取普测计划的详细数据
|
||||
*/
|
||||
export const getPlanById = (id: string) => {
|
||||
return createAxios({
|
||||
url: MAPPING_PATH + '/getById?id=' + id,
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -85,8 +85,7 @@ const tableStore = new TableStore({
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
// planAddRef.value.open('查看计划', row)
|
||||
handleAudit(row.processInstanceId)
|
||||
handleAudit(row.processInstanceId,row.historyInstanceId)
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -178,17 +177,19 @@ const handleClose = () => {
|
||||
}
|
||||
|
||||
/** 处理审批按钮 */
|
||||
const handleAudit = (instanceId: any) => {
|
||||
const handleAudit = (instanceId: string,historyInstanceId:string) => {
|
||||
push({
|
||||
name: 'BpmProcessInstanceDetail',
|
||||
query: {
|
||||
id: instanceId
|
||||
state: {
|
||||
id: instanceId,
|
||||
historyInstanceId
|
||||
}
|
||||
})
|
||||
}
|
||||
// 取消
|
||||
|
||||
onMounted(() => {
|
||||
TableHeaderRef.value.setInterval(1)
|
||||
tableStore.index()
|
||||
getUserByRoleType(3).then(res => {
|
||||
auditList.value = res.data
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="add">新增计划</el-button>
|
||||
<!-- <el-button icon="el-icon-Download" type="primary" @click="exportFn">导出</el-button> -->
|
||||
</template>
|
||||
</TableHeader ref="tableRef">
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<!-- 新增 -->
|
||||
<planTest ref="planTestRef" @onsubmit="tableStore.index()" />
|
||||
@@ -50,9 +50,8 @@ const TableHeaderRef = ref()
|
||||
const auditList:any = ref([])
|
||||
const auditUser = ref('')
|
||||
|
||||
const ruleFormRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/generalSurvey/getSurvey',
|
||||
url: '/supervision-boot/surveyTest/surveyTestPage',
|
||||
publicHeight: 65,
|
||||
method: 'POST',
|
||||
column: [
|
||||
@@ -258,6 +257,7 @@ const handleAudit = (instanceId: any) => {
|
||||
// 取消
|
||||
|
||||
onMounted(() => {
|
||||
TableHeaderRef.value.setInterval(1)
|
||||
tableStore.index()
|
||||
getUserByRoleType(3).then(res => {
|
||||
auditList.value = res.data
|
||||
|
||||
@@ -1,71 +1,49 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<!-- <h1>详细信息回显</h1>-->
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="普测计划名称">
|
||||
<div class='default-main'>
|
||||
<el-descriptions :column='2' border>
|
||||
<el-descriptions-item label='普测计划名称'>
|
||||
{{ detailData?.planName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="计划负责人">
|
||||
{{ detailData?.leader }}
|
||||
<el-descriptions-item label='普测负责单位'>
|
||||
{{ detailData?.deptName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="计划开始时间">
|
||||
<el-descriptions-item label='计划开始时间'>
|
||||
{{ detailData?.planStartTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="计划结束时间">
|
||||
<el-descriptions-item label='计划结束时间'>
|
||||
{{ detailData?.planEndTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核状态">
|
||||
<el-tag :type="getDeviceStatusType(detailData?.status)">
|
||||
<el-descriptions-item label='审核状态'>
|
||||
<el-tag :type='getDeviceStatusType(detailData?.status)'>
|
||||
{{ getDeviceStatus(detailData?.status) }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="文件">
|
||||
<div v-for="(item, index) in aList">
|
||||
<el-icon>
|
||||
<Link />
|
||||
</el-icon>
|
||||
<a :href="item.url">
|
||||
{{ item.fileName }}
|
||||
</a>
|
||||
<!-- <el-button type="primary" link @click="downloadFile(item.url, item.fileName)">
|
||||
{{ item.fileName }}
|
||||
</el-button> -->
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div style="height: 300px">
|
||||
<div style='height: 300px'>
|
||||
<vxe-table
|
||||
v-bind="defaultAttribute"
|
||||
ref="vxeRef"
|
||||
class="mt10"
|
||||
height="auto"
|
||||
:data="detailData?.supervisionGeneralSurveyPlanDetailPOS"
|
||||
v-bind='defaultAttribute'
|
||||
ref='vxeRef'
|
||||
class='mt10'
|
||||
height='auto'
|
||||
:data='detailData?.surveySubstationList'
|
||||
>
|
||||
<vxe-column field="subName" title="变电站名称"></vxe-column>
|
||||
<vxe-column field="voltageLevel" title="变电站电压等级" :formatter="formatter"></vxe-column>
|
||||
<vxe-column field="measurementPointId" title="在线监测点ID">
|
||||
<template #default="{ row }">{{ row.measurementPointId ? row.measurementPointId : '/' }}</template>
|
||||
</vxe-column>
|
||||
|
||||
<vxe-column field="isSurvey" title="是否实现监测">
|
||||
<template #default="{ row }">{{ row.isSurvey === 1 ? '是' : '否' }}</template>
|
||||
</vxe-column>
|
||||
<vxe-column field='substationName' title='变电站名称'></vxe-column>
|
||||
<vxe-column field='voltageLevel' title='变电站电压等级' ></vxe-column>
|
||||
<vxe-column field='dataSource' title='变电站来源' :formatter='formatterSource'></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
<script setup lang='ts'>
|
||||
import { onMounted, ref } from 'vue'
|
||||
|
||||
defineOptions({ name: 'QuitRunningDeviceDetail' })
|
||||
import { propTypes } from '@/utils/propTypes'
|
||||
import { querySurveyDetail } from '@/api/process-boot/generalTest'
|
||||
import { getFileNameAndFilePath } from '@/api/system-boot/file'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { Link } from '@element-plus/icons-vue'
|
||||
const { query } = useRoute() // 查询参数
|
||||
import { getPlanById } from '@/api/supervision-boot/survey/plan'
|
||||
|
||||
const { query } = useRoute() // 查询参数
|
||||
const props = defineProps({
|
||||
id: propTypes.string.def(undefined)
|
||||
})
|
||||
@@ -73,37 +51,20 @@ const dictData = useDictData()
|
||||
const detailLoading = ref(false) // 表单的加载中
|
||||
const detailData: any = ref({}) // 详情数据
|
||||
const levelList = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
const aList: any = ref([]) // 详情数据
|
||||
const queryId = query.id // 从 URL 传递过来的 id 编号
|
||||
|
||||
/** 获得数据 */
|
||||
const getInfo = async () => {
|
||||
detailLoading.value = true
|
||||
try {
|
||||
await querySurveyDetail({ id: props.id || queryId }).then(res => {
|
||||
await getPlanById(props.id || queryId).then(res => {
|
||||
detailData.value = res.data
|
||||
aList.value = []
|
||||
let arr = res.data.filePath.split(',')
|
||||
|
||||
arr.slice(0, -1).forEach((item: any) => {
|
||||
getFileNameAndFilePath({ filePath: item }).then((res: any) => {
|
||||
aList.value.push(res.data)
|
||||
})
|
||||
})
|
||||
})
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
// 下载文件
|
||||
const downloadFile = (url: string, fileName: string) => {
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = fileName
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
}
|
||||
|
||||
const getDeviceStatus = (status: number) => {
|
||||
if (status === 1) {
|
||||
return '审批中'
|
||||
@@ -136,13 +97,28 @@ const getDeviceStatusType = (status: number) => {
|
||||
return 'success'
|
||||
}
|
||||
// 过滤数据
|
||||
const formatter = (row: any) => {
|
||||
if (row.column.field == 'voltageLevel') {
|
||||
return levelList.filter(item => item.id == row.cellValue)[0].name
|
||||
// const formatter = (row: any) => {
|
||||
// if (row.column.field == 'voltageLevel') {
|
||||
// debugger
|
||||
// return levelList.filter(item => item.id == row.cellValue)[0].name
|
||||
// } else {
|
||||
// return row.cellValue
|
||||
// }
|
||||
// }
|
||||
|
||||
const formatterSource = (row: any) => {
|
||||
if (row.column.field == 'dataSource') {
|
||||
if (row.cellValue == 0) {
|
||||
return '系统内台账变电站'
|
||||
} else {
|
||||
return '自定义变电站'
|
||||
}
|
||||
} else {
|
||||
return row.cellValue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
defineExpose({ open: getInfo }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 初始化 **/
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<TableHeader ref='TableHeaderRef'>
|
||||
<template #select>
|
||||
<el-form-item label='工程名称'>
|
||||
<el-form-item label='用户名称'>
|
||||
<el-input v-model='tableStore.table.params.projectName' clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label='所属地市'>
|
||||
@@ -57,7 +57,7 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'projectName', title: '工程名称', minWidth: 170 },
|
||||
{ field: 'projectName', title: '用户名称', minWidth: 170 },
|
||||
{ field: 'city', title: '所属地市', minWidth: 80 },
|
||||
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user