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