Files
admin-sjzx/src/views/pqs/runManage/assessment/components/uese/index.vue

298 lines
11 KiB
Vue
Raw Normal View History

2025-03-25 10:20:24 +08:00
<template>
<div>
<div>
2025-06-17 15:48:22 +08:00
<TableHeader ref="TableHeaderRef" area showExport>
2025-03-25 10:20:24 +08:00
<template #select>
2025-06-17 15:48:22 +08:00
<!-- <el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.deptId" clearable placeholder="请选择所在地市">
2025-03-25 10:20:24 +08:00
<el-option
v-for="item in areaOptionList"
:key="item.id"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
2025-06-17 15:48:22 +08:00
</el-form-item> -->
2025-03-25 10:20:24 +08:00
<el-form-item label="用户名称">
<el-input
placeholder="请输入用户名称"
2025-06-17 15:48:22 +08:00
v-model="tableStore.table.params.assessName"
2025-03-25 10:20:24 +08:00
clearable
show-word-limit
maxlength="32"
2025-03-25 10:20:24 +08:00
></el-input>
</el-form-item>
<el-form-item label="接入变电站">
<el-input
placeholder="请输入接入变电站"
2025-06-17 15:48:22 +08:00
v-model="tableStore.table.params.powerstationName"
2025-03-25 10:20:24 +08:00
clearable
show-word-limit
maxlength="32"
2025-03-25 10:20:24 +08:00
></el-input>
</el-form-item>
<el-form-item label="电站电压等级">
2025-06-17 15:48:22 +08:00
<el-select
v-model="tableStore.table.params.powerstationScaleList"
multiple
collapse-tags
collapse-tags-tooltip
filterable
clearable
style="width: 240px"
placeholder="请选择电站电压等级"
>
2025-03-25 10:20:24 +08:00
<el-option
v-for="item in voltageleveloption"
:key="item.id"
:label="item.name"
2025-09-03 18:26:19 +08:00
:value="item.id"
2025-03-25 10:20:24 +08:00
></el-option>
</el-select>
</el-form-item>
2025-06-17 15:48:22 +08:00
<el-form-item label="母线电压等级">
<el-select
v-model="tableStore.table.params.busScaleList"
multiple
collapse-tags
collapse-tags-tooltip
filterable
2025-03-25 10:20:24 +08:00
clearable
2025-06-17 15:48:22 +08:00
style="width: 240px"
placeholder="请选择母线电压等级"
>
<el-option
v-for="item in voltageleveloption"
:key="item.id"
:label="item.name"
2025-09-03 18:26:19 +08:00
:value="item.id"
2025-06-17 15:48:22 +08:00
></el-option>
</el-select>
</el-form-item>
<el-form-item label="用户负荷类型">
<el-select
v-model="tableStore.table.params.isWindfarm"
filterable
clearable
style="width: 240px"
placeholder="请选择用户负荷类型"
>
<el-option label="风电场" value="01"></el-option>
<el-option label="光伏" value="02"></el-option>
<el-option label="其他" value="03"></el-option>
</el-select>
2025-03-25 10:20:24 +08:00
</el-form-item>
</template>
<template #operation>
2025-03-25 10:57:52 +08:00
<el-button icon="el-icon-Plus" type="primary" @click="addForm">新增</el-button>
2025-06-17 15:48:22 +08:00
<el-button type="primary" icon="el-icon-Delete" @click="del">删除</el-button>
2025-03-25 10:20:24 +08:00
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
2025-06-17 15:48:22 +08:00
import { cableList, batchDel } from '@/api/advance-boot/assess'
2025-03-25 10:57:52 +08:00
import { useRouter } from 'vue-router'
2025-08-26 11:07:11 +08:00
import Form from './form.vue'
2025-12-29 19:44:17 +08:00
import { selectUserList, bindAssessmentId } from '@/api/device-boot/Business'
import { forEach } from 'min-dash'
defineOptions({
name: 'runManage/addUser'
})
2025-03-25 10:57:52 +08:00
const { push } = useRouter()
2025-03-25 10:20:24 +08:00
const dictData = useDictData()
const areaOptionList = dictData.getBasicData('jibei_area')
2025-06-17 15:48:22 +08:00
const linetypeList = ref([])
2025-03-25 10:20:24 +08:00
//字典获取电压等级
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
const tableStore: any = new TableStore({
2025-06-17 15:48:22 +08:00
url: '/advance-boot/assessUser/page',
method: 'POST',
2025-03-25 10:20:24 +08:00
publicHeight: 65,
column: [
2025-06-17 15:48:22 +08:00
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 80,
field: 'name',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
2025-06-17 15:48:22 +08:00
{ field: 'deptName', title: '所属地市', minWidth: 100 },
{ field: 'assessName', title: '用户名称', minWidth: 180 },
{ field: 'powerstationName', title: '接入变电站', minWidth: 180 },
{
field: 'powerstationScale',
title: '电站电压等级',
minWidth: 180,
formatter: (row: any) => {
return voltageleveloption.find((item: any) => item.id === row.cellValue)?.name
}
},
{ field: 'busName', title: '接入母线', minWidth: 180 },
{
field: 'busScale',
title: '母线电压等级',
minWidth: 180,
formatter: (row: any) => {
return voltageleveloption.find((item: any) => item.id === row.cellValue)?.name
}
},
{ field: 'powersupplyCapacity', title: '供电设备容量(MVA)', minWidth: 180 },
{ field: 'minshortcircuitCapacity', title: '最小短路容量(MVA)', minWidth: 180 },
{ field: 'agreedCapacity', title: '用户协议容量(MVA)', minWidth: 180 },
{ field: 'lineName', title: 'PCC点名称', minWidth: 180 },
{
field: 'linetypeId',
title: '导线类型',
minWidth: 180,
formatter: (row: any) => {
return linetypeList.value.find((item: any) => item.linetypeId === row.cellValue)?.linetypeName
}
},
{ field: 'lineLen', title: '长度(km)', minWidth: 180 },
{ field: 'lineNum', title: '回路数', minWidth: 180 },
{
field: 'isWindfarm',
title: '用户负荷类型',
minWidth: 180,
formatter: (row: any) => {
return row.cellValue == '01' ? '风电场' : row.cellValue == '02' ? '光伏' : '其他'
}
},
2025-08-26 11:07:11 +08:00
{ field: 'windfarmCapacity', title: '风电场装机容量(MW)', minWidth: 180 },
2025-06-17 15:48:22 +08:00
{
field: 'singleLoad',
title: '是否单相负荷',
minWidth: 180,
formatter: (row: any) => {
return row.cellValue == '00' ? '是' : '否'
}
},
// { field: 'name13', title: '单相负荷', minWidth: 180 },
2025-03-25 10:20:24 +08:00
{
title: '操作',
width: '220',
render: 'buttons',
fixed: 'right',
2025-03-25 10:20:24 +08:00
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
2025-06-17 15:48:22 +08:00
click: async row => {
push({
path: 'addUser',
query: {
id: row.assessId
}
})
}
2025-03-25 10:20:24 +08:00
},
{
name: 'edit',
title: '查看',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
2025-08-26 11:07:11 +08:00
click: async row => {
push({
path: 'addUser',
query: {
id: row.assessId,
mode: 'view'
}
})
}
2025-03-25 10:20:24 +08:00
}
]
}
],
2025-06-17 15:48:22 +08:00
beforeSearchFun: () => {
2025-12-29 19:44:17 +08:00
tableStore.table.params.deptId = tableStore.table.params.deptIndex
2025-06-17 15:48:22 +08:00
},
2025-03-25 10:20:24 +08:00
2025-12-29 19:44:17 +08:00
loadCallback: () => {}
2025-03-25 10:20:24 +08:00
})
2025-06-17 15:48:22 +08:00
tableStore.table.params.assessName = ''
tableStore.table.params.deptId = ''
tableStore.table.params.powerstationName = ''
tableStore.table.params.busScaleList = []
tableStore.table.params.isWindfarm = ''
tableStore.table.params.powerstationScaleList = []
2025-03-25 10:20:24 +08:00
provide('tableStore', tableStore)
2025-08-26 11:07:11 +08:00
const route = useRoute()
// 监听路由变化
watch(
() => route.query,
2025-12-29 19:44:17 +08:00
newQuery => {
2025-08-26 11:07:11 +08:00
tableStore.index()
2025-12-29 19:44:17 +08:00
}
2025-09-03 18:26:19 +08:00
// { immediate: true }
2025-08-26 11:07:11 +08:00
)
2025-03-25 10:57:52 +08:00
// 新增评估用户页面
const addForm = () => {
push({
2025-06-17 15:48:22 +08:00
path: 'addUser'
})
}
const Info = () => {
cableList({}).then(res => {
linetypeList.value = res.data
2025-03-25 10:57:52 +08:00
})
}
2025-06-17 15:48:22 +08:00
//删除
const del = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
2025-12-29 19:44:17 +08:00
let ids = tableStore.table.selection.map(item => item.assessId)
batchDel(ids).then(res => {
2025-06-17 15:48:22 +08:00
ElMessage({
type: 'success',
message: '删除成功!'
})
2025-12-29 19:44:17 +08:00
ids.forEach(item => {
bindAssessmentId({
userReportId: item,
assessMentId: null
})
})
2025-06-17 15:48:22 +08:00
tableStore.index()
})
})
}
}
2025-03-25 10:20:24 +08:00
onMounted(() => {
tableStore.index()
2025-06-17 15:48:22 +08:00
Info()
2025-03-25 10:20:24 +08:00
})
</script>