修改表格操作列

This commit is contained in:
guanj
2026-01-20 14:18:41 +08:00
parent a19952b771
commit 6a112c8ae2
143 changed files with 17745 additions and 17546 deletions

View File

@@ -1,72 +1,115 @@
import createAxios from '@/utils/request'
//事件报告
export function getEventReport(data) {
return createAxios({
url: '/event-boot/report/getEventReport',
method: 'post',
data
})
}
// 生成报告
export function getAreaReport(data) {
return createAxios({
url: '/event-boot/report/getAreaReport',
method: 'post',
data,
responseType: 'blob'
})
}
//查询所有模板
export function getList(data) {
return createAxios({
url: '/system-boot/EventTemplate/getList',
method: 'post',
data
})
}
export function selectReleation(data) {
return createAxios({
url: '/system-boot/EventTemplate/selectReleation',
method: 'post',
params: data
})
}
export function getLineExport(data) {
return createAxios({
url: '/event-boot/report/getLineExport',
method: 'post',
data: data,
responseType: 'blob'
})
}
export function getVoltage(data: any) {
return createAxios({
url: '/event-boot/report/getVoltage',
method: 'post',
data
})
}
export function getGeneralSituation(data: any) {
return createAxios({
url: '/event-boot/report/getGeneralSituation',
method: 'post',
data
})
}
export function getTransientValue(data: any) {
return createAxios({
url: '/event-boot/transient/getTransientValue',
method: 'post',
data
})
}
// 周报导出
export function getExport(data: any) {
return createAxios({
url: '/event-boot/report/getExport',
method: 'post',
data,
responseType: 'blob'
})
}
import createAxios from '@/utils/request'
import { genFileId, ElMessage, ElNotification } from 'element-plus'
//事件报告
export function getEventReport(data) {
return createAxios({
url: '/event-boot/report/getEventReport',
method: 'post',
data
})
}
// 生成报告
export function getAreaReport(data) {
return createAxios({
url: '/event-boot/report/getAreaReport',
method: 'post',
data,
responseType: 'blob'
}).then(async res => {
let load: any = await readJsonBlob(res)
if (load.code) {
if (load.data.code == 'A0011') {
ElMessage.warning('下载失败!')
} else {
ElMessage.warning(load.data.message)
}
} else {
return res
}
})
}
async function readJsonBlob(blob) {
try {
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
const jsonStr = await blob.text()
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
const jsonData = JSON.parse(jsonStr)
// 3. 拿到数据,后续随便用
return {
code: true,
data: jsonData
}
} catch (err) {
return {
code: false,
data: {}
}
// console.error('解析Blob的JSON数据失败', err)
}
}
//查询所有模板
export function getList(data) {
return createAxios({
url: '/system-boot/EventTemplate/getList',
method: 'post',
data
})
}
export function selectReleation(data) {
return createAxios({
url: '/system-boot/EventTemplate/selectReleation',
method: 'post',
params: data
})
}
export function getLineExport(data) {
return createAxios({
url: '/event-boot/report/getLineExport',
method: 'post',
data: data,
responseType: 'blob'
}).then(async res => {
let load: any = await readJsonBlob(res)
if (load.code) {
if (load.data.code == 'A0011') {
ElMessage.warning('下载失败!')
} else {
ElMessage.warning(load.data.message)
}
} else {
return res
}
})
}
export function getVoltage(data: any) {
return createAxios({
url: '/event-boot/report/getVoltage',
method: 'post',
data
})
}
export function getGeneralSituation(data: any) {
return createAxios({
url: '/event-boot/report/getGeneralSituation',
method: 'post',
data
})
}
export function getTransientValue(data: any) {
return createAxios({
url: '/event-boot/transient/getTransientValue',
method: 'post',
data
})
}
// 周报导出
export function getExport(data: any) {
return createAxios({
url: '/event-boot/report/getExport',
method: 'post',
data,
responseType: 'blob'
})
}

View File

@@ -1,18 +1,48 @@
import request from '@/utils/request'
export function getHistoryResult(data: any) {
return request({
url: '/harmonic-boot/harmonic/getHistoryResult',
method: 'post',
data: data
})
}
// word报告
export function exportModelJB(data: any) {
return request({
url: '/harmonic-boot/exportmodel/exportModelJB',
method: 'post',
responseType: 'blob',
data: data
})
}
import request from '@/utils/request'
import { genFileId, ElMessage, ElNotification } from 'element-plus'
export function getHistoryResult(data: any) {
return request({
url: '/harmonic-boot/harmonic/getHistoryResult',
method: 'post',
data: data
})
}
// word报告
export function exportModelJB(data: any) {
return request({
url: '/harmonic-boot/exportmodel/exportModelJB',
method: 'post',
responseType: 'blob',
data: data
}).then(async res => {
let load: any = await readJsonBlob(res)
if (load.code) {
if (load.data.code == 'A0011') {
ElMessage.warning('下载失败!')
} else {
ElMessage.warning(load.data.message)
}
} else {
return res
}
})
}
async function readJsonBlob(blob) {
try {
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
const jsonStr = await blob.text()
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
const jsonData = JSON.parse(jsonStr)
// 3. 拿到数据,后续随便用
return {
code: true,
data: jsonData
}
} catch (err) {
return {
code: false,
data: {}
}
// console.error('解析Blob的JSON数据失败', err)
}
}

View File

@@ -1,4 +1,5 @@
import createAxios from '@/utils/request'
import { genFileId, ElMessage, ElNotification } from 'element-plus'
export function exportModel(data: any) {
return createAxios({
@@ -6,6 +7,17 @@ export function exportModel(data: any) {
method: 'post',
data: data,
responseType: 'blob'
}).then(async res => {
let load: any = await readJsonBlob(res)
if (load.code) {
if (load.data.code == 'A0011') {
ElMessage.warning('下载失败!')
} else {
ElMessage.warning(load.data.message)
}
} else {
return res
}
})
}
export function areaHarmonicReport(data: any) {
@@ -14,5 +26,35 @@ export function areaHarmonicReport(data: any) {
method: 'post',
data: data,
responseType: 'blob'
}).then(async res => {
let load: any = await readJsonBlob(res)
if (load.code) {
if (load.data.code == 'A0011') {
ElMessage.warning('下载失败!')
} else {
ElMessage.warning(load.data.message)
}
} else {
return res
}
})
}
async function readJsonBlob(blob) {
try {
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
const jsonStr = await blob.text()
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
const jsonData = JSON.parse(jsonStr)
// 3. 拿到数据,后续随便用
return {
code: true,
data: jsonData
}
} catch (err) {
return {
code: false,
data: {}
}
// console.error('解析Blob的JSON数据失败', err)
}
}

View File

@@ -1,176 +1,176 @@
<template>
<div class='default-main'>
<!-- 表头 -->
<!-- date-picker 时间组件 area区域组件-->
<TableHeader date-picker area>
<template v-slot:select>
<el-form-item label='关键词:'>
<el-input
style='width: 240px'
v-model='tableStore.table.params.searchValue'
clearable
placeholder='仅根据用户名/登录名'
/>
</el-form-item>
</template>
<template v-slot:operation>
<el-button :icon='Plus' type='primary' @click='addUser'>添加</el-button>
</template>
</TableHeader>
<!-- 表格 -->
<Table ref='tableRef' />
<!-- 弹框 -->
<PopupEdit ref='popupEdit' />
</div>
</template>
<script setup lang='ts'>
import { Plus } from '@element-plus/icons-vue'
import { ref, onMounted, provide, defineOptions } from 'vue'
import { ElMessageBox, ElMessage } from 'element-plus'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import PopupEdit from './dialog.vue'
import { mainHeight } from '@/utils/layout'
// 注意名字不要重复若要保持页面存活名字需要和路由admin后面的字符保持一致
defineOptions({
name: 'auth/userlist'
})
const popupEdit = ref()
const tableStore = new TableStore({
// 若页面表格高度需要调整请修改publicHeight(内容区域除表格外其他内容的高度)
// publicHeight: 60,
url: '/user-boot/user/list',
method: 'POST',
column: [
{ title: '用户名称', field: 'name', minWidth: '130' },
{ title: '登录名', field: 'loginName', minWidth: '130' },
{ title: '角色', field: 'roleName', minWidth: '130' },
{ title: '部门', field: 'deptName', minWidth: '200' },
{ title: '电话', field: 'phoneShow', minWidth: '100' },
{ title: '注册时间', field: 'registerTime', minWidth: '130' },
{ title: '登录时间', field: 'loginTime', minWidth: '130' },
{ title: '类型', field: 'casualUserName', minWidth: '80' },
{
title: '状态',
field: 'state',
width: '100',
render: 'tag',
custom: {
0: 'danger',
1: 'success',
2: 'warning',
3: 'warning',
4: 'info',
5: 'danger'
},
replaceValue: {
0: '注销',
1: '正常',
2: '锁定',
3: '待审核',
4: '休眠',
5: '密码过期'
}
},
{
title: '操作',
width: '180',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.state !== 1
},
click: row => {
}
},
{
name: 'edit',
title: '修改密码',
type: 'primary',
icon: 'el-icon-Lock',
render: 'basicButton',
disabled: row => {
return row.state !== 1
},
click: row => {
ElMessageBox.prompt('二次校验密码确认', '注销用户', {
confirmButtonText: '确认',
cancelButtonText: '取消',
inputType: 'password'
}).then(({ value }) => {
})
}
},
{
name: 'edit',
title: '激活',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.state !== 2 && row.state !== 5 && row.state !== 0 && row.state !== 4
},
click: row => {
}
},
{
name: 'edit',
title: '注销',
type: 'danger',
icon: 'el-icon-SwitchButton',
render: 'basicButton',
disabled: row => {
return row.state !== 1 && row.state !== 3
},
click: row => {
}
}
]
}
],
loadCallback: () => {
tableStore.table.data.forEach((item: any) => {
item.deptName = item.deptName || '/'
item.phoneShow = item.phone || '/'
item.roleName = item.role.length ? item.role : '/'
switch (item.casualUser) {
case 0:
item.casualUserName = '临时用户'
break
case 1:
item.casualUserName = '长期用户'
break
default:
item.casualUserName = '/'
break
}
})
}
})
// 注入到子组件
provide('tableStore', tableStore)
// 默认参数 参数多的话可以使用Object.assign方法
tableStore.table.params.searchState = 1
tableStore.table.params.searchValue = ''
tableStore.table.params.casualUser = -1
tableStore.table.params.orderBy = ''
onMounted(() => {
// 加载数据
tableStore.index()
})
// 弹框
const addUser = () => {
popupEdit.value.open('新增用户')
}
</script>
<template>
<div class='default-main'>
<!-- 表头 -->
<!-- date-picker 时间组件 area区域组件-->
<TableHeader date-picker area>
<template v-slot:select>
<el-form-item label='关键词:'>
<el-input
style='width: 240px'
v-model='tableStore.table.params.searchValue'
clearable
placeholder='仅根据用户名/登录名'
/>
</el-form-item>
</template>
<template v-slot:operation>
<el-button :icon='Plus' type='primary' @click='addUser'>添加</el-button>
</template>
</TableHeader>
<!-- 表格 -->
<Table ref='tableRef' />
<!-- 弹框 -->
<PopupEdit ref='popupEdit' />
</div>
</template>
<script setup lang='ts'>
import { Plus } from '@element-plus/icons-vue'
import { ref, onMounted, provide, defineOptions } from 'vue'
import { ElMessageBox, ElMessage } from 'element-plus'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import PopupEdit from './dialog.vue'
import { mainHeight } from '@/utils/layout'
// 注意名字不要重复若要保持页面存活名字需要和路由admin后面的字符保持一致
defineOptions({
name: 'auth/userlist'
})
const popupEdit = ref()
const tableStore = new TableStore({
// 若页面表格高度需要调整请修改publicHeight(内容区域除表格外其他内容的高度)
// publicHeight: 60,
url: '/user-boot/user/list',
method: 'POST',
column: [
{ title: '用户名称', field: 'name', minWidth: '130' },
{ title: '登录名', field: 'loginName', minWidth: '130' },
{ title: '角色', field: 'roleName', minWidth: '130' },
{ title: '部门', field: 'deptName', minWidth: '200' },
{ title: '电话', field: 'phoneShow', minWidth: '100' },
{ title: '注册时间', field: 'registerTime', minWidth: '130' },
{ title: '登录时间', field: 'loginTime', minWidth: '130' },
{ title: '类型', field: 'casualUserName', minWidth: '80' },
{
title: '状态',
field: 'state',
width: '100',
render: 'tag',
custom: {
0: 'danger',
1: 'success',
2: 'warning',
3: 'warning',
4: 'info',
5: 'danger'
},
replaceValue: {
0: '注销',
1: '正常',
2: '锁定',
3: '待审核',
4: '休眠',
5: '密码过期'
}
},
{
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.state !== 1
},
click: row => {
}
},
{
name: 'edit',
title: '修改密码',
type: 'primary',
icon: 'el-icon-Lock',
render: 'basicButton',
disabled: row => {
return row.state !== 1
},
click: row => {
ElMessageBox.prompt('二次校验密码确认', '注销用户', {
confirmButtonText: '确认',
cancelButtonText: '取消',
inputType: 'password'
}).then(({ value }) => {
})
}
},
{
name: 'edit',
title: '激活',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.state !== 2 && row.state !== 5 && row.state !== 0 && row.state !== 4
},
click: row => {
}
},
{
name: 'edit',
title: '注销',
type: 'danger',
icon: 'el-icon-SwitchButton',
render: 'basicButton',
disabled: row => {
return row.state !== 1 && row.state !== 3
},
click: row => {
}
}
]
}
],
loadCallback: () => {
tableStore.table.data.forEach((item: any) => {
item.deptName = item.deptName || '/'
item.phoneShow = item.phone || '/'
item.roleName = item.role.length ? item.role : '/'
switch (item.casualUser) {
case 0:
item.casualUserName = '临时用户'
break
case 1:
item.casualUserName = '长期用户'
break
default:
item.casualUserName = '/'
break
}
})
}
})
// 注入到子组件
provide('tableStore', tableStore)
// 默认参数 参数多的话可以使用Object.assign方法
tableStore.table.params.searchState = 1
tableStore.table.params.searchValue = ''
tableStore.table.params.casualUser = -1
tableStore.table.params.orderBy = ''
onMounted(() => {
// 加载数据
tableStore.index()
})
// 弹框
const addUser = () => {
popupEdit.value.open('新增用户')
}
</script>

View File

@@ -56,7 +56,7 @@ class MQTT {
localStorage.getItem('MqttUrl') == 'null'
? 'ws://192.168.1.68:8083/mqtt'
: localStorage.getItem('MqttUrl')
if (mqttUrl == 'null'||mqttUrl == null) return
this.client = mqtt.connect(mqttUrl, this.defaultOptions as IClientOptions)
this.setupEventListeners()

View File

@@ -1,125 +1,125 @@
<template>
<div class="default-main">
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="新能源场站名称">
<el-input v-model="tableStore.table.params.name" 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" />
<!--弹框-->
<addForm ref="addFormRef" @onSubmit="tableStore.index()" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import addForm from './components/addForm.vue'
import { useDictData } from '@/stores/dictData'
import { useAdminInfo } from '@/stores/adminInfo'
import { delNewStation } from '@/api/device-boot/newEnergy'
defineOptions({
name: 'newEnergy/newEnergyLedger'
})
const dictData = useDictData()
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const newEnergy = dictData.getBasicData('new_station_type')
const scaleList = dictData.getBasicData('Dev_Voltage_Stand')
const tableRef = ref()
const TableHeaderRef = ref()
const addFormRef = ref()
const tableStore = new TableStore({
url: '/device-boot/newStation/queryPage',
method: 'POST',
column: [
{
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'name', title: '新能源场站名称' },
{
field: 'stationType',
title: '新能源场站类型',
formatter: (row: any) => newEnergy.filter(item => item.id == row.cellValue)[0]?.name
},
{
field: 'scale',
title: '电压等级',
formatter: (row: any) => scaleList.filter(item => item.id == row.cellValue)[0]?.name
},
{ field: 'ratedPower', title: '额定有功功率(kW)' },
{ field: 'longitude', title: '经度' },
{ field: 'latitude', title: '纬度' },
{
title: '操作',
align: 'center',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'edit',
title: '修改',
type: 'primary',
icon: 'el-icon-edit',
render: 'basicButton',
click: row => {
addFormRef.value.open({
title: '修改',
row: row
})
}
},
{
name: 'delete',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除该数据吗?'
},
click: row => {
delNewStation({ ids: row.id }).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.currentPage = tableStore.table.params.pageNum
},
loadCallback: () => {}
})
tableStore.table.params.name = ''
const add = () => {
addFormRef.value.open({
title: '新增'
})
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>
<style scoped lang="scss"></style>
<template>
<div class="default-main">
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="新能源场站名称">
<el-input v-model="tableStore.table.params.name" 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" />
<!--弹框-->
<addForm ref="addFormRef" @onSubmit="tableStore.index()" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import addForm from './components/addForm.vue'
import { useDictData } from '@/stores/dictData'
import { useAdminInfo } from '@/stores/adminInfo'
import { delNewStation } from '@/api/device-boot/newEnergy'
defineOptions({
name: 'newEnergy/newEnergyLedger'
})
const dictData = useDictData()
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const newEnergy = dictData.getBasicData('new_station_type')
const scaleList = dictData.getBasicData('Dev_Voltage_Stand')
const tableRef = ref()
const TableHeaderRef = ref()
const addFormRef = ref()
const tableStore = new TableStore({
url: '/device-boot/newStation/queryPage',
method: 'POST',
column: [
{
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'name', title: '新能源场站名称' },
{
field: 'stationType',
title: '新能源场站类型',
formatter: (row: any) => newEnergy.filter(item => item.id == row.cellValue)[0]?.name
},
{
field: 'scale',
title: '电压等级',
formatter: (row: any) => scaleList.filter(item => item.id == row.cellValue)[0]?.name
},
{ field: 'ratedPower', title: '额定有功功率(kW)' },
{ field: 'longitude', title: '经度' },
{ field: 'latitude', title: '纬度' },
{
title: '操作',fixed: 'right',
align: 'center',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '修改',
type: 'primary',
icon: 'el-icon-edit',
render: 'basicButton',
click: row => {
addFormRef.value.open({
title: '修改',
row: row
})
}
},
{
name: 'delete',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除该数据吗?'
},
click: row => {
delNewStation({ ids: row.id }).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.currentPage = tableStore.table.params.pageNum
},
loadCallback: () => {}
})
tableStore.table.params.name = ''
const add = () => {
addFormRef.value.open({
title: '新增'
})
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>
<style scoped lang="scss"></style>

View File

@@ -136,7 +136,7 @@ const tableStore: any = new TableStore({
{ field: 'evaluateDate', title: '评估日期' },
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [

View File

@@ -187,7 +187,7 @@ const tableStore: any = new TableStore({
{ field: 'createBy', title: '创建者' },
{ field: 'createTime', title: '创建日期' },
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [

View File

@@ -77,7 +77,7 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [

View File

@@ -315,7 +315,7 @@ const tableStore = new TableStore({
{ title: '描述', field: 'remark' },
{
title: '操作',
title: '操作',fixed: 'right',
align: 'center',
width: '180',
render: 'buttons',

View File

@@ -328,7 +328,7 @@ const tableStore = new TableStore({
field: 'tfDescribe'
},
{
title: '操作',
title: '操作',fixed: 'right',
align: 'center',
width: '180',
render: 'buttons',

View File

@@ -161,7 +161,7 @@ const tableStore = new TableStore({
field: 'tfDescribe'
},
{
title: '操作',
title: '操作',fixed: 'right',
align: 'center',
width: '180',
render: 'buttons',

View File

@@ -1,315 +1,315 @@
<template>
<div class="default-main">
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="项目名称">
<el-input
style="width: 200px"
placeholder="请输入项目名称"
v-model="tableStore.table.params.projectName"
clearable
maxlength="32"
show-word-limit
></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
<el-option
v-for="item in areaOptionList"
:key="item.id"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<!-- <el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate" :loading="loading">
模板下载
</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef" />
<el-dialog title="详情" width="60%" v-model="dialogShow" v-if="dialogShow">
<DetailInfo :id="userId" :openType="'sourcesOfInterference'"></DetailInfo>
</el-dialog>
<!-- 批量导入 -->
<sensitive-user-popup ref="sensitiveUserPopup" />
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref="addForms" @onSubmit="tableStore.index()" :openType="'sourcesOfInterference'"></addForm>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import addForm from './components/addForm.vue'
import SensitiveUserPopup from './components/sensitiveUserPopup.vue'
import { useDictData } from '@/stores/dictData'
import { useRouter } from 'vue-router'
import { downloadSensitiveReportTemplate } from '@/api/supervision-boot/userReport/form'
import DetailInfo from './components/detail.vue'
import { cancelFormData, getUserReportById } from '@/api/supervision-boot/interfere/index'
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
const addForms = ref()
const dictData = useDictData()
const sensitiveUserPopup = ref()
const TableHeaderRef = ref()
const loading = ref(false)
const areaOptionList = dictData.getBasicData('jibei_area')
const { push, options, currentRoute } = useRouter()
import { useAdminInfo } from '@/stores/adminInfo'
defineOptions({
name: 'BusinessAdministrator/TerminalManagement/userLedger'
})
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getUserLedgerPage',
// publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'city', title: '所在地市', minWidth: 80 },
{ field: 'substation', title: '厂站名称', minWidth: 100 },
{ field: 'projectName', title: '项目名称', minWidth: 170 },
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{ field: 'ratePower', title: '装机容量(MW)', minWidth: 130 },
{
field: 'createBy',
title: '创建人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详细信息',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
lookInfo(row.id)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return !(row.status == 0)
},
click: row => {
addForms.value.filterUsers([6])
addForms.value.open({
title: '编辑',
row: row
})
}
},
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
}
})
tableStore.table.params.city = ''
tableStore.table.params.orgId = adminInfo.$state.deptId
tableStore.table.params.projectName = ''
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
const userId = ref()
const dialogShow = ref(false)
const lookInfo = (id: string) => {
userId.value = id
dialogShow.value = true
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
dataType: 1,
reason: value
}
await cancelFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
// 新增
const addFormModel = () => {
addForms.value.filterUsers([6])
setTimeout(() => {
addForms.value.open({
title: '用户档案录入'
})
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
//导出模板
const exportExcelTemplate = async () => {
loading.value = true
await downloadSensitiveReportTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '干扰源用户台账模板'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
}, 0)
}
//批量导入用户数据
const importUserData = () => {
sensitiveUserPopup.value.open('导入干扰源用户')
}
const props = defineProps({ id: { type: String, default: 'null' } })
watch(
() => props.id,
async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getUserReportById(fullId).then(res => {
if (res && res.code == 'A0000') {
addForms.value.setcontroFlag()
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
},
{ immediate: true }
)
</script>
<template>
<div class="default-main">
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="项目名称">
<el-input
style="width: 200px"
placeholder="请输入项目名称"
v-model="tableStore.table.params.projectName"
clearable
maxlength="32"
show-word-limit
></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
<el-option
v-for="item in areaOptionList"
:key="item.id"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<!-- <el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate" :loading="loading">
模板下载
</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef" />
<el-dialog title="详情" width="60%" v-model="dialogShow" v-if="dialogShow">
<DetailInfo :id="userId" :openType="'sourcesOfInterference'"></DetailInfo>
</el-dialog>
<!-- 批量导入 -->
<sensitive-user-popup ref="sensitiveUserPopup" />
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref="addForms" @onSubmit="tableStore.index()" :openType="'sourcesOfInterference'"></addForm>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import addForm from './components/addForm.vue'
import SensitiveUserPopup from './components/sensitiveUserPopup.vue'
import { useDictData } from '@/stores/dictData'
import { useRouter } from 'vue-router'
import { downloadSensitiveReportTemplate } from '@/api/supervision-boot/userReport/form'
import DetailInfo from './components/detail.vue'
import { cancelFormData, getUserReportById } from '@/api/supervision-boot/interfere/index'
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
const addForms = ref()
const dictData = useDictData()
const sensitiveUserPopup = ref()
const TableHeaderRef = ref()
const loading = ref(false)
const areaOptionList = dictData.getBasicData('jibei_area')
const { push, options, currentRoute } = useRouter()
import { useAdminInfo } from '@/stores/adminInfo'
defineOptions({
name: 'BusinessAdministrator/TerminalManagement/userLedger'
})
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getUserLedgerPage',
// publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'city', title: '所在地市', minWidth: 80 },
{ field: 'substation', title: '厂站名称', minWidth: 100 },
{ field: 'projectName', title: '项目名称', minWidth: 170 },
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{ field: 'ratePower', title: '装机容量(MW)', minWidth: 130 },
{
field: 'createBy',
title: '创建人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
minWidth: 150,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详细信息',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
lookInfo(row.id)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return !(row.status == 0)
},
click: row => {
addForms.value.filterUsers([6])
addForms.value.open({
title: '编辑',
row: row
})
}
},
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
}
})
tableStore.table.params.city = ''
tableStore.table.params.orgId = adminInfo.$state.deptId
tableStore.table.params.projectName = ''
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
const userId = ref()
const dialogShow = ref(false)
const lookInfo = (id: string) => {
userId.value = id
dialogShow.value = true
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
dataType: 1,
reason: value
}
await cancelFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
// 新增
const addFormModel = () => {
addForms.value.filterUsers([6])
setTimeout(() => {
addForms.value.open({
title: '用户档案录入'
})
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
//导出模板
const exportExcelTemplate = async () => {
loading.value = true
await downloadSensitiveReportTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '干扰源用户台账模板'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
}, 0)
}
//批量导入用户数据
const importUserData = () => {
sensitiveUserPopup.value.open('导入干扰源用户')
}
const props = defineProps({ id: { type: String, default: 'null' } })
watch(
() => props.id,
async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getUserReportById(fullId).then(res => {
if (res && res.code == 'A0000') {
addForms.value.setcontroFlag()
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
},
{ immediate: true }
)
</script>

View File

@@ -1,274 +1,274 @@
<template>
<div class="default-main">
<!-- 案例库 -->
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="名称">
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入搜索名称" maxlength="32" show-word-limit/>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addUser" v-if="information">新增</el-button>
<el-button icon="el-icon-View" type="primary" @click="checkOutTheCriteria">查看常见治理措施</el-button>
<!-- <el-upload :show-file-list="false" action="" :auto-upload="false" class="ml10" :on-change="choose"
v-if="information">
<el-button icon="el-icon-Top" type="primary">上传常见治理措施</el-button>
</el-upload>
<el-button icon="el-icon-Download" type="primary" class="ml10" @click="downloadTheReport">
下载常见治理措施
</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef"></Table>
<!-- 弹框 -->
<PopupEdit ref="popupEditRef" @onSubmit="tableStore.index()" />
<!-- 简介详情 -->
<el-dialog v-model="dialogVisible" title="事件简介" width="60%">
<div class="editor" v-html="summary"></div>
</el-dialog>
<!-- 抽屉 -->
<drawer ref="drawerRef" />
<!-- 文件 -->
<annex ref="annexRef" />
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import TableHeader from '@/components/table/header/index.vue'
import Table from '@/components/table/index.vue'
import PopupEdit from './components/form.vue'
import { libcaseBeleteyById } from '@/api/supervision-boot/database/index'
import drawer from './components/drawer.vue'
import annex from './components/annex.vue'
import { ElMessage } from 'element-plus'
import { uploadFile, getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
import { addStandardCase, queryStandardCase } from '@/api/supervision-boot/database/index'
import { useAdminInfo } from '@/stores/adminInfo'
import katex from "katex";
import "katex/dist/katex.css";
const adminInfo = useAdminInfo()
defineOptions({
name: 'database/case'
})
const popupEditRef = ref()
const drawerRef = ref()
const TableHeaderRef = ref()
const annexRef = ref()
const dialogVisible = ref(false)
const summary = ref('')
const information = adminInfo.roleCode.includes('information_info')
const tableStore = new TableStore({
url: '/supervision-boot/libcase/pageQuery',
method: 'POST',
column: [
{ title: '电能质量事件名称', field: 'name' },
{
title: '发生地点',
field: 'location'
},
// {
// title: '发生事件',
// field: 'type'
// },
// {
// title: '事件经过',
// field: 'process'
// },
// {
// title: '处理措施',
// field: 'measures'
// },
// {
// title: '治理效果',
// field: 'effect'
// },
{
title: '事件简介',
width: '140',
render: 'buttons',
buttons: [
{
name: 'view',
title: '查看',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
dialogVisible.value = true
summary.value = row.summary
setTimeout(() => {
const spans = document.querySelectorAll('span[data-value]');
// 遍历每个 span 标签
spans.forEach(function (span) {
let val = katex.renderToString(span.getAttribute('data-value'), {
throwOnError: false,
})
var newDiv = span;
newDiv.innerHTML = val;
span.parentNode.replaceChild(newDiv, span);
});
}, 100)
}
}
]
},
{
title: '操作',
width: '200',
render: 'buttons',
buttons: [
{
name: 'view',
title: '详情',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
annexRef.value.open(row)
}
},
{
name: 'view',
title: '下载附件',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
annexRef.value.open(row)
}
},
{
name: 'edit',
title: '修改',
type: 'primary',
disabled: row => {
return !information
},
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
popupEditRef.value.open('修改案例', row)
}
},
{
name: 'delete',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
disabled: row => {
return !information
},
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
libcaseBeleteyById({ id: row.id }).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
loadCallback: () => { }
})
tableStore.table.params.searchValue = ''
// 弹框
const addUser = () => {
popupEditRef.value.open('新增案例')
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
// console.log('🚀 ~ libcaseBeleteyById ~ tableStore:', tableStore)
})
const checkOutTheCriteria = () => {
queryStandardCase().then(res => {
drawerRef.value.open(res.data)
})
}
// 上传
const choose = (e: any) => {
ElMessage.info('上传中,请稍等...')
uploadFile(e.raw, '/supervision/').then((row: any) => {
addStandardCase({ caseUrl: row.data.name }).then(res => {
ElMessage.success('上传成功!')
})
})
//
}
const downloadTheReport = () => {
queryStandardCase().then(res => {
let urls = res.data
let name = urls.match(/\/([^/]+)\.(\w+)$/)[1]
ElMessage.info('下载中,请稍等...')
downloadFile({ filePath: urls }).then((res: any) => {
let blob = new Blob([res], {
type: urls.includes('.pdf')
? 'application/pdf'
: urls.includes('.docx')
? 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
: urls.includes('.xls')
? 'application/vnd.ms-excel'
: urls.includes('.xlsx')
? 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
: urls.includes('.png')
? 'image/png'
: urls.includes('.jpeg')
? 'image/jpeg'
: urls.includes('.jpg')
? 'image/jpg'
: ''
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = name
document.body.appendChild(link)
link.click()
link.remove()
})
})
}
</script>
<style lang="scss">
.editor {
table {
width: 100%;
border-collapse: collapse;
}
th,
td {
border: 1px solid black;
padding: 8px;
text-align: center;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
td {
background-color: #ffffff;
}
}
</style>
<template>
<div class="default-main">
<!-- 案例库 -->
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="名称">
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入搜索名称" maxlength="32" show-word-limit/>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addUser" v-if="information">新增</el-button>
<el-button icon="el-icon-View" type="primary" @click="checkOutTheCriteria">查看常见治理措施</el-button>
<!-- <el-upload :show-file-list="false" action="" :auto-upload="false" class="ml10" :on-change="choose"
v-if="information">
<el-button icon="el-icon-Top" type="primary">上传常见治理措施</el-button>
</el-upload>
<el-button icon="el-icon-Download" type="primary" class="ml10" @click="downloadTheReport">
下载常见治理措施
</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef"></Table>
<!-- 弹框 -->
<PopupEdit ref="popupEditRef" @onSubmit="tableStore.index()" />
<!-- 简介详情 -->
<el-dialog v-model="dialogVisible" title="事件简介" width="60%">
<div class="editor" v-html="summary"></div>
</el-dialog>
<!-- 抽屉 -->
<drawer ref="drawerRef" />
<!-- 文件 -->
<annex ref="annexRef" />
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import TableHeader from '@/components/table/header/index.vue'
import Table from '@/components/table/index.vue'
import PopupEdit from './components/form.vue'
import { libcaseBeleteyById } from '@/api/supervision-boot/database/index'
import drawer from './components/drawer.vue'
import annex from './components/annex.vue'
import { ElMessage } from 'element-plus'
import { uploadFile, getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
import { addStandardCase, queryStandardCase } from '@/api/supervision-boot/database/index'
import { useAdminInfo } from '@/stores/adminInfo'
import katex from "katex";
import "katex/dist/katex.css";
const adminInfo = useAdminInfo()
defineOptions({
name: 'database/case'
})
const popupEditRef = ref()
const drawerRef = ref()
const TableHeaderRef = ref()
const annexRef = ref()
const dialogVisible = ref(false)
const summary = ref('')
const information = adminInfo.roleCode.includes('information_info')
const tableStore = new TableStore({
url: '/supervision-boot/libcase/pageQuery',
method: 'POST',
column: [
{ title: '电能质量事件名称', field: 'name' },
{
title: '发生地点',
field: 'location'
},
// {
// title: '发生事件',
// field: 'type'
// },
// {
// title: '事件经过',
// field: 'process'
// },
// {
// title: '处理措施',
// field: 'measures'
// },
// {
// title: '治理效果',
// field: 'effect'
// },
{
title: '事件简介',
width: '140',
render: 'buttons',
buttons: [
{
name: 'view',
title: '查看',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
dialogVisible.value = true
summary.value = row.summary
setTimeout(() => {
const spans = document.querySelectorAll('span[data-value]');
// 遍历每个 span 标签
spans.forEach(function (span) {
let val = katex.renderToString(span.getAttribute('data-value'), {
throwOnError: false,
})
var newDiv = span;
newDiv.innerHTML = val;
span.parentNode.replaceChild(newDiv, span);
});
}, 100)
}
}
]
},
{
title: '操作',fixed: 'right',
width: '200',
render: 'buttons',
buttons: [
{
name: 'view',
title: '详情',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
annexRef.value.open(row)
}
},
{
name: 'view',
title: '下载附件',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
annexRef.value.open(row)
}
},
{
name: 'edit',
title: '修改',
type: 'primary',
disabled: row => {
return !information
},
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
popupEditRef.value.open('修改案例', row)
}
},
{
name: 'delete',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
disabled: row => {
return !information
},
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
libcaseBeleteyById({ id: row.id }).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
loadCallback: () => { }
})
tableStore.table.params.searchValue = ''
// 弹框
const addUser = () => {
popupEditRef.value.open('新增案例')
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
// console.log('🚀 ~ libcaseBeleteyById ~ tableStore:', tableStore)
})
const checkOutTheCriteria = () => {
queryStandardCase().then(res => {
drawerRef.value.open(res.data)
})
}
// 上传
const choose = (e: any) => {
ElMessage.info('上传中,请稍等...')
uploadFile(e.raw, '/supervision/').then((row: any) => {
addStandardCase({ caseUrl: row.data.name }).then(res => {
ElMessage.success('上传成功!')
})
})
//
}
const downloadTheReport = () => {
queryStandardCase().then(res => {
let urls = res.data
let name = urls.match(/\/([^/]+)\.(\w+)$/)[1]
ElMessage.info('下载中,请稍等...')
downloadFile({ filePath: urls }).then((res: any) => {
let blob = new Blob([res], {
type: urls.includes('.pdf')
? 'application/pdf'
: urls.includes('.docx')
? 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
: urls.includes('.xls')
? 'application/vnd.ms-excel'
: urls.includes('.xlsx')
? 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
: urls.includes('.png')
? 'image/png'
: urls.includes('.jpeg')
? 'image/jpeg'
: urls.includes('.jpg')
? 'image/jpg'
: ''
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = name
document.body.appendChild(link)
link.click()
link.remove()
})
})
}
</script>
<style lang="scss">
.editor {
table {
width: 100%;
border-collapse: collapse;
}
th,
td {
border: 1px solid black;
padding: 8px;
text-align: center;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
td {
background-color: #ffffff;
}
}
</style>

View File

@@ -49,7 +49,7 @@ const tableStore = new TableStore({
field: 'createTime'
},
{
title: '操作',
title: '操作',fixed: 'right',
width: '280',
render: 'buttons',
buttons: [

View File

@@ -179,7 +179,7 @@ const tableStore = new TableStore({
{ field: 'duration', title: '持续时间(s)', minWidth: '100' },
{
title: '操作',
title: '操作',fixed: 'right',
width: '120',
render: 'buttons',
buttons: [

View File

@@ -74,9 +74,14 @@
</el-select>
</el-form-item>
<el-form-item label="电网标志">
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志">
<el-option v-for="item in sign" :key="item.id" :label="item.name" :value="item.algoDescribe" />
</el-select>
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志">
<el-option
v-for="item in sign"
:key="item.id"
:label="item.name"
:value="item.algoDescribe"
/>
</el-select>
</el-form-item>
</template>
</TableHeader>
@@ -159,6 +164,8 @@ const tableStore = new TableStore({
title: '电压等级',
field: 'voltageLevel',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
@@ -167,6 +174,7 @@ const tableStore = new TableStore({
title: '网络参数',
field: 'networkParam',
align: 'center',
minWidth: 120,
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
@@ -175,6 +183,7 @@ const tableStore = new TableStore({
title: '监测点名称',
field: 'lineName',
align: 'center',
minWidth: 120,
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
@@ -183,6 +192,7 @@ const tableStore = new TableStore({
title: '厂家',
field: 'factoryName',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
@@ -191,6 +201,7 @@ const tableStore = new TableStore({
title: '谐波电压(%)',
field: 'harmonicVoltage',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -199,6 +210,7 @@ const tableStore = new TableStore({
title: '电压偏差(%)',
field: 'voltageOffset',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -207,6 +219,7 @@ const tableStore = new TableStore({
title: '三相电压不平衡度(%)',
field: 'voltageUnbalance',
align: 'center',
minWidth: 100,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -215,6 +228,7 @@ const tableStore = new TableStore({
title: '间谐波电压含有率(%)',
field: 'interHarmonic',
align: 'center',
minWidth: 100,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -223,6 +237,7 @@ const tableStore = new TableStore({
title: '谐波电流(%)',
field: 'harmonicCurrent',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -231,6 +246,7 @@ const tableStore = new TableStore({
title: '负序电流(%)',
field: 'negativeCurrent',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -239,6 +255,7 @@ const tableStore = new TableStore({
title: '频率偏差(%)',
field: 'freqOffset',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -247,6 +264,7 @@ const tableStore = new TableStore({
title: '闪变(%)',
field: 'flicker',
align: 'center',
minWidth: 80,
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
@@ -256,7 +274,7 @@ const tableStore = new TableStore({
loadCallback: () => {
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
setTimeout(() => {
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
@@ -312,7 +330,7 @@ const tree2List = (list: any, id?: string) => {
})
// 返回结果数组
return arr
}
}
onMounted(() => {
tableStore.index()
})

View File

@@ -69,7 +69,7 @@ const tableStore = new TableStore({
{ title: '更新时间', field: 'updateTime' },
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [

View File

@@ -49,7 +49,7 @@ const tableStore = new TableStore({
{ title: '计算时间', field: 'updateTime' },
{ title: '计算窗口', field: 'timeWindow' },
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [

View File

@@ -107,9 +107,9 @@ const tableStore = new TableStore({
minWidth: 150
},
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -106,9 +106,9 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -123,7 +123,8 @@ const tableStore = new TableStore({
{ field: 'name', title: '电网拓扑', width: 350, type: 'radio', align: 'left', treeNode: true },
{
field: 'ip',
title: '网络参数' ,width:'120px',
title: '网络参数',
width: '120px',
formatter: ({ row }: any) => {
return row.ip || '/'
}
@@ -249,7 +250,7 @@ const searchEvent = debounce(() => {
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
options
)
// console.log('🚀 ~ searchEvent ~ rest:', rest)
// console.log('🚀 ~ searchEvent ~ rest:', rest)
tableStore.table.data = rest
@@ -288,6 +289,10 @@ const exportEvent = () => {
})
exportModelJB(form)
.then(async res => {
if (res == undefined) {
loading.value = false
return
}
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
})

View File

@@ -123,7 +123,8 @@ const tableStore = new TableStore({
{ field: 'name', title: '电网拓扑', width: 350, type: 'radio', align: 'left', treeNode: true },
{
field: 'ip',
title: '网络参数' ,width:'120px',
title: '网络参数',
width: '120px',
formatter: ({ row }: any) => {
return row.ip || '/'
}
@@ -249,7 +250,7 @@ const searchEvent = debounce(() => {
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
options
)
// console.log('🚀 ~ searchEvent ~ rest:', rest)
// console.log('🚀 ~ searchEvent ~ rest:', rest)
tableStore.table.data = rest
@@ -288,6 +289,10 @@ const exportEvent = () => {
})
exportModelJB(form)
.then(async res => {
if (res == undefined) {
loading.value = false
return
}
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
})

View File

@@ -86,7 +86,7 @@ const tableStore = new TableStore({
item.data[k.r][k.c].v ? (item.data[k.r][k.c] = k.v) : ''
})
})
setTimeout(() => {
luckysheet.create({
container: 'luckysheet',
@@ -126,7 +126,6 @@ const changetype = (val: any) => {
reportForm.value = val.reportForm
}
const selectChange = () => {
if (tableStore.table.data.length != 0) {
setTimeout(() => {
luckysheet && luckysheet?.resize()
@@ -152,6 +151,10 @@ const exportReport = () => {
})
exportModelJB(form)
.then(async res => {
if (res == undefined) {
loading.value = false
return
}
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
})

View File

@@ -1,129 +1,141 @@
<!--业务用户管理界面-->
<template>
<div class="default-main">
<TableHeader datePicker area showExport>
<template v-slot:select>
<el-form-item label="筛选数据">
<el-input v-model="tableStore.table.params.searchValue" clearable maxlength="32" show-word-limit placeholder="筛选数据" />
</el-form-item>
</template>
<template v-slot:operation>
<!-- <el-button type="primary" @click="exportEvent" class="ml10" icon="el-icon-Download">导出</el-button> -->
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef"></Table>
</div>
</template>
<script setup lang="ts">
import { ElMessage } from 'element-plus'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useDictData } from '@/stores/dictData'
import { pageTable } from '@/api/harmonic-boot/luckyexcel.ts'
defineOptions({
name: 'harmonic-boot/reate/word'
})
const dictData = useDictData()
//区域联级选择
const industry = dictData.getBasicData('Interference_Source')
//用户信息弹出框
const tableRef = ref()
const tableStore = new TableStore({
url: '/harmonic-boot/qualifiedReport/pageTable',
method: 'POST',
column: [
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '变电站', field: 'subName', width: 200 },
{ title: '监测点名称', field: 'lineName', width: 200 },
{
title: '行业类型',
field: 'businessType',
formatter: (row: any) => {
return industry.find((item: any) => item.id == row.cellValue)?.name || '/'
}
},
{
title: '分类等级',
field: 'calssificationGrade',
formatter: (row: any) => {
return row.cellValue || '/'
}
},
{ title: '电压等级', field: 'voltageScale' },
{
title: '上级变电站',
field: 'superiorsSubstation',
formatter: (row: any) => {
return row.cellValue || '/'
}
},
{
title: '挂接线路',
field: 'hangLine',
formatter: (row: any) => {
return row.cellValue || '/'
}
},
{
title: 'PT变比',
field: 'pt',
formatter: (row: any) => {
return row.row.pt1 + '/' + row.row.pt2
}
},
{
title: 'CT变比',
field: 'ct',
formatter: (row: any) => {
return row.row.ct1 + '/' + row.row.ct2
}
},
{ title: '短路容量(MVA)', field: 'shortCapacity' },
{ title: '终端容量(MVA)', field: 'deviceCapacity' },
{ title: '协议容量(MVA)', field: 'dealCapacity' },
{ title: '谐波情况', field: 'harmDes' },
{ title: '电能质量情况', field: 'powerDes' }
],
beforeSearchFun: () => {
tableStore.table.params.beginTime = tableStore.table.params.startTime
tableStore.table.params.deptId = tableStore.table.params.deptIndex
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
// 导出
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
pageTable(form).then(res => {
tableRef.value.getRef().exportData({
filename: '合格率报告', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
</script>
<!--业务用户管理界面-->
<template>
<div class="default-main">
<TableHeader datePicker area showExport>
<template v-slot:select>
<el-form-item label="筛选数据">
<el-input
v-model="tableStore.table.params.searchValue"
clearable
maxlength="32"
show-word-limit
placeholder="筛选数据"
/>
</el-form-item>
</template>
<template v-slot:operation>
<!-- <el-button type="primary" @click="exportEvent" class="ml10" icon="el-icon-Download">导出</el-button> -->
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef"></Table>
</div>
</template>
<script setup lang="ts">
import { ElMessage } from 'element-plus'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useDictData } from '@/stores/dictData'
import { pageTable } from '@/api/harmonic-boot/luckyexcel.ts'
defineOptions({
name: 'harmonic-boot/reate/word'
})
const dictData = useDictData()
//区域联级选择
const industry = dictData.getBasicData('Interference_Source')
//用户信息弹出框
const tableRef = ref()
const tableStore = new TableStore({
url: '/harmonic-boot/qualifiedReport/pageTable',
method: 'POST',
column: [
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '变电站', field: 'subName', width: 200 },
{ title: '监测点名称', field: 'lineName', width: 200 },
{
title: '行业类型',
field: 'businessType',
minWidth: 80,
formatter: (row: any) => {
return industry.find((item: any) => item.id == row.cellValue)?.name || '/'
}
},
{
title: '分类等级',
field: 'calssificationGrade',
minWidth: 80,
formatter: (row: any) => {
return row.cellValue || '/'
}
},
{ title: '电压等级', field: 'voltageScale', minWidth: 80 },
{
title: '上级变电站',
field: 'superiorsSubstation',
minWidth: 90,
formatter: (row: any) => {
return row.cellValue || '/'
}
},
{
title: '挂接线路',
field: 'hangLine',
minWidth: 80,
formatter: (row: any) => {
return row.cellValue || '/'
}
},
{
title: 'PT变比',
field: 'pt',
minWidth: 80,
formatter: (row: any) => {
return row.row.pt1 + '/' + row.row.pt2
}
},
{
title: 'CT变比',
field: 'ct',
minWidth: 80,
formatter: (row: any) => {
return row.row.ct1 + '/' + row.row.ct2
}
},
{ title: '短路容量(MVA)', field: 'shortCapacity', minWidth: 80 },
{ title: '终端容量(MVA)', field: 'deviceCapacity', minWidth: 80 },
{ title: '协议容量(MVA)', field: 'dealCapacity', minWidth: 80 },
{ title: '谐波情况', field: 'harmDes', minWidth: 80 },
{ title: '电能质量情况', field: 'powerDes', minWidth: 100 }
],
beforeSearchFun: () => {
tableStore.table.params.beginTime = tableStore.table.params.startTime
tableStore.table.params.deptId = tableStore.table.params.deptIndex
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
// 导出
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
pageTable(form).then(res => {
tableRef.value.getRef().exportData({
filename: '合格率报告', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
</script>

View File

@@ -87,6 +87,10 @@ const exportEvent = () => {
endTime: TableHeaderRef.value.datePickerRef.timeValue[1]
})
.then((res: any) => {
if (res == undefined) {
loading.value = false
return
}
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
})

View File

@@ -41,7 +41,13 @@
</template>
<template #operation>
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出excel</el-button>
<el-button icon="el-icon-Download" :loading="loading" @click="exportReport" type="primary" v-if="VITE_FLAG">
<el-button
icon="el-icon-Download"
:loading="loading"
@click="exportReport"
type="primary"
v-if="VITE_FLAG"
>
下载报告
</el-button>
</template>
@@ -189,6 +195,10 @@ const exportReport = () => {
})
exportModelJB(form)
.then(async res => {
if (res == undefined) {
loading.value = false
return
}
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
})

View File

@@ -151,6 +151,10 @@ const exportEvent = () => {
ElMessage('生成报告中...')
exportModel(form)
.then((res: any) => {
if (res == undefined) {
loading.value = false
return
}
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
})

View File

@@ -1,141 +1,141 @@
<!--业务用户管理界面-->
<template>
<div class="default-main">
<div v-show="addedShow">
<TableHeader>
<template v-slot:select>
<el-form-item label="筛选数据">
<el-input v-model="tableStore.table.params.name" clearable placeholder="筛选数据" />
</el-form-item>
</template>
<template v-slot:operation>
<el-button type="primary" @click="add" class="ml10" icon="el-icon-Plus">新增</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef"></Table>
</div>
<!-- 设计流程 -->
<editor v-if="!addedShow" :model="model" @quit="quit" />
<!-- 配置表单 -->
<Allocation ref="allocationRef" @quit="tableStore.index()" />
</div>
</template>
<script setup lang="ts">
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import Allocation from './allocation.vue'
import { deleteDeploy } from '@/api/process-boot/bpm'
import { onMounted, provide, ref } from 'vue'
import { ElMessage } from 'element-plus'
import editor from './editor/index.vue'
defineOptions({
name: '/flowable/definition/index'
})
const tableRef = ref()
const allocationRef = ref()
const model = ref({})
const addedShow = ref(true)
const tableStore = new TableStore({
url: '/process-boot/flowable/definition/list',
method: 'GET',
column: [
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '流程标识', field: 'flowKey' },
{ title: '流程分类', field: 'category' },
{ title: '流程名称', field: 'name' },
{
title: '业务功能',
field: 'formId',
formatter: (row: any) => {
return row.cellValue == 1 ? '谐波普测计划' : row.cellValue == 2 ? '干扰源用户管理' : '暂无表单'
}
},
{ title: '流程版本V', field: 'version' },
{ title: '部署时间', field: 'deploymentTime' },
{
title: '操作',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '设计',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
model.value = row
addedShow.value = false
}
},
{
name: 'edit',
title: '配置主表单',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {
allocationRef.value.open(row)
}
},
{
name: 'del',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteDeploy([row.id]).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.beginTime = tableStore.table.params.startTime
tableStore.table.params.deptId = tableStore.table.params.deptIndex
}
})
// 新增
const add = () => {
model.value = {}
addedShow.value = false
}
onMounted(() => {
// 加载数据
tableStore.index()
})
const quit = () => {
addedShow.value = true
tableStore.index()
}
tableStore.table.params.name = ''
provide('tableStore', tableStore)
</script>
<!--业务用户管理界面-->
<template>
<div class="default-main">
<div v-show="addedShow">
<TableHeader>
<template v-slot:select>
<el-form-item label="筛选数据">
<el-input v-model="tableStore.table.params.name" clearable placeholder="筛选数据" />
</el-form-item>
</template>
<template v-slot:operation>
<el-button type="primary" @click="add" class="ml10" icon="el-icon-Plus">新增</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef"></Table>
</div>
<!-- 设计流程 -->
<editor v-if="!addedShow" :model="model" @quit="quit" />
<!-- 配置表单 -->
<Allocation ref="allocationRef" @quit="tableStore.index()" />
</div>
</template>
<script setup lang="ts">
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import Allocation from './allocation.vue'
import { deleteDeploy } from '@/api/process-boot/bpm'
import { onMounted, provide, ref } from 'vue'
import { ElMessage } from 'element-plus'
import editor from './editor/index.vue'
defineOptions({
name: '/flowable/definition/index'
})
const tableRef = ref()
const allocationRef = ref()
const model = ref({})
const addedShow = ref(true)
const tableStore = new TableStore({
url: '/process-boot/flowable/definition/list',
method: 'GET',
column: [
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '流程标识', field: 'flowKey' },
{ title: '流程分类', field: 'category' },
{ title: '流程名称', field: 'name' },
{
title: '业务功能',
field: 'formId',
formatter: (row: any) => {
return row.cellValue == 1 ? '谐波普测计划' : row.cellValue == 2 ? '干扰源用户管理' : '暂无表单'
}
},
{ title: '流程版本V', field: 'version' },
{ title: '部署时间', field: 'deploymentTime' },
{
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '设计',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
model.value = row
addedShow.value = false
}
},
{
name: 'edit',
title: '配置主表单',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {
allocationRef.value.open(row)
}
},
{
name: 'del',
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
deleteDeploy([row.id]).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.beginTime = tableStore.table.params.startTime
tableStore.table.params.deptId = tableStore.table.params.deptIndex
}
})
// 新增
const add = () => {
model.value = {}
addedShow.value = false
}
onMounted(() => {
// 加载数据
tableStore.index()
})
const quit = () => {
addedShow.value = true
tableStore.index()
}
tableStore.table.params.name = ''
provide('tableStore', tableStore)
</script>

View File

@@ -62,9 +62,9 @@ const tableStore = new TableStore({
{ title: '零序电抗X0(Ω/km)', field: 'zeroX0', minWidth: '80' },
{ title: '零序电纳Y0(S/km)', field: 'zeroY0', minWidth: '80' },
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -96,9 +96,9 @@ const tableStore = new TableStore({
{ title: '谐波49次', field: 'i49', minWidth: '80' },
{ title: '谐波50次', field: 'i50', minWidth: '80' },
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -63,9 +63,9 @@ const tableStore = new TableStore({
{ title: '启动容量倍数', field: 'inpactloadMultiple', minWidth: '80' },
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -73,9 +73,9 @@ const tableStore = new TableStore({
{ title: '空载电流(A)', field: 'noloadCur', minWidth: '80' },
{ title: '短路阻抗(%)', field: 'shortCircuitImpedance', minWidth: '80' },
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -184,10 +184,10 @@ const tableStore: any = new TableStore({
// { field: 'name13', title: '单相负荷', minWidth: 180 },
{
title: '操作',
title: '操作',fixed: 'right',
width: '220',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'edit',

View File

@@ -1,155 +1,155 @@
<template>
<div>
<TableHeader area datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="问题来源">
<el-select v-model="tableStore.table.params.problemSources" clearable placeholder="请选择问题来源">
<el-option
v-for="item in problemData"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="填报进度">
<el-select v-model="tableStore.table.params.reportProcess" clearable placeholder="请选择填报进度">
<el-option
v-for="item in fillingProgress"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="问题名称">
<el-input
v-model="tableStore.table.params.problemName"
clearable
placeholder="请输入问题名称"
style="width: 100%"
></el-input>
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 审核 -->
<el-dialog draggable title="问题审核" v-model="dialogVisible" width="1400px" :before-close="beforeClose">
<Filling
ref="FillingRef"
v-if="dialogVisible"
:isDisabled="true"
:audit="true"
:flag="true"
@beforeClose="beforeClose"
/>
</el-dialog>
<!-- 审核记录 -->
<recording ref="recordingRef" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } 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 Filling from './filling.vue'
import recording from './recording.vue'
const dictData = useDictData()
const problemData = dictData.getBasicData('Problem_Sources')
const fillingProgress = dictData.getBasicData('Fill_Progress')
const TableHeaderRef = ref()
const FillingRef = ref()
const ruleFormRef = ref()
const list: any = ref({})
const recordingRef = ref(false)
const dialogVisible = ref(false)
const tableStore = new TableStore({
url: '/process-boot/electricityQuality/getIssues',
publicHeight: 65,
method: 'POST',
column: [
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'orgName', title: '所属单位' },
{
field: 'problemSources',
title: '问题来源'
},
{ field: 'powerQualityProblemNo', title: '问题编号' },
{ field: 'problemName', title: '问题名称' },
{ field: 'dataDate', title: '提交时间' },
{
field: 'reportProcess',
title: '填报节点',
formatter: (row: any) => {
return fillingProgress.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
title: '操作',
width: '150',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '审核',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {
dialogVisible.value = true
setTimeout(() => {
list.value = row
FillingRef.value.open(row)
}, 10)
}
},
{
name: 'edit',
title: '审核记录',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {
recordingRef.value.open(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.dataDate = tableStore.table.params.searchBeginTime
tableStore.table.params.dataType = TableHeaderRef.value.datePickerRef.interval
}
})
tableStore.table.params.problemSources = ''
tableStore.table.params.reportProcess = ''
tableStore.table.params.problemName = ''
tableStore.table.params.reportProcessStatus = 'Auditt'
const beforeClose = () => {
tableStore.index()
dialogVisible.value = false
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>
<template>
<div>
<TableHeader area datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="问题来源">
<el-select v-model="tableStore.table.params.problemSources" clearable placeholder="请选择问题来源">
<el-option
v-for="item in problemData"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="填报进度">
<el-select v-model="tableStore.table.params.reportProcess" clearable placeholder="请选择填报进度">
<el-option
v-for="item in fillingProgress"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="问题名称">
<el-input
v-model="tableStore.table.params.problemName"
clearable
placeholder="请输入问题名称"
style="width: 100%"
></el-input>
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 审核 -->
<el-dialog draggable title="问题审核" v-model="dialogVisible" width="1400px" :before-close="beforeClose">
<Filling
ref="FillingRef"
v-if="dialogVisible"
:isDisabled="true"
:audit="true"
:flag="true"
@beforeClose="beforeClose"
/>
</el-dialog>
<!-- 审核记录 -->
<recording ref="recordingRef" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } 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 Filling from './filling.vue'
import recording from './recording.vue'
const dictData = useDictData()
const problemData = dictData.getBasicData('Problem_Sources')
const fillingProgress = dictData.getBasicData('Fill_Progress')
const TableHeaderRef = ref()
const FillingRef = ref()
const ruleFormRef = ref()
const list: any = ref({})
const recordingRef = ref(false)
const dialogVisible = ref(false)
const tableStore = new TableStore({
url: '/process-boot/electricityQuality/getIssues',
publicHeight: 65,
method: 'POST',
column: [
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'orgName', title: '所属单位' },
{
field: 'problemSources',
title: '问题来源'
},
{ field: 'powerQualityProblemNo', title: '问题编号' },
{ field: 'problemName', title: '问题名称' },
{ field: 'dataDate', title: '提交时间' },
{
field: 'reportProcess',
title: '填报节点',
formatter: (row: any) => {
return fillingProgress.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
width: '150',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '审核',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {
dialogVisible.value = true
setTimeout(() => {
list.value = row
FillingRef.value.open(row)
}, 10)
}
},
{
name: 'edit',
title: '审核记录',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {
recordingRef.value.open(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.dataDate = tableStore.table.params.searchBeginTime
tableStore.table.params.dataType = TableHeaderRef.value.datePickerRef.interval
}
})
tableStore.table.params.problemSources = ''
tableStore.table.params.reportProcess = ''
tableStore.table.params.problemName = ''
tableStore.table.params.reportProcessStatus = 'Auditt'
const beforeClose = () => {
tableStore.index()
dialogVisible.value = false
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -1,255 +1,255 @@
<template>
<TableHeader area datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="问题来源">
<el-select v-model="tableStore.table.params.problemSources" clearable placeholder="请选择问题来源">
<el-option
v-for="item in problemData"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="填报进度">
<el-select v-model="tableStore.table.params.reportProcess" clearable placeholder="请选择填报进度">
<el-option
v-for="item in fillingProgress"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="tableStore.table.params.reportProcessStatus" clearable placeholder="请选择状态">
<el-option
v-for="item in auditStatus"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="问题名称">
<el-input
v-model="tableStore.table.params.problemName"
clearable
placeholder="请填写问题名称"
style="width: 100%"
></el-input>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增 -->
<NewlyAdd v-if="showNewlyAdded" @handleClose="handleClose" @onSubmit="beforeClose" />
<!-- 填报 -->
<el-dialog draggable title="填报" v-model="dialogVisible" width="1400px" :before-close="beforeClose">
<Filling ref="FillingRef" v-if="dialogVisible" @beforeClose="beforeClose" />
</el-dialog>
<!-- 详情 -->
<Detail ref="detailRef" />
<!-- 审核记录 -->
<recording ref="recordingRef" />
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { deleteIssues, archive } from '@/api/process-boot/electricitymanagement'
import { useDictData } from '@/stores/dictData'
import NewlyAdd from './NewlyAdd.vue'
import Filling from './filling.vue'
import Detail from './detail.vue'
import recording from './recording.vue'
const dictData = useDictData()
const FillingRef = ref()
const showNewlyAdded = ref(false)
const dialogVisible = ref(false)
const recordingRef = ref(false)
const TableHeaderRef = ref()
const detailRef = ref()
const problemData = dictData.getBasicData('Problem_Sources')
const fillingProgress = dictData.getBasicData('Fill_Progress')
const auditStatus = dictData.getBasicData('Audit_Status')
const tableStore: any = new TableStore({
url: '/process-boot/electricityQuality/getIssues',
publicHeight: 65,
method: 'POST',
column: [
// { width: '60', type: 'checkbox' },
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'orgName', title: '所属单位' },
{
field: 'problemSources',
title: '问题来源'
},
{ field: 'powerQualityProblemNo', title: '问题编号' },
{ field: 'problemName', title: '问题名称' },
{ field: 'dataDate', title: '问题新建时间' },
{
field: 'reportProcess',
title: '填报进度',
formatter: (row: any) => {
return fillingProgress.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
field: 'reportProcessStatus',
title: '状态',
formatter: (row: any) => {
return auditStatus.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
title: '操作',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '查看',
type: 'primary',
disabled: row => {
return row.reportProcessStatus == 'Init'
},
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {
detailRef.value.open(row)
}
},
{
name: 'edit',
title: '填报',
disabled: row => {
return (
row.reportProcessStatus == 'Auditt' ||
(row.reportProcess == 'Insights' && row.reportProcessStatus == 'Success') ||
row.reportProcess == 'Archived'
)
},
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
dialogVisible.value = true
setTimeout(() => {
FillingRef.value.open(row)
}, 10)
}
},
{
name: 'edit',
title: '归档',
disabled: row => {
return !(row.reportProcess == 'Insights' && row.reportProcessStatus == 'Success')
},
type: 'primary',
icon: 'el-icon-SuccessFilled',
render: 'basicButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定归档?'
},
click: row => {
archive(row.powerQualityProblemNo).then(() => {
ElMessage.success('归档成功!')
tableStore.index()
})
}
},
{
name: 'edit',
title: '审核记录',
type: 'primary',
disabled: row => {
return row.reportProcessStatus == 'Init'
},
icon: 'el-icon-PieChart',
render: 'basicButton',
click: row => {
recordingRef.value.open(row)
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
disabled: row => {
return row.reportProcess == 'Archived'
},
click: row => {
deleteIssues(row.powerQualityProblemNo).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.dataDate = tableStore.table.params.searchBeginTime
tableStore.table.params.dataType = TableHeaderRef.value.datePickerRef.interval
}
})
tableStore.table.params.problemName = ''
tableStore.table.params.problemSources = ''
tableStore.table.params.reportProcess = ''
tableStore.table.params.reportProcessStatus = ''
provide('tableStore', tableStore)
onMounted(() => {
TableHeaderRef.value.setDatePicker([
{ label: '年', value: 1 },
{ label: '季', value: 2 },
{ label: '月', value: 3 }
])
tableStore.index()
})
// 新增
const add = () => {
showNewlyAdded.value = true
}
// 关闭弹框
const handleClose = () => {
showNewlyAdded.value = false
}
// 关闭 填报
const beforeClose = () => {
dialogVisible.value = false
tableStore.index()
}
</script>
<template>
<TableHeader area datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="问题来源">
<el-select v-model="tableStore.table.params.problemSources" clearable placeholder="请选择问题来源">
<el-option
v-for="item in problemData"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="填报进度">
<el-select v-model="tableStore.table.params.reportProcess" clearable placeholder="请选择填报进度">
<el-option
v-for="item in fillingProgress"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="tableStore.table.params.reportProcessStatus" clearable placeholder="请选择状态">
<el-option
v-for="item in auditStatus"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="问题名称">
<el-input
v-model="tableStore.table.params.problemName"
clearable
placeholder="请填写问题名称"
style="width: 100%"
></el-input>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增 -->
<NewlyAdd v-if="showNewlyAdded" @handleClose="handleClose" @onSubmit="beforeClose" />
<!-- 填报 -->
<el-dialog draggable title="填报" v-model="dialogVisible" width="1400px" :before-close="beforeClose">
<Filling ref="FillingRef" v-if="dialogVisible" @beforeClose="beforeClose" />
</el-dialog>
<!-- 详情 -->
<Detail ref="detailRef" />
<!-- 审核记录 -->
<recording ref="recordingRef" />
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { deleteIssues, archive } from '@/api/process-boot/electricitymanagement'
import { useDictData } from '@/stores/dictData'
import NewlyAdd from './NewlyAdd.vue'
import Filling from './filling.vue'
import Detail from './detail.vue'
import recording from './recording.vue'
const dictData = useDictData()
const FillingRef = ref()
const showNewlyAdded = ref(false)
const dialogVisible = ref(false)
const recordingRef = ref(false)
const TableHeaderRef = ref()
const detailRef = ref()
const problemData = dictData.getBasicData('Problem_Sources')
const fillingProgress = dictData.getBasicData('Fill_Progress')
const auditStatus = dictData.getBasicData('Audit_Status')
const tableStore: any = new TableStore({
url: '/process-boot/electricityQuality/getIssues',
publicHeight: 65,
method: 'POST',
column: [
// { width: '60', type: 'checkbox' },
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'orgName', title: '所属单位' },
{
field: 'problemSources',
title: '问题来源'
},
{ field: 'powerQualityProblemNo', title: '问题编号' },
{ field: 'problemName', title: '问题名称' },
{ field: 'dataDate', title: '问题新建时间' },
{
field: 'reportProcess',
title: '填报进度',
formatter: (row: any) => {
return fillingProgress.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
field: 'reportProcessStatus',
title: '状态',
formatter: (row: any) => {
return auditStatus.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '查看',
type: 'primary',
disabled: row => {
return row.reportProcessStatus == 'Init'
},
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {
detailRef.value.open(row)
}
},
{
name: 'edit',
title: '填报',
disabled: row => {
return (
row.reportProcessStatus == 'Auditt' ||
(row.reportProcess == 'Insights' && row.reportProcessStatus == 'Success') ||
row.reportProcess == 'Archived'
)
},
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
dialogVisible.value = true
setTimeout(() => {
FillingRef.value.open(row)
}, 10)
}
},
{
name: 'edit',
title: '归档',
disabled: row => {
return !(row.reportProcess == 'Insights' && row.reportProcessStatus == 'Success')
},
type: 'primary',
icon: 'el-icon-SuccessFilled',
render: 'basicButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定归档?'
},
click: row => {
archive(row.powerQualityProblemNo).then(() => {
ElMessage.success('归档成功!')
tableStore.index()
})
}
},
{
name: 'edit',
title: '审核记录',
type: 'primary',
disabled: row => {
return row.reportProcessStatus == 'Init'
},
icon: 'el-icon-PieChart',
render: 'basicButton',
click: row => {
recordingRef.value.open(row)
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
disabled: row => {
return row.reportProcess == 'Archived'
},
click: row => {
deleteIssues(row.powerQualityProblemNo).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.dataDate = tableStore.table.params.searchBeginTime
tableStore.table.params.dataType = TableHeaderRef.value.datePickerRef.interval
}
})
tableStore.table.params.problemName = ''
tableStore.table.params.problemSources = ''
tableStore.table.params.reportProcess = ''
tableStore.table.params.reportProcessStatus = ''
provide('tableStore', tableStore)
onMounted(() => {
TableHeaderRef.value.setDatePicker([
{ label: '年', value: 1 },
{ label: '季', value: 2 },
{ label: '月', value: 3 }
])
tableStore.index()
})
// 新增
const add = () => {
showNewlyAdded.value = true
}
// 关闭弹框
const handleClose = () => {
showNewlyAdded.value = false
}
// 关闭 填报
const beforeClose = () => {
dialogVisible.value = false
tableStore.index()
}
</script>

View File

@@ -122,7 +122,7 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: 120,
align: 'center',
render: 'buttons',

View File

@@ -187,11 +187,11 @@ const tableStore = new TableStore({
title: '最新数据时间'
},
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
align: 'center',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'productSetting',

View File

@@ -104,11 +104,11 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: '180',
align: 'center',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'edit',

View File

@@ -134,9 +134,9 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: 230,
fixed: 'right',
render: 'buttons',
buttons: [
// {

View File

@@ -1,67 +1,67 @@
<template>
<div>
<div>
<TableHeader area datePicker ref="TableHeaderRef" />
<Table ref="tableRef" />
<!-- 审核 -->
<planAdd ref="planAddRef" @onsubmit="tableStore.index()" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import planAdd from './planAdd.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const TableHeaderRef = ref()
const planAddRef = ref()
const tableStore = new TableStore({
url: '/process-boot/rGeneralSurveyPlan/queryPlanAudit',
publicHeight: 65,
method: 'POST',
column: [
{ field: 'orgName', title: '所属单位' },
{ field: 'planNo', title: '普测计划编号' },
{ field: 'planName', title: '普测计划名称' },
{ field: 'planStartTime', title: '开始时间' },
{ field: 'planEndTime', title: '结束时间' },
{ field: 'subCount', title: '普测变电站数量' },
{
title: '操作',
width: '120',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '审核',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
planAddRef.value.open('计划审核', row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.planStartTime = tableStore.table.params.searchBeginTime
tableStore.table.params.planEndTime = tableStore.table.params.searchEndTime
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.currentPage = tableStore.table.params.pageNum
}
})
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>
<template>
<div>
<div>
<TableHeader area datePicker ref="TableHeaderRef" />
<Table ref="tableRef" />
<!-- 审核 -->
<planAdd ref="planAddRef" @onsubmit="tableStore.index()" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import planAdd from './planAdd.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const TableHeaderRef = ref()
const planAddRef = ref()
const tableStore = new TableStore({
url: '/process-boot/rGeneralSurveyPlan/queryPlanAudit',
publicHeight: 65,
method: 'POST',
column: [
{ field: 'orgName', title: '所属单位' },
{ field: 'planNo', title: '普测计划编号' },
{ field: 'planName', title: '普测计划名称' },
{ field: 'planStartTime', title: '开始时间' },
{ field: 'planEndTime', title: '结束时间' },
{ field: 'subCount', title: '普测变电站数量' },
{
title: '操作',fixed: 'right',
width: '120',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '审核',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
planAddRef.value.open('计划审核', row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.planStartTime = tableStore.table.params.searchBeginTime
tableStore.table.params.planEndTime = tableStore.table.params.searchEndTime
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.currentPage = tableStore.table.params.pageNum
}
})
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -147,9 +147,9 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: '180',
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -1,362 +1,362 @@
<template>
<TableHeader area datePicker nextFlag theCurrentTime showTimeAll ref="TableHeaderRef" showExport>
<template v-slot:select>
<el-form-item label="监督类型">
<el-select v-model="tableStore.table.params.supvType" clearable placeholder="请选择监督类型">
<el-option
v-for="item in supvTypeOptionList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option
v-for="item in statusSelect"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 新增 -->
<planTest ref="planTestRef" @onsubmit="tableStore.index()" />
</template>
<script setup lang="ts">
import { ref, onMounted, provide, watch, nextTick } from 'vue'
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { cancelTest } from '@/api/process-boot/generalTest'
import planTest from './planTest.vue'
import { useRouter } from 'vue-router'
import { deleteSurveyPlanTest } from '@/api/supervision-boot/delete/index'
import { queryPlan, removeSurvey } from '@/api/process-boot/generalTest'
import { getUserByRoleType } from '@/api/user-boot/user'
const { push } = useRouter()
const tableRef = ref()
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const supvTypeOptionList = dictData.getBasicData('supv_type')
const statusSelect = dictData.statusSelect()
const planTestRef = ref()
const TableHeaderRef = ref()
const auditList: any = ref([])
const tableStore = new TableStore({
url: '/supervision-boot/surveyTest/surveyTestPage',
publicHeight: 65,
method: 'POST',
filename: '技术监督测试管理',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'planName', title: '计划名称', minWidth: 140 },
{
field: 'supvType',
title: '监督类型',
minWidth: 130,
formatter: (row: any) => {
return supvTypeOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'supvObjectName',
minWidth: 130,
title: '监督对象名称'
},
{ field: 'substationName', title: '变电站', minWidth: 140 },
{ field: 'planStartTime', title: '计划开始时间', minWidth: 140 },
{ field: 'planEndTime', title: '计划结束时间', minWidth: 140 },
{
field: 'problemFlag',
title: '是否存在问题',
minWidth: 120,
render: 'tag',
custom: {
0: 'success',
1: 'danger',
null: 'primary'
},
replaceValue: {
0: '合格',
1: '存在问题',
null: '待测试'
}
},
{ field: 'deptName', title: '负责单位', minWidth: 140 },
{ field: 'completeBy', title: '计划负责人', minWidth: 130 },
{ field: 'completeTime', title: '实际完成时间', minWidth: 140 },
{
field: 'status',
title: '流程状态',
render: 'tag',
minWidth: 140,
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 120,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
minWidth: 180,
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'productSetting',
title: '测试填报',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.status != 6
},
click: row => {
add(row.id)
}
},
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.status == 6 || !row.processInstanceId
},
click: row => {
// planTestRef.value.open('查看计划', row)
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.deptId != adminInfo.$state.deptId || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
planTestRef.value.open('编辑', row.id, false)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.deptId != adminInfo.$state.deptId || !(row.status == 3 || row.status == 4)
},
click: row => {
planTestRef.value.open('重新发起计划测试', row.id, false)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.deptId != adminInfo.$state.deptId || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.currentPage = tableStore.table.params.pageNum
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.problemFlag = item.problemFlag == 0 ? '合格' : item.problemFlag == 1 ? '存在问题' : '待测试'
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: '已取消'
return item
})
}
})
tableStore.table.params.status = ''
tableStore.table.params.supvType = ''
provide('tableStore', tableStore)
// 新增计划
const add = (id: string) => {
planTestRef.value.open('计划测试填报', id, true)
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteSurveyPlanTest(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
const exportFn = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
queryPlan(form).then(res => {
tableRef.value.getRef().exportData({
filename: '计划', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelTest(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
// 取消
onMounted(() => {
tableStore.index()
getUserByRoleType(3).then(res => {
auditList.value = res.data
})
})
const props = defineProps(['id', 'businessKey'])
watch(
() => props.id,
async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
nextTick(() => {
if (props.businessKey == '3') {
planTestRef.value.open('编辑', fullId, false)
} else {
planTestRef.value.open('重新发起计划测试', fullId, false)
}
})
},
{ immediate: true }
)
</script>
<style scoped lang="scss"></style>
<template>
<TableHeader area datePicker nextFlag theCurrentTime showTimeAll ref="TableHeaderRef" showExport>
<template v-slot:select>
<el-form-item label="监督类型">
<el-select v-model="tableStore.table.params.supvType" clearable placeholder="请选择监督类型">
<el-option
v-for="item in supvTypeOptionList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option
v-for="item in statusSelect"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 新增 -->
<planTest ref="planTestRef" @onsubmit="tableStore.index()" />
</template>
<script setup lang="ts">
import { ref, onMounted, provide, watch, nextTick } from 'vue'
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { cancelTest } from '@/api/process-boot/generalTest'
import planTest from './planTest.vue'
import { useRouter } from 'vue-router'
import { deleteSurveyPlanTest } from '@/api/supervision-boot/delete/index'
import { queryPlan, removeSurvey } from '@/api/process-boot/generalTest'
import { getUserByRoleType } from '@/api/user-boot/user'
const { push } = useRouter()
const tableRef = ref()
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const supvTypeOptionList = dictData.getBasicData('supv_type')
const statusSelect = dictData.statusSelect()
const planTestRef = ref()
const TableHeaderRef = ref()
const auditList: any = ref([])
const tableStore = new TableStore({
url: '/supervision-boot/surveyTest/surveyTestPage',
publicHeight: 65,
method: 'POST',
filename: '技术监督测试管理',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'planName', title: '计划名称', minWidth: 140 },
{
field: 'supvType',
title: '监督类型',
minWidth: 130,
formatter: (row: any) => {
return supvTypeOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'supvObjectName',
minWidth: 130,
title: '监督对象名称'
},
{ field: 'substationName', title: '变电站', minWidth: 140 },
{ field: 'planStartTime', title: '计划开始时间', minWidth: 140 },
{ field: 'planEndTime', title: '计划结束时间', minWidth: 140 },
{
field: 'problemFlag',
title: '是否存在问题',
minWidth: 120,
render: 'tag',
custom: {
0: 'success',
1: 'danger',
null: 'primary'
},
replaceValue: {
0: '合格',
1: '存在问题',
null: '待测试'
}
},
{ field: 'deptName', title: '负责单位', minWidth: 140 },
{ field: 'completeBy', title: '计划负责人', minWidth: 130 },
{ field: 'completeTime', title: '实际完成时间', minWidth: 140 },
{
field: 'status',
title: '流程状态',
render: 'tag',
minWidth: 140,
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 120,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
minWidth: 180,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '测试填报',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.status != 6
},
click: row => {
add(row.id)
}
},
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.status == 6 || !row.processInstanceId
},
click: row => {
// planTestRef.value.open('查看计划', row)
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.deptId != adminInfo.$state.deptId || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
planTestRef.value.open('编辑', row.id, false)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.deptId != adminInfo.$state.deptId || !(row.status == 3 || row.status == 4)
},
click: row => {
planTestRef.value.open('重新发起计划测试', row.id, false)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.deptId != adminInfo.$state.deptId || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.currentPage = tableStore.table.params.pageNum
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.problemFlag = item.problemFlag == 0 ? '合格' : item.problemFlag == 1 ? '存在问题' : '待测试'
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: '已取消'
return item
})
}
})
tableStore.table.params.status = ''
tableStore.table.params.supvType = ''
provide('tableStore', tableStore)
// 新增计划
const add = (id: string) => {
planTestRef.value.open('计划测试填报', id, true)
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteSurveyPlanTest(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
const exportFn = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
queryPlan(form).then(res => {
tableRef.value.getRef().exportData({
filename: '计划', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelTest(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
// 取消
onMounted(() => {
tableStore.index()
getUserByRoleType(3).then(res => {
auditList.value = res.data
})
})
const props = defineProps(['id', 'businessKey'])
watch(
() => props.id,
async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
nextTick(() => {
if (props.businessKey == '3') {
planTestRef.value.open('编辑', fullId, false)
} else {
planTestRef.value.open('重新发起计划测试', fullId, false)
}
})
},
{ immediate: true }
)
</script>
<style scoped lang="scss"></style>

View File

@@ -61,7 +61,7 @@ const tableStore = new TableStore({
{ field: 'recordTime', title: '建档时间' },
{ field: 'iuploadTime', title: '报告提交评估时间' },
{
title: '操作',
title: '操作',fixed: 'right',
width: '120',
render: 'buttons',
buttons: [

View File

@@ -1,129 +1,129 @@
<template>
<div>
<div>
<TableHeader area ref="TableHeaderRef">
<template #select>
<el-form-item label="干扰源类型">
<el-select v-model="tableStore.table.params.loadType" clearable placeholder="请选择干扰源类型">
<el-option
v-for="item in interferenceType"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="干扰源用户名称">
<el-input
v-model="tableStore.table.params.userName"
clearable
placeholder="请选择干扰源用户名称"
></el-input>
</el-form-item>
<el-form-item label="关联干扰源用户">
<el-input
v-model="tableStore.table.params.relationUserName"
clearable
placeholder="请选择关联干扰源用户"
></el-input>
</el-form-item>
<el-form-item label="是否已上传实测">
<el-select
v-model="tableStore.table.params.aisFileUpload"
clearable
placeholder="请选择是否已上传实测"
>
<el-option label="否" value="0" />
<el-option label="是" value="1" />
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Upload" type="primary">上传</el-button>
<el-button icon="el-icon-Download" type="primary">导出</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { mainHeight } from '@/utils/layout'
import { useDictData } from '@/stores/dictData'
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
const dictData = useDictData()
const interferenceType = dictData.getBasicData('Interference_Source')
const istatusList = dictData.getBasicData('On-network_Status')
const TableHeaderRef = ref()
const tableStore = new TableStore({
url: '/process-boot/loadTypeUserManage/getLoadTypeRelationList',
publicHeight: 65,
method: 'POST',
column: [
{ width: '60', type: 'checkbox' },
{ field: 'orgName', title: '所属单位' },
{
field: 'loadType',
title: '干扰源类型',
formatter: row => {
return interferenceType.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'userName', title: '干扰源用户名称' },
{ field: 'relationUserName', title: '关联干扰源用户名称' },
{
field: 'istatus',
title: '实测报告状态',
formatter: row => {
return istatusList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '查看',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
}
})
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>
<template>
<div>
<div>
<TableHeader area ref="TableHeaderRef">
<template #select>
<el-form-item label="干扰源类型">
<el-select v-model="tableStore.table.params.loadType" clearable placeholder="请选择干扰源类型">
<el-option
v-for="item in interferenceType"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="干扰源用户名称">
<el-input
v-model="tableStore.table.params.userName"
clearable
placeholder="请选择干扰源用户名称"
></el-input>
</el-form-item>
<el-form-item label="关联干扰源用户">
<el-input
v-model="tableStore.table.params.relationUserName"
clearable
placeholder="请选择关联干扰源用户"
></el-input>
</el-form-item>
<el-form-item label="是否已上传实测">
<el-select
v-model="tableStore.table.params.aisFileUpload"
clearable
placeholder="请选择是否已上传实测"
>
<el-option label="否" value="0" />
<el-option label="是" value="1" />
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Upload" type="primary">上传</el-button>
<el-button icon="el-icon-Download" type="primary">导出</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { mainHeight } from '@/utils/layout'
import { useDictData } from '@/stores/dictData'
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
const dictData = useDictData()
const interferenceType = dictData.getBasicData('Interference_Source')
const istatusList = dictData.getBasicData('On-network_Status')
const TableHeaderRef = ref()
const tableStore = new TableStore({
url: '/process-boot/loadTypeUserManage/getLoadTypeRelationList',
publicHeight: 65,
method: 'POST',
column: [
{ width: '60', type: 'checkbox' },
{ field: 'orgName', title: '所属单位' },
{
field: 'loadType',
title: '干扰源类型',
formatter: row => {
return interferenceType.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'userName', title: '干扰源用户名称' },
{ field: 'relationUserName', title: '关联干扰源用户名称' },
{
field: 'istatus',
title: '实测报告状态',
formatter: row => {
return istatusList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '查看',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
}
})
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -188,9 +188,9 @@ const tableStore = new TableStore({
},
// visible:!jb_pl.value && !jb_dky.value?true:false,
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: 300,
fixed: 'right',
render: 'buttons',
buttons: [

View File

@@ -161,9 +161,9 @@ const tableStore = new TableStore({
},
{ field: 'createTime', title: '创建时间', minWidth: 100 },
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: 180,
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -167,9 +167,9 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -1,217 +1,217 @@
<template>
<div class="default-main">
<!-- <el-dialog
v-model="dialogFormVisible"
title="技术监督计划实施问题"
width="90%"
:append-to-body="true"
:before-close="close"
:close-on-click-modal="false"
draggable
custom-class="fixed-dialog"
@closed="close"
> -->
<TableHeader :showSearch="false" ref="TableHeaderRef">
<!-- <template #select>
<el-form-item label="用户名称">
<el-input v-model="tableStore.table.params.searchValue" clearable></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.loadType" clearable placeholder="请选择所在地市">
<el-option
v-for="item in areaOptionList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template> -->
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Back" @click="go(-1)">返回</el-button>
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRefs" />
<!-- </el-dialog> -->
<addForm ref="addFormRef" :planId="planId" @onSubmit="effectTableStore.index()"></addForm>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, reactive, defineExpose, defineProps, defineEmits, watch, onUnmounted } from 'vue'
import { useDictData } from '@/stores/dictData'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import addForm from './addForm.vue'
import { queryByAllCode } from '@/api/system-boot/dictTree'
import { useAdminInfo } from '@/stores/adminInfo'
import { uploadFile } from '@/api/system-boot/file'
import { addPlanFormData, getUserByDeptId } from '@/api/supervision-boot/plan/index'
import { getAreaList } from '@/api/common'
import Area from '@/components/form/area/index.vue'
defineOptions({
name: 'PlanEffectProblem'
})
const emits = defineEmits([''])
const props = defineProps({
effectProblemForm: {
type: Object,
default: () => ({})
}
})
const planId: any = ref('')
const dictData = useDictData()
const dialogFormVisible = ref(false)
const tableRefs = ref()
//字典获取问题类型
const problemTypeList = dictData.getBasicData('problem_type')
//字典整改情况
const rectificationStatusList = dictData.getBasicData('rectification_type')
//字典问题等级
const problemLevelList = dictData.getBasicData('problem_level_type')
const effectTableStore = new TableStore({
url: '/supervision-boot/superProblem/pageProblem',
// publicHeight: 65,
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{
field: 'problemDesc',
title: '问题描述',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'problemLevel',
title: '问题等级',
minWidth: 170,
formatter: (row: any) => {
return problemLevelList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'problemLevelReason',
title: '定级依据',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'problemType',
title: '问题类型',
minWidth: 170,
formatter: (row: any) => {
return problemTypeList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{ field: 'rectificationMeasure', title: '整改措施', minWidth: 170 },
{ field: 'rectificationProgramme', title: '整改方案', minWidth: 170 },
{
field: 'rectificationStatus',
title: '整改情况',
minWidth: 170,
formatter: (row: any) => {
return rectificationStatusList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'rectificationTime',
title: '整改时间',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue.replace('T', ' ')
}
},
{ field: 'remark', title: '备注', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleDetail(row)
}
},
{
name: 'productSetting',
title: '修改',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return true
},
click: row => {
handleEdit(row)
}
}
]
}
],
beforeSearchFun: () => {
effectTableStore.table.params.orgNo = effectTableStore.table.params.deptIndex
}
})
const { query } = useRoute() // 查询参数
const { go } = useRouter() // 路由
const queryId = query.id as unknown as string // 从 URL 传递过来的 id 编号
planId.value = queryId
watch(
() => queryId,
(val, oldVal) => {
if (val) {
effectTableStore.table.params.planId = val
effectTableStore.index()
}
},
{
deep: true,
immediate: true
}
)
provide('tableStore', effectTableStore)
const open = () => {
dialogFormVisible.value = true
}
const close = () => {
dialogFormVisible.value = false
// emits('onSubmit')
}
//新增
const addFormRef = ref()
const addFormModel = () => {
addFormRef.value.open({}, 'add')
}
//详情
const handleDetail = (row: any) => {
addFormRef.value.open(row, 'detail')
}
//修改
const handleEdit = (row: any) => {
console.log(row)
}
onMounted(() => {})
defineExpose({ open })
</script>
<template>
<div class="default-main">
<!-- <el-dialog
v-model="dialogFormVisible"
title="技术监督计划实施问题"
width="90%"
:append-to-body="true"
:before-close="close"
:close-on-click-modal="false"
draggable
custom-class="fixed-dialog"
@closed="close"
> -->
<TableHeader :showSearch="false" ref="TableHeaderRef">
<!-- <template #select>
<el-form-item label="用户名称">
<el-input v-model="tableStore.table.params.searchValue" clearable></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.loadType" clearable placeholder="请选择所在地市">
<el-option
v-for="item in areaOptionList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template> -->
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Back" @click="go(-1)">返回</el-button>
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRefs" />
<!-- </el-dialog> -->
<addForm ref="addFormRef" :planId="planId" @onSubmit="effectTableStore.index()"></addForm>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, reactive, defineExpose, defineProps, defineEmits, watch, onUnmounted } from 'vue'
import { useDictData } from '@/stores/dictData'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import addForm from './addForm.vue'
import { queryByAllCode } from '@/api/system-boot/dictTree'
import { useAdminInfo } from '@/stores/adminInfo'
import { uploadFile } from '@/api/system-boot/file'
import { addPlanFormData, getUserByDeptId } from '@/api/supervision-boot/plan/index'
import { getAreaList } from '@/api/common'
import Area from '@/components/form/area/index.vue'
defineOptions({
name: 'PlanEffectProblem'
})
const emits = defineEmits([''])
const props = defineProps({
effectProblemForm: {
type: Object,
default: () => ({})
}
})
const planId: any = ref('')
const dictData = useDictData()
const dialogFormVisible = ref(false)
const tableRefs = ref()
//字典获取问题类型
const problemTypeList = dictData.getBasicData('problem_type')
//字典整改情况
const rectificationStatusList = dictData.getBasicData('rectification_type')
//字典问题等级
const problemLevelList = dictData.getBasicData('problem_level_type')
const effectTableStore = new TableStore({
url: '/supervision-boot/superProblem/pageProblem',
// publicHeight: 65,
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{
field: 'problemDesc',
title: '问题描述',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'problemLevel',
title: '问题等级',
minWidth: 170,
formatter: (row: any) => {
return problemLevelList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'problemLevelReason',
title: '定级依据',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'problemType',
title: '问题类型',
minWidth: 170,
formatter: (row: any) => {
return problemTypeList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{ field: 'rectificationMeasure', title: '整改措施', minWidth: 170 },
{ field: 'rectificationProgramme', title: '整改方案', minWidth: 170 },
{
field: 'rectificationStatus',
title: '整改情况',
minWidth: 170,
formatter: (row: any) => {
return rectificationStatusList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'rectificationTime',
title: '整改时间',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue.replace('T', ' ')
}
},
{ field: 'remark', title: '备注', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
minWidth: 150,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleDetail(row)
}
},
{
name: 'productSetting',
title: '修改',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return true
},
click: row => {
handleEdit(row)
}
}
]
}
],
beforeSearchFun: () => {
effectTableStore.table.params.orgNo = effectTableStore.table.params.deptIndex
}
})
const { query } = useRoute() // 查询参数
const { go } = useRouter() // 路由
const queryId = query.id as unknown as string // 从 URL 传递过来的 id 编号
planId.value = queryId
watch(
() => queryId,
(val, oldVal) => {
if (val) {
effectTableStore.table.params.planId = val
effectTableStore.index()
}
},
{
deep: true,
immediate: true
}
)
provide('tableStore', effectTableStore)
const open = () => {
dialogFormVisible.value = true
}
const close = () => {
dialogFormVisible.value = false
// emits('onSubmit')
}
//新增
const addFormRef = ref()
const addFormModel = () => {
addFormRef.value.open({}, 'add')
}
//详情
const handleDetail = (row: any) => {
addFormRef.value.open(row, 'detail')
}
//修改
const handleEdit = (row: any) => {
console.log(row)
}
onMounted(() => {})
defineExpose({ open })
</script>

View File

@@ -176,9 +176,9 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: 300,
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -1,382 +1,382 @@
<!--待办事项列表-->
<template>
<div>
<TableHeader date-picker nextFlag theCurrentTime showTimeAll showExport>
<template #select>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option
v-for="item in statusSelect"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="搜索">
<el-input
v-model="tableStore.table.params.searchValue"
placeholder="输入变电站、监测点"
clearable
></el-input>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef" :checkbox-config="checkboxConfig"></Table>
<!--弹框-->
<monitor-quit-popup ref="deviceQuitPopup" />
</div>
</template>
<script setup lang="ts">
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import MonitorQuitPopup from '@/views/pqs/supervise/retire/monitorQuitPopup.vue'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import { cancelQuitRunningDevice, getRunningDeviceById } from '@/api/supervision-boot/device/quitRunningDev'
import { deleteQuitRunningDevice } from '@/api/supervision-boot/delete/index'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const statusSelect = dictData.statusSelect()
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
defineOptions({
name: 'supervision/retire'
})
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const deviceQuitPopup = ref()
const tableStore = new TableStore({
url: '/supervision-boot/quitRunningDevice/list',
method: 'POST',
publicHeight: 65,
filename:'监测点状态管理',
column: [
{
width: '60',
type: 'checkbox'
},
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '供电公司', field: 'gdName', minWidth: 130 },
{ title: '变电站', field: 'subName', minWidth: 160 },
{ title: '监测点', field: 'deviceName', minWidth: 200 },
{ title: '退运原因', field: 'propertyNo', minWidth: 160 },
{
title: '变更前状态',
field: 'devOriginalStatus',
minWidth: 130,
render: 'tag',
custom: {
0: 'success',
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info',
null: 'primary'
},
replaceValue: {
0: '投运',
1: '检修',
2: '停运',
3: '调试',
4: '退运',
null: '/'
}
},
{
title: '目标状态',
field: 'devStatus',
minWidth: 130,
render: 'tag',
custom: {
0: 'success',
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info',
null: 'primary'
},
replaceValue: {
0: '投运',
1: '检修',
2: '停运',
3: '调试',
4: '退运',
null: '/'
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
null: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
null: '/'
}
},
{ field: 'createTime', title: '开始时间', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
align: 'center',
minWidth: '150',
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
deviceQuitPopup.value.open('编辑', row)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
deviceQuitPopup.value.open('重新发起', row)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status !== 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
// for (let key in tableStore.table.params) {
// if (tableStore.table.params[key] === '') {
// delete tableStore.table.params[key]
// }
// }
tableStore.table.params.deviceType = 2
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.devOriginalStatus =
item.devOriginalStatus == 0
? '运行'
: item.devOriginalStatus == 1
? '检修'
: item.devOriginalStatus == 2
? '停运'
: item.devOriginalStatus == 3
? '调试'
: item.devOriginalStatus == 4
? '退运'
: '/'
item.devStatus =
item.devStatus == 0
? '运行'
: item.devStatus == 1
? '检修'
: item.devStatus == 2
? '停运'
: item.devStatus == 3
? '调试'
: item.devStatus == 4
? '退运'
: '/'
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: item.status == 4
? '已取消'
: item.status == 5
? '新增'
: '/'
return item
})
}
})
tableStore.table.params.searchValue = ''
tableStore.table.params.status = ''
provide('tableStore', tableStore)
//新增退运终端信息
const add = () => {
deviceQuitPopup.value.open('新增监测点状态变更')
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteQuitRunningDevice(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
/** 流程实例详情 */
const handleAudit = (instanceId: string, historyInstanceId: string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelQuitRunningDevice(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
onMounted(() => {
// 加载数据
tableStore.index()
})
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
const props = defineProps({ id: { type: String, default: 'null' } })
watch(
() => props.id,
async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getRunningDeviceById(fullId).then(res => {
if (res && res.code == 'A0000') {
deviceQuitPopup.value.open('重新发起', res.data)
}
})
},
{ immediate: true }
)
</script>
<!--待办事项列表-->
<template>
<div>
<TableHeader date-picker nextFlag theCurrentTime showTimeAll showExport>
<template #select>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option
v-for="item in statusSelect"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="搜索">
<el-input
v-model="tableStore.table.params.searchValue"
placeholder="输入变电站、监测点"
clearable
></el-input>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef" :checkbox-config="checkboxConfig"></Table>
<!--弹框-->
<monitor-quit-popup ref="deviceQuitPopup" />
</div>
</template>
<script setup lang="ts">
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import MonitorQuitPopup from '@/views/pqs/supervise/retire/monitorQuitPopup.vue'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import { cancelQuitRunningDevice, getRunningDeviceById } from '@/api/supervision-boot/device/quitRunningDev'
import { deleteQuitRunningDevice } from '@/api/supervision-boot/delete/index'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const statusSelect = dictData.statusSelect()
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
defineOptions({
name: 'supervision/retire'
})
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const deviceQuitPopup = ref()
const tableStore = new TableStore({
url: '/supervision-boot/quitRunningDevice/list',
method: 'POST',
publicHeight: 65,
filename:'监测点状态管理',
column: [
{
width: '60',
type: 'checkbox'
},
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '供电公司', field: 'gdName', minWidth: 130 },
{ title: '变电站', field: 'subName', minWidth: 160 },
{ title: '监测点', field: 'deviceName', minWidth: 200 },
{ title: '退运原因', field: 'propertyNo', minWidth: 160 },
{
title: '变更前状态',
field: 'devOriginalStatus',
minWidth: 130,
render: 'tag',
custom: {
0: 'success',
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info',
null: 'primary'
},
replaceValue: {
0: '投运',
1: '检修',
2: '停运',
3: '调试',
4: '退运',
null: '/'
}
},
{
title: '目标状态',
field: 'devStatus',
minWidth: 130,
render: 'tag',
custom: {
0: 'success',
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info',
null: 'primary'
},
replaceValue: {
0: '投运',
1: '检修',
2: '停运',
3: '调试',
4: '退运',
null: '/'
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
null: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
null: '/'
}
},
{ field: 'createTime', title: '开始时间', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
align: 'center',
minWidth: '150',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
deviceQuitPopup.value.open('编辑', row)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
deviceQuitPopup.value.open('重新发起', row)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status !== 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
// for (let key in tableStore.table.params) {
// if (tableStore.table.params[key] === '') {
// delete tableStore.table.params[key]
// }
// }
tableStore.table.params.deviceType = 2
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.devOriginalStatus =
item.devOriginalStatus == 0
? '运行'
: item.devOriginalStatus == 1
? '检修'
: item.devOriginalStatus == 2
? '停运'
: item.devOriginalStatus == 3
? '调试'
: item.devOriginalStatus == 4
? '退运'
: '/'
item.devStatus =
item.devStatus == 0
? '运行'
: item.devStatus == 1
? '检修'
: item.devStatus == 2
? '停运'
: item.devStatus == 3
? '调试'
: item.devStatus == 4
? '退运'
: '/'
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: item.status == 4
? '已取消'
: item.status == 5
? '新增'
: '/'
return item
})
}
})
tableStore.table.params.searchValue = ''
tableStore.table.params.status = ''
provide('tableStore', tableStore)
//新增退运终端信息
const add = () => {
deviceQuitPopup.value.open('新增监测点状态变更')
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteQuitRunningDevice(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
/** 流程实例详情 */
const handleAudit = (instanceId: string, historyInstanceId: string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelQuitRunningDevice(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
onMounted(() => {
// 加载数据
tableStore.index()
})
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
const props = defineProps({ id: { type: String, default: 'null' } })
watch(
() => props.id,
async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getRunningDeviceById(fullId).then(res => {
if (res && res.code == 'A0000') {
deviceQuitPopup.value.open('重新发起', res.data)
}
})
},
{ immediate: true }
)
</script>

View File

@@ -1,378 +1,378 @@
<!--待办事项列表-->
<template>
<div>
<TableHeader date-picker nextFlag theCurrentTime showTimeAll showExport>
<template v-slot:select>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option
v-for="item in statusSelect"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="搜索">
<el-input
v-model="tableStore.table.params.searchValue"
placeholder="输入变电站、终端"
clearable
></el-input>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef" :checkbox-config="checkboxConfig"></Table>
<!--弹框-->
<device-quit-popup ref="deviceQuitPopup" />
</div>
</template>
<script setup lang="ts">
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import DeviceQuitPopup from '@/views/pqs/supervise/retire/deviceQuitPopup.vue'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import { cancelQuitRunningDevice, getRunningDeviceById } from '@/api/supervision-boot/device/quitRunningDev'
import { useAdminInfo } from '@/stores/adminInfo'
import { useDictData } from '@/stores/dictData'
import { deleteQuitRunningDevice } from '@/api/supervision-boot/delete/index'
const dictData = useDictData()
const statusSelect = dictData.statusSelect()
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
defineOptions({
name: 'supervision/retire'
})
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const deviceQuitPopup = ref()
const tableStore = new TableStore({
url: '/supervision-boot/quitRunningDevice/list',
method: 'POST',
publicHeight: 65,
filename:'终端状态管理',
column: [
{
width: '60',
type: 'checkbox'
},
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '供电公司', field: 'gdName', minWidth: 130 },
{ title: '变电站', field: 'subName', minWidth: 160 },
{ title: '终端名称', field: 'deviceName', minWidth: 130 },
{ title: '变更原因', field: 'propertyNo', minWidth: 160 },
{
title: '变更前状态',
field: 'devOriginalStatus',
minWidth: 130,
render: 'tag',
custom: {
0: 'success',
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info',
null: 'primary'
},
replaceValue: {
0: '运行',
1: '检修',
2: '停运',
3: '调试',
4: '退运',
null: '/'
}
},
{
title: '目标状态',
field: 'devStatus',
minWidth: 130,
render: 'tag',
custom: {
0: 'success',
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info',
null: 'primary'
},
replaceValue: {
0: '运行',
1: '检修',
2: '停运',
3: '调试',
4: '退运',
null: '/'
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{ field: 'createTime', title: '开始时间', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
align: 'center',
minWidth: '150',
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
deviceQuitPopup.value.open('编辑', row)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
deviceQuitPopup.value.open('重新发起', row)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
// for (let key in tableStore.table.params) {
// if (tableStore.table.params[key] === '') {
// delete tableStore.table.params[key]
// }
// }
tableStore.table.params.deviceType = 1
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.devOriginalStatus =
item.devOriginalStatus == 0
? '运行'
: item.devOriginalStatus == 1
? '检修'
: item.devOriginalStatus == 2
? '停运'
: item.devOriginalStatus == 3
? '调试'
: item.devOriginalStatus == 4
? '退运'
: '/'
item.devStatus =
item.devStatus == 0
? '运行'
: item.devStatus == 1
? '检修'
: item.devStatus == 2
? '停运'
: item.devStatus == 3
? '调试'
: item.devStatus == 4
? '退运'
: '/'
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: item.status == 4
? '已取消'
: item.status == 5
? '新增'
: '/'
return item
})
}
})
tableStore.table.params.status = ''
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
//新增退运终端信息
const add = () => {
deviceQuitPopup.value.open('新增终端状态变更')
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteQuitRunningDevice(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
/** 流程实例详情 */
const handleAudit = (instanceId: string, historyInstanceId: string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelQuitRunningDevice(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
onMounted(() => {
// 加载数据
tableStore.index()
})
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
const props = defineProps({ id: { type: String, default: 'null' } })
watch(
() => props.id,
async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getRunningDeviceById(fullId).then(res => {
if (res && res.code == 'A0000') {
deviceQuitPopup.value.open('重新发起', res.data)
}
})
},
{ immediate: true }
)
</script>
<!--待办事项列表-->
<template>
<div>
<TableHeader date-picker nextFlag theCurrentTime showTimeAll showExport>
<template v-slot:select>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option
v-for="item in statusSelect"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="搜索">
<el-input
v-model="tableStore.table.params.searchValue"
placeholder="输入变电站、终端"
clearable
></el-input>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef" :checkbox-config="checkboxConfig"></Table>
<!--弹框-->
<device-quit-popup ref="deviceQuitPopup" />
</div>
</template>
<script setup lang="ts">
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import DeviceQuitPopup from '@/views/pqs/supervise/retire/deviceQuitPopup.vue'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import { cancelQuitRunningDevice, getRunningDeviceById } from '@/api/supervision-boot/device/quitRunningDev'
import { useAdminInfo } from '@/stores/adminInfo'
import { useDictData } from '@/stores/dictData'
import { deleteQuitRunningDevice } from '@/api/supervision-boot/delete/index'
const dictData = useDictData()
const statusSelect = dictData.statusSelect()
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
defineOptions({
name: 'supervision/retire'
})
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const deviceQuitPopup = ref()
const tableStore = new TableStore({
url: '/supervision-boot/quitRunningDevice/list',
method: 'POST',
publicHeight: 65,
filename:'终端状态管理',
column: [
{
width: '60',
type: 'checkbox'
},
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '供电公司', field: 'gdName', minWidth: 130 },
{ title: '变电站', field: 'subName', minWidth: 160 },
{ title: '终端名称', field: 'deviceName', minWidth: 130 },
{ title: '变更原因', field: 'propertyNo', minWidth: 160 },
{
title: '变更前状态',
field: 'devOriginalStatus',
minWidth: 130,
render: 'tag',
custom: {
0: 'success',
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info',
null: 'primary'
},
replaceValue: {
0: '运行',
1: '检修',
2: '停运',
3: '调试',
4: '退运',
null: '/'
}
},
{
title: '目标状态',
field: 'devStatus',
minWidth: 130,
render: 'tag',
custom: {
0: 'success',
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info',
null: 'primary'
},
replaceValue: {
0: '运行',
1: '检修',
2: '停运',
3: '调试',
4: '退运',
null: '/'
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{ field: 'createTime', title: '开始时间', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
align: 'center',
minWidth: '150',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
deviceQuitPopup.value.open('编辑', row)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
deviceQuitPopup.value.open('重新发起', row)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
// for (let key in tableStore.table.params) {
// if (tableStore.table.params[key] === '') {
// delete tableStore.table.params[key]
// }
// }
tableStore.table.params.deviceType = 1
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.devOriginalStatus =
item.devOriginalStatus == 0
? '运行'
: item.devOriginalStatus == 1
? '检修'
: item.devOriginalStatus == 2
? '停运'
: item.devOriginalStatus == 3
? '调试'
: item.devOriginalStatus == 4
? '退运'
: '/'
item.devStatus =
item.devStatus == 0
? '运行'
: item.devStatus == 1
? '检修'
: item.devStatus == 2
? '停运'
: item.devStatus == 3
? '调试'
: item.devStatus == 4
? '退运'
: '/'
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: item.status == 4
? '已取消'
: item.status == 5
? '新增'
: '/'
return item
})
}
})
tableStore.table.params.status = ''
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
//新增退运终端信息
const add = () => {
deviceQuitPopup.value.open('新增终端状态变更')
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteQuitRunningDevice(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
/** 流程实例详情 */
const handleAudit = (instanceId: string, historyInstanceId: string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelQuitRunningDevice(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
onMounted(() => {
// 加载数据
tableStore.index()
})
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
const props = defineProps({ id: { type: String, default: 'null' } })
watch(
() => props.id,
async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getRunningDeviceById(fullId).then(res => {
if (res && res.code == 'A0000') {
deviceQuitPopup.value.open('重新发起', res.data)
}
})
},
{ immediate: true }
)
</script>

View File

@@ -221,11 +221,11 @@ const tableStore = new TableStore({
// },
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: '220',
align: 'center',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'productSetting',

View File

@@ -138,11 +138,11 @@ const tableStore = new TableStore({
// ]
// },
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: '220',
align: 'center',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'productSetting',

View File

@@ -1,214 +1,214 @@
<template>
<div>
<div>
<TableHeader datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="筛选数据">
<el-input
v-model="tableStore.table.params.searchValue"
clearable
placeholder="请选择筛选数据"
></el-input>
</el-form-item>
</template>
</TableHeader>
<div class="box">
<MyEChart style="flex: 1.2" :options="options1" />
<MyEChart style="flex: 2" :options="options2" />
</div>
<Table ref="tableRef" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { mainHeight } from '@/utils/layout'
import { useDictData } from '@/stores/dictData'
import MyEChart from '@/components/echarts/MyEchart.vue'
import { info } from 'console'
const dictData = useDictData()
const dialogVisible = ref(false)
const TableHeaderRef = ref()
const title = ref('')
const options1 = ref({})
const options2 = ref({})
const ruleFormRef = ref()
const tableStore = new TableStore({
url: '/system-boot/area/areaSelect',
publicHeight: 345,
method: 'POST',
column: [
{ field: 'name', title: '事务名称' },
{ field: 'type', title: '事务类型' },
{ field: 'createUser', title: '创建人员' },
{ field: 'companyName', title: '创建部门' },
{ field: 'modifyUser', title: '处理人员' },
{ field: 'modifyTime', title: '处理时间' },
{ field: 'progressTime', title: '进行时间(天)' },
{ field: 'progress', title: '流程状态' },
{ field: 'alertType', title: '预警类型' },
{
title: '操作',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '上传',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {}
},
{
name: 'edit',
title: '查看',
type: '',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {}
}
]
}
],
loadCallback: () => {
tableStore.table.data = []
}
})
tableStore.table.params.searchState = ''
tableStore.table.params.searchValue = ''
tableStore.table.params.type = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
info()
})
//渲染图表
const info = () => {
options1.value = {
title: {
text: '商务类型',
x: 'center',
textStyle: {
fontWeight: 'normal'
}
},
xAxis: [
{
data: ['全部', '预警单', '告警单']
}
],
yAxis: [{}],
series: [
{
name: '数量',
type: 'bar',
barMaxWidth: 30, //最大宽度
data: [
{
value: 9,
id: ''
},
{
value: 4,
id: '0'
},
{
value: 5,
id: '1'
}
]
}
]
}
options2.value = {
title: {
text: '事务流程',
x: 'center',
textStyle: {
fontWeight: 'normal'
}
},
xAxis: [
{
data: [
'全部',
'开始',
'预/告警单下发',
'预/告警单反馈',
'现场测试',
'整改通知单下发',
'整改通知单反馈',
'完结'
]
}
],
yAxis: [{}],
series: [
{
name: '数量',
type: 'bar',
barMaxWidth: 30, //最大宽度
data: [
{
value: 9,
id: ''
},
{
value: 4,
id: '0'
},
{
value: 5,
id: '1'
},
{
value: 5,
id: '2'
},
{
value: 5,
id: '3'
},
{
value: 5,
id: '4'
},
{
value: 5,
id: '5'
},
{
value: 5,
id: '6'
}
]
}
]
}
}
// 新增
const add = () => {
title.value = '新增告警单'
dialogVisible.value = true
}
</script>
<style lang="scss" scoped>
.box {
height: 280px;
display: flex;
justify-content: space-between;
}
</style>
<template>
<div>
<div>
<TableHeader datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="筛选数据">
<el-input
v-model="tableStore.table.params.searchValue"
clearable
placeholder="请选择筛选数据"
></el-input>
</el-form-item>
</template>
</TableHeader>
<div class="box">
<MyEChart style="flex: 1.2" :options="options1" />
<MyEChart style="flex: 2" :options="options2" />
</div>
<Table ref="tableRef" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { mainHeight } from '@/utils/layout'
import { useDictData } from '@/stores/dictData'
import MyEChart from '@/components/echarts/MyEchart.vue'
import { info } from 'console'
const dictData = useDictData()
const dialogVisible = ref(false)
const TableHeaderRef = ref()
const title = ref('')
const options1 = ref({})
const options2 = ref({})
const ruleFormRef = ref()
const tableStore = new TableStore({
url: '/system-boot/area/areaSelect',
publicHeight: 345,
method: 'POST',
column: [
{ field: 'name', title: '事务名称' },
{ field: 'type', title: '事务类型' },
{ field: 'createUser', title: '创建人员' },
{ field: 'companyName', title: '创建部门' },
{ field: 'modifyUser', title: '处理人员' },
{ field: 'modifyTime', title: '处理时间' },
{ field: 'progressTime', title: '进行时间(天)' },
{ field: 'progress', title: '流程状态' },
{ field: 'alertType', title: '预警类型' },
{
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '上传',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {}
},
{
name: 'edit',
title: '查看',
type: '',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {}
}
]
}
],
loadCallback: () => {
tableStore.table.data = []
}
})
tableStore.table.params.searchState = ''
tableStore.table.params.searchValue = ''
tableStore.table.params.type = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
info()
})
//渲染图表
const info = () => {
options1.value = {
title: {
text: '商务类型',
x: 'center',
textStyle: {
fontWeight: 'normal'
}
},
xAxis: [
{
data: ['全部', '预警单', '告警单']
}
],
yAxis: [{}],
series: [
{
name: '数量',
type: 'bar',
barMaxWidth: 30, //最大宽度
data: [
{
value: 9,
id: ''
},
{
value: 4,
id: '0'
},
{
value: 5,
id: '1'
}
]
}
]
}
options2.value = {
title: {
text: '事务流程',
x: 'center',
textStyle: {
fontWeight: 'normal'
}
},
xAxis: [
{
data: [
'全部',
'开始',
'预/告警单下发',
'预/告警单反馈',
'现场测试',
'整改通知单下发',
'整改通知单反馈',
'完结'
]
}
],
yAxis: [{}],
series: [
{
name: '数量',
type: 'bar',
barMaxWidth: 30, //最大宽度
data: [
{
value: 9,
id: ''
},
{
value: 4,
id: '0'
},
{
value: 5,
id: '1'
},
{
value: 5,
id: '2'
},
{
value: 5,
id: '3'
},
{
value: 5,
id: '4'
},
{
value: 5,
id: '5'
},
{
value: 5,
id: '6'
}
]
}
]
}
}
// 新增
const add = () => {
title.value = '新增告警单'
dialogVisible.value = true
}
</script>
<style lang="scss" scoped>
.box {
height: 280px;
display: flex;
justify-content: space-between;
}
</style>

View File

@@ -1,188 +1,188 @@
<template>
<div>
<div>
<TableHeader datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="筛选数据">
<el-input
v-model="tableStore.table.params.searchValue"
clearable
placeholder="请选择筛选数据"
></el-input>
</el-form-item>
<el-form-item label="事务类型:">
<el-select v-model="tableStore.table.params.type" clearable placeholder="请选择事务类型">
<el-option
v-for="item in affairs"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属流程:">
<el-select v-model="tableStore.table.params.searchState" placeholder="请选择所属流程">
<el-option
v-for="item in process"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新建</el-button>
<el-button icon="el-icon-Plus" type="primary" @click="add">上传模板</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { mainHeight } from '@/utils/layout'
import { useDictData } from '@/stores/dictData'
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
const dictData = useDictData()
const process = [
{
name: '开始',
id: '0'
},
{
name: '预/告警单下发',
id: '1'
},
{
name: '反馈单上传',
id: '2'
},
{
name: '现场测试',
id: '3'
},
{
name: '整改通知单下发',
id: '4'
},
{
name: '整改通知单反馈',
id: '5'
},
{
name: '完结',
id: '6'
}
]
const affairs = [
{
name: '预警单',
id: '0'
},
{
name: '告警单',
id: '1'
}
]
const dialogVisible = ref(false)
const TableHeaderRef = ref()
const title = ref('')
const ruleFormRef = ref()
const tableStore = new TableStore({
url: '/system-boot/area/areaSelect',
publicHeight: 65,
method: 'POST',
column: [
{ field: 'name', title: '名称' },
{
field: 'grade',
title: '等级'
},
{ field: 'bigType', title: '策略选择' },
{ field: 'updateBy', title: '更新人员' },
{ field: 'updateTime', title: '更新时间' },
{
field: 'state',
title: '状态',
activeValue: '2',
inactiveValue: '1',
render: 'switch',
onChangeField: (row: any, value) => {
console.log('🚀 ~ row:', 444123, value)
}
},
{
title: '操作',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '绑定',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {}
},
{
name: 'edit',
title: '编辑',
type: '',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
click: row => {
removeUse({ userIds: row.userId }).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
loadCallback: () => {
tableStore.table.data = []
}
})
tableStore.table.params.searchState = ''
tableStore.table.params.searchValue = ''
tableStore.table.params.type = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
// 新增
const add = () => {
title.value = '新增告警单'
dialogVisible.value = true
}
</script>
<template>
<div>
<div>
<TableHeader datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="筛选数据">
<el-input
v-model="tableStore.table.params.searchValue"
clearable
placeholder="请选择筛选数据"
></el-input>
</el-form-item>
<el-form-item label="事务类型:">
<el-select v-model="tableStore.table.params.type" clearable placeholder="请选择事务类型">
<el-option
v-for="item in affairs"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属流程:">
<el-select v-model="tableStore.table.params.searchState" placeholder="请选择所属流程">
<el-option
v-for="item in process"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新建</el-button>
<el-button icon="el-icon-Plus" type="primary" @click="add">上传模板</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { mainHeight } from '@/utils/layout'
import { useDictData } from '@/stores/dictData'
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
const dictData = useDictData()
const process = [
{
name: '开始',
id: '0'
},
{
name: '预/告警单下发',
id: '1'
},
{
name: '反馈单上传',
id: '2'
},
{
name: '现场测试',
id: '3'
},
{
name: '整改通知单下发',
id: '4'
},
{
name: '整改通知单反馈',
id: '5'
},
{
name: '完结',
id: '6'
}
]
const affairs = [
{
name: '预警单',
id: '0'
},
{
name: '告警单',
id: '1'
}
]
const dialogVisible = ref(false)
const TableHeaderRef = ref()
const title = ref('')
const ruleFormRef = ref()
const tableStore = new TableStore({
url: '/system-boot/area/areaSelect',
publicHeight: 65,
method: 'POST',
column: [
{ field: 'name', title: '名称' },
{
field: 'grade',
title: '等级'
},
{ field: 'bigType', title: '策略选择' },
{ field: 'updateBy', title: '更新人员' },
{ field: 'updateTime', title: '更新时间' },
{
field: 'state',
title: '状态',
activeValue: '2',
inactiveValue: '1',
render: 'switch',
onChangeField: (row: any, value) => {
console.log('🚀 ~ row:', 444123, value)
}
},
{
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '绑定',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {}
},
{
name: 'edit',
title: '编辑',
type: '',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
click: row => {
removeUse({ userIds: row.userId }).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
loadCallback: () => {
tableStore.table.data = []
}
})
tableStore.table.params.searchState = ''
tableStore.table.params.searchValue = ''
tableStore.table.params.type = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
// 新增
const add = () => {
title.value = '新增告警单'
dialogVisible.value = true
}
</script>

View File

@@ -1,302 +1,302 @@
<template>
<div>
<div>
<TableHeader area ref="TableHeaderRef">
<template #select>
<el-form-item label="终端名称">
<el-input
v-model="tableStore.table.params.name"
clearable
placeholder="请输入终端名称"
></el-input>
</el-form-item>
<el-form-item label="生产厂家">
<el-select
v-model="tableStore.table.params.manufacture"
placeholder="请选择生产厂家"
multiple
collapse-tags
clearable
class="select"
>
<el-option
v-for="item in manufactorList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检测结果">
<el-select
v-model="tableStore.table.params.testResults"
placeholder="请选择检测结果"
clearable
class="select"
>
<el-option
v-for="item in testResultsList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Download" type="primary">导出</el-button>
<el-upload
ref="uploadRef"
action=""
accept=".xls"
:on-change="choose"
:show-file-list="false"
:auto-upload="false"
>
<template #trigger>
<el-button
icon="el-icon-Upload"
type="primary"
style="margin-left: 12px; margin-right: 12px"
>
excel导入
</el-button>
</template>
</el-upload>
<el-button icon="el-icon-Upload" type="primary" @click="UploadOriginal">上传检测报告</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 上传检测报告 -->
<el-dialog
draggable
title="上传检测报告__支持批量上传"
v-model="showBatchUpload"
width="30%"
:before-close="handleClose"
>
<el-upload
multiple
action=""
:auto-upload="false"
:limit="999"
accept=".doc,.docx"
:file-list="fileList"
:on-remove="handleRemove"
:on-change="chooseBatch"
ref="upload"
>
<el-button type="primary" icon="el-icon-Upload">选择文件</el-button>
<span :style="`color:#f58003`">
  (*传入的检测报告文件格式(终端编号-检测报告(yyyy-MM-dd).docx))
</span>
</el-upload>
<template #footer>
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="BatchUpload"> </el-button>
</template>
</el-dialog>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { DownloadExport, reportDownload, batchTerminal, importReport } from '@/api/process-boot/terminal'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const manufactorList = dictData.getBasicData('Dev_Manufacturers')
const testResultsList = [
{
id: 0,
name: '未展开'
},
{
id: 1,
name: '已展开'
}
]
const TableHeaderRef = ref()
const showBatchUpload = ref(false)
const fileList: any = ref([])
const tableStore = new TableStore({
url: '/process-boot/process/pmsTerminalDetection/getTerminalPage',
publicHeight: 85,
method: 'POST',
column: [
{ field: 'id', title: '终端编号' },
{
field: 'manufacture',
title: '生产厂家',
formatter(row: any) {
return manufactorList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'installPlace', title: '安装位置' },
{ field: 'inspectionUnit', title: '送检单位' },
{
field: 'testResults',
title: '检测结果',
render: 'tag',
custom: {
0: 'warning',
1: 'success'
},
replaceValue: {
0: '未展开',
1: '已展开'
}
// formatter(row: any) {
// return row.cellValue == 0 ? '未展开' : '已展开'
// }
},
{ field: 'nextInspectionTime', title: '下次检测时间' },
{
title: '操作',
width: '250',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'edit',
title: '下载原始数据报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.originalReport == null
},
click: row => {
download(row, 0)
}
},
{
name: 'edit',
title: '下载检测报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.inspectionReport == null
},
click: row => {
download(row, 1)
}
}
]
}
]
})
tableStore.table.params.name = ''
tableStore.table.params.id = dictData.state.area[0].id
tableStore.table.params.testResults = ''
tableStore.table.params.manufacture = []
tableStore.table.params.type = 1
provide('tableStore', tableStore)
// 关闭弹窗查询
const onsubmit = () => {}
// 下载模版
const Export = () => {
DownloadExport().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '终端入网检测录入模板' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// 下载报告
const download = (row: any, type: number) => {
reportDownload({
id: row.id,
type: type
}).then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = type == 1 ? row.inspectionName : row.originalName // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// excel导入
const choose = (e: any) => {
batchTerminal(e.raw).then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功,无错误数据!')
tableStore.index()
} else {
ElMessage.warning('上传成功,有错误数据 自动下载 请查看')
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '模板错误信息' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
}
})
}
// 上传原始报告
const UploadOriginal = () => {
showBatchUpload.value = true
}
// 上传
const BatchUpload = () => {
let form = new FormData()
form.append('type', '1')
fileList.value.forEach((item: any) => {
form.append('files', item.raw)
})
importReport(form)
.then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功!')
handleClose()
tableStore.index()
} else {
ElMessage.error('上传失败!')
}
})
.catch(response => {
// console.log(response);
})
// fileList.value
}
const chooseBatch = (e: any) => {
fileList.value.push(e)
}
const handleRemove = (e: any) => {
fileList.value = fileList.value.filter((item: any) => item.uid !== e.uid)
}
const handleClose = () => {
fileList.value = []
showBatchUpload.value = false
}
onMounted(() => {
tableStore.index()
})
</script>
<template>
<div>
<div>
<TableHeader area ref="TableHeaderRef">
<template #select>
<el-form-item label="终端名称">
<el-input
v-model="tableStore.table.params.name"
clearable
placeholder="请输入终端名称"
></el-input>
</el-form-item>
<el-form-item label="生产厂家">
<el-select
v-model="tableStore.table.params.manufacture"
placeholder="请选择生产厂家"
multiple
collapse-tags
clearable
class="select"
>
<el-option
v-for="item in manufactorList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检测结果">
<el-select
v-model="tableStore.table.params.testResults"
placeholder="请选择检测结果"
clearable
class="select"
>
<el-option
v-for="item in testResultsList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Download" type="primary">导出</el-button>
<el-upload
ref="uploadRef"
action=""
accept=".xls"
:on-change="choose"
:show-file-list="false"
:auto-upload="false"
>
<template #trigger>
<el-button
icon="el-icon-Upload"
type="primary"
style="margin-left: 12px; margin-right: 12px"
>
excel导入
</el-button>
</template>
</el-upload>
<el-button icon="el-icon-Upload" type="primary" @click="UploadOriginal">上传检测报告</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 上传检测报告 -->
<el-dialog
draggable
title="上传检测报告__支持批量上传"
v-model="showBatchUpload"
width="30%"
:before-close="handleClose"
>
<el-upload
multiple
action=""
:auto-upload="false"
:limit="999"
accept=".doc,.docx"
:file-list="fileList"
:on-remove="handleRemove"
:on-change="chooseBatch"
ref="upload"
>
<el-button type="primary" icon="el-icon-Upload">选择文件</el-button>
<span :style="`color:#f58003`">
  (*传入的检测报告文件格式(终端编号-检测报告(yyyy-MM-dd).docx))
</span>
</el-upload>
<template #footer>
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="BatchUpload"> </el-button>
</template>
</el-dialog>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { DownloadExport, reportDownload, batchTerminal, importReport } from '@/api/process-boot/terminal'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const manufactorList = dictData.getBasicData('Dev_Manufacturers')
const testResultsList = [
{
id: 0,
name: '未展开'
},
{
id: 1,
name: '已展开'
}
]
const TableHeaderRef = ref()
const showBatchUpload = ref(false)
const fileList: any = ref([])
const tableStore = new TableStore({
url: '/process-boot/process/pmsTerminalDetection/getTerminalPage',
publicHeight: 85,
method: 'POST',
column: [
{ field: 'id', title: '终端编号' },
{
field: 'manufacture',
title: '生产厂家',
formatter(row: any) {
return manufactorList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'installPlace', title: '安装位置' },
{ field: 'inspectionUnit', title: '送检单位' },
{
field: 'testResults',
title: '检测结果',
render: 'tag',
custom: {
0: 'warning',
1: 'success'
},
replaceValue: {
0: '未展开',
1: '已展开'
}
// formatter(row: any) {
// return row.cellValue == 0 ? '未展开' : '已展开'
// }
},
{ field: 'nextInspectionTime', title: '下次检测时间' },
{
title: '操作',fixed: 'right',
width: '250',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '下载原始数据报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.originalReport == null
},
click: row => {
download(row, 0)
}
},
{
name: 'edit',
title: '下载检测报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.inspectionReport == null
},
click: row => {
download(row, 1)
}
}
]
}
]
})
tableStore.table.params.name = ''
tableStore.table.params.id = dictData.state.area[0].id
tableStore.table.params.testResults = ''
tableStore.table.params.manufacture = []
tableStore.table.params.type = 1
provide('tableStore', tableStore)
// 关闭弹窗查询
const onsubmit = () => {}
// 下载模版
const Export = () => {
DownloadExport().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '终端入网检测录入模板' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// 下载报告
const download = (row: any, type: number) => {
reportDownload({
id: row.id,
type: type
}).then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = type == 1 ? row.inspectionName : row.originalName // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// excel导入
const choose = (e: any) => {
batchTerminal(e.raw).then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功,无错误数据!')
tableStore.index()
} else {
ElMessage.warning('上传成功,有错误数据 自动下载 请查看')
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '模板错误信息' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
}
})
}
// 上传原始报告
const UploadOriginal = () => {
showBatchUpload.value = true
}
// 上传
const BatchUpload = () => {
let form = new FormData()
form.append('type', '1')
fileList.value.forEach((item: any) => {
form.append('files', item.raw)
})
importReport(form)
.then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功!')
handleClose()
tableStore.index()
} else {
ElMessage.error('上传失败!')
}
})
.catch(response => {
// console.log(response);
})
// fileList.value
}
const chooseBatch = (e: any) => {
fileList.value.push(e)
}
const handleRemove = (e: any) => {
fileList.value = fileList.value.filter((item: any) => item.uid !== e.uid)
}
const handleClose = () => {
fileList.value = []
showBatchUpload.value = false
}
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -95,7 +95,7 @@ const tableStore = new TableStore({
}
/* {
title: '操作',
title: '操作',fixed: 'right',
minWidth: 150,
fixed: 'right',
render: 'buttons',

View File

@@ -1,388 +1,388 @@
<template>
<div>
<TableHeader ref="TableHeaderRef" showExport>
<template #select>
<el-form-item label="项目名称">
<el-input style="width: 200px" placeholder="请输入项目名称" v-model="tableStore.table.params.projectName"
clearable></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
<el-option v-for="item in areaOptionList" :key="item.id" :label="item.name"
:value="item.name"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate" :loading="loading">模板下载</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<el-dialog title="详情" width="80%" v-model="dialogShow" v-if="dialogShow">
<DetailInfo :id="userId" :openType="'sourcesOfInterference'"></DetailInfo>
</el-dialog>
<!-- 批量导入 -->
<sensitive-user-popup ref="sensitiveUserPopup" />
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref="addForms" @onSubmit="tableStore.index()" :openType="'sourcesOfInterference'"></addForm>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import addForm from '@/views/pqs/supervise/interfere/components/undocumented/addForm.vue'
import SensitiveUserPopup from './sensitiveUserPopup.vue'
import { useDictData } from '@/stores/dictData'
import { useRouter } from 'vue-router'
import { downloadSensitiveReportTemplate } from '@/api/supervision-boot/userReport/form'
import DetailInfo from '../../interfere/components/undocumented/detail.vue'
import { cancelFormData, getUserReportById } from '@/api/supervision-boot/interfere/index'
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
const addForms = ref()
const dictData = useDictData()
const sensitiveUserPopup = ref()
const TableHeaderRef = ref()
const loading = ref(false)
const areaOptionList = dictData.getBasicData('jibei_area')
const { push, options, currentRoute } = useRouter()
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getInterferenceUserPage',
publicHeight: 65,
method: 'POST',
filename:'干扰源用户台账',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ field: 'city', title: '所在地市', minWidth: 80 },
{ field: 'substation', title: '厂站名称', minWidth: 100 },
{ field: 'projectName', title: '项目名称', minWidth: 170 },
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
{ field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详细信息',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
lookInfo(row.id)
}
},
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
// showDisabled: row => {
// return (
// (row.city != adminInfo.$state.deptName && row.createBy != adminInfo.$state.id) ||
// !(row.dataType == 1)
// )
// },
disabled: row => {
return !(row.status == 0)
},
click: row => {
addForms.value.filterUsers([6])
addForms.value.open({
title: '编辑',
row: row
})
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.setcontroFlag()
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
}
})
tableStore.table.params.city = ''
tableStore.table.params.orgId = adminInfo.$state.deptId
tableStore.table.params.projectName = ''
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
const userId = ref()
const dialogShow = ref(false)
const lookInfo = (id: string) => {
userId.value = id
dialogShow.value = true
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
dataType: 1,
reason: value
}
await cancelFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
// 新增
const addFormModel = () => {
addForms.value.filterUsers([6])
setTimeout(() => {
addForms.value.open({
title: '用户档案录入'
})
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
//导出模板
const exportExcelTemplate = async() => {
loading.value = true
await downloadSensitiveReportTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '干扰源用户台账模板'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
},0)
}
//批量导入用户数据
const importUserData = () => {
sensitiveUserPopup.value.open('导入干扰源用户')
}
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getUserReportById(fullId).then(res => {
if (res && res.code == 'A0000') {
addForms.value.setcontroFlag()
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}, { immediate: true })
</script>
<template>
<div>
<TableHeader ref="TableHeaderRef" showExport>
<template #select>
<el-form-item label="项目名称">
<el-input style="width: 200px" placeholder="请输入项目名称" v-model="tableStore.table.params.projectName"
clearable></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
<el-option v-for="item in areaOptionList" :key="item.id" :label="item.name"
:value="item.name"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate" :loading="loading">模板下载</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<el-dialog title="详情" width="80%" v-model="dialogShow" v-if="dialogShow">
<DetailInfo :id="userId" :openType="'sourcesOfInterference'"></DetailInfo>
</el-dialog>
<!-- 批量导入 -->
<sensitive-user-popup ref="sensitiveUserPopup" />
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref="addForms" @onSubmit="tableStore.index()" :openType="'sourcesOfInterference'"></addForm>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import addForm from '@/views/pqs/supervise/interfere/components/undocumented/addForm.vue'
import SensitiveUserPopup from './sensitiveUserPopup.vue'
import { useDictData } from '@/stores/dictData'
import { useRouter } from 'vue-router'
import { downloadSensitiveReportTemplate } from '@/api/supervision-boot/userReport/form'
import DetailInfo from '../../interfere/components/undocumented/detail.vue'
import { cancelFormData, getUserReportById } from '@/api/supervision-boot/interfere/index'
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
const addForms = ref()
const dictData = useDictData()
const sensitiveUserPopup = ref()
const TableHeaderRef = ref()
const loading = ref(false)
const areaOptionList = dictData.getBasicData('jibei_area')
const { push, options, currentRoute } = useRouter()
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getInterferenceUserPage',
publicHeight: 65,
method: 'POST',
filename:'干扰源用户台账',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ field: 'city', title: '所在地市', minWidth: 80 },
{ field: 'substation', title: '厂站名称', minWidth: 100 },
{ field: 'projectName', title: '项目名称', minWidth: 170 },
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
{ field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
minWidth: 150,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详细信息',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
lookInfo(row.id)
}
},
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
// showDisabled: row => {
// return (
// (row.city != adminInfo.$state.deptName && row.createBy != adminInfo.$state.id) ||
// !(row.dataType == 1)
// )
// },
disabled: row => {
return !(row.status == 0)
},
click: row => {
addForms.value.filterUsers([6])
addForms.value.open({
title: '编辑',
row: row
})
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.setcontroFlag()
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
}
})
tableStore.table.params.city = ''
tableStore.table.params.orgId = adminInfo.$state.deptId
tableStore.table.params.projectName = ''
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
const userId = ref()
const dialogShow = ref(false)
const lookInfo = (id: string) => {
userId.value = id
dialogShow.value = true
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
dataType: 1,
reason: value
}
await cancelFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
// 新增
const addFormModel = () => {
addForms.value.filterUsers([6])
setTimeout(() => {
addForms.value.open({
title: '用户档案录入'
})
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
//导出模板
const exportExcelTemplate = async() => {
loading.value = true
await downloadSensitiveReportTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '干扰源用户台账模板'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
},0)
}
//批量导入用户数据
const importUserData = () => {
sensitiveUserPopup.value.open('导入干扰源用户')
}
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getUserReportById(fullId).then(res => {
if (res && res.code == 'A0000') {
addForms.value.setcontroFlag()
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}, { immediate: true })
</script>

View File

@@ -194,7 +194,7 @@ const tableStore = new TableStore({
}
/* {
title: '操作',
title: '操作',fixed: 'right',
minWidth: 150,
fixed: 'right',
render: 'buttons',

View File

@@ -1,372 +1,372 @@
<template>
<div>
<div>
<TableHeader area ref="TableHeaderRef">
<template #select>
<el-form-item label="终端名称">
<el-input
v-model="tableStore.table.params.name"
clearable
placeholder="请输入终端名称"
></el-input>
</el-form-item>
<el-form-item label="生产厂家">
<el-select
v-model="tableStore.table.params.manufacture"
placeholder="请选择生产厂家"
multiple
collapse-tags
clearable
class="select"
>
<el-option
v-for="item in manufactorList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检测结果">
<el-select
v-model="tableStore.table.params.testResults"
placeholder="请选择检测结果"
clearable
class="select"
>
<el-option
v-for="item in testResultsList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出</el-button>
<el-button icon="el-icon-Download" type="primary" @click="Export">下载模板</el-button>
<el-upload
ref="uploadRef"
action=""
accept=".xls"
:on-change="choose"
:show-file-list="false"
:auto-upload="false"
>
<template #trigger>
<el-button
icon="el-icon-Upload"
type="primary"
style="margin-left: 12px; margin-right: 12px"
>
excel导入
</el-button>
</template>
</el-upload>
<el-button icon="el-icon-Upload" type="primary" @click="UploadOriginal">上传原始报告</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增 -->
<newlyIncreased ref="addRef" @onsubmit="tableStore.index()" />
<!-- 上传原始报告 -->
<el-dialog
draggable
title="上传原始报告__支持批量上传"
v-model="showBatchUpload"
width="30%"
:before-close="handleClose"
>
<el-upload
multiple
action=""
:auto-upload="false"
:limit="999"
accept=".doc,.docx"
:file-list="fileList"
:on-remove="handleRemove"
:on-change="chooseBatch"
ref="upload"
>
<el-button type="primary" icon="el-icon-Upload">选择文件</el-button>
<span :style="`color:#f58003`">  (*传入的原始数据文件格式(终端编号-原始数据报告.docx))</span>
</el-upload>
<template #footer>
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="BatchUpload"> </el-button>
</template>
</el-dialog>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import newlyIncreased from './add.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
DownloadExport,
reportDownload,
batchTerminal,
delTerminal,
getTerminalPage,
importReport
} from '@/api/process-boot/terminal'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const manufactorList = dictData.getBasicData('Dev_Manufacturers')
const testResultsList = [
{
id: 0,
name: '未展开'
},
{
id: 1,
name: '已展开'
}
]
const fileList: any = ref([])
const TableHeaderRef = ref()
const addRef = ref()
const showBatchUpload = ref(false)
const tableRef = ref()
const ruleFormRef = ref()
const tableStore = new TableStore({
url: '/process-boot/process/pmsTerminalDetection/getTerminalPage',
publicHeight: 85,
method: 'POST',
column: [
// { width: '60', type: 'checkbox' },
{ field: 'orgName', title: '所属单位' },
{ field: 'id', title: '终端编号' },
{ field: 'name', title: '终端名称' },
{
field: 'manufacture',
title: '生产厂家',
formatter(row: any) {
return manufactorList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'installPlace', title: '安装位置' },
{ field: 'inspectionUnit', title: '送检单位' },
{
field: 'testResults',
title: '检测结果',
render: 'tag',
custom: {
0: 'warning',
1: 'success'
},
replaceValue: {
0: '未展开',
1: '已展开'
}
},
{ field: 'inspectionTime', title: '检测时间' },
{ field: 'nextInspectionTime', title: '下次检测时间' },
{
title: '操作',
width: '250',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
addRef.value.open({
title: '编辑',
row: row
})
}
},
{
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
delTerminal([row.id]).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
},
{
name: 'edit',
title: '下载原始数据报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.originalReport == null
},
click: row => {
download(row, 0)
}
},
{
name: 'edit',
title: '下载检测报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.inspectionReport == null
},
click: row => {
download(row, 1)
}
}
]
}
]
})
tableStore.table.params.name = ''
tableStore.table.params.id = dictData.state.area[0].id
tableStore.table.params.testResults = ''
tableStore.table.params.manufacture = []
tableStore.table.params.type = 0
provide('tableStore', tableStore)
const add = () => {
addRef.value.open({
title: '新增'
})
}
// 下载模版
const Export = () => {
DownloadExport().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '终端入网检测录入模板' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// 下载报告
const download = (row: any, type: number) => {
reportDownload({
id: row.id,
type: type
}).then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = type == 1 ? row.inspectionName : row.originalName // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// excel导入
const choose = (e: any) => {
batchTerminal(e.raw).then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功,无错误数据!')
tableStore.index()
} else {
ElMessage.warning('上传成功,有错误数据 自动下载 请查看')
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '模板错误信息' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
}
})
}
// 导出
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getTerminalPage(form).then(res => {
tableRef.value.getRef().exportData({
filename: '终端入网检测', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
// 上传原始报告
const UploadOriginal = () => {
showBatchUpload.value = true
}
// 上传
const BatchUpload = () => {
let form = new FormData()
form.append('type', '0')
fileList.value.forEach((item: any) => {
form.append('files', item.raw)
})
importReport(form)
.then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功!')
handleClose()
tableStore.index()
} else {
ElMessage.error('上传失败!')
}
})
.catch(response => {
// console.log(response);
})
// fileList.value
}
const chooseBatch = (e: any) => {
fileList.value.push(e)
}
const handleRemove = (e: any) => {
fileList.value = fileList.value.filter((item: any) => item.uid !== e.uid)
}
const handleClose = () => {
fileList.value = []
showBatchUpload.value = false
}
onMounted(() => {
tableStore.index()
})
</script>
<template>
<div>
<div>
<TableHeader area ref="TableHeaderRef">
<template #select>
<el-form-item label="终端名称">
<el-input
v-model="tableStore.table.params.name"
clearable
placeholder="请输入终端名称"
></el-input>
</el-form-item>
<el-form-item label="生产厂家">
<el-select
v-model="tableStore.table.params.manufacture"
placeholder="请选择生产厂家"
multiple
collapse-tags
clearable
class="select"
>
<el-option
v-for="item in manufactorList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检测结果">
<el-select
v-model="tableStore.table.params.testResults"
placeholder="请选择检测结果"
clearable
class="select"
>
<el-option
v-for="item in testResultsList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出</el-button>
<el-button icon="el-icon-Download" type="primary" @click="Export">下载模板</el-button>
<el-upload
ref="uploadRef"
action=""
accept=".xls"
:on-change="choose"
:show-file-list="false"
:auto-upload="false"
>
<template #trigger>
<el-button
icon="el-icon-Upload"
type="primary"
style="margin-left: 12px; margin-right: 12px"
>
excel导入
</el-button>
</template>
</el-upload>
<el-button icon="el-icon-Upload" type="primary" @click="UploadOriginal">上传原始报告</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增 -->
<newlyIncreased ref="addRef" @onsubmit="tableStore.index()" />
<!-- 上传原始报告 -->
<el-dialog
draggable
title="上传原始报告__支持批量上传"
v-model="showBatchUpload"
width="30%"
:before-close="handleClose"
>
<el-upload
multiple
action=""
:auto-upload="false"
:limit="999"
accept=".doc,.docx"
:file-list="fileList"
:on-remove="handleRemove"
:on-change="chooseBatch"
ref="upload"
>
<el-button type="primary" icon="el-icon-Upload">选择文件</el-button>
<span :style="`color:#f58003`">  (*传入的原始数据文件格式(终端编号-原始数据报告.docx))</span>
</el-upload>
<template #footer>
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="BatchUpload"> </el-button>
</template>
</el-dialog>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import newlyIncreased from './add.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
DownloadExport,
reportDownload,
batchTerminal,
delTerminal,
getTerminalPage,
importReport
} from '@/api/process-boot/terminal'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const manufactorList = dictData.getBasicData('Dev_Manufacturers')
const testResultsList = [
{
id: 0,
name: '未展开'
},
{
id: 1,
name: '已展开'
}
]
const fileList: any = ref([])
const TableHeaderRef = ref()
const addRef = ref()
const showBatchUpload = ref(false)
const tableRef = ref()
const ruleFormRef = ref()
const tableStore = new TableStore({
url: '/process-boot/process/pmsTerminalDetection/getTerminalPage',
publicHeight: 85,
method: 'POST',
column: [
// { width: '60', type: 'checkbox' },
{ field: 'orgName', title: '所属单位' },
{ field: 'id', title: '终端编号' },
{ field: 'name', title: '终端名称' },
{
field: 'manufacture',
title: '生产厂家',
formatter(row: any) {
return manufactorList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'installPlace', title: '安装位置' },
{ field: 'inspectionUnit', title: '送检单位' },
{
field: 'testResults',
title: '检测结果',
render: 'tag',
custom: {
0: 'warning',
1: 'success'
},
replaceValue: {
0: '未展开',
1: '已展开'
}
},
{ field: 'inspectionTime', title: '检测时间' },
{ field: 'nextInspectionTime', title: '下次检测时间' },
{
title: '操作',fixed: 'right',
width: '250',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
addRef.value.open({
title: '编辑',
row: row
})
}
},
{
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
delTerminal([row.id]).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
},
{
name: 'edit',
title: '下载原始数据报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.originalReport == null
},
click: row => {
download(row, 0)
}
},
{
name: 'edit',
title: '下载检测报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.inspectionReport == null
},
click: row => {
download(row, 1)
}
}
]
}
]
})
tableStore.table.params.name = ''
tableStore.table.params.id = dictData.state.area[0].id
tableStore.table.params.testResults = ''
tableStore.table.params.manufacture = []
tableStore.table.params.type = 0
provide('tableStore', tableStore)
const add = () => {
addRef.value.open({
title: '新增'
})
}
// 下载模版
const Export = () => {
DownloadExport().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '终端入网检测录入模板' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// 下载报告
const download = (row: any, type: number) => {
reportDownload({
id: row.id,
type: type
}).then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = type == 1 ? row.inspectionName : row.originalName // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// excel导入
const choose = (e: any) => {
batchTerminal(e.raw).then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功,无错误数据!')
tableStore.index()
} else {
ElMessage.warning('上传成功,有错误数据 自动下载 请查看')
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '模板错误信息' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
}
})
}
// 导出
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getTerminalPage(form).then(res => {
tableRef.value.getRef().exportData({
filename: '终端入网检测', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
// 上传原始报告
const UploadOriginal = () => {
showBatchUpload.value = true
}
// 上传
const BatchUpload = () => {
let form = new FormData()
form.append('type', '0')
fileList.value.forEach((item: any) => {
form.append('files', item.raw)
})
importReport(form)
.then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功!')
handleClose()
tableStore.index()
} else {
ElMessage.error('上传失败!')
}
})
.catch(response => {
// console.log(response);
})
// fileList.value
}
const chooseBatch = (e: any) => {
fileList.value.push(e)
}
const handleRemove = (e: any) => {
fileList.value = fileList.value.filter((item: any) => item.uid !== e.uid)
}
const handleClose = () => {
fileList.value = []
showBatchUpload.value = false
}
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -1,286 +1,286 @@
<template>
<div>
<TableHeader ref="TableHeaderRef" showExport>
<template #select>
<el-form-item label="项目名称">
<el-input style="width: 200px" placeholder="请输入项目名称" v-model="tableStore.table.params.projectName"
clearable></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
<el-option v-for="item in areaOptionList" :key="item.id" :label="item.name"
:value="item.name"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate" :loading="loading">模版下载</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<el-dialog title="详情" width="80%" v-model="dialogShow">
<DetailInfo :id="userId"></DetailInfo>
</el-dialog>
<sensitive-user-popup ref="sensitiveUserPopup" />
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref="addForms" @onSubmit="tableStore.index()" openType="create" :submissionControl="false"></addForm>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } 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 DetailInfo from '../../interfere/components/undocumented/detail.vue'
import { downloadSensitiveUserTemplate } from '@/api/supervision-boot/userReport/form'
import SensitiveUserPopup from './sensitiveUserPopup.vue'
import addForm from '@/views/pqs/supervise/interfere/components/undocumented/addForm.vue'
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
import { ElMessage } from 'element-plus'
const dictData = useDictData()
const sensitiveUserPopup = ref()
const TableHeaderRef = ref()
const loading = ref(false)
const areaOptionList = dictData.getBasicData('jibei_area')
const loadLevelOptionList = dictData.getBasicData('load_level')
const powerSupplyInfoOptionList = dictData.getBasicData('supply_condition')
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getSensitiveUserPage',
publicHeight: 65,
method: 'POST',
filename:'敏感及重要用户台账',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'city', title: '所在地市', minWidth: 80 },
{
field: 'substation',
title: '厂站名称',
minWidth: 100,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'projectName', title: '项目名称', minWidth: 170 },
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userReportSensitivePO.loadLevel',
title: '负荷级别',
minWidth: 170,
formatter: (row: any) => {
return loadLevelOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'userReportSensitivePO.powerSupplyInfo',
title: '供电电源情况',
minWidth: 170,
formatter: (row: any) => {
return powerSupplyInfoOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详细信息',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
lookInfo(row.id)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return (
(row.city != adminInfo.$state.deptName && row.createBy != adminInfo.$state.id) ||
!(row.dataType == 1)
)
},
// disabled: row => {
// return !(row.status == 0)
// },
click: row => {
addForms.value.filterUsers([5, 4, 3, 2, 1, 0])
addForms.value.open({
title: '编辑',
row: row
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
}
})
tableStore.table.params.city = ''
tableStore.table.params.projectName = ''
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.orgId = adminInfo.$state.deptId
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
const addForms = ref()
const userId = ref()
const dialogShow = ref(false)
const lookInfo = (id: string) => {
userId.value = id
dialogShow.value = true
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
// 新增
const addFormModel = () => {
addForms.value.filterUsers([5, 4, 3, 2, 1, 0])
addForms.value.open({
title: '用户档案录入'
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
//导出模板
const exportExcelTemplate = async () => {
loading.value = true
await downloadSensitiveUserTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '敏感及重要用户模板'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
}, 0)
}
//批量导入用户数据
const importUserData = () => {
sensitiveUserPopup.value.open('导入敏感及重要用户')
}
</script>
<template>
<div>
<TableHeader ref="TableHeaderRef" showExport>
<template #select>
<el-form-item label="项目名称">
<el-input style="width: 200px" placeholder="请输入项目名称" v-model="tableStore.table.params.projectName"
clearable></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
<el-option v-for="item in areaOptionList" :key="item.id" :label="item.name"
:value="item.name"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate" :loading="loading">模版下载</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<el-dialog title="详情" width="80%" v-model="dialogShow">
<DetailInfo :id="userId"></DetailInfo>
</el-dialog>
<sensitive-user-popup ref="sensitiveUserPopup" />
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref="addForms" @onSubmit="tableStore.index()" openType="create" :submissionControl="false"></addForm>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } 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 DetailInfo from '../../interfere/components/undocumented/detail.vue'
import { downloadSensitiveUserTemplate } from '@/api/supervision-boot/userReport/form'
import SensitiveUserPopup from './sensitiveUserPopup.vue'
import addForm from '@/views/pqs/supervise/interfere/components/undocumented/addForm.vue'
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
import { ElMessage } from 'element-plus'
const dictData = useDictData()
const sensitiveUserPopup = ref()
const TableHeaderRef = ref()
const loading = ref(false)
const areaOptionList = dictData.getBasicData('jibei_area')
const loadLevelOptionList = dictData.getBasicData('load_level')
const powerSupplyInfoOptionList = dictData.getBasicData('supply_condition')
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getSensitiveUserPage',
publicHeight: 65,
method: 'POST',
filename:'敏感及重要用户台账',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'city', title: '所在地市', minWidth: 80 },
{
field: 'substation',
title: '厂站名称',
minWidth: 100,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'projectName', title: '项目名称', minWidth: 170 },
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userReportSensitivePO.loadLevel',
title: '负荷级别',
minWidth: 170,
formatter: (row: any) => {
return loadLevelOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'userReportSensitivePO.powerSupplyInfo',
title: '供电电源情况',
minWidth: 170,
formatter: (row: any) => {
return powerSupplyInfoOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
minWidth: 150,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详细信息',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
lookInfo(row.id)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return (
(row.city != adminInfo.$state.deptName && row.createBy != adminInfo.$state.id) ||
!(row.dataType == 1)
)
},
// disabled: row => {
// return !(row.status == 0)
// },
click: row => {
addForms.value.filterUsers([5, 4, 3, 2, 1, 0])
addForms.value.open({
title: '编辑',
row: row
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
}
})
tableStore.table.params.city = ''
tableStore.table.params.projectName = ''
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.orgId = adminInfo.$state.deptId
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
const addForms = ref()
const userId = ref()
const dialogShow = ref(false)
const lookInfo = (id: string) => {
userId.value = id
dialogShow.value = true
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
// 新增
const addFormModel = () => {
addForms.value.filterUsers([5, 4, 3, 2, 1, 0])
addForms.value.open({
title: '用户档案录入'
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
//导出模板
const exportExcelTemplate = async () => {
loading.value = true
await downloadSensitiveUserTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '敏感及重要用户模板'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
}, 0)
}
//批量导入用户数据
const importUserData = () => {
sensitiveUserPopup.value.open('导入敏感及重要用户')
}
</script>

View File

@@ -1,304 +1,304 @@
<!---终端入网检测-->
<template>
<TableHeader area ref='TableHeaderRef' showExport>
<template #select>
<el-form-item label='搜索'>
<el-input
v-model='tableStore.table.params.searchValue'
placeholder='输入变电站.终端名称'
clearable
></el-input>
</el-form-item>
<el-form-item label='流程状态'>
<el-select v-model='tableStore.table.params.status' clearable placeholder='请选择流程状态'>
<el-option
v-for='item in statusSelect'
:key='item.id'
:label='item.name'
:value='item.id'
></el-option>
</el-select>
</el-form-item>
<el-form-item label='处理状态'>
<el-select v-model='tableStore.table.params.state' clearable placeholder='请选处理状态'>
<el-option
v-for='item in stateSelect'
:key='item.id'
:label='item.name'
:value='item.id'
></el-option>
</el-select>
</el-form-item>
</template>
</TableHeader>
<Table ref='tableRef' />
<Form ref='FormRef' @onSubmit='tableStore.index()' />
</template>
<script setup lang='ts'>
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import { ElMessage, ElMessageBox } from 'element-plus'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import Form from './form.vue'
import { cancel, getInfoById } from '@/api/supervision-boot/cycleDetection/index'
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const TableHeaderRef = ref()
const tableRef = ref()
const FormRef = ref()
const statusSelect = dictData.statusSelect()
const stateSelect = [
{
id: 0,
name: '未处理'
},
{
id: 1,
name: '处理中'
},
{
id: 2,
name: '已处理'
}
]
//申请联调
const debugForms = ref()
const tableStore = new TableStore({
url: '/supervision-boot/checkDevice/list',
publicHeight: 65,
method: 'POST',
filename:'终端周期检测',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ field: 'substation', title: '变电站' },
{ field: 'dept', title: '供电公司' },
{
field: 'deviceName',
title: '终端名称'
},
{
field: 'thisTimeCheck',
title: '本次定检时间'
},
{
field: 'nextTimeCheck',
title: '下次定检时间'
},
{
field: 'overdueDay',
title: '逾期天数',
type: 'html',
formatter: (row: any) => {
let text = row.row.status == 2
? '/'
: `<span style='color: ${
row.row.overdueDay > 10 ? 'red' : row.row.overdueDay > 3 ? 'yellow' : ''
};text-decoration: none'>${row.row.overdueDay}</span>`
return text
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
5: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
5: '同步台账成功',
null: '/'
}
},
{
title: '操作',
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
},
disabled: row => {
return !row.processInstanceId
}
},
{
name: 'edit',
title: '报告上传',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.status != null
},
click: row => {
FormRef.value.open('报告上传', row)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
FormRef.value.open('重新发起', row)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: async row => {
// cancelLeave(row)
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancel(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.deptId = tableStore.table.params.deptIndex
tableStore.table.params.statveList = [2]
// tableStore.table.params.relationUserName = tableStore.table.params.userName
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: item.status == 4
? '已取消':item.status == 5
? '同步台账成功':'/'
return item
})
}
})
tableStore.table.params.status = ''
tableStore.table.params.state = ''
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
const addFormModel = () => {
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
const props = defineProps(['id', 'businessKey'])
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getInfoById({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
if (props.businessKey == '3') {
FormRef.value.open('报告上传', res.data)
} else {
FormRef.value.open('重新发起', res.data)
}
}
})
}, { immediate: true })
</script>
<style scoped lang='scss'>
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
</style>
<!---终端入网检测-->
<template>
<TableHeader area ref='TableHeaderRef' showExport>
<template #select>
<el-form-item label='搜索'>
<el-input
v-model='tableStore.table.params.searchValue'
placeholder='输入变电站.终端名称'
clearable
></el-input>
</el-form-item>
<el-form-item label='流程状态'>
<el-select v-model='tableStore.table.params.status' clearable placeholder='请选择流程状态'>
<el-option
v-for='item in statusSelect'
:key='item.id'
:label='item.name'
:value='item.id'
></el-option>
</el-select>
</el-form-item>
<el-form-item label='处理状态'>
<el-select v-model='tableStore.table.params.state' clearable placeholder='请选处理状态'>
<el-option
v-for='item in stateSelect'
:key='item.id'
:label='item.name'
:value='item.id'
></el-option>
</el-select>
</el-form-item>
</template>
</TableHeader>
<Table ref='tableRef' />
<Form ref='FormRef' @onSubmit='tableStore.index()' />
</template>
<script setup lang='ts'>
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import { ElMessage, ElMessageBox } from 'element-plus'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import Form from './form.vue'
import { cancel, getInfoById } from '@/api/supervision-boot/cycleDetection/index'
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const TableHeaderRef = ref()
const tableRef = ref()
const FormRef = ref()
const statusSelect = dictData.statusSelect()
const stateSelect = [
{
id: 0,
name: '未处理'
},
{
id: 1,
name: '处理中'
},
{
id: 2,
name: '已处理'
}
]
//申请联调
const debugForms = ref()
const tableStore = new TableStore({
url: '/supervision-boot/checkDevice/list',
publicHeight: 65,
method: 'POST',
filename:'终端周期检测',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ field: 'substation', title: '变电站' },
{ field: 'dept', title: '供电公司' },
{
field: 'deviceName',
title: '终端名称'
},
{
field: 'thisTimeCheck',
title: '本次定检时间'
},
{
field: 'nextTimeCheck',
title: '下次定检时间'
},
{
field: 'overdueDay',
title: '逾期天数',
type: 'html',
formatter: (row: any) => {
let text = row.row.status == 2
? '/'
: `<span style='color: ${
row.row.overdueDay > 10 ? 'red' : row.row.overdueDay > 3 ? 'yellow' : ''
};text-decoration: none'>${row.row.overdueDay}</span>`
return text
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
5: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
5: '同步台账成功',
null: '/'
}
},
{
title: '操作',fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
},
disabled: row => {
return !row.processInstanceId
}
},
{
name: 'edit',
title: '报告上传',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.status != null
},
click: row => {
FormRef.value.open('报告上传', row)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
FormRef.value.open('重新发起', row)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: async row => {
// cancelLeave(row)
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancel(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.deptId = tableStore.table.params.deptIndex
tableStore.table.params.statveList = [2]
// tableStore.table.params.relationUserName = tableStore.table.params.userName
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: item.status == 4
? '已取消':item.status == 5
? '同步台账成功':'/'
return item
})
}
})
tableStore.table.params.status = ''
tableStore.table.params.state = ''
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
const addFormModel = () => {
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
const props = defineProps(['id', 'businessKey'])
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getInfoById({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
if (props.businessKey == '3') {
FormRef.value.open('报告上传', res.data)
} else {
FormRef.value.open('重新发起', res.data)
}
}
})
}, { immediate: true })
</script>
<style scoped lang='scss'>
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
</style>

View File

@@ -1,379 +1,379 @@
<!---终端入网检测-->
<template>
<TableHeader area datePicker nextFlag theCurrentTime showTimeAll showExport ref="TableHeaderRef">
<template #select>
<el-form-item label="搜索">
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入变电站、终端、监测点名称"
clearable style="width: 230px"></el-input>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<!-- <el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button> -->
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 申请联调弹框 -->
<debug ref="debugForms" @onSubmit="tableStore.index()" :debugId="debugId"></debug>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import { ElMessage, ElMessageBox } from 'element-plus'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { getLoadTypeUserList } from '@/api/process-boot/interference'
import {
getMointorPointTempLinedebugDetail,
setTempLinedebugLedgerSync
} from '@/api/supervision-boot/jointDebugList/index'
import debug from './debug.vue'
import { cancelMointorPointTempLinedebug } from '@/api/supervision-boot/jointDebugList/index'
import { useAdminInfo } from '@/stores/adminInfo'
import { deleteTempLineDebugReport } from '@/api/supervision-boot/delete/index'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const TableHeaderRef = ref()
const tableRef = ref()
const statusSelect = dictData.statusSelect()
statusSelect.push({ name: '同步台账成功', id: 5 })
const tableStore = new TableStore({
url: '/supervision-boot/tempLinedebug/list',
publicHeight: 65,
method: 'POST',
filename:'监测点联调列表',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{
field: 'powerSubstationName',
title: '电网侧变电站',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'lineName', title: '监测点名称', minWidth: 170 },
{
field: 'reason',
title: '调试原因',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'lineId', title: '监测点编号', minWidth: 170 },
// { field: 'monitoringTerminalCode', title: '终端编码', minWidth: 170 },
{ field: 'monitoringTerminalName', title: '终端名称', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
5: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
5: '同步台账成功',
null: '/'
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
},
disabled: row => {
return !row.processInstanceId
}
},
// {
// name: 'edit',
// title: '编辑',
// type: 'primary',
// icon: 'el-icon-Open',
// render: 'basicButton',
// showDisabled: row => {
// return row.createBy != adminInfo.$state.id || !(row.status == 0)
// },
// disabled: row => {
// return !(row.status == 0)
// },
// click: row => {
// debugForms.value.open('编辑', row)
// }
// },
{
name: 'productSetting',
title: '申请联调',
type: 'primary',
icon: 'el-icon-add',
render: 'basicButton',
click: row => {
// handleDebug(row)
debugForms.value.open('申请联调', row)
},
disabled: row => {
return row.reason
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
debugForms.value.open('重新发起', row)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
},
{
name: 'productSetting',
title: '同步台账',
type: 'primary',
icon: 'el-icon-add',
render: 'basicButton',
click: row => {
setTempLinedebugLedgerSync({ id: row.id }).then(res => {
if (res.code == 'A0000') {
ElMessage({
message: '台账同步成功',
type: 'success'
})
tableStore.index()
}
})
},
disabled: row => {
return row.status != 2
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.statveList = [2]
// tableStore.table.params.relationUserName = tableStore.table.params.userName
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: item.status == 4
? '已取消':item.status == 5
? '同步台账成功':'/'
return item
})
}
})
tableStore.table.params.status = ''
tableStore.table.params.searchValue = ''
// tableStore.table.params.loadType = ''
// tableStore.table.params.userName = ''
// tableStore.table.params.fileUploadflag = ''
provide('tableStore', tableStore)
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getLoadTypeUserList(form).then(res => {
tableRef.value.getRef().exportData({
filename: '未建档非线性用户', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteTempLineDebugReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
onMounted(() => {
tableStore.index()
})
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
//申请联调
const debugForms = ref()
const debugId = ref('')
const handleDebug = (row: any) => {
debugId.value = row.id
console.log(debugId.value)
debugForms.value.open('申请联调', row)
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelMointorPointTempLinedebug(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getMointorPointTempLinedebugDetail({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
debugForms.value.open('重新发起', res.data)
}
})
}, { immediate: true })
</script>
<style scoped lang="scss">
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
</style>
<!---终端入网检测-->
<template>
<TableHeader area datePicker nextFlag theCurrentTime showTimeAll showExport ref="TableHeaderRef">
<template #select>
<el-form-item label="搜索">
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入变电站、终端、监测点名称"
clearable style="width: 230px"></el-input>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<!-- <el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button> -->
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 申请联调弹框 -->
<debug ref="debugForms" @onSubmit="tableStore.index()" :debugId="debugId"></debug>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import { ElMessage, ElMessageBox } from 'element-plus'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { getLoadTypeUserList } from '@/api/process-boot/interference'
import {
getMointorPointTempLinedebugDetail,
setTempLinedebugLedgerSync
} from '@/api/supervision-boot/jointDebugList/index'
import debug from './debug.vue'
import { cancelMointorPointTempLinedebug } from '@/api/supervision-boot/jointDebugList/index'
import { useAdminInfo } from '@/stores/adminInfo'
import { deleteTempLineDebugReport } from '@/api/supervision-boot/delete/index'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const TableHeaderRef = ref()
const tableRef = ref()
const statusSelect = dictData.statusSelect()
statusSelect.push({ name: '同步台账成功', id: 5 })
const tableStore = new TableStore({
url: '/supervision-boot/tempLinedebug/list',
publicHeight: 65,
method: 'POST',
filename:'监测点联调列表',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{
field: 'powerSubstationName',
title: '电网侧变电站',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'lineName', title: '监测点名称', minWidth: 170 },
{
field: 'reason',
title: '调试原因',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'lineId', title: '监测点编号', minWidth: 170 },
// { field: 'monitoringTerminalCode', title: '终端编码', minWidth: 170 },
{ field: 'monitoringTerminalName', title: '终端名称', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
5: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
5: '同步台账成功',
null: '/'
}
},
{
title: '操作',fixed: 'right',
minWidth: 150,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
},
disabled: row => {
return !row.processInstanceId
}
},
// {
// name: 'edit',
// title: '编辑',
// type: 'primary',
// icon: 'el-icon-Open',
// render: 'basicButton',
// showDisabled: row => {
// return row.createBy != adminInfo.$state.id || !(row.status == 0)
// },
// disabled: row => {
// return !(row.status == 0)
// },
// click: row => {
// debugForms.value.open('编辑', row)
// }
// },
{
name: 'productSetting',
title: '申请联调',
type: 'primary',
icon: 'el-icon-add',
render: 'basicButton',
click: row => {
// handleDebug(row)
debugForms.value.open('申请联调', row)
},
disabled: row => {
return row.reason
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
debugForms.value.open('重新发起', row)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
},
{
name: 'productSetting',
title: '同步台账',
type: 'primary',
icon: 'el-icon-add',
render: 'basicButton',
click: row => {
setTempLinedebugLedgerSync({ id: row.id }).then(res => {
if (res.code == 'A0000') {
ElMessage({
message: '台账同步成功',
type: 'success'
})
tableStore.index()
}
})
},
disabled: row => {
return row.status != 2
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.statveList = [2]
// tableStore.table.params.relationUserName = tableStore.table.params.userName
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: item.status == 4
? '已取消':item.status == 5
? '同步台账成功':'/'
return item
})
}
})
tableStore.table.params.status = ''
tableStore.table.params.searchValue = ''
// tableStore.table.params.loadType = ''
// tableStore.table.params.userName = ''
// tableStore.table.params.fileUploadflag = ''
provide('tableStore', tableStore)
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getLoadTypeUserList(form).then(res => {
tableRef.value.getRef().exportData({
filename: '未建档非线性用户', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteTempLineDebugReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
onMounted(() => {
tableStore.index()
})
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
//申请联调
const debugForms = ref()
const debugId = ref('')
const handleDebug = (row: any) => {
debugId.value = row.id
console.log(debugId.value)
debugForms.value.open('申请联调', row)
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelMointorPointTempLinedebug(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getMointorPointTempLinedebugDetail({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
debugForms.value.open('重新发起', res.data)
}
})
}, { immediate: true })
</script>
<style scoped lang="scss">
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
</style>

View File

@@ -107,9 +107,9 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -1,388 +1,388 @@
<template>
<TableHeader area datePicker nextFlag theCurrentTime showTimeAll showExport ref="TableHeaderRef">
<template #select>
<el-form-item label="搜索">
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入变电站、终端名称"
clearable style="width: 180px"></el-input>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate"
:loading="loading">模版下载</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 新增弹框 -->
<addForm ref="addForms" @onSubmit="tableStore.index()"></addForm>
<!-- 上传模版 -->
<uploadATemplate ref="uploadATemplateRef" />
<!-- 上传模版 详情 -->
<el-dialog title="详情" width="80%" v-model="dialogShow" v-if="dialogShow">
<DetailInfo :id="userId"></DetailInfo>
</el-dialog>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { downloadDevTemplate } from '@/api/supervision-boot/userReport/form'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import DetailInfo from '@/views/pqs/supervise/terminalNetworkDetection/components/terminainal/detail.vue'
import { cancelTerminalFormData, getTerminalDetailsById } from '@/api/supervision-boot/terminal/index'
import uploadATemplate from './uploadATemplate.vue'
import addForm from './addForm.vue'
import { useAdminInfo } from '@/stores/adminInfo'
import { deleteDevReport } from '@/api/supervision-boot/delete/index'
import { getUserReportById } from "@/api/supervision-boot/interfere";
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const TableHeaderRef = ref()
const userId = ref()
const loading = ref(false)
const tableRef = ref()
const areaOptionList = dictData.getBasicData('jibei_area')
const statusSelect = dictData.statusSelect()
const ruleFormRef = ref()
const uploadATemplateRef = ref()
const show: any = ref(false)
const fileList = ref([])
const dialogShow = ref(false)
const flag = ref(false)
const tableStore = new TableStore({
url: '/supervision-boot/deVReport/list',
publicHeight: 65,
method: 'POST',
filename:'终端入网检测',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{
field: 'orgName',
title: '填报部门名称',
minWidth: 170,
formatter: (row: any) => {
row.cellValue = row.cellValue ? row.cellValue : ''
return row.cellValue
}
},
{
field: 'substationName',
title: '所属变电站',
minWidth: 170,
formatter: (row: any) => {
row.cellValue = row.cellValue ? row.cellValue : '/'
return row.cellValue
}
},
{ field: 'monitoringTerminalName', title: '终端名称', minWidth: 170 },
{ field: 'monitoringTerminalCode', title: '终端编号', minWidth: 170 },
{ field: 'reportDate', title: '填报日期', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.importType != 0 || !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'productSetting',
title: '详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.importType != 1
},
click: row => {
userId.value = row.id
dialogShow.value = true
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.importType == 1 ? false : row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return row.importType == 1 ? false : !(row.status == 0)
},
click: row => {
addForms.value.open({
title: '编辑',
row: row
})
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
// tableStore.table.params.relationUserName = tableStore.table.params.userName
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: '已取消'
return item
})
}
})
tableStore.table.params.status = ''
tableStore.table.params.searchValue = ''
// tableStore.table.params.loadType = ''
// tableStore.table.params.userName = ''
// tableStore.table.params.fileUploadflag = ''
provide('tableStore', tableStore)
const addForms = ref()
const addFormModel = () => {
setTimeout(() => {
addForms.value.open({
title: '终端信息'
})
}, 0)
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelTerminalFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteDevReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
//导出模板
const exportExcelTemplate = async () => {
loading.value = true
downloadDevTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '终端入网检测模板'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
}, 0)
}
//批量导入用户数据
const importUserData = () => {
uploadATemplateRef.value.open('导入终端入网检测')
}
onMounted(() => {
tableStore.index()
})
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getTerminalDetailsById({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}, { immediate: true })
</script>
<style scoped lang="scss">
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
</style>
<template>
<TableHeader area datePicker nextFlag theCurrentTime showTimeAll showExport ref="TableHeaderRef">
<template #select>
<el-form-item label="搜索">
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入变电站、终端名称"
clearable style="width: 180px"></el-input>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate"
:loading="loading">模版下载</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 新增弹框 -->
<addForm ref="addForms" @onSubmit="tableStore.index()"></addForm>
<!-- 上传模版 -->
<uploadATemplate ref="uploadATemplateRef" />
<!-- 上传模版 详情 -->
<el-dialog title="详情" width="80%" v-model="dialogShow" v-if="dialogShow">
<DetailInfo :id="userId"></DetailInfo>
</el-dialog>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { downloadDevTemplate } from '@/api/supervision-boot/userReport/form'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import DetailInfo from '@/views/pqs/supervise/terminalNetworkDetection/components/terminainal/detail.vue'
import { cancelTerminalFormData, getTerminalDetailsById } from '@/api/supervision-boot/terminal/index'
import uploadATemplate from './uploadATemplate.vue'
import addForm from './addForm.vue'
import { useAdminInfo } from '@/stores/adminInfo'
import { deleteDevReport } from '@/api/supervision-boot/delete/index'
import { getUserReportById } from "@/api/supervision-boot/interfere";
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const TableHeaderRef = ref()
const userId = ref()
const loading = ref(false)
const tableRef = ref()
const areaOptionList = dictData.getBasicData('jibei_area')
const statusSelect = dictData.statusSelect()
const ruleFormRef = ref()
const uploadATemplateRef = ref()
const show: any = ref(false)
const fileList = ref([])
const dialogShow = ref(false)
const flag = ref(false)
const tableStore = new TableStore({
url: '/supervision-boot/deVReport/list',
publicHeight: 65,
method: 'POST',
filename:'终端入网检测',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{
field: 'orgName',
title: '填报部门名称',
minWidth: 170,
formatter: (row: any) => {
row.cellValue = row.cellValue ? row.cellValue : ''
return row.cellValue
}
},
{
field: 'substationName',
title: '所属变电站',
minWidth: 170,
formatter: (row: any) => {
row.cellValue = row.cellValue ? row.cellValue : '/'
return row.cellValue
}
},
{ field: 'monitoringTerminalName', title: '终端名称', minWidth: 170 },
{ field: 'monitoringTerminalCode', title: '终端编号', minWidth: 170 },
{ field: 'reportDate', title: '填报日期', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
title: '操作',fixed: 'right',
minWidth: 150,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.importType != 0 || !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'productSetting',
title: '详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.importType != 1
},
click: row => {
userId.value = row.id
dialogShow.value = true
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.importType == 1 ? false : row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return row.importType == 1 ? false : !(row.status == 0)
},
click: row => {
addForms.value.open({
title: '编辑',
row: row
})
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
// tableStore.table.params.relationUserName = tableStore.table.params.userName
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: '已取消'
return item
})
}
})
tableStore.table.params.status = ''
tableStore.table.params.searchValue = ''
// tableStore.table.params.loadType = ''
// tableStore.table.params.userName = ''
// tableStore.table.params.fileUploadflag = ''
provide('tableStore', tableStore)
const addForms = ref()
const addFormModel = () => {
setTimeout(() => {
addForms.value.open({
title: '终端信息'
})
}, 0)
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelTerminalFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteDevReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
//导出模板
const exportExcelTemplate = async () => {
loading.value = true
downloadDevTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '终端入网检测模板'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
}, 0)
}
//批量导入用户数据
const importUserData = () => {
uploadATemplateRef.value.open('导入终端入网检测')
}
onMounted(() => {
tableStore.index()
})
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getTerminalDetailsById({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}, { immediate: true })
</script>
<style scoped lang="scss">
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
</style>

View File

@@ -146,9 +146,9 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: 230,
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -1,155 +1,155 @@
<template>
<div>
<TableHeader area datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="问题来源">
<el-select v-model="tableStore.table.params.problemSources" clearable placeholder="请选择问题来源">
<el-option
v-for="item in problemData"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="填报进度">
<el-select v-model="tableStore.table.params.reportProcess" clearable placeholder="请选择填报进度">
<el-option
v-for="item in fillingProgress"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="问题名称">
<el-input
v-model="tableStore.table.params.problemName"
clearable
placeholder="请输入问题名称"
style="width: 100%"
></el-input>
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 审核 -->
<el-dialog draggable title="问题审核" v-model="dialogVisible" width="1400px" :before-close="beforeClose">
<Filling
ref="FillingRef"
v-if="dialogVisible"
:isDisabled="true"
:audit="true"
:flag="true"
@beforeClose="beforeClose"
/>
</el-dialog>
<!-- 审核记录 -->
<recording ref="recordingRef" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } 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 Filling from './filling.vue'
import recording from './recording.vue'
const dictData = useDictData()
const problemData = dictData.getBasicData('Problem_Sources')
const fillingProgress = dictData.getBasicData('Fill_Progress')
const TableHeaderRef = ref()
const FillingRef = ref()
const ruleFormRef = ref()
const list: any = ref({})
const recordingRef = ref(false)
const dialogVisible = ref(false)
const tableStore = new TableStore({
url: '/process-boot/electricityQuality/getIssues',
publicHeight: 65,
method: 'POST',
column: [
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'orgName', title: '所属单位' },
{
field: 'problemSources',
title: '问题来源'
},
{ field: 'powerQualityProblemNo', title: '问题编号' },
{ field: 'problemName', title: '问题名称' },
{ field: 'dataDate', title: '提交时间' },
{
field: 'reportProcess',
title: '填报节点',
formatter: (row: any) => {
return fillingProgress.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
title: '操作',
width: '150',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '审核',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {
dialogVisible.value = true
setTimeout(() => {
list.value = row
FillingRef.value.open(row)
}, 10)
}
},
{
name: 'edit',
title: '审核记录',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {
recordingRef.value.open(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.dataDate = tableStore.table.params.searchBeginTime
tableStore.table.params.dataType = TableHeaderRef.value.datePickerRef.interval
}
})
tableStore.table.params.problemSources = ''
tableStore.table.params.reportProcess = ''
tableStore.table.params.problemName = ''
tableStore.table.params.reportProcessStatus = 'Auditt'
const beforeClose = () => {
tableStore.index()
dialogVisible.value = false
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>
<template>
<div>
<TableHeader area datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="问题来源">
<el-select v-model="tableStore.table.params.problemSources" clearable placeholder="请选择问题来源">
<el-option
v-for="item in problemData"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="填报进度">
<el-select v-model="tableStore.table.params.reportProcess" clearable placeholder="请选择填报进度">
<el-option
v-for="item in fillingProgress"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="问题名称">
<el-input
v-model="tableStore.table.params.problemName"
clearable
placeholder="请输入问题名称"
style="width: 100%"
></el-input>
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 审核 -->
<el-dialog draggable title="问题审核" v-model="dialogVisible" width="1400px" :before-close="beforeClose">
<Filling
ref="FillingRef"
v-if="dialogVisible"
:isDisabled="true"
:audit="true"
:flag="true"
@beforeClose="beforeClose"
/>
</el-dialog>
<!-- 审核记录 -->
<recording ref="recordingRef" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } 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 Filling from './filling.vue'
import recording from './recording.vue'
const dictData = useDictData()
const problemData = dictData.getBasicData('Problem_Sources')
const fillingProgress = dictData.getBasicData('Fill_Progress')
const TableHeaderRef = ref()
const FillingRef = ref()
const ruleFormRef = ref()
const list: any = ref({})
const recordingRef = ref(false)
const dialogVisible = ref(false)
const tableStore = new TableStore({
url: '/process-boot/electricityQuality/getIssues',
publicHeight: 65,
method: 'POST',
column: [
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'orgName', title: '所属单位' },
{
field: 'problemSources',
title: '问题来源'
},
{ field: 'powerQualityProblemNo', title: '问题编号' },
{ field: 'problemName', title: '问题名称' },
{ field: 'dataDate', title: '提交时间' },
{
field: 'reportProcess',
title: '填报节点',
formatter: (row: any) => {
return fillingProgress.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
width: '150',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '审核',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {
dialogVisible.value = true
setTimeout(() => {
list.value = row
FillingRef.value.open(row)
}, 10)
}
},
{
name: 'edit',
title: '审核记录',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {
recordingRef.value.open(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.dataDate = tableStore.table.params.searchBeginTime
tableStore.table.params.dataType = TableHeaderRef.value.datePickerRef.interval
}
})
tableStore.table.params.problemSources = ''
tableStore.table.params.reportProcess = ''
tableStore.table.params.problemName = ''
tableStore.table.params.reportProcessStatus = 'Auditt'
const beforeClose = () => {
tableStore.index()
dialogVisible.value = false
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -1,255 +1,255 @@
<template>
<TableHeader area datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="问题来源">
<el-select v-model="tableStore.table.params.problemSources" clearable placeholder="请选择问题来源">
<el-option
v-for="item in problemData"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="填报进度">
<el-select v-model="tableStore.table.params.reportProcess" clearable placeholder="请选择填报进度">
<el-option
v-for="item in fillingProgress"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="tableStore.table.params.reportProcessStatus" clearable placeholder="请选择状态">
<el-option
v-for="item in auditStatus"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="问题名称">
<el-input
v-model="tableStore.table.params.problemName"
clearable
placeholder="请填写问题名称"
style="width: 100%"
></el-input>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增 -->
<NewlyAdd v-if="showNewlyAdded" @handleClose="handleClose" @onSubmit="beforeClose" />
<!-- 填报 -->
<el-dialog draggable title="填报" v-model="dialogVisible" width="1400px" :before-close="beforeClose">
<Filling ref="FillingRef" v-if="dialogVisible" @beforeClose="beforeClose" />
</el-dialog>
<!-- 详情 -->
<Detail ref="detailRef" />
<!-- 审核记录 -->
<recording ref="recordingRef" />
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { deleteIssues, archive } from '@/api/process-boot/electricitymanagement'
import { useDictData } from '@/stores/dictData'
import NewlyAdd from './NewlyAdd.vue'
import Filling from './filling.vue'
import Detail from './detail.vue'
import recording from './recording.vue'
const dictData = useDictData()
const FillingRef = ref()
const showNewlyAdded = ref(false)
const dialogVisible = ref(false)
const recordingRef = ref(false)
const TableHeaderRef = ref()
const detailRef = ref()
const problemData = dictData.getBasicData('Problem_Sources')
const fillingProgress = dictData.getBasicData('Fill_Progress')
const auditStatus = dictData.getBasicData('Audit_Status')
const tableStore: any = new TableStore({
url: '/process-boot/electricityQuality/getIssues',
publicHeight: 65,
method: 'POST',
column: [
// { width: '60', type: 'checkbox' },
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'orgName', title: '所属单位' },
{
field: 'problemSources',
title: '问题来源'
},
{ field: 'powerQualityProblemNo', title: '问题编号' },
{ field: 'problemName', title: '问题名称' },
{ field: 'dataDate', title: '问题新建时间' },
{
field: 'reportProcess',
title: '填报进度',
formatter: (row: any) => {
return fillingProgress.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
field: 'reportProcessStatus',
title: '状态',
formatter: (row: any) => {
return auditStatus.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
title: '操作',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '查看',
type: 'primary',
disabled: row => {
return row.reportProcessStatus == 'Init'
},
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {
detailRef.value.open(row)
}
},
{
name: 'edit',
title: '填报',
disabled: row => {
return (
row.reportProcessStatus == 'Auditt' ||
(row.reportProcess == 'Insights' && row.reportProcessStatus == 'Success') ||
row.reportProcess == 'Archived'
)
},
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
dialogVisible.value = true
setTimeout(() => {
FillingRef.value.open(row)
}, 10)
}
},
{
name: 'edit',
title: '归档',
disabled: row => {
return !(row.reportProcess == 'Insights' && row.reportProcessStatus == 'Success')
},
type: 'primary',
icon: 'el-icon-SuccessFilled',
render: 'basicButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定归档?'
},
click: row => {
archive(row.powerQualityProblemNo).then(() => {
ElMessage.success('归档成功!')
tableStore.index()
})
}
},
{
name: 'edit',
title: '审核记录',
type: 'primary',
disabled: row => {
return row.reportProcessStatus == 'Init'
},
icon: 'el-icon-PieChart',
render: 'basicButton',
click: row => {
recordingRef.value.open(row)
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
disabled: row => {
return row.reportProcess == 'Archived'
},
click: row => {
deleteIssues(row.powerQualityProblemNo).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.dataDate = tableStore.table.params.searchBeginTime
tableStore.table.params.dataType = TableHeaderRef.value.datePickerRef.interval
}
})
tableStore.table.params.problemName = ''
tableStore.table.params.problemSources = ''
tableStore.table.params.reportProcess = ''
tableStore.table.params.reportProcessStatus = ''
provide('tableStore', tableStore)
onMounted(() => {
TableHeaderRef.value.setDatePicker([
{ label: '年', value: 1 },
{ label: '季', value: 2 },
{ label: '月', value: 3 }
])
tableStore.index()
})
// 新增
const add = () => {
showNewlyAdded.value = true
}
// 关闭弹框
const handleClose = () => {
showNewlyAdded.value = false
}
// 关闭 填报
const beforeClose = () => {
dialogVisible.value = false
tableStore.index()
}
</script>
<template>
<TableHeader area datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="问题来源">
<el-select v-model="tableStore.table.params.problemSources" clearable placeholder="请选择问题来源">
<el-option
v-for="item in problemData"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="填报进度">
<el-select v-model="tableStore.table.params.reportProcess" clearable placeholder="请选择填报进度">
<el-option
v-for="item in fillingProgress"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="tableStore.table.params.reportProcessStatus" clearable placeholder="请选择状态">
<el-option
v-for="item in auditStatus"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="问题名称">
<el-input
v-model="tableStore.table.params.problemName"
clearable
placeholder="请填写问题名称"
style="width: 100%"
></el-input>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增 -->
<NewlyAdd v-if="showNewlyAdded" @handleClose="handleClose" @onSubmit="beforeClose" />
<!-- 填报 -->
<el-dialog draggable title="填报" v-model="dialogVisible" width="1400px" :before-close="beforeClose">
<Filling ref="FillingRef" v-if="dialogVisible" @beforeClose="beforeClose" />
</el-dialog>
<!-- 详情 -->
<Detail ref="detailRef" />
<!-- 审核记录 -->
<recording ref="recordingRef" />
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { deleteIssues, archive } from '@/api/process-boot/electricitymanagement'
import { useDictData } from '@/stores/dictData'
import NewlyAdd from './NewlyAdd.vue'
import Filling from './filling.vue'
import Detail from './detail.vue'
import recording from './recording.vue'
const dictData = useDictData()
const FillingRef = ref()
const showNewlyAdded = ref(false)
const dialogVisible = ref(false)
const recordingRef = ref(false)
const TableHeaderRef = ref()
const detailRef = ref()
const problemData = dictData.getBasicData('Problem_Sources')
const fillingProgress = dictData.getBasicData('Fill_Progress')
const auditStatus = dictData.getBasicData('Audit_Status')
const tableStore: any = new TableStore({
url: '/process-boot/electricityQuality/getIssues',
publicHeight: 65,
method: 'POST',
column: [
// { width: '60', type: 'checkbox' },
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'orgName', title: '所属单位' },
{
field: 'problemSources',
title: '问题来源'
},
{ field: 'powerQualityProblemNo', title: '问题编号' },
{ field: 'problemName', title: '问题名称' },
{ field: 'dataDate', title: '问题新建时间' },
{
field: 'reportProcess',
title: '填报进度',
formatter: (row: any) => {
return fillingProgress.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
field: 'reportProcessStatus',
title: '状态',
formatter: (row: any) => {
return auditStatus.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '查看',
type: 'primary',
disabled: row => {
return row.reportProcessStatus == 'Init'
},
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {
detailRef.value.open(row)
}
},
{
name: 'edit',
title: '填报',
disabled: row => {
return (
row.reportProcessStatus == 'Auditt' ||
(row.reportProcess == 'Insights' && row.reportProcessStatus == 'Success') ||
row.reportProcess == 'Archived'
)
},
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
dialogVisible.value = true
setTimeout(() => {
FillingRef.value.open(row)
}, 10)
}
},
{
name: 'edit',
title: '归档',
disabled: row => {
return !(row.reportProcess == 'Insights' && row.reportProcessStatus == 'Success')
},
type: 'primary',
icon: 'el-icon-SuccessFilled',
render: 'basicButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定归档?'
},
click: row => {
archive(row.powerQualityProblemNo).then(() => {
ElMessage.success('归档成功!')
tableStore.index()
})
}
},
{
name: 'edit',
title: '审核记录',
type: 'primary',
disabled: row => {
return row.reportProcessStatus == 'Init'
},
icon: 'el-icon-PieChart',
render: 'basicButton',
click: row => {
recordingRef.value.open(row)
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
disabled: row => {
return row.reportProcess == 'Archived'
},
click: row => {
deleteIssues(row.powerQualityProblemNo).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.dataDate = tableStore.table.params.searchBeginTime
tableStore.table.params.dataType = TableHeaderRef.value.datePickerRef.interval
}
})
tableStore.table.params.problemName = ''
tableStore.table.params.problemSources = ''
tableStore.table.params.reportProcess = ''
tableStore.table.params.reportProcessStatus = ''
provide('tableStore', tableStore)
onMounted(() => {
TableHeaderRef.value.setDatePicker([
{ label: '年', value: 1 },
{ label: '季', value: 2 },
{ label: '月', value: 3 }
])
tableStore.index()
})
// 新增
const add = () => {
showNewlyAdded.value = true
}
// 关闭弹框
const handleClose = () => {
showNewlyAdded.value = false
}
// 关闭 填报
const beforeClose = () => {
dialogVisible.value = false
tableStore.index()
}
</script>

View File

@@ -1,225 +1,225 @@
<template>
<!-- 用户投诉 -->
<!-- 2 有新增 发起 预警单 -->
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template v-slot:select>
<el-form-item label="是否解决">
<el-select v-model="tableStore.table.params.dealState" clearable placeholder="请选择是否解决">
<el-option v-for="item in dealStateList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</template>
<template v-slot:operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增 -->
<complaintsForm ref="formRef" @onSubmit="tableStore.index()" />
<!-- 详情 -->
<detail ref="detailRef" />
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useDictData } from '@/stores/dictData'
import complaintsForm from './form/complaintsForm.vue'
import { useRouter } from 'vue-router'
import { sureInitiateWarningLeaflet } from '@/api/process-boot/electricitymanagement'
import detail from './complaintsDetail.vue';
// Steady_Statis
const dictData = useDictData()
const exceeded = dictData.getBasicData('Steady_Statis')
const tableRef = ref()
const planAddRef = ref()
const formRef = ref()
const TableHeaderRef = ref()
const detailRef = ref()
const router = useRouter() // 路由对象
const dealStateList = ref([
{
label: '未解决',
value: '0'
},
])
const tableStore = new TableStore({
url: '/supervision-boot/SupervisionUserComplaint/list',
publicHeight: 65,
method: 'POST',
column: [
{
title: '序号',
align: 'center',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'userName', title: '用户名称' },
{ field: 'userNumber', title: '用户编号' },
{ field: 'dutyOrgName', title: '负责单位', minWidth: '80' },
// { field: 'userCategory', title: '用户类别' },
{ field: 'complaintText', title: '投诉内容' },
{ field: 'steadyIndicator', title: '稳态指标' },
{ field: 'transientIndicators', title: '暂态指标' },
{
field: 'monitorName',
title: '监测点名称',
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'detectionFlag',
title: '是否实现监测',
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
},
replaceValue: {
0: '否',
1: '是',
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'dealState',
title: '是否解决',
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
null: 'info'
},
replaceValue: {
0: '未解决',
1: '已解决',
null: '/'
}
},
{
title: '操作',
minWidth: 120,
align: 'center',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '发起告警单',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.dealState != 0
},
// popconfirm: {
// confirmButtonText: '确认',
// cancelButtonText: '取消',
// confirmButtonType: 'primary',
// title: '请确认发起告警单!'
// },
click: async row => {
const { value } = await ElMessageBox.prompt('', '整改意见', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '请输入整改意见'
})
sureInitiateWarningLeaflet({ id: row.id, reformAdvice: value }).then(res => {
ElMessage.success('发起告警单成功!')
tableStore.index()
})
}
},
{
name: 'edit',
title: '详情',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.dealState == 0
},
click: row => {
detailRef.value.open({
row: row,
title: '详情',
})
}
},
{
name: 'edit',
title: '查看告警单',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.initiateWarningFlag == 0
},
click: row => {
router.push({
name: 'supervision/supervision/manage',
query: {
type: 1,
t: Date.now()
}
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.currentPage = tableStore.table.params.pageNum
},
loadCallback: () => {
// tableStore.table.data = [
// {
// userName: '东润开阳堡光伏电站用户',
// userId: '8115771123274',
// complaintContent: '终端频繁重启',
// complaintTime: '2024-05-16'
// }
// ]
}
})
provide('tableStore', tableStore)
tableStore.table.params.dealState = ''
onMounted(() => {
tableStore.index()
})
// 新增
const add = () => {
formRef.value.open({ text: '新增投诉' })
}
</script>
<style scoped lang="scss"></style>
<template>
<!-- 用户投诉 -->
<!-- 2 有新增 发起 预警单 -->
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template v-slot:select>
<el-form-item label="是否解决">
<el-select v-model="tableStore.table.params.dealState" clearable placeholder="请选择是否解决">
<el-option v-for="item in dealStateList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</template>
<template v-slot:operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增 -->
<complaintsForm ref="formRef" @onSubmit="tableStore.index()" />
<!-- 详情 -->
<detail ref="detailRef" />
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useDictData } from '@/stores/dictData'
import complaintsForm from './form/complaintsForm.vue'
import { useRouter } from 'vue-router'
import { sureInitiateWarningLeaflet } from '@/api/process-boot/electricitymanagement'
import detail from './complaintsDetail.vue';
// Steady_Statis
const dictData = useDictData()
const exceeded = dictData.getBasicData('Steady_Statis')
const tableRef = ref()
const planAddRef = ref()
const formRef = ref()
const TableHeaderRef = ref()
const detailRef = ref()
const router = useRouter() // 路由对象
const dealStateList = ref([
{
label: '未解决',
value: '0'
},
])
const tableStore = new TableStore({
url: '/supervision-boot/SupervisionUserComplaint/list',
publicHeight: 65,
method: 'POST',
column: [
{
title: '序号',
align: 'center',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'userName', title: '用户名称' },
{ field: 'userNumber', title: '用户编号' },
{ field: 'dutyOrgName', title: '负责单位', minWidth: '80' },
// { field: 'userCategory', title: '用户类别' },
{ field: 'complaintText', title: '投诉内容' },
{ field: 'steadyIndicator', title: '稳态指标' },
{ field: 'transientIndicators', title: '暂态指标' },
{
field: 'monitorName',
title: '监测点名称',
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'detectionFlag',
title: '是否实现监测',
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
},
replaceValue: {
0: '否',
1: '是',
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'dealState',
title: '是否解决',
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
null: 'info'
},
replaceValue: {
0: '未解决',
1: '已解决',
null: '/'
}
},
{
title: '操作',fixed: 'right',
minWidth: 120,
align: 'center',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '发起告警单',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.dealState != 0
},
// popconfirm: {
// confirmButtonText: '确认',
// cancelButtonText: '取消',
// confirmButtonType: 'primary',
// title: '请确认发起告警单!'
// },
click: async row => {
const { value } = await ElMessageBox.prompt('', '整改意见', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '请输入整改意见'
})
sureInitiateWarningLeaflet({ id: row.id, reformAdvice: value }).then(res => {
ElMessage.success('发起告警单成功!')
tableStore.index()
})
}
},
{
name: 'edit',
title: '详情',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.dealState == 0
},
click: row => {
detailRef.value.open({
row: row,
title: '详情',
})
}
},
{
name: 'edit',
title: '查看告警单',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.initiateWarningFlag == 0
},
click: row => {
router.push({
name: 'supervision/supervision/manage',
query: {
type: 1,
t: Date.now()
}
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.currentPage = tableStore.table.params.pageNum
},
loadCallback: () => {
// tableStore.table.data = [
// {
// userName: '东润开阳堡光伏电站用户',
// userId: '8115771123274',
// complaintContent: '终端频繁重启',
// complaintTime: '2024-05-16'
// }
// ]
}
})
provide('tableStore', tableStore)
tableStore.table.params.dealState = ''
onMounted(() => {
tableStore.index()
})
// 新增
const add = () => {
formRef.value.open({ text: '新增投诉' })
}
</script>
<style scoped lang="scss"></style>

View File

@@ -1,378 +1,378 @@
<template>
<!-- <div>1 监测点信息 发起预告警单 </div> -->
<TableHeader datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template v-slot:select>
<el-form-item label="区域">
<Area ref="areaRef" v-model="tableStore.table.params.deptId" @changeValue="changeArea"/>
</el-form-item>
<el-form-item label="监测点性质">
<el-select v-model="tableStore.table.params.lineType" clearable placeholder="请选择监测点性质">
<el-option label="电网侧" value="0"/>
<el-option label="非电网侧" value="1"/>
</el-select>
</el-form-item>
<el-form-item label="超标指标">
<el-select
v-model="tableStore.table.params.targetList"
clearable
multiple
collapse-tags
collapse-tags-tooltip
placeholder="请选择超标指标"
>
<el-option v-for="item in exceeded" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item label="数据类型">
<el-switch
v-model="tableStore.table.params.dataType"
inline-prompt
active-value="1"
inactive-value="0"
active-text="超标数据"
inactive-text="无数据"
/>
</el-form-item>
<el-form-item label="预警阈值">
<!-- <el-input v-model="tableStore.table.params.alertThreshold" placeholder="请输入预警阈值" clearable></el-input> -->
<el-input-number
v-model="tableStore.table.params.alertThreshold"
:min="0"
:step="1"
step-strictly
@change="changeAlert"
/>
</el-form-item>
<el-form-item label="告警阈值">
<el-input-number
v-model="tableStore.table.params.alarmThreshold"
:min="0"
:step="1"
step-strictly
@change="changeAlarm"
/>
</el-form-item>
<!-- <el-form-item label="搜索">
<el-input
v-model="tableStore.table.params.searchValue"
placeholder="输入变电站、终端、监测点名称"
clearable
></el-input>
</el-form-item> -->
</template>
<template #operation>
<el-button icon="el-icon-Plus" :disabled="flag > 2" type="primary" @click="launch('发起预警单')">
发起预警单
</el-button>
<el-button icon="el-icon-Plus" :disabled="flag > 2" type="primary" @click="launch('发起告警单')">
发起告警单
</el-button>
</template>
</TableHeader>
<Table ref="tableRef"/>
<!-- /告警单 -->
<alarmList ref="alarmListRef" @onSubmit="tableStore.index()"/>
<!-- 详情 -->
<detail ref="detailRef"/>
</template>
<script setup lang="ts">
import {ref, onMounted, provide, nextTick} from 'vue'
import TableStore from '@/utils/tableStore'
import Area from '@/components/form/area/index.vue'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import {ElMessage, ElMessageBox} from 'element-plus'
import {useDictData} from '@/stores/dictData'
import alarmList from './form/alarmList.vue'
import detail from './form/detail.vue'
const dictData = useDictData()
import {useRouter} from 'vue-router'
const router = useRouter() // 路由对象
//字典获取超标指标
const exceeded = dictData.getBasicData('Steady_Statis')
const tableRef = ref()
const industry = dictData.getBasicData('Business_Type')
const TableHeaderRef = ref()
const alarmListRef = ref()
const flagTime = ref(false)
const detailRef = ref()
const list: any = ref({
deptId: '',
searchBeginTime: '',
searchEndTime: '',
alertThreshold: '',
alarmThreshold: ''
})
const level: any = ref(dictData.state.area[0]?.level)
const flag: any = ref('')
const tableStore = new TableStore({
url: '/supervision-boot/onlineMonitor/list',
publicHeight: 65,
method: 'POST',
// isWebPaging:true,
column: [
{title: '', type: 'checkbox', width: 40},
{
title: '序号',
align: 'center',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{field: 'dept', title: '负责单位'},
{field: 'substation', title: '变电站名称'},
{field: 'deviceName', title: '终端名称'},
{field: 'lineName', title: '监测点名称'},
{
field: 'businessType',
title: '监测对象类型',
formatter: (row: any) => {
return industry.find((item: any) => item.id == row.cellValue)?.name || '/'
}
},
{field: 'objectName', title: '监测对象名称'},
{
field: 'targetType',
title: '指标类型',
formatter: (row: any) => {
return exceeded.find((item: any) => item.id == row.cellValue)?.name || '/'
}
},
{
field: 'overLimitDay',
title: '累计超标天数',
formatter: (row: any) => {
return row.cellValue != null ? row.cellValue : '/'
}
},
{
field: 'updateTime',
visible: flagTime,
title: '最新数据时间'
},
{
title: '操作',
width: '180',
align: 'center',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'productSetting',
title: '详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.targetType == 0
},
click: row => {
detailRef.value.open({
text: '详情',
row: row,
list: list.value
})
}
},
{
name: 'productSetting',
title: '查看预警单',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.step != 1
},
click: row => {
router.push({
name: 'supervision/supervision/manage',
query: {
type: 0,
t: Date.now()
}
})
}
},
{
name: 'productSetting',
title: '查看告警单',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.step != 2
},
click: row => {
router.push({
name: 'supervision/supervision/manage',
query: {
type: 1,
t: Date.now()
}
})
}
}
// {
// name: 'productSetting',
// title: '发起告警单',
// type: 'warning',
// disabled: row => {
// return row.overLimitDay < tableStore.table.params.alarmThreshold
// },
// icon: 'el-icon-EditPen',
// render: 'basicButton',
// click: async row => {
// // handleWarningAlarmFlag(row).then(res => {
// // console.log(res)
// // ElMessage.success('发起告警单成功!')
// // tableStore.index()
// // })
// const { value } = await ElMessageBox.prompt('', '整改意见', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// inputType: 'textarea',
// inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
// inputErrorMessage: '请输入整改意见'
// })
// handleWarningAlarmFlag({ ...row, reformAdvice: value }).then(res => {
// ElMessage.success('发起告警单成功!')
// tableStore.index()
// })
// }
// },
// {
// name: 'edit',
// title: '发起预警单',
// type: 'primary',
// icon: 'el-icon-Open',
// disabled: row => {
// return row.overLimitDay >= tableStore.table.params.alarmThreshold
// },
// render: 'basicButton',
// click: async row => {
// // handleWarningAlarmFlag(row).then(res => {
// // console.log(res)
// // ElMessage.success('发起预警单成功!')
// // tableStore.index()
// // })
// const { value } = await ElMessageBox.prompt('', '整改意见', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// inputType: 'textarea',
// inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
// inputErrorMessage: '请输入整改意见'
// })
// handleWarningAlarmFlag({ ...row, reformAdvice: value }).then(res => {
// ElMessage.success('发起预警单成功!')
// tableStore.index()
// })
// }
// }
]
}
],
beforeSearchFun: () => {
tableStore.table.params.currentPage = tableStore.table.params.pageNum
list.value.deptId = tableStore.table.params.deptId
list.value.searchBeginTime = tableStore.table.params.searchBeginTime
list.value.searchEndTime = tableStore.table.params.searchEndTime
if (tableStore.table.params.alertThreshold != '') {
list.value.alertThreshold = tableStore.table.params.alertThreshold
}
list.value.lineType = tableStore.table.params.lineType
list.value.alarmThreshold = tableStore.table.params.alarmThreshold
flag.value = level.value
flagTime.value = tableStore.table.params.dataType == 0 ? true : false
},
loadCallback: () => {
// tableStore.table.data = [
// {
// orgName: '张家口',
// subName: '110kV马头山风电场',
// lineName: '111口头线',
// voltageScale: '110kV',
// overDay: '20',
// overDays: '10'
// },
// {
// orgName: '张家口',
// subName: '110kV韩家庄风电场',
// lineName: '111缘韩一线',
// voltageScale: '110kV',
// overDay: '20',
// overDays: '16'
// }
// ]
}
})
tableStore.table.params.alertThreshold = 5
tableStore.table.params.alarmThreshold = 5
tableStore.table.params.targetList = exceeded.filter(item => item.code == 'Total_Indicator')[0].id
? [exceeded.filter(item => item.code == 'Total_Indicator')[0].id]
: []
tableStore.table.params.lineType = ''
tableStore.table.params.dataType = '1'
tableStore.table.params.deptId = dictData.state.area[0].id
provide('tableStore', tableStore)
onMounted(() => {
TableHeaderRef.value.setDatePicker([{label: '月', value: 3}])
tableStore.index()
setTimeout(() => {
TableHeaderRef.value.showSelectChange()
}, 10)
})
const changeAlert = e => {
if (e == null) {
tableStore.table.params.alertThreshold = 5
} else {
if (e > tableStore.table.params.alarmThreshold) {
ElMessage.warning('预警阈值不能大于报警阈值')
tableStore.table.params.alertThreshold = 5
}
}
}
const changeAlarm = e => {
if (e == null) {
tableStore.table.params.alarmThreshold = 5
} else {
if (e < tableStore.table.params.alertThreshold) {
ElMessage.warning('报警阈值不能小于预警阈值')
tableStore.table.params.alarmThreshold = 5
}
}
}
// 发起预警单
const launch = (title: string) => {
if (tableStore.table.selection.length == 0) {
ElMessage.warning('请选择一条数据')
return
}
alarmListRef.value.open({
text: title,
form: list.value,
row: tableStore.table.selection
})
console.log('🚀 ~ launch ~ list.value:', list.value)
}
const changeArea = e => {
level.value = e.data.level
}
</script>
<style scoped lang="scss"></style>
<template>
<!-- <div>1 监测点信息 发起预告警单 </div> -->
<TableHeader datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template v-slot:select>
<el-form-item label="区域">
<Area ref="areaRef" v-model="tableStore.table.params.deptId" @changeValue="changeArea"/>
</el-form-item>
<el-form-item label="监测点性质">
<el-select v-model="tableStore.table.params.lineType" clearable placeholder="请选择监测点性质">
<el-option label="电网侧" value="0"/>
<el-option label="非电网侧" value="1"/>
</el-select>
</el-form-item>
<el-form-item label="超标指标">
<el-select
v-model="tableStore.table.params.targetList"
clearable
multiple
collapse-tags
collapse-tags-tooltip
placeholder="请选择超标指标"
>
<el-option v-for="item in exceeded" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item label="数据类型">
<el-switch
v-model="tableStore.table.params.dataType"
inline-prompt
active-value="1"
inactive-value="0"
active-text="超标数据"
inactive-text="无数据"
/>
</el-form-item>
<el-form-item label="预警阈值">
<!-- <el-input v-model="tableStore.table.params.alertThreshold" placeholder="请输入预警阈值" clearable></el-input> -->
<el-input-number
v-model="tableStore.table.params.alertThreshold"
:min="0"
:step="1"
step-strictly
@change="changeAlert"
/>
</el-form-item>
<el-form-item label="告警阈值">
<el-input-number
v-model="tableStore.table.params.alarmThreshold"
:min="0"
:step="1"
step-strictly
@change="changeAlarm"
/>
</el-form-item>
<!-- <el-form-item label="搜索">
<el-input
v-model="tableStore.table.params.searchValue"
placeholder="输入变电站、终端、监测点名称"
clearable
></el-input>
</el-form-item> -->
</template>
<template #operation>
<el-button icon="el-icon-Plus" :disabled="flag > 2" type="primary" @click="launch('发起预警单')">
发起预警单
</el-button>
<el-button icon="el-icon-Plus" :disabled="flag > 2" type="primary" @click="launch('发起告警单')">
发起告警单
</el-button>
</template>
</TableHeader>
<Table ref="tableRef"/>
<!-- /告警单 -->
<alarmList ref="alarmListRef" @onSubmit="tableStore.index()"/>
<!-- 详情 -->
<detail ref="detailRef"/>
</template>
<script setup lang="ts">
import {ref, onMounted, provide, nextTick} from 'vue'
import TableStore from '@/utils/tableStore'
import Area from '@/components/form/area/index.vue'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import {ElMessage, ElMessageBox} from 'element-plus'
import {useDictData} from '@/stores/dictData'
import alarmList from './form/alarmList.vue'
import detail from './form/detail.vue'
const dictData = useDictData()
import {useRouter} from 'vue-router'
const router = useRouter() // 路由对象
//字典获取超标指标
const exceeded = dictData.getBasicData('Steady_Statis')
const tableRef = ref()
const industry = dictData.getBasicData('Business_Type')
const TableHeaderRef = ref()
const alarmListRef = ref()
const flagTime = ref(false)
const detailRef = ref()
const list: any = ref({
deptId: '',
searchBeginTime: '',
searchEndTime: '',
alertThreshold: '',
alarmThreshold: ''
})
const level: any = ref(dictData.state.area[0]?.level)
const flag: any = ref('')
const tableStore = new TableStore({
url: '/supervision-boot/onlineMonitor/list',
publicHeight: 65,
method: 'POST',
// isWebPaging:true,
column: [
{title: '', type: 'checkbox', width: 40},
{
title: '序号',
align: 'center',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{field: 'dept', title: '负责单位'},
{field: 'substation', title: '变电站名称'},
{field: 'deviceName', title: '终端名称'},
{field: 'lineName', title: '监测点名称'},
{
field: 'businessType',
title: '监测对象类型',
formatter: (row: any) => {
return industry.find((item: any) => item.id == row.cellValue)?.name || '/'
}
},
{field: 'objectName', title: '监测对象名称'},
{
field: 'targetType',
title: '指标类型',
formatter: (row: any) => {
return exceeded.find((item: any) => item.id == row.cellValue)?.name || '/'
}
},
{
field: 'overLimitDay',
title: '累计超标天数',
formatter: (row: any) => {
return row.cellValue != null ? row.cellValue : '/'
}
},
{
field: 'updateTime',
visible: flagTime,
title: '最新数据时间'
},
{
title: '操作',fixed: 'right',
width: '180',
align: 'center',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.targetType == 0
},
click: row => {
detailRef.value.open({
text: '详情',
row: row,
list: list.value
})
}
},
{
name: 'productSetting',
title: '查看预警单',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.step != 1
},
click: row => {
router.push({
name: 'supervision/supervision/manage',
query: {
type: 0,
t: Date.now()
}
})
}
},
{
name: 'productSetting',
title: '查看告警单',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.step != 2
},
click: row => {
router.push({
name: 'supervision/supervision/manage',
query: {
type: 1,
t: Date.now()
}
})
}
}
// {
// name: 'productSetting',
// title: '发起告警单',
// type: 'warning',
// disabled: row => {
// return row.overLimitDay < tableStore.table.params.alarmThreshold
// },
// icon: 'el-icon-EditPen',
// render: 'basicButton',
// click: async row => {
// // handleWarningAlarmFlag(row).then(res => {
// // console.log(res)
// // ElMessage.success('发起告警单成功!')
// // tableStore.index()
// // })
// const { value } = await ElMessageBox.prompt('', '整改意见', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// inputType: 'textarea',
// inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
// inputErrorMessage: '请输入整改意见'
// })
// handleWarningAlarmFlag({ ...row, reformAdvice: value }).then(res => {
// ElMessage.success('发起告警单成功!')
// tableStore.index()
// })
// }
// },
// {
// name: 'edit',
// title: '发起预警单',
// type: 'primary',
// icon: 'el-icon-Open',
// disabled: row => {
// return row.overLimitDay >= tableStore.table.params.alarmThreshold
// },
// render: 'basicButton',
// click: async row => {
// // handleWarningAlarmFlag(row).then(res => {
// // console.log(res)
// // ElMessage.success('发起预警单成功!')
// // tableStore.index()
// // })
// const { value } = await ElMessageBox.prompt('', '整改意见', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// inputType: 'textarea',
// inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
// inputErrorMessage: '请输入整改意见'
// })
// handleWarningAlarmFlag({ ...row, reformAdvice: value }).then(res => {
// ElMessage.success('发起预警单成功!')
// tableStore.index()
// })
// }
// }
]
}
],
beforeSearchFun: () => {
tableStore.table.params.currentPage = tableStore.table.params.pageNum
list.value.deptId = tableStore.table.params.deptId
list.value.searchBeginTime = tableStore.table.params.searchBeginTime
list.value.searchEndTime = tableStore.table.params.searchEndTime
if (tableStore.table.params.alertThreshold != '') {
list.value.alertThreshold = tableStore.table.params.alertThreshold
}
list.value.lineType = tableStore.table.params.lineType
list.value.alarmThreshold = tableStore.table.params.alarmThreshold
flag.value = level.value
flagTime.value = tableStore.table.params.dataType == 0 ? true : false
},
loadCallback: () => {
// tableStore.table.data = [
// {
// orgName: '张家口',
// subName: '110kV马头山风电场',
// lineName: '111口头线',
// voltageScale: '110kV',
// overDay: '20',
// overDays: '10'
// },
// {
// orgName: '张家口',
// subName: '110kV韩家庄风电场',
// lineName: '111缘韩一线',
// voltageScale: '110kV',
// overDay: '20',
// overDays: '16'
// }
// ]
}
})
tableStore.table.params.alertThreshold = 5
tableStore.table.params.alarmThreshold = 5
tableStore.table.params.targetList = exceeded.filter(item => item.code == 'Total_Indicator')[0].id
? [exceeded.filter(item => item.code == 'Total_Indicator')[0].id]
: []
tableStore.table.params.lineType = ''
tableStore.table.params.dataType = '1'
tableStore.table.params.deptId = dictData.state.area[0].id
provide('tableStore', tableStore)
onMounted(() => {
TableHeaderRef.value.setDatePicker([{label: '月', value: 3}])
tableStore.index()
setTimeout(() => {
TableHeaderRef.value.showSelectChange()
}, 10)
})
const changeAlert = e => {
if (e == null) {
tableStore.table.params.alertThreshold = 5
} else {
if (e > tableStore.table.params.alarmThreshold) {
ElMessage.warning('预警阈值不能大于报警阈值')
tableStore.table.params.alertThreshold = 5
}
}
}
const changeAlarm = e => {
if (e == null) {
tableStore.table.params.alarmThreshold = 5
} else {
if (e < tableStore.table.params.alertThreshold) {
ElMessage.warning('报警阈值不能小于预警阈值')
tableStore.table.params.alarmThreshold = 5
}
}
}
// 发起预警单
const launch = (title: string) => {
if (tableStore.table.selection.length == 0) {
ElMessage.warning('请选择一条数据')
return
}
alarmListRef.value.open({
text: title,
form: list.value,
row: tableStore.table.selection
})
console.log('🚀 ~ launch ~ list.value:', list.value)
}
const changeArea = e => {
level.value = e.data.level
}
</script>
<style scoped lang="scss"></style>

View File

@@ -1,187 +1,187 @@
<template>
<!-- <div> 普测结果 发起预告警单</div> -->
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template v-slot:select>
<el-form-item label="计划名称">
<el-input style="width: 200px" v-model="tableStore.table.params.searchValue" clearable
placeholder="请输入计划名称"></el-input>
</el-form-item>
<el-form-item label="是否解决">
<el-select v-model="tableStore.table.params.dealState" clearable placeholder="请选择是否解决">
<el-option v-for="item in dealStateList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" />
<testQuestionsForm ref="testQuestionsFormRef" />
<!-- 详情 -->
<el-dialog draggable v-model="dialogVisible" v-if="dialogVisible" title="详情" width="1000">
<detail :id="detailId" :flag="flag" />
</el-dialog>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import testQuestionsForm from './form/testQuestionsForm.vue'
import { initiateWarningLeaflet } from '@/api/supervision-boot/survey/test'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import detail from '@/views/pqs/supervise/harmonicSurvey/test/detail.vue'
const dictData = useDictData()
const { push } = useRouter()
const router = useRouter() // 路由对象
const tableRef = ref()
const flag = ref(false)
const TableHeaderRef = ref()
const dialogVisible = ref(false)
const detailId = ref('')
const testQuestionsFormRef = ref()
const dealStateList = ref([
{
label: '未解决',
value: '0'
},
])
const tableStore = new TableStore({
url: '/supervision-boot/surveyTest/pageProblemSurvey',
publicHeight: 65,
method: 'POST',
column: [
{
title: '序号',
align: 'center',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'planName', title: '计划名称', minWidth: 120 },
{ field: 'deptName', title: '负责单位', minWidth: 120 },
{ field: 'substationName', title: '变电站', minWidth: 120 },
{ field: 'planStartTime', title: '计划开始时间', minWidth: 100 },
{ field: 'planEndTime', title: '计划结束时间', minWidth: 100 },
{ field: 'completeTime', title: '实际完成时间', minWidth: 100 },
{ field: 'completeBy', title: '测试负责人', minWidth: 120 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'dealState',
title: '是否解决',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
null: 'info'
},
replaceValue: {
0: '未解决',
1: '已解决',
null: '/'
}
},
{
title: '操作',
minWidth: '180',
align: 'center',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'edit',
title: '详情',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
click: async row => {
flag.value = row.dealState == 1 ? true : false
dialogVisible.value = true
detailId.value = row.id
}
},
{
name: 'edit',
title: '发起告警单',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.dealState != 0
},
click: async row => {
const { value } = await ElMessageBox.prompt('', '整改意见', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '请输入整改意见'
})
initiateWarningLeaflet({ id: row.id, reformAdvice: value }).then(res => {
ElMessage.success('发起告警成功!')
tableStore.index()
})
}
},
{
name: 'edit',
title: '查看告警单',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.initiateWarningFlag == 0
},
click: row => {
router.push({
name: 'supervision/supervision/manage',
query: {
type: 1,
t: Date.now()
}
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.currentPage = tableStore.table.params.pageNum
}
})
tableStore.table.params.dealState = ''
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
/**
* 发起告警单
*/
const initiateAlarm = async (id: string) => {
await initiateWarningLeaflet(id)
ElMessage.success('发起告警成功!')
// 加载数据
tableStore.index()
}
</script>
<style scoped lang="scss"></style>
<template>
<!-- <div> 普测结果 发起预告警单</div> -->
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template v-slot:select>
<el-form-item label="计划名称">
<el-input style="width: 200px" v-model="tableStore.table.params.searchValue" clearable
placeholder="请输入计划名称"></el-input>
</el-form-item>
<el-form-item label="是否解决">
<el-select v-model="tableStore.table.params.dealState" clearable placeholder="请选择是否解决">
<el-option v-for="item in dealStateList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" />
<testQuestionsForm ref="testQuestionsFormRef" />
<!-- 详情 -->
<el-dialog draggable v-model="dialogVisible" v-if="dialogVisible" title="详情" width="1000">
<detail :id="detailId" :flag="flag" />
</el-dialog>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import testQuestionsForm from './form/testQuestionsForm.vue'
import { initiateWarningLeaflet } from '@/api/supervision-boot/survey/test'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import detail from '@/views/pqs/supervise/harmonicSurvey/test/detail.vue'
const dictData = useDictData()
const { push } = useRouter()
const router = useRouter() // 路由对象
const tableRef = ref()
const flag = ref(false)
const TableHeaderRef = ref()
const dialogVisible = ref(false)
const detailId = ref('')
const testQuestionsFormRef = ref()
const dealStateList = ref([
{
label: '未解决',
value: '0'
},
])
const tableStore = new TableStore({
url: '/supervision-boot/surveyTest/pageProblemSurvey',
publicHeight: 65,
method: 'POST',
column: [
{
title: '序号',
align: 'center',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'planName', title: '计划名称', minWidth: 120 },
{ field: 'deptName', title: '负责单位', minWidth: 120 },
{ field: 'substationName', title: '变电站', minWidth: 120 },
{ field: 'planStartTime', title: '计划开始时间', minWidth: 100 },
{ field: 'planEndTime', title: '计划结束时间', minWidth: 100 },
{ field: 'completeTime', title: '实际完成时间', minWidth: 100 },
{ field: 'completeBy', title: '测试负责人', minWidth: 120 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'dealState',
title: '是否解决',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
null: 'info'
},
replaceValue: {
0: '未解决',
1: '已解决',
null: '/'
}
},
{
title: '操作',fixed: 'right',
minWidth: '180',
align: 'center',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '详情',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
click: async row => {
flag.value = row.dealState == 1 ? true : false
dialogVisible.value = true
detailId.value = row.id
}
},
{
name: 'edit',
title: '发起告警单',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.dealState != 0
},
click: async row => {
const { value } = await ElMessageBox.prompt('', '整改意见', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '请输入整改意见'
})
initiateWarningLeaflet({ id: row.id, reformAdvice: value }).then(res => {
ElMessage.success('发起告警成功!')
tableStore.index()
})
}
},
{
name: 'edit',
title: '查看告警单',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.initiateWarningFlag == 0
},
click: row => {
router.push({
name: 'supervision/supervision/manage',
query: {
type: 1,
t: Date.now()
}
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.currentPage = tableStore.table.params.pageNum
}
})
tableStore.table.params.dealState = ''
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
/**
* 发起告警单
*/
const initiateAlarm = async (id: string) => {
await initiateWarningLeaflet(id)
ElMessage.success('发起告警成功!')
// 加载数据
tableStore.index()
}
</script>
<style scoped lang="scss"></style>

View File

@@ -1,302 +1,302 @@
<!---试运行列表-->
<template>
<div>
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template #select>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否解决">
<el-select v-model="tableStore.table.params.dealState" clearable placeholder="请选择是否解决">
<el-option v-for="item in dealStateList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 详情 -->
<detail ref="detailRef" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, reactive } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { ElMessage, ElMessageBox } from 'element-plus'
import { addRunTest, initiateWarningLeaflet } from '@/api/supervision-boot/lineRunTest'
import { formatDate } from '@/utils/formatTime'
import { VxeTablePropTypes } from 'vxe-table'
import { useAdminInfo } from '@/stores/adminInfo'
import { getFileNameAndFilePath } from '@/api/system-boot/file'
import detail from './testRunDetail.vue'
const dictData = useDictData()
const statusSelect = dictData.statusSelect()
const { push } = useRouter()
const adminInfo = useAdminInfo()
const TableHeaderRef = ref()
const tableRef = ref()
const detailRef = ref()
const dealStateList = ref([
{
label: '未解决',
value: '0'
},
])
const tableStore = new TableStore({
url: '/supervision-boot/lineRunTestProblem/pageProblem',
method: 'POST',
publicHeight: 65,
column: [
{
title: '序号', width: 80, formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'lineName', title: '监测点名称', minWidth: 160 },
{ field: 'connectedBus', title: '接入母线', minWidth: 160 },
// { field: 'monitoringTerminalCode', title: '终端编号', minWidth: 140 },
{ field: 'monitoringTerminalName', title: '终端名称', minWidth: 140, },
{
field: 'powerSubstationName', title: '变电站', minWidth: 160, formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'reason', title: '调试原因', minWidth: 160 },
{
field: 'testRunState',
title: '试运行状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
2: 'success',
3: 'danger',
1: 'warning'
},
replaceValue: {
0: '待试运行',
1: '试运行中',
2: '试运行成功',
3: '试运行失败',
null: '待试运行'
}
},
{
field: 'testRunTime',
title: '试运行时间范围',
minWidth: 200,
formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'problemReason', title: '试运行评估问题', minWidth: 200 },
{
field: 'createBy',
title: '填报人',
minWidth: 100,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'dealState',
title: '是否解决',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
null: 'info'
},
replaceValue: {
0: '未解决',
1: '已解决',
null: '/'
}
},
{
title: '操作',
minWidth: 230,
fixed: 'right',
render: 'buttons',
buttons: [
// {
// name: 'productSetting',
// title: '流程详情',
// type: 'primary',
// icon: 'el-icon-EditPen',
// render: 'basicButton',
// click: row => {
// handleAudit(row.processInstanceId, row.historyInstanceId)
// },
// disabled: row => {
// return row.testRunState != 2 || !row.processInstanceId
// }
// },
{
name: 'productSetting',
title: '下载报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
downloadTheReport(row.testRunReport)
},
disabled: row => {
return row.testRunReport == null || row.testRunReport.length == 0
}
},
{
name: 'edit',
title: '发起告警单',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.dealState != 0
},
click: async row => {
const { value } = await ElMessageBox.prompt('', '整改意见', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '请输入整改意见'
})
initiateWarningLeaflet({
id: row.id,
problemId: row.problemId,
reformAdvice: value,
type: 2,
issueDetail: row.problemReason
}).then(res => {
ElMessage.success('发起告警单成功!')
tableStore.index()
})
}
},
{
name: 'edit',
title: '详情',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.dealState == 0
},
click: row => {
detailRef.value.open({
row: row,
title: '详情',
})
}
},
{
name: 'edit',
title: '查看告警单',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.problemType == null
},
click: row => {
push({
name: 'supervision/supervision/manage',
query: {
type: 1,
t: Date.now()
}
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.statveList = [2]
// tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.status = ''
tableStore.table.params.dealState = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
const checkboxConfig = reactive<VxeTablePropTypes.CheckboxConfig>({
labelField: '',
checkMethod: ({ row }) => {
return !(row.testRunState == 1 || row.testRunState == 2)
}
})
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
// 下载报告
const downloadTheReport = (url: string) => {
getFileNameAndFilePath({ filePath: url }).then((res: any) => {
const link = document.createElement('a')
link.href = res.data.url
link.download = res.data.name
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
})
}
const runTestSubmit = (type: number) => {
const start = new Date()
start.setDate(start.getDate() + 1)
start.setHours(0, 0, 0)
const end = new Date()
end.setDate(end.getDate() + 3)
end.setHours(23, 59, 59)
const startString = formatDate(start, 'YYYY-MM-DD') // 转换为 YYYY-MM-DD 格式
const endString = formatDate(end, 'YYYY-MM-DD')
const data = {
startTime: startString,
endTime: endString,
lineIds: monitorIds,
operateType: type
}
addRunTest(data).then((res: any) => {
if (res.code === 'A0000') {
ElMessage({
message: '发起试运行成功',
type: 'success'
})
tableStore.index()
}
})
}
</script>
<style scoped lang="scss"></style>
<!---试运行列表-->
<template>
<div>
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template #select>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否解决">
<el-select v-model="tableStore.table.params.dealState" clearable placeholder="请选择是否解决">
<el-option v-for="item in dealStateList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 详情 -->
<detail ref="detailRef" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, reactive } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { ElMessage, ElMessageBox } from 'element-plus'
import { addRunTest, initiateWarningLeaflet } from '@/api/supervision-boot/lineRunTest'
import { formatDate } from '@/utils/formatTime'
import { VxeTablePropTypes } from 'vxe-table'
import { useAdminInfo } from '@/stores/adminInfo'
import { getFileNameAndFilePath } from '@/api/system-boot/file'
import detail from './testRunDetail.vue'
const dictData = useDictData()
const statusSelect = dictData.statusSelect()
const { push } = useRouter()
const adminInfo = useAdminInfo()
const TableHeaderRef = ref()
const tableRef = ref()
const detailRef = ref()
const dealStateList = ref([
{
label: '未解决',
value: '0'
},
])
const tableStore = new TableStore({
url: '/supervision-boot/lineRunTestProblem/pageProblem',
method: 'POST',
publicHeight: 65,
column: [
{
title: '序号', width: 80, formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'lineName', title: '监测点名称', minWidth: 160 },
{ field: 'connectedBus', title: '接入母线', minWidth: 160 },
// { field: 'monitoringTerminalCode', title: '终端编号', minWidth: 140 },
{ field: 'monitoringTerminalName', title: '终端名称', minWidth: 140, },
{
field: 'powerSubstationName', title: '变电站', minWidth: 160, formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'reason', title: '调试原因', minWidth: 160 },
{
field: 'testRunState',
title: '试运行状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
2: 'success',
3: 'danger',
1: 'warning'
},
replaceValue: {
0: '待试运行',
1: '试运行中',
2: '试运行成功',
3: '试运行失败',
null: '待试运行'
}
},
{
field: 'testRunTime',
title: '试运行时间范围',
minWidth: 200,
formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'problemReason', title: '试运行评估问题', minWidth: 200 },
{
field: 'createBy',
title: '填报人',
minWidth: 100,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'dealState',
title: '是否解决',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
null: 'info'
},
replaceValue: {
0: '未解决',
1: '已解决',
null: '/'
}
},
{
title: '操作',fixed: 'right',
minWidth: 230,
render: 'buttons',
buttons: [
// {
// name: 'productSetting',
// title: '流程详情',
// type: 'primary',
// icon: 'el-icon-EditPen',
// render: 'basicButton',
// click: row => {
// handleAudit(row.processInstanceId, row.historyInstanceId)
// },
// disabled: row => {
// return row.testRunState != 2 || !row.processInstanceId
// }
// },
{
name: 'productSetting',
title: '下载报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
downloadTheReport(row.testRunReport)
},
disabled: row => {
return row.testRunReport == null || row.testRunReport.length == 0
}
},
{
name: 'edit',
title: '发起告警单',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.dealState != 0
},
click: async row => {
const { value } = await ElMessageBox.prompt('', '整改意见', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '请输入整改意见'
})
initiateWarningLeaflet({
id: row.id,
problemId: row.problemId,
reformAdvice: value,
type: 2,
issueDetail: row.problemReason
}).then(res => {
ElMessage.success('发起告警单成功!')
tableStore.index()
})
}
},
{
name: 'edit',
title: '详情',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.dealState == 0
},
click: row => {
detailRef.value.open({
row: row,
title: '详情',
})
}
},
{
name: 'edit',
title: '查看告警单',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.problemType == null
},
click: row => {
push({
name: 'supervision/supervision/manage',
query: {
type: 1,
t: Date.now()
}
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.statveList = [2]
// tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.status = ''
tableStore.table.params.dealState = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
const checkboxConfig = reactive<VxeTablePropTypes.CheckboxConfig>({
labelField: '',
checkMethod: ({ row }) => {
return !(row.testRunState == 1 || row.testRunState == 2)
}
})
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
// 下载报告
const downloadTheReport = (url: string) => {
getFileNameAndFilePath({ filePath: url }).then((res: any) => {
const link = document.createElement('a')
link.href = res.data.url
link.download = res.data.name
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
})
}
const runTestSubmit = (type: number) => {
const start = new Date()
start.setDate(start.getDate() + 1)
start.setHours(0, 0, 0)
const end = new Date()
end.setDate(end.getDate() + 3)
end.setHours(23, 59, 59)
const startString = formatDate(start, 'YYYY-MM-DD') // 转换为 YYYY-MM-DD 格式
const endString = formatDate(end, 'YYYY-MM-DD')
const data = {
startTime: startString,
endTime: endString,
lineIds: monitorIds,
operateType: type
}
addRunTest(data).then((res: any) => {
if (res.code === 'A0000') {
ElMessage({
message: '发起试运行成功',
type: 'success'
})
tableStore.index()
}
})
}
</script>
<style scoped lang="scss"></style>

View File

@@ -1,67 +1,67 @@
<template>
<div>
<div>
<TableHeader area datePicker ref="TableHeaderRef" />
<Table ref="tableRef" />
<!-- 审核 -->
<planAdd ref="planAddRef" @onsubmit="tableStore.index()" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import planAdd from './planAdd.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const TableHeaderRef = ref()
const planAddRef = ref()
const tableStore = new TableStore({
url: '/process-boot/rGeneralSurveyPlan/queryPlanAudit',
publicHeight: 65,
method: 'POST',
column: [
{ field: 'orgName', title: '所属单位' },
{ field: 'planNo', title: '普测计划编号' },
{ field: 'planName', title: '普测计划名称' },
{ field: 'planStartTime', title: '开始时间' },
{ field: 'planEndTime', title: '结束时间' },
{ field: 'subCount', title: '普测变电站数量' },
{
title: '操作',
width: '120',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '审核',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
planAddRef.value.open('计划审核', row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.planStartTime = tableStore.table.params.searchBeginTime
tableStore.table.params.planEndTime = tableStore.table.params.searchEndTime
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.currentPage = tableStore.table.params.pageNum
}
})
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>
<template>
<div>
<div>
<TableHeader area datePicker ref="TableHeaderRef" />
<Table ref="tableRef" />
<!-- 审核 -->
<planAdd ref="planAddRef" @onsubmit="tableStore.index()" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import planAdd from './planAdd.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const TableHeaderRef = ref()
const planAddRef = ref()
const tableStore = new TableStore({
url: '/process-boot/rGeneralSurveyPlan/queryPlanAudit',
publicHeight: 65,
method: 'POST',
column: [
{ field: 'orgName', title: '所属单位' },
{ field: 'planNo', title: '普测计划编号' },
{ field: 'planName', title: '普测计划名称' },
{ field: 'planStartTime', title: '开始时间' },
{ field: 'planEndTime', title: '结束时间' },
{ field: 'subCount', title: '普测变电站数量' },
{
title: '操作',fixed: 'right',
width: '120',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '审核',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
planAddRef.value.open('计划审核', row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.planStartTime = tableStore.table.params.searchBeginTime
tableStore.table.params.planEndTime = tableStore.table.params.searchEndTime
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.currentPage = tableStore.table.params.pageNum
}
})
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -1,336 +1,336 @@
<template>
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template #select>
<el-form-item label="监督类型">
<el-select v-model="tableStore.table.params.supvType" clearable placeholder="请选择监督类型">
<el-option v-for="item in supvTypeOptionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增计划</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 新增 -->
<planAdd ref="planAddRef" @onsubmit="tableStore.index()" :openType="openType" />
</template>
<script setup lang="ts">
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
import { ref, onMounted, provide, watch, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { cancel, getById } from '@/api/process-boot/generalTest'
import planAdd from './planAdd.vue'
import { useRouter } from 'vue-router'
import { queryPlan, removeSurvey } from '@/api/process-boot/generalTest'
import { getUserByRoleType } from '@/api/user-boot/user'
import { useDictData } from '@/stores/dictData'
import { deleteSurveyPlan } from '@/api/supervision-boot/delete/index'
import { getUserReportById } from "@/api/supervision-boot/interfere";
const dictData = useDictData()
const supvTypeOptionList = dictData.getBasicData('supv_type')
const statusSelect = dictData.statusSelect()
const { push, options, currentRoute } = useRouter()
const dialogVisible = ref(false)
const tableRef = ref()
const planAddRef = ref()
const TableHeaderRef = ref()
const auditList: any = ref([])
const auditUser = ref('')
const flag = ref(false)
const openType = ref('create')
const tableStore = new TableStore({
url: '/supervision-boot/surveyPlan/surveyPlanPage',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{
field: 'planName',
title: '计划名称',
minWidth: 130
},
{
field: 'supvType',
title: '监督类型',
minWidth: 130,
formatter: (row: any) => {
return supvTypeOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'supvObjectName',
minWidth: 130,
title: '监督对象名称'
},
{
field: 'deptName',
minWidth: 130,
title: '负责单位'
},
{
field: 'substation',
title: '变电站',
minWidth: 110,
formatter: (row: any) => {
return row.cellValue
}
},
{ field: 'planStartTime', minWidth: 130, title: '计划开始时间' },
{ field: 'planEndTime', minWidth: 130, title: '计划结束时间' },
{
field: 'status',
title: '流程状态',
render: 'tag',
minWidth: 80,
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
minWidth: '180',
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
planAddRef.value.open('编辑', row.id, false)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
// deviceQuitPopup.value.open('重新发起退运', row)
planAddRef.value.open('重新发起计划', row.id, false)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.currentPage = tableStore.table.params.pageNum
}
})
tableStore.table.params.status = ''
tableStore.table.params.supvType = ''
provide('tableStore', tableStore)
// 新增计划
const add = () => {
// title.value = '普测计划新增'
planAddRef.value.open('计划新增')
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteSurveyPlan(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
const exportFn = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
queryPlan(form).then(res => {
tableRef.value.getRef().exportData({
filename: '计划', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancel(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
const handleClose = () => {
dialogVisible.value = false
auditUser.value = ''
}
/** 处理审批按钮 */
const handleAudit = (instanceId: string, historyInstanceId: string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
// 取消
onMounted(() => {
tableStore.index()
getUserByRoleType(3).then(res => {
auditList.value = res.data
})
})
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
nextTick(() => {
planAddRef.value.open('重新发起计划', fullId, false)
})
}, { immediate: true })
</script>
<style scoped lang="scss"></style>
<template>
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template #select>
<el-form-item label="监督类型">
<el-select v-model="tableStore.table.params.supvType" clearable placeholder="请选择监督类型">
<el-option v-for="item in supvTypeOptionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增计划</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 新增 -->
<planAdd ref="planAddRef" @onsubmit="tableStore.index()" :openType="openType" />
</template>
<script setup lang="ts">
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
import { ref, onMounted, provide, watch, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { cancel, getById } from '@/api/process-boot/generalTest'
import planAdd from './planAdd.vue'
import { useRouter } from 'vue-router'
import { queryPlan, removeSurvey } from '@/api/process-boot/generalTest'
import { getUserByRoleType } from '@/api/user-boot/user'
import { useDictData } from '@/stores/dictData'
import { deleteSurveyPlan } from '@/api/supervision-boot/delete/index'
import { getUserReportById } from "@/api/supervision-boot/interfere";
const dictData = useDictData()
const supvTypeOptionList = dictData.getBasicData('supv_type')
const statusSelect = dictData.statusSelect()
const { push, options, currentRoute } = useRouter()
const dialogVisible = ref(false)
const tableRef = ref()
const planAddRef = ref()
const TableHeaderRef = ref()
const auditList: any = ref([])
const auditUser = ref('')
const flag = ref(false)
const openType = ref('create')
const tableStore = new TableStore({
url: '/supervision-boot/surveyPlan/surveyPlanPage',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{
field: 'planName',
title: '计划名称',
minWidth: 130
},
{
field: 'supvType',
title: '监督类型',
minWidth: 130,
formatter: (row: any) => {
return supvTypeOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'supvObjectName',
minWidth: 130,
title: '监督对象名称'
},
{
field: 'deptName',
minWidth: 130,
title: '负责单位'
},
{
field: 'substation',
title: '变电站',
minWidth: 110,
formatter: (row: any) => {
return row.cellValue
}
},
{ field: 'planStartTime', minWidth: 130, title: '计划开始时间' },
{ field: 'planEndTime', minWidth: 130, title: '计划结束时间' },
{
field: 'status',
title: '流程状态',
render: 'tag',
minWidth: 80,
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
minWidth: '180',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
planAddRef.value.open('编辑', row.id, false)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
// deviceQuitPopup.value.open('重新发起退运', row)
planAddRef.value.open('重新发起计划', row.id, false)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.currentPage = tableStore.table.params.pageNum
}
})
tableStore.table.params.status = ''
tableStore.table.params.supvType = ''
provide('tableStore', tableStore)
// 新增计划
const add = () => {
// title.value = '普测计划新增'
planAddRef.value.open('计划新增')
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteSurveyPlan(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
const exportFn = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
queryPlan(form).then(res => {
tableRef.value.getRef().exportData({
filename: '计划', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancel(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
const handleClose = () => {
dialogVisible.value = false
auditUser.value = ''
}
/** 处理审批按钮 */
const handleAudit = (instanceId: string, historyInstanceId: string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
// 取消
onMounted(() => {
tableStore.index()
getUserByRoleType(3).then(res => {
auditList.value = res.data
})
})
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
nextTick(() => {
planAddRef.value.open('重新发起计划', fullId, false)
})
}, { immediate: true })
</script>
<style scoped lang="scss"></style>

View File

@@ -1,339 +1,339 @@
<template>
<TableHeader area datePicker nextFlag theCurrentTime ref='TableHeaderRef'>
<template v-slot:select>
<el-form-item label='监督类型'>
<el-select v-model='tableStore.table.params.supvType' clearable placeholder='请选择监督类型'>
<el-option v-for='item in supvTypeOptionList' :key='item.id' :label='item.name'
:value='item.id'></el-option>
</el-select>
</el-form-item>
<el-form-item label='流程状态'>
<el-select v-model='tableStore.table.params.status' clearable placeholder='请选择流程状态'>
<el-option v-for='item in statusSelect' :key='item.id' :label='item.name'
:value='item.id'></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon='el-icon-Delete' type='primary' @click='deleteEven'>删除</el-button>
</template>
</TableHeader>
<Table ref='tableRef' :checkbox-config='checkboxConfig' />
<!-- 新增 -->
<planTest ref='planTestRef' @onsubmit='tableStore.index()' />
</template>
<script setup lang='ts'>
import { ref, onMounted, provide, watch, nextTick } from 'vue'
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { cancelTest } from '@/api/process-boot/generalTest'
import planTest from './planTest.vue'
import { useRouter } from 'vue-router'
import { deleteSurveyPlanTest } from '@/api/supervision-boot/delete/index'
import { queryPlan, removeSurvey } from '@/api/process-boot/generalTest'
import { getUserByRoleType } from '@/api/user-boot/user'
const { push } = useRouter()
const tableRef = ref()
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const supvTypeOptionList = dictData.getBasicData('supv_type')
const statusSelect = dictData.statusSelect()
const planTestRef = ref()
const TableHeaderRef = ref()
const auditList: any = ref([])
const tableStore = new TableStore({
url: '/supervision-boot/surveyTest/surveyTestPage',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'planName', title: '计划名称', minWidth: 140 },
{
field: 'supvType',
title: '监督类型',
minWidth: 130,
formatter: (row: any) => {
return supvTypeOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'supvObjectName',
minWidth: 130,
title: '监督对象名称'
},
{ field: 'substationName', title: '变电站', minWidth: 140 },
{ field: 'planStartTime', title: '计划开始时间', minWidth: 140 },
{ field: 'planEndTime', title: '计划结束时间', minWidth: 140 },
{
field: 'problemFlag',
title: '是否存在问题',
minWidth: 120,
render: 'tag',
custom: {
0: 'success',
1: 'danger',
null: 'primary'
},
replaceValue: {
0: '合格',
1: '存在问题',
null: '待测试'
}
},
{ field: 'deptName', title: '负责单位', minWidth: 140 },
{ field: 'completeBy', title: '计划负责人', minWidth: 130 },
{ field: 'completeTime', title: '实际完成时间', minWidth: 140 },
{
field: 'status',
title: '流程状态',
render: 'tag',
minWidth: 140,
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 120,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
minWidth: 180,
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'productSetting',
title: '测试填报',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.status != 6
},
click: row => {
add(row.id)
}
},
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.status == 6 || !row.processInstanceId
},
click: row => {
// planTestRef.value.open('查看计划', row)
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.deptId != adminInfo.$state.deptId || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
planTestRef.value.open('编辑', row.id, false)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.deptId != adminInfo.$state.deptId || !(row.status == 3 || row.status == 4)
},
click: row => {
planTestRef.value.open('重新发起计划测试', row.id, false)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.deptId != adminInfo.$state.deptId || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.currentPage = tableStore.table.params.pageNum
}
})
tableStore.table.params.status = ''
tableStore.table.params.supvType = ''
provide('tableStore', tableStore)
// 新增计划
const add = (id: string) => {
planTestRef.value.open('计划测试填报', id, true)
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteSurveyPlanTest(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
const exportFn = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
queryPlan(form).then(res => {
tableRef.value.getRef().exportData({
filename: '计划', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelTest(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
// 取消
onMounted(() => {
tableStore.index()
getUserByRoleType(3).then(res => {
auditList.value = res.data
})
})
const props = defineProps(['id', 'businessKey'])
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
nextTick(() => {
if (props.businessKey == '3') {
planTestRef.value.open('编辑', fullId, false)
} else {
planTestRef.value.open('重新发起计划测试', fullId, false)
}
})
}, { immediate: true })
</script>
<style scoped lang='scss'></style>
<template>
<TableHeader area datePicker nextFlag theCurrentTime ref='TableHeaderRef'>
<template v-slot:select>
<el-form-item label='监督类型'>
<el-select v-model='tableStore.table.params.supvType' clearable placeholder='请选择监督类型'>
<el-option v-for='item in supvTypeOptionList' :key='item.id' :label='item.name'
:value='item.id'></el-option>
</el-select>
</el-form-item>
<el-form-item label='流程状态'>
<el-select v-model='tableStore.table.params.status' clearable placeholder='请选择流程状态'>
<el-option v-for='item in statusSelect' :key='item.id' :label='item.name'
:value='item.id'></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon='el-icon-Delete' type='primary' @click='deleteEven'>删除</el-button>
</template>
</TableHeader>
<Table ref='tableRef' :checkbox-config='checkboxConfig' />
<!-- 新增 -->
<planTest ref='planTestRef' @onsubmit='tableStore.index()' />
</template>
<script setup lang='ts'>
import { ref, onMounted, provide, watch, nextTick } from 'vue'
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { cancelTest } from '@/api/process-boot/generalTest'
import planTest from './planTest.vue'
import { useRouter } from 'vue-router'
import { deleteSurveyPlanTest } from '@/api/supervision-boot/delete/index'
import { queryPlan, removeSurvey } from '@/api/process-boot/generalTest'
import { getUserByRoleType } from '@/api/user-boot/user'
const { push } = useRouter()
const tableRef = ref()
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const supvTypeOptionList = dictData.getBasicData('supv_type')
const statusSelect = dictData.statusSelect()
const planTestRef = ref()
const TableHeaderRef = ref()
const auditList: any = ref([])
const tableStore = new TableStore({
url: '/supervision-boot/surveyTest/surveyTestPage',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'planName', title: '计划名称', minWidth: 140 },
{
field: 'supvType',
title: '监督类型',
minWidth: 130,
formatter: (row: any) => {
return supvTypeOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'supvObjectName',
minWidth: 130,
title: '监督对象名称'
},
{ field: 'substationName', title: '变电站', minWidth: 140 },
{ field: 'planStartTime', title: '计划开始时间', minWidth: 140 },
{ field: 'planEndTime', title: '计划结束时间', minWidth: 140 },
{
field: 'problemFlag',
title: '是否存在问题',
minWidth: 120,
render: 'tag',
custom: {
0: 'success',
1: 'danger',
null: 'primary'
},
replaceValue: {
0: '合格',
1: '存在问题',
null: '待测试'
}
},
{ field: 'deptName', title: '负责单位', minWidth: 140 },
{ field: 'completeBy', title: '计划负责人', minWidth: 130 },
{ field: 'completeTime', title: '实际完成时间', minWidth: 140 },
{
field: 'status',
title: '流程状态',
render: 'tag',
minWidth: 140,
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 120,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
minWidth: 180,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '测试填报',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.status != 6
},
click: row => {
add(row.id)
}
},
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.status == 6 || !row.processInstanceId
},
click: row => {
// planTestRef.value.open('查看计划', row)
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.deptId != adminInfo.$state.deptId || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
planTestRef.value.open('编辑', row.id, false)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.deptId != adminInfo.$state.deptId || !(row.status == 3 || row.status == 4)
},
click: row => {
planTestRef.value.open('重新发起计划测试', row.id, false)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.deptId != adminInfo.$state.deptId || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.currentPage = tableStore.table.params.pageNum
}
})
tableStore.table.params.status = ''
tableStore.table.params.supvType = ''
provide('tableStore', tableStore)
// 新增计划
const add = (id: string) => {
planTestRef.value.open('计划测试填报', id, true)
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteSurveyPlanTest(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
const exportFn = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
queryPlan(form).then(res => {
tableRef.value.getRef().exportData({
filename: '计划', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelTest(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
// 取消
onMounted(() => {
tableStore.index()
getUserByRoleType(3).then(res => {
auditList.value = res.data
})
})
const props = defineProps(['id', 'businessKey'])
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
nextTick(() => {
if (props.businessKey == '3') {
planTestRef.value.open('编辑', fullId, false)
} else {
planTestRef.value.open('重新发起计划测试', fullId, false)
}
})
}, { immediate: true })
</script>
<style scoped lang='scss'></style>

View File

@@ -61,7 +61,7 @@ const tableStore = new TableStore({
{ field: 'recordTime', title: '建档时间' },
{ field: 'iuploadTime', title: '报告提交评估时间' },
{
title: '操作',
title: '操作',fixed: 'right',
width: '120',
render: 'buttons',
buttons: [

View File

@@ -1,129 +1,129 @@
<template>
<div>
<div>
<TableHeader area ref="TableHeaderRef">
<template #select>
<el-form-item label="干扰源类型">
<el-select v-model="tableStore.table.params.loadType" clearable placeholder="请选择干扰源类型">
<el-option
v-for="item in interferenceType"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="干扰源用户名称">
<el-input
v-model="tableStore.table.params.userName"
clearable
placeholder="请选择干扰源用户名称"
></el-input>
</el-form-item>
<el-form-item label="关联干扰源用户">
<el-input
v-model="tableStore.table.params.relationUserName"
clearable
placeholder="请选择关联干扰源用户"
></el-input>
</el-form-item>
<el-form-item label="是否已上传实测">
<el-select
v-model="tableStore.table.params.aisFileUpload"
clearable
placeholder="请选择是否已上传实测"
>
<el-option label="否" value="0" />
<el-option label="是" value="1" />
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Upload" type="primary">上传</el-button>
<el-button icon="el-icon-Download" type="primary">导出</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { mainHeight } from '@/utils/layout'
import { useDictData } from '@/stores/dictData'
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
const dictData = useDictData()
const interferenceType = dictData.getBasicData('Interference_Source')
const istatusList = dictData.getBasicData('On-network_Status')
const TableHeaderRef = ref()
const tableStore = new TableStore({
url: '/process-boot/loadTypeUserManage/getLoadTypeRelationList',
publicHeight: 65,
method: 'POST',
column: [
{ width: '60', type: 'checkbox' },
{ field: 'orgName', title: '所属单位' },
{
field: 'loadType',
title: '干扰源类型',
formatter: row => {
return interferenceType.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'userName', title: '干扰源用户名称' },
{ field: 'relationUserName', title: '关联干扰源用户名称' },
{
field: 'istatus',
title: '实测报告状态',
formatter: row => {
return istatusList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '查看',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
}
})
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>
<template>
<div>
<div>
<TableHeader area ref="TableHeaderRef">
<template #select>
<el-form-item label="干扰源类型">
<el-select v-model="tableStore.table.params.loadType" clearable placeholder="请选择干扰源类型">
<el-option
v-for="item in interferenceType"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="干扰源用户名称">
<el-input
v-model="tableStore.table.params.userName"
clearable
placeholder="请选择干扰源用户名称"
></el-input>
</el-form-item>
<el-form-item label="关联干扰源用户">
<el-input
v-model="tableStore.table.params.relationUserName"
clearable
placeholder="请选择关联干扰源用户"
></el-input>
</el-form-item>
<el-form-item label="是否已上传实测">
<el-select
v-model="tableStore.table.params.aisFileUpload"
clearable
placeholder="请选择是否已上传实测"
>
<el-option label="否" value="0" />
<el-option label="是" value="1" />
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Upload" type="primary">上传</el-button>
<el-button icon="el-icon-Download" type="primary">导出</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { mainHeight } from '@/utils/layout'
import { useDictData } from '@/stores/dictData'
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
const dictData = useDictData()
const interferenceType = dictData.getBasicData('Interference_Source')
const istatusList = dictData.getBasicData('On-network_Status')
const TableHeaderRef = ref()
const tableStore = new TableStore({
url: '/process-boot/loadTypeUserManage/getLoadTypeRelationList',
publicHeight: 65,
method: 'POST',
column: [
{ width: '60', type: 'checkbox' },
{ field: 'orgName', title: '所属单位' },
{
field: 'loadType',
title: '干扰源类型',
formatter: row => {
return interferenceType.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'userName', title: '干扰源用户名称' },
{ field: 'relationUserName', title: '关联干扰源用户名称' },
{
field: 'istatus',
title: '实测报告状态',
formatter: row => {
return istatusList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '查看',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
}
})
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -173,9 +173,9 @@ const tableStore = new TableStore({
},
// visible:!jb_pl.value && !jb_dky.value?true:false,
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: 300,
fixed: 'right',
render: 'buttons',
buttons: [

View File

@@ -1,358 +1,358 @@
<template>
<div class="default-main">
<!-- <TableHeader ref='TableHeaderRef'>
<template #select>
<el-form-item label='用户名称'>
<el-input v-model='tableStore.table.params.projectName' clearable></el-input>
</el-form-item>
<el-form-item label='所在地市'>
<el-select v-model='tableStore.table.params.city' clearable placeholder='请选择所在地市'>
<el-option
v-for='item in areaOptionList'
:key='item.id'
:label='item.name'
:value='item.name'
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon='' type='primary' @click='toGoNet()'>{{ titleButton }}</el-button>
<el-button style='margin-left: 50px' :icon='Back' @click='go(-1)'>返回</el-button>
</template>
</TableHeader> -->
<div class="header_btn">
<el-button v-if="bussType == 0 && !(jb_pl || jb_dky)" icon="" type="primary" @click="toGoNet()">
{{ titleButton }}
</el-button>
<el-button v-if="bussType == 1 && needGovernance != '0' && !(jb_pl || jb_dky)" icon="" type="primary"
@click="toGoNet()">
{{ titleButton }}
</el-button>
<el-button style="margin-left: 50px" :icon="Back" @click="go(-1)">返回</el-button>
</div>
<Table ref="tableRef" />
<addForm v-if="dialogVisible" ref="addForms" :id="bussId" :bussType="bussType" :title="titleButton1"
openType="detail" @onSubmit="tableStore.index()"></addForm>
</div>
</template>
<script setup lang="ts">
defineOptions({
name: 'ProgramReview'
})
import { ref, onMounted, provide, nextTick, onUnmounted } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { cancel, userReportGoNetById } from '@/api/supervision-boot/interfere/index'
import { useDictData } from '@/stores/dictData'
import addForm from './addForm.vue'
import { useRouter, useRoute } from 'vue-router'
import { Back } from '@element-plus/icons-vue'
import { useAdminInfo } from '@/stores/adminInfo'
const { go, currentRoute, push } = useRouter()
const { query } = useRoute() // 查询参数
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
const needGovernance = query.needGovernance as unknown as string // 从 URL 传递过来的 是否需要治理
const dictData = useDictData()
const areaOptionList = dictData.getBasicData('jibei_area')
const adminInfo = useAdminInfo()
const jb_pl = ref(false)
const jb_dky = ref(false)
jb_pl.value =
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_pl'
}).length != 0
? true
: false
jb_dky.value =
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_dky'
}).length != 0
? true
: false
const tableStore = new TableStore({
url: '/supervision-boot/userReportNormal/userReportGoNetPage',
method: 'POST',
column: [
{
title: '序号', width: 80, formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'projectName', title: '用户名称', minWidth: 170 },
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
{ field: 'city', title: '所在地市', minWidth: 80 },
{ field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{ field: 'substation', title: '厂站名称', minWidth: 100 },
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'createTime', title: '创建时间', minWidth: 100 },
{
title: '操作',
minWidth: 180,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
handleAudit(row.processInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return !(row.status == 0 || row.status == 3)
},
disabled: row => {
return !(row.status == 0 || row.status == 3)
},
click: row => {
dialogVisible.value = true
titleButton1.value = '编辑'
setTimeout(() => {
addForms.value.open(row)
}, 0)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 4)
},
click: row => {
dialogVisible.value = true
titleButton1.value = '重新发起'
setTimeout(() => {
addForms.value.open(row)
}, 0)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status !== 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.userReportId = bussId.value
tableStore.table.params.type = bussType.value
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.city = ''
tableStore.table.params.projectName = ''
const dialogVisible = ref(false)
const bussId = ref()
bussId.value = currentRoute.value.query.id
const bussType = ref()
bussType.value = Number(currentRoute.value.query.type)
const titleButton = ref()
const titleButton1 = ref()
provide('tableStore', tableStore)
const handleVisibilityChange = async () => {
if (document.visibilityState === 'visible') {
// 在这里执行页面回到回到当前页签需要做的事情
await tableStore.index()
} else if (document.visibilityState === 'hidden') {
// 在这里执行页面离开时需要做的事情
}
}
onMounted(async () => {
tableStore.index()
document.addEventListener('visibilitychange', handleVisibilityChange)
if (query.fangAnId) {
//根据id查询待编辑的数据
await userReportGoNetById({ id: query.fangAnId }).then(res => {
if (res && res.code == 'A0000') {
dialogVisible.value = true
titleButton1.value = '重新发起'
setTimeout(() => {
res.data.id = query.fangAnId
addForms.value.open(res.data)
}, 0)
}
})
}
})
onUnmounted(() => {
document.removeEventListener('visibilitychange', handleVisibilityChange)
})
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancel(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
/** 处理审批按钮 */
const handleAudit = (instanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
query: {
id: instanceId
}
})
}
if (bussType.value === 0) {
titleButton.value = '入网设计方案申请'
} else {
titleButton.value = '治理工程申请'
}
const addForms = ref()
const toGoNet = () => {
dialogVisible.value = true
if (bussType.value === 0) {
titleButton1.value = '入网设计方案申请'
} else {
titleButton1.value = '治理工程申请'
}
setTimeout(() => {
addForms.value.open()
}, 0)
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
</script>
<style scoped lang="scss">
.header_btn {
width: 100%;
height: 60px;
display: flex;
padding: 13px 15px;
justify-content: flex-end;
align-items: center;
border: 1px solid #dddfe6;
}
</style>
<template>
<div class="default-main">
<!-- <TableHeader ref='TableHeaderRef'>
<template #select>
<el-form-item label='用户名称'>
<el-input v-model='tableStore.table.params.projectName' clearable></el-input>
</el-form-item>
<el-form-item label='所在地市'>
<el-select v-model='tableStore.table.params.city' clearable placeholder='请选择所在地市'>
<el-option
v-for='item in areaOptionList'
:key='item.id'
:label='item.name'
:value='item.name'
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon='' type='primary' @click='toGoNet()'>{{ titleButton }}</el-button>
<el-button style='margin-left: 50px' :icon='Back' @click='go(-1)'>返回</el-button>
</template>
</TableHeader> -->
<div class="header_btn">
<el-button v-if="bussType == 0 && !(jb_pl || jb_dky)" icon="" type="primary" @click="toGoNet()">
{{ titleButton }}
</el-button>
<el-button v-if="bussType == 1 && needGovernance != '0' && !(jb_pl || jb_dky)" icon="" type="primary"
@click="toGoNet()">
{{ titleButton }}
</el-button>
<el-button style="margin-left: 50px" :icon="Back" @click="go(-1)">返回</el-button>
</div>
<Table ref="tableRef" />
<addForm v-if="dialogVisible" ref="addForms" :id="bussId" :bussType="bussType" :title="titleButton1"
openType="detail" @onSubmit="tableStore.index()"></addForm>
</div>
</template>
<script setup lang="ts">
defineOptions({
name: 'ProgramReview'
})
import { ref, onMounted, provide, nextTick, onUnmounted } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { cancel, userReportGoNetById } from '@/api/supervision-boot/interfere/index'
import { useDictData } from '@/stores/dictData'
import addForm from './addForm.vue'
import { useRouter, useRoute } from 'vue-router'
import { Back } from '@element-plus/icons-vue'
import { useAdminInfo } from '@/stores/adminInfo'
const { go, currentRoute, push } = useRouter()
const { query } = useRoute() // 查询参数
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
const needGovernance = query.needGovernance as unknown as string // 从 URL 传递过来的 是否需要治理
const dictData = useDictData()
const areaOptionList = dictData.getBasicData('jibei_area')
const adminInfo = useAdminInfo()
const jb_pl = ref(false)
const jb_dky = ref(false)
jb_pl.value =
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_pl'
}).length != 0
? true
: false
jb_dky.value =
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_dky'
}).length != 0
? true
: false
const tableStore = new TableStore({
url: '/supervision-boot/userReportNormal/userReportGoNetPage',
method: 'POST',
column: [
{
title: '序号', width: 80, formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'projectName', title: '用户名称', minWidth: 170 },
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
{ field: 'city', title: '所在地市', minWidth: 80 },
{ field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{ field: 'substation', title: '厂站名称', minWidth: 100 },
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'createTime', title: '创建时间', minWidth: 100 },
{
title: '操作',fixed: 'right',
minWidth: 180,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
handleAudit(row.processInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return !(row.status == 0 || row.status == 3)
},
disabled: row => {
return !(row.status == 0 || row.status == 3)
},
click: row => {
dialogVisible.value = true
titleButton1.value = '编辑'
setTimeout(() => {
addForms.value.open(row)
}, 0)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 4)
},
click: row => {
dialogVisible.value = true
titleButton1.value = '重新发起'
setTimeout(() => {
addForms.value.open(row)
}, 0)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status !== 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.userReportId = bussId.value
tableStore.table.params.type = bussType.value
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.city = ''
tableStore.table.params.projectName = ''
const dialogVisible = ref(false)
const bussId = ref()
bussId.value = currentRoute.value.query.id
const bussType = ref()
bussType.value = Number(currentRoute.value.query.type)
const titleButton = ref()
const titleButton1 = ref()
provide('tableStore', tableStore)
const handleVisibilityChange = async () => {
if (document.visibilityState === 'visible') {
// 在这里执行页面回到回到当前页签需要做的事情
await tableStore.index()
} else if (document.visibilityState === 'hidden') {
// 在这里执行页面离开时需要做的事情
}
}
onMounted(async () => {
tableStore.index()
document.addEventListener('visibilitychange', handleVisibilityChange)
if (query.fangAnId) {
//根据id查询待编辑的数据
await userReportGoNetById({ id: query.fangAnId }).then(res => {
if (res && res.code == 'A0000') {
dialogVisible.value = true
titleButton1.value = '重新发起'
setTimeout(() => {
res.data.id = query.fangAnId
addForms.value.open(res.data)
}, 0)
}
})
}
})
onUnmounted(() => {
document.removeEventListener('visibilitychange', handleVisibilityChange)
})
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancel(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
/** 处理审批按钮 */
const handleAudit = (instanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
query: {
id: instanceId
}
})
}
if (bussType.value === 0) {
titleButton.value = '入网设计方案申请'
} else {
titleButton.value = '治理工程申请'
}
const addForms = ref()
const toGoNet = () => {
dialogVisible.value = true
if (bussType.value === 0) {
titleButton1.value = '入网设计方案申请'
} else {
titleButton1.value = '治理工程申请'
}
setTimeout(() => {
addForms.value.open()
}, 0)
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
</script>
<style scoped lang="scss">
.header_btn {
width: 100%;
height: 60px;
display: flex;
padding: 13px 15px;
justify-content: flex-end;
align-items: center;
border: 1px solid #dddfe6;
}
</style>

View File

@@ -1,404 +1,404 @@
<template>
<TableHeader datePicker nextFlag theCurrentTime ref='TableHeaderRef'>
<template #select>
<el-form-item label='项目名称'>
<el-input v-model='tableStore.table.params.projectName' placeholder='请输入项目名称' clearable maxlength="32" show-word-limit></el-input>
</el-form-item>
<el-form-item label='所在地市'>
<el-select v-model='tableStore.table.params.city' clearable placeholder='请选择所在地市'>
<el-option v-for='item in areaOptionList' :key='item.id' :label='item.name' :value='item.name'></el-option>
</el-select>
</el-form-item>
<el-form-item label='流程状态'>
<el-select v-model='tableStore.table.params.status' clearable placeholder='请选择流程状态'>
<el-option v-for='item in statusSelect' :key='item.id' :label='item.name' :value='item.id'></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<!-- <el-button icon="el-icon-Plus" type="primary" @click="addList">新增</el-button> -->
<el-button icon='el-icon-Plus' type='primary' @click='addFormModel'>新增</el-button>
<el-button icon='el-icon-Delete' type='primary' @click='deleteEven'>删除</el-button>
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref='tableRef' :checkbox-config='checkboxConfig' />
<!-- 新增 -->
<Add ref='addRef' @onSubmit='tableStore.index()' />
<!-- 上传 -->
<Audit ref='AuditRef' @onSubmit='tableStore.index()' />
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref='addForms' @onSubmit='tableStore.index()'></addForm>
</template>
<script setup lang='ts'>
import { ref, onMounted, provide, watch, reactive } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import Add from './add.vue'
import Audit from './audit.vue'
import addForm from './addForm.vue'
import { useDictData } from '@/stores/dictData'
import { getLoadTypeUserList } from '@/api/process-boot/interference'
import { cancelFormData, getUserReportById } from '@/api/supervision-boot/interfere/index'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useAdminInfo } from '@/stores/adminInfo'
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const TableHeaderRef = ref()
const tableRef = ref()
const areaOptionList = dictData
.getBasicData('jibei_area')
.filter(item => !(item.name == '超高压' || item.name == '风光储'))
const statusSelect = dictData.statusSelect()
const addRef = ref()
const AuditRef = ref()
const ruleFormRef = ref()
const show: any = ref(false)
const fileList = ref([])
const flag = ref(false)
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getUserReport',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'city',
title: '所在地市',
minWidth: 80
// formatter: (obj: any) => {
// return areaOptionList.filter(item => item.id == obj.row.city)[0]?.name
// }
},
{
field: 'substation',
title: '厂站名称',
minWidth: 100,
formatter: (row: any) => {
row.cellValue = row.cellValue ? row.cellValue : '/'
return row.cellValue
}
},
{ field: 'projectName', title: '项目名称', minWidth: 170 },
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
{ field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{ field: 'createTime', title: '开始时间', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
addForms.value.open({
title: '编辑',
row: row
})
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.city = ''
tableStore.table.params.projectName = ''
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.fileUploadflag = ''
tableStore.table.params.orgId = adminInfo.$state.deptId
tableStore.table.params.status = ''
provide('tableStore', tableStore)
// 新增
const addList = () => {
addRef.value.open()
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
const addForms = ref()
const addFormModel = () => {
show.value = true
setTimeout(() => {
addForms.value.open({
title: '用户档案录入'
})
}, 0)
}
// 导出
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getLoadTypeUserList(form).then(res => {
tableRef.value.getRef().exportData({
filename: '未建档非线性用户', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
onMounted(() => {
tableStore.index()
})
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getUserReportById(fullId).then(res => {
if (res && res.code == 'A0000') {
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}, { immediate: true })
</script>
<style scoped lang='scss'></style>
<template>
<TableHeader datePicker nextFlag theCurrentTime ref='TableHeaderRef'>
<template #select>
<el-form-item label='项目名称'>
<el-input v-model='tableStore.table.params.projectName' placeholder='请输入项目名称' clearable maxlength="32" show-word-limit></el-input>
</el-form-item>
<el-form-item label='所在地市'>
<el-select v-model='tableStore.table.params.city' clearable placeholder='请选择所在地市'>
<el-option v-for='item in areaOptionList' :key='item.id' :label='item.name' :value='item.name'></el-option>
</el-select>
</el-form-item>
<el-form-item label='流程状态'>
<el-select v-model='tableStore.table.params.status' clearable placeholder='请选择流程状态'>
<el-option v-for='item in statusSelect' :key='item.id' :label='item.name' :value='item.id'></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<!-- <el-button icon="el-icon-Plus" type="primary" @click="addList">新增</el-button> -->
<el-button icon='el-icon-Plus' type='primary' @click='addFormModel'>新增</el-button>
<el-button icon='el-icon-Delete' type='primary' @click='deleteEven'>删除</el-button>
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref='tableRef' :checkbox-config='checkboxConfig' />
<!-- 新增 -->
<Add ref='addRef' @onSubmit='tableStore.index()' />
<!-- 上传 -->
<Audit ref='AuditRef' @onSubmit='tableStore.index()' />
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref='addForms' @onSubmit='tableStore.index()'></addForm>
</template>
<script setup lang='ts'>
import { ref, onMounted, provide, watch, reactive } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import Add from './add.vue'
import Audit from './audit.vue'
import addForm from './addForm.vue'
import { useDictData } from '@/stores/dictData'
import { getLoadTypeUserList } from '@/api/process-boot/interference'
import { cancelFormData, getUserReportById } from '@/api/supervision-boot/interfere/index'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useAdminInfo } from '@/stores/adminInfo'
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const TableHeaderRef = ref()
const tableRef = ref()
const areaOptionList = dictData
.getBasicData('jibei_area')
.filter(item => !(item.name == '超高压' || item.name == '风光储'))
const statusSelect = dictData.statusSelect()
const addRef = ref()
const AuditRef = ref()
const ruleFormRef = ref()
const show: any = ref(false)
const fileList = ref([])
const flag = ref(false)
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getUserReport',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'city',
title: '所在地市',
minWidth: 80
// formatter: (obj: any) => {
// return areaOptionList.filter(item => item.id == obj.row.city)[0]?.name
// }
},
{
field: 'substation',
title: '厂站名称',
minWidth: 100,
formatter: (row: any) => {
row.cellValue = row.cellValue ? row.cellValue : '/'
return row.cellValue
}
},
{ field: 'projectName', title: '项目名称', minWidth: 170 },
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
{ field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{ field: 'createTime', title: '开始时间', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
minWidth: 150,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
addForms.value.open({
title: '编辑',
row: row
})
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.city = ''
tableStore.table.params.projectName = ''
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.fileUploadflag = ''
tableStore.table.params.orgId = adminInfo.$state.deptId
tableStore.table.params.status = ''
provide('tableStore', tableStore)
// 新增
const addList = () => {
addRef.value.open()
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
const addForms = ref()
const addFormModel = () => {
show.value = true
setTimeout(() => {
addForms.value.open({
title: '用户档案录入'
})
}, 0)
}
// 导出
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getLoadTypeUserList(form).then(res => {
tableRef.value.getRef().exportData({
filename: '未建档非线性用户', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
onMounted(() => {
tableStore.index()
})
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getUserReportById(fullId).then(res => {
if (res && res.code == 'A0000') {
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}, { immediate: true })
</script>
<style scoped lang='scss'></style>

View File

@@ -1,217 +1,217 @@
<template>
<div class="default-main">
<!-- <el-dialog
v-model="dialogFormVisible"
title="技术监督计划实施问题"
width="90%"
:append-to-body="true"
:before-close="close"
:close-on-click-modal="false"
draggable
custom-class="fixed-dialog"
@closed="close"
> -->
<TableHeader :showSearch="false" ref="TableHeaderRef">
<!-- <template #select>
<el-form-item label="用户名称">
<el-input v-model="tableStore.table.params.searchValue" clearable></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.loadType" clearable placeholder="请选择所在地市">
<el-option
v-for="item in areaOptionList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template> -->
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Back" @click="go(-1)">返回</el-button>
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRefs" />
<!-- </el-dialog> -->
<addForm ref="addFormRef" :planId="planId" @onSubmit="effectTableStore.index()"></addForm>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, reactive, defineExpose, defineProps, defineEmits, watch, onUnmounted } from 'vue'
import { useDictData } from '@/stores/dictData'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import addForm from './addForm.vue'
import { queryByAllCode } from '@/api/system-boot/dictTree'
import { useAdminInfo } from '@/stores/adminInfo'
import { uploadFile } from '@/api/system-boot/file'
import { addPlanFormData, getUserByDeptId } from '@/api/supervision-boot/plan/index'
import { getAreaList } from '@/api/common'
import Area from '@/components/form/area/index.vue'
defineOptions({
name: 'PlanEffectProblem'
})
const emits = defineEmits([''])
const props = defineProps({
effectProblemForm: {
type: Object,
default: () => ({})
}
})
const planId: any = ref('')
const dictData = useDictData()
const dialogFormVisible = ref(false)
const tableRefs = ref()
//字典获取问题类型
const problemTypeList = dictData.getBasicData('problem_type')
//字典整改情况
const rectificationStatusList = dictData.getBasicData('rectification_type')
//字典问题等级
const problemLevelList = dictData.getBasicData('problem_level_type')
const effectTableStore = new TableStore({
url: '/supervision-boot/superProblem/pageProblem',
// publicHeight: 65,
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{
field: 'problemDesc',
title: '问题描述',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'problemLevel',
title: '问题等级',
minWidth: 170,
formatter: (row: any) => {
return problemLevelList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'problemLevelReason',
title: '定级依据',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'problemType',
title: '问题类型',
minWidth: 170,
formatter: (row: any) => {
return problemTypeList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{ field: 'rectificationMeasure', title: '整改措施', minWidth: 170 },
{ field: 'rectificationProgramme', title: '整改方案', minWidth: 170 },
{
field: 'rectificationStatus',
title: '整改情况',
minWidth: 170,
formatter: (row: any) => {
return rectificationStatusList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'rectificationTime',
title: '整改时间',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue.replace('T', ' ')
}
},
{ field: 'remark', title: '备注', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleDetail(row)
}
},
{
name: 'productSetting',
title: '修改',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return true
},
click: row => {
handleEdit(row)
}
}
]
}
],
beforeSearchFun: () => {
effectTableStore.table.params.orgNo = effectTableStore.table.params.deptIndex
}
})
const { query } = useRoute() // 查询参数
const { go } = useRouter() // 路由
const queryId = query.id as unknown as string // 从 URL 传递过来的 id 编号
planId.value = queryId
watch(
() => queryId,
(val, oldVal) => {
if (val) {
effectTableStore.table.params.planId = val
effectTableStore.index()
}
},
{
deep: true,
immediate: true
}
)
provide('tableStore', effectTableStore)
const open = () => {
dialogFormVisible.value = true
}
const close = () => {
dialogFormVisible.value = false
// emits('onSubmit')
}
//新增
const addFormRef = ref()
const addFormModel = () => {
addFormRef.value.open({}, 'add')
}
//详情
const handleDetail = (row: any) => {
addFormRef.value.open(row, 'detail')
}
//修改
const handleEdit = (row: any) => {
console.log(row)
}
onMounted(() => {})
defineExpose({ open })
</script>
<template>
<div class="default-main">
<!-- <el-dialog
v-model="dialogFormVisible"
title="技术监督计划实施问题"
width="90%"
:append-to-body="true"
:before-close="close"
:close-on-click-modal="false"
draggable
custom-class="fixed-dialog"
@closed="close"
> -->
<TableHeader :showSearch="false" ref="TableHeaderRef">
<!-- <template #select>
<el-form-item label="用户名称">
<el-input v-model="tableStore.table.params.searchValue" clearable></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.loadType" clearable placeholder="请选择所在地市">
<el-option
v-for="item in areaOptionList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template> -->
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Back" @click="go(-1)">返回</el-button>
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRefs" />
<!-- </el-dialog> -->
<addForm ref="addFormRef" :planId="planId" @onSubmit="effectTableStore.index()"></addForm>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, reactive, defineExpose, defineProps, defineEmits, watch, onUnmounted } from 'vue'
import { useDictData } from '@/stores/dictData'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import addForm from './addForm.vue'
import { queryByAllCode } from '@/api/system-boot/dictTree'
import { useAdminInfo } from '@/stores/adminInfo'
import { uploadFile } from '@/api/system-boot/file'
import { addPlanFormData, getUserByDeptId } from '@/api/supervision-boot/plan/index'
import { getAreaList } from '@/api/common'
import Area from '@/components/form/area/index.vue'
defineOptions({
name: 'PlanEffectProblem'
})
const emits = defineEmits([''])
const props = defineProps({
effectProblemForm: {
type: Object,
default: () => ({})
}
})
const planId: any = ref('')
const dictData = useDictData()
const dialogFormVisible = ref(false)
const tableRefs = ref()
//字典获取问题类型
const problemTypeList = dictData.getBasicData('problem_type')
//字典整改情况
const rectificationStatusList = dictData.getBasicData('rectification_type')
//字典问题等级
const problemLevelList = dictData.getBasicData('problem_level_type')
const effectTableStore = new TableStore({
url: '/supervision-boot/superProblem/pageProblem',
// publicHeight: 65,
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{
field: 'problemDesc',
title: '问题描述',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'problemLevel',
title: '问题等级',
minWidth: 170,
formatter: (row: any) => {
return problemLevelList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'problemLevelReason',
title: '定级依据',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'problemType',
title: '问题类型',
minWidth: 170,
formatter: (row: any) => {
return problemTypeList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{ field: 'rectificationMeasure', title: '整改措施', minWidth: 170 },
{ field: 'rectificationProgramme', title: '整改方案', minWidth: 170 },
{
field: 'rectificationStatus',
title: '整改情况',
minWidth: 170,
formatter: (row: any) => {
return rectificationStatusList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'rectificationTime',
title: '整改时间',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue.replace('T', ' ')
}
},
{ field: 'remark', title: '备注', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
minWidth: 150,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleDetail(row)
}
},
{
name: 'productSetting',
title: '修改',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return true
},
click: row => {
handleEdit(row)
}
}
]
}
],
beforeSearchFun: () => {
effectTableStore.table.params.orgNo = effectTableStore.table.params.deptIndex
}
})
const { query } = useRoute() // 查询参数
const { go } = useRouter() // 路由
const queryId = query.id as unknown as string // 从 URL 传递过来的 id 编号
planId.value = queryId
watch(
() => queryId,
(val, oldVal) => {
if (val) {
effectTableStore.table.params.planId = val
effectTableStore.index()
}
},
{
deep: true,
immediate: true
}
)
provide('tableStore', effectTableStore)
const open = () => {
dialogFormVisible.value = true
}
const close = () => {
dialogFormVisible.value = false
// emits('onSubmit')
}
//新增
const addFormRef = ref()
const addFormModel = () => {
addFormRef.value.open({}, 'add')
}
//详情
const handleDetail = (row: any) => {
addFormRef.value.open(row, 'detail')
}
//修改
const handleEdit = (row: any) => {
console.log(row)
}
onMounted(() => {})
defineExpose({ open })
</script>

View File

@@ -1,391 +1,391 @@
<!---技术监督计划-->
<template>
<div class="default-main">
<TableHeader area datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option
v-for="item in statusSelect"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增弹框 -->
<addForm ref="addForms" @onSubmit="tableStore.index()"></addForm>
<!-- 实施问题弹框 -->
<effectProblem
ref="effectProblemList"
@onSubmit="tableStore.index()"
:effectProblemForm="effectProblemForm"
></effectProblem>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import { mainHeight } from '@/utils/layout'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { getLoadTypeUserList } from '@/api/process-boot/interference'
import { useDictData } from '@/stores/dictData'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
const dictData = useDictData()
const statusSelect = dictData.statusSelect()
import addForm from './components/addForm.vue'
import effectProblem from './components/effectProblem/index.vue'
import { planDetailsAudit, sendAlarm } from '@/api/supervision-boot/plan/index'
import { useAdminInfo } from '@/stores/adminInfo'
import { cancelPlanFormData } from '@/api/supervision-boot/plan/index'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
defineOptions({
name: 'plan'
})
const flag = ref(false)
// const layout = mainHeight(120) as any
const { push, options, currentRoute } = useRouter()
const router = useRouter() // 路由对象
const TableHeaderRef = ref()
const tableRef = ref()
//字典获取监督类型
const supvTypeList = dictData.getBasicData('supv_type')
//字典获取监督阶段
const supvStageList = dictData.getBasicData('supv_stage')
//字典获取监督对象类型
const supvObjTypeList = dictData.getBasicData('supv_obj_type')
const tableStore = new TableStore({
url: '/supervision-boot/superPlan/pagePlan',
// publicHeight: 65,
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{
field: 'province',
title: '所属省份',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'city',
title: '所在地市',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'county',
title: '所属县区',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'supvOrgName',
title: '监督单位',
minWidth: 170
},
{ field: 'workPlanName', title: '计划名称', minWidth: 170 },
{
field: 'planSupvDate',
title: '计划监督时间',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue.replace('T', ' ')
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'supvType',
title: '监督类型',
minWidth: 170,
formatter: (row: any) => {
return supvTypeList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'supvStage',
title: '监督阶段',
minWidth: 170,
formatter: (row: any) => {
return supvStageList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'supvObjType',
title: '监督对象类型',
minWidth: 170,
formatter: (row: any) => {
return supvObjTypeList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'objType',
title: '监督对象属性',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue == '1' ? '在运站' : '新(改、扩)建站'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
minWidth: 300,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
flag.value = true
handleDetails(row.processInstanceId, row.historyInstanceId)
},
disabled: row => {
return !row.processInstanceId
}
},
{
name: 'productSetting',
title: '实施问题',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 3
},
click: row => {
handleEffectProblem(row)
}
},
{
name: 'productSetting',
title: '提交审核',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.processInstanceId
},
click: row => {
handleAudit(row)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
// return row.createBy != adminInfo.$state.id || row.status != 1 || !row.processInstanceId
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
},
{
name: 'productSetting',
title: '发起告警单',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.isUploadHead == 1
},
click: row => {
handleAlarmForm(row)
}
},
{
name: 'edit',
title: '查看告警单',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.isUploadHead == 0
},
click: row => {
router.push({
name: 'supervision/supervision/manage',
query: {
type: 1
}
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
// tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.status = ''
// tableStore.table.params.loadType = ''
// tableStore.table.params.userName = ''
// tableStore.table.params.fileUploadflag = ''
provide('tableStore', tableStore)
const addForms = ref()
const addFormModel = () => {
setTimeout(() => {
addForms.value.open({
title: '技术监督计划'
})
}, 0)
}
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getLoadTypeUserList(form).then(res => {
tableRef.value.getRef().exportData({
filename: '未建档非线性用户', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
onMounted(() => {
tableStore.index()
})
//
const handleDetails = (id: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: id,
historyInstanceId
}
})
}
/** 提交审核按钮 */
const handleAudit = (row: any) => {
planDetailsAudit({ id: row.planId }).then(res => {
ElMessage.success('提交审核成功!')
tableStore.index()
})
}
//发起告警单
const handleAlarmForm = (row: any) => {
sendAlarm({ id: row.planId }).then(res => {
ElMessage.success('发起告警单成功!')
tableStore.index()
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.planId,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelPlanFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
// 实施问题按钮
const effectProblemList = ref()
const effectProblemForm: any = ref({})
const handleEffectProblem = (row: any) => {
// effectProblemForm.value = row
// effectProblemList.value.open()
push({
name: 'PlanEffectProblem',
query: {
id: row.planId
}
})
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
</script>
<!---技术监督计划-->
<template>
<div class="default-main">
<TableHeader area datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option
v-for="item in statusSelect"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增弹框 -->
<addForm ref="addForms" @onSubmit="tableStore.index()"></addForm>
<!-- 实施问题弹框 -->
<effectProblem
ref="effectProblemList"
@onSubmit="tableStore.index()"
:effectProblemForm="effectProblemForm"
></effectProblem>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import { mainHeight } from '@/utils/layout'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { getLoadTypeUserList } from '@/api/process-boot/interference'
import { useDictData } from '@/stores/dictData'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
const dictData = useDictData()
const statusSelect = dictData.statusSelect()
import addForm from './components/addForm.vue'
import effectProblem from './components/effectProblem/index.vue'
import { planDetailsAudit, sendAlarm } from '@/api/supervision-boot/plan/index'
import { useAdminInfo } from '@/stores/adminInfo'
import { cancelPlanFormData } from '@/api/supervision-boot/plan/index'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
defineOptions({
name: 'plan'
})
const flag = ref(false)
// const layout = mainHeight(120) as any
const { push, options, currentRoute } = useRouter()
const router = useRouter() // 路由对象
const TableHeaderRef = ref()
const tableRef = ref()
//字典获取监督类型
const supvTypeList = dictData.getBasicData('supv_type')
//字典获取监督阶段
const supvStageList = dictData.getBasicData('supv_stage')
//字典获取监督对象类型
const supvObjTypeList = dictData.getBasicData('supv_obj_type')
const tableStore = new TableStore({
url: '/supervision-boot/superPlan/pagePlan',
// publicHeight: 65,
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{
field: 'province',
title: '所属省份',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'city',
title: '所在地市',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'county',
title: '所属县区',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'supvOrgName',
title: '监督单位',
minWidth: 170
},
{ field: 'workPlanName', title: '计划名称', minWidth: 170 },
{
field: 'planSupvDate',
title: '计划监督时间',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue.replace('T', ' ')
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'supvType',
title: '监督类型',
minWidth: 170,
formatter: (row: any) => {
return supvTypeList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'supvStage',
title: '监督阶段',
minWidth: 170,
formatter: (row: any) => {
return supvStageList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'supvObjType',
title: '监督对象类型',
minWidth: 170,
formatter: (row: any) => {
return supvObjTypeList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'objType',
title: '监督对象属性',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue == '1' ? '在运站' : '新(改、扩)建站'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
minWidth: 300,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
flag.value = true
handleDetails(row.processInstanceId, row.historyInstanceId)
},
disabled: row => {
return !row.processInstanceId
}
},
{
name: 'productSetting',
title: '实施问题',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 3
},
click: row => {
handleEffectProblem(row)
}
},
{
name: 'productSetting',
title: '提交审核',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.processInstanceId
},
click: row => {
handleAudit(row)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
// return row.createBy != adminInfo.$state.id || row.status != 1 || !row.processInstanceId
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
},
{
name: 'productSetting',
title: '发起告警单',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.isUploadHead == 1
},
click: row => {
handleAlarmForm(row)
}
},
{
name: 'edit',
title: '查看告警单',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.isUploadHead == 0
},
click: row => {
router.push({
name: 'supervision/supervision/manage',
query: {
type: 1
}
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
// tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.status = ''
// tableStore.table.params.loadType = ''
// tableStore.table.params.userName = ''
// tableStore.table.params.fileUploadflag = ''
provide('tableStore', tableStore)
const addForms = ref()
const addFormModel = () => {
setTimeout(() => {
addForms.value.open({
title: '技术监督计划'
})
}, 0)
}
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getLoadTypeUserList(form).then(res => {
tableRef.value.getRef().exportData({
filename: '未建档非线性用户', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
onMounted(() => {
tableStore.index()
})
//
const handleDetails = (id: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: id,
historyInstanceId
}
})
}
/** 提交审核按钮 */
const handleAudit = (row: any) => {
planDetailsAudit({ id: row.planId }).then(res => {
ElMessage.success('提交审核成功!')
tableStore.index()
})
}
//发起告警单
const handleAlarmForm = (row: any) => {
sendAlarm({ id: row.planId }).then(res => {
ElMessage.success('发起告警单成功!')
tableStore.index()
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.planId,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelPlanFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
// 实施问题按钮
const effectProblemList = ref()
const effectProblemForm: any = ref({})
const handleEffectProblem = (row: any) => {
// effectProblemForm.value = row
// effectProblemList.value.open()
push({
name: 'PlanEffectProblem',
query: {
id: row.planId
}
})
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
</script>

View File

@@ -148,10 +148,10 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
align: 'center',
minWidth: '150',
fixed: 'right',
render: 'buttons',
buttons: [
{

View File

@@ -144,10 +144,10 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
align: 'center',
minWidth: '150',
fixed: 'right',
render: 'buttons',
buttons: [
{

File diff suppressed because it is too large Load Diff

View File

@@ -112,11 +112,11 @@ const tableStore = new TableStore({
// ]
// },
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: '220',
align: 'center',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'productSetting',

View File

@@ -1,214 +1,214 @@
<template>
<div>
<div>
<TableHeader datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="筛选数据">
<el-input
v-model="tableStore.table.params.searchValue"
clearable
placeholder="请选择筛选数据"
></el-input>
</el-form-item>
</template>
</TableHeader>
<div class="box">
<MyEChart style="flex: 1.2" :options="options1" />
<MyEChart style="flex: 2" :options="options2" />
</div>
<Table ref="tableRef" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { mainHeight } from '@/utils/layout'
import { useDictData } from '@/stores/dictData'
import MyEChart from '@/components/echarts/MyEchart.vue'
import { info } from 'console'
const dictData = useDictData()
const dialogVisible = ref(false)
const TableHeaderRef = ref()
const title = ref('')
const options1 = ref({})
const options2 = ref({})
const ruleFormRef = ref()
const tableStore = new TableStore({
url: '/system-boot/area/areaSelect',
publicHeight: 345,
method: 'POST',
column: [
{ field: 'name', title: '事务名称' },
{ field: 'type', title: '事务类型' },
{ field: 'createUser', title: '创建人员' },
{ field: 'companyName', title: '创建部门' },
{ field: 'modifyUser', title: '处理人员' },
{ field: 'modifyTime', title: '处理时间' },
{ field: 'progressTime', title: '进行时间(天)' },
{ field: 'progress', title: '流程状态' },
{ field: 'alertType', title: '预警类型' },
{
title: '操作',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '上传',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {}
},
{
name: 'edit',
title: '查看',
type: '',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {}
}
]
}
],
loadCallback: () => {
tableStore.table.data = []
}
})
tableStore.table.params.searchState = ''
tableStore.table.params.searchValue = ''
tableStore.table.params.type = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
info()
})
//渲染图表
const info = () => {
options1.value = {
title: {
text: '商务类型',
x: 'center',
textStyle: {
fontWeight: 'normal'
}
},
xAxis: [
{
data: ['全部', '预警单', '告警单']
}
],
yAxis: [{}],
series: [
{
name: '数量',
type: 'bar',
barMaxWidth: 30, //最大宽度
data: [
{
value: 9,
id: ''
},
{
value: 4,
id: '0'
},
{
value: 5,
id: '1'
}
]
}
]
}
options2.value = {
title: {
text: '事务流程',
x: 'center',
textStyle: {
fontWeight: 'normal'
}
},
xAxis: [
{
data: [
'全部',
'开始',
'预/告警单下发',
'预/告警单反馈',
'现场测试',
'整改通知单下发',
'整改通知单反馈',
'完结'
]
}
],
yAxis: [{}],
series: [
{
name: '数量',
type: 'bar',
barMaxWidth: 30, //最大宽度
data: [
{
value: 9,
id: ''
},
{
value: 4,
id: '0'
},
{
value: 5,
id: '1'
},
{
value: 5,
id: '2'
},
{
value: 5,
id: '3'
},
{
value: 5,
id: '4'
},
{
value: 5,
id: '5'
},
{
value: 5,
id: '6'
}
]
}
]
}
}
// 新增
const add = () => {
title.value = '新增告警单'
dialogVisible.value = true
}
</script>
<style lang="scss" scoped>
.box {
height: 280px;
display: flex;
justify-content: space-between;
}
</style>
<template>
<div>
<div>
<TableHeader datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="筛选数据">
<el-input
v-model="tableStore.table.params.searchValue"
clearable
placeholder="请选择筛选数据"
></el-input>
</el-form-item>
</template>
</TableHeader>
<div class="box">
<MyEChart style="flex: 1.2" :options="options1" />
<MyEChart style="flex: 2" :options="options2" />
</div>
<Table ref="tableRef" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { mainHeight } from '@/utils/layout'
import { useDictData } from '@/stores/dictData'
import MyEChart from '@/components/echarts/MyEchart.vue'
import { info } from 'console'
const dictData = useDictData()
const dialogVisible = ref(false)
const TableHeaderRef = ref()
const title = ref('')
const options1 = ref({})
const options2 = ref({})
const ruleFormRef = ref()
const tableStore = new TableStore({
url: '/system-boot/area/areaSelect',
publicHeight: 345,
method: 'POST',
column: [
{ field: 'name', title: '事务名称' },
{ field: 'type', title: '事务类型' },
{ field: 'createUser', title: '创建人员' },
{ field: 'companyName', title: '创建部门' },
{ field: 'modifyUser', title: '处理人员' },
{ field: 'modifyTime', title: '处理时间' },
{ field: 'progressTime', title: '进行时间(天)' },
{ field: 'progress', title: '流程状态' },
{ field: 'alertType', title: '预警类型' },
{
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '上传',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {}
},
{
name: 'edit',
title: '查看',
type: '',
icon: 'el-icon-Plus',
render: 'basicButton',
click: async row => {}
}
]
}
],
loadCallback: () => {
tableStore.table.data = []
}
})
tableStore.table.params.searchState = ''
tableStore.table.params.searchValue = ''
tableStore.table.params.type = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
info()
})
//渲染图表
const info = () => {
options1.value = {
title: {
text: '商务类型',
x: 'center',
textStyle: {
fontWeight: 'normal'
}
},
xAxis: [
{
data: ['全部', '预警单', '告警单']
}
],
yAxis: [{}],
series: [
{
name: '数量',
type: 'bar',
barMaxWidth: 30, //最大宽度
data: [
{
value: 9,
id: ''
},
{
value: 4,
id: '0'
},
{
value: 5,
id: '1'
}
]
}
]
}
options2.value = {
title: {
text: '事务流程',
x: 'center',
textStyle: {
fontWeight: 'normal'
}
},
xAxis: [
{
data: [
'全部',
'开始',
'预/告警单下发',
'预/告警单反馈',
'现场测试',
'整改通知单下发',
'整改通知单反馈',
'完结'
]
}
],
yAxis: [{}],
series: [
{
name: '数量',
type: 'bar',
barMaxWidth: 30, //最大宽度
data: [
{
value: 9,
id: ''
},
{
value: 4,
id: '0'
},
{
value: 5,
id: '1'
},
{
value: 5,
id: '2'
},
{
value: 5,
id: '3'
},
{
value: 5,
id: '4'
},
{
value: 5,
id: '5'
},
{
value: 5,
id: '6'
}
]
}
]
}
}
// 新增
const add = () => {
title.value = '新增告警单'
dialogVisible.value = true
}
</script>
<style lang="scss" scoped>
.box {
height: 280px;
display: flex;
justify-content: space-between;
}
</style>

View File

@@ -122,7 +122,7 @@ const tableStore = new TableStore({
},
{
title: '操作',
title: '操作',fixed: 'right',
width: '180',
render: 'buttons',
buttons: [

View File

@@ -1,302 +1,302 @@
<template>
<div>
<div>
<TableHeader area ref="TableHeaderRef">
<template #select>
<el-form-item label="终端名称">
<el-input
v-model="tableStore.table.params.name"
clearable
placeholder="请输入终端名称"
></el-input>
</el-form-item>
<el-form-item label="生产厂家">
<el-select
v-model="tableStore.table.params.manufacture"
placeholder="请选择生产厂家"
multiple
collapse-tags
clearable
class="select"
>
<el-option
v-for="item in manufactorList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检测结果">
<el-select
v-model="tableStore.table.params.testResults"
placeholder="请选择检测结果"
clearable
class="select"
>
<el-option
v-for="item in testResultsList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Download" type="primary">导出</el-button>
<el-upload
ref="uploadRef"
action=""
accept=".xls"
:on-change="choose"
:show-file-list="false"
:auto-upload="false"
>
<template #trigger>
<el-button
icon="el-icon-Upload"
type="primary"
style="margin-left: 12px; margin-right: 12px"
>
excel导入
</el-button>
</template>
</el-upload>
<el-button icon="el-icon-Upload" type="primary" @click="UploadOriginal">上传检测报告</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 上传检测报告 -->
<el-dialog
draggable
title="上传检测报告__支持批量上传"
v-model="showBatchUpload"
width="30%"
:before-close="handleClose"
>
<el-upload
multiple
action=""
:auto-upload="false"
:limit="999"
accept=".doc,.docx"
:file-list="fileList"
:on-remove="handleRemove"
:on-change="chooseBatch"
ref="upload"
>
<el-button type="primary" icon="el-icon-Upload">选择文件</el-button>
<span :style="`color:#f58003`">
  (*传入的检测报告文件格式(终端编号-检测报告(yyyy-MM-dd).docx))
</span>
</el-upload>
<template #footer>
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="BatchUpload"> </el-button>
</template>
</el-dialog>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { DownloadExport, reportDownload, batchTerminal, importReport } from '@/api/process-boot/terminal'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const manufactorList = dictData.getBasicData('Dev_Manufacturers')
const testResultsList = [
{
id: 0,
name: '未展开'
},
{
id: 1,
name: '已展开'
}
]
const TableHeaderRef = ref()
const showBatchUpload = ref(false)
const fileList: any = ref([])
const tableStore = new TableStore({
url: '/process-boot/process/pmsTerminalDetection/getTerminalPage',
publicHeight: 85,
method: 'POST',
column: [
{ field: 'id', title: '终端编号' },
{
field: 'manufacture',
title: '生产厂家',
formatter(row: any) {
return manufactorList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'installPlace', title: '安装位置' },
{ field: 'inspectionUnit', title: '送检单位' },
{
field: 'testResults',
title: '检测结果',
render: 'tag',
custom: {
0: 'warning',
1: 'success'
},
replaceValue: {
0: '未展开',
1: '已展开'
}
// formatter(row: any) {
// return row.cellValue == 0 ? '未展开' : '已展开'
// }
},
{ field: 'nextInspectionTime', title: '下次检测时间' },
{
title: '操作',
width: '250',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'edit',
title: '下载原始数据报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.originalReport == null
},
click: row => {
download(row, 0)
}
},
{
name: 'edit',
title: '下载检测报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.inspectionReport == null
},
click: row => {
download(row, 1)
}
}
]
}
]
})
tableStore.table.params.name = ''
tableStore.table.params.id = dictData.state.area[0].id
tableStore.table.params.testResults = ''
tableStore.table.params.manufacture = []
tableStore.table.params.type = 1
provide('tableStore', tableStore)
// 关闭弹窗查询
const onsubmit = () => {}
// 下载模版
const Export = () => {
DownloadExport().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '终端入网检测录入模板' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// 下载报告
const download = (row: any, type: number) => {
reportDownload({
id: row.id,
type: type
}).then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = type == 1 ? row.inspectionName : row.originalName // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// excel导入
const choose = (e: any) => {
batchTerminal(e.raw).then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功,无错误数据!')
tableStore.index()
} else {
ElMessage.warning('上传成功,有错误数据 自动下载 请查看')
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '模板错误信息' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
}
})
}
// 上传原始报告
const UploadOriginal = () => {
showBatchUpload.value = true
}
// 上传
const BatchUpload = () => {
let form = new FormData()
form.append('type', '1')
fileList.value.forEach((item: any) => {
form.append('files', item.raw)
})
importReport(form)
.then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功!')
handleClose()
tableStore.index()
} else {
ElMessage.error('上传失败!')
}
})
.catch(response => {
// console.log(response);
})
// fileList.value
}
const chooseBatch = (e: any) => {
fileList.value.push(e)
}
const handleRemove = (e: any) => {
fileList.value = fileList.value.filter((item: any) => item.uid !== e.uid)
}
const handleClose = () => {
fileList.value = []
showBatchUpload.value = false
}
onMounted(() => {
tableStore.index()
})
</script>
<template>
<div>
<div>
<TableHeader area ref="TableHeaderRef">
<template #select>
<el-form-item label="终端名称">
<el-input
v-model="tableStore.table.params.name"
clearable
placeholder="请输入终端名称"
></el-input>
</el-form-item>
<el-form-item label="生产厂家">
<el-select
v-model="tableStore.table.params.manufacture"
placeholder="请选择生产厂家"
multiple
collapse-tags
clearable
class="select"
>
<el-option
v-for="item in manufactorList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检测结果">
<el-select
v-model="tableStore.table.params.testResults"
placeholder="请选择检测结果"
clearable
class="select"
>
<el-option
v-for="item in testResultsList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Download" type="primary">导出</el-button>
<el-upload
ref="uploadRef"
action=""
accept=".xls"
:on-change="choose"
:show-file-list="false"
:auto-upload="false"
>
<template #trigger>
<el-button
icon="el-icon-Upload"
type="primary"
style="margin-left: 12px; margin-right: 12px"
>
excel导入
</el-button>
</template>
</el-upload>
<el-button icon="el-icon-Upload" type="primary" @click="UploadOriginal">上传检测报告</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 上传检测报告 -->
<el-dialog
draggable
title="上传检测报告__支持批量上传"
v-model="showBatchUpload"
width="30%"
:before-close="handleClose"
>
<el-upload
multiple
action=""
:auto-upload="false"
:limit="999"
accept=".doc,.docx"
:file-list="fileList"
:on-remove="handleRemove"
:on-change="chooseBatch"
ref="upload"
>
<el-button type="primary" icon="el-icon-Upload">选择文件</el-button>
<span :style="`color:#f58003`">
  (*传入的检测报告文件格式(终端编号-检测报告(yyyy-MM-dd).docx))
</span>
</el-upload>
<template #footer>
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="BatchUpload"> </el-button>
</template>
</el-dialog>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { DownloadExport, reportDownload, batchTerminal, importReport } from '@/api/process-boot/terminal'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const manufactorList = dictData.getBasicData('Dev_Manufacturers')
const testResultsList = [
{
id: 0,
name: '未展开'
},
{
id: 1,
name: '已展开'
}
]
const TableHeaderRef = ref()
const showBatchUpload = ref(false)
const fileList: any = ref([])
const tableStore = new TableStore({
url: '/process-boot/process/pmsTerminalDetection/getTerminalPage',
publicHeight: 85,
method: 'POST',
column: [
{ field: 'id', title: '终端编号' },
{
field: 'manufacture',
title: '生产厂家',
formatter(row: any) {
return manufactorList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'installPlace', title: '安装位置' },
{ field: 'inspectionUnit', title: '送检单位' },
{
field: 'testResults',
title: '检测结果',
render: 'tag',
custom: {
0: 'warning',
1: 'success'
},
replaceValue: {
0: '未展开',
1: '已展开'
}
// formatter(row: any) {
// return row.cellValue == 0 ? '未展开' : '已展开'
// }
},
{ field: 'nextInspectionTime', title: '下次检测时间' },
{
title: '操作',fixed: 'right',
width: '250',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '下载原始数据报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.originalReport == null
},
click: row => {
download(row, 0)
}
},
{
name: 'edit',
title: '下载检测报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.inspectionReport == null
},
click: row => {
download(row, 1)
}
}
]
}
]
})
tableStore.table.params.name = ''
tableStore.table.params.id = dictData.state.area[0].id
tableStore.table.params.testResults = ''
tableStore.table.params.manufacture = []
tableStore.table.params.type = 1
provide('tableStore', tableStore)
// 关闭弹窗查询
const onsubmit = () => {}
// 下载模版
const Export = () => {
DownloadExport().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '终端入网检测录入模板' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// 下载报告
const download = (row: any, type: number) => {
reportDownload({
id: row.id,
type: type
}).then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = type == 1 ? row.inspectionName : row.originalName // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// excel导入
const choose = (e: any) => {
batchTerminal(e.raw).then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功,无错误数据!')
tableStore.index()
} else {
ElMessage.warning('上传成功,有错误数据 自动下载 请查看')
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '模板错误信息' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
}
})
}
// 上传原始报告
const UploadOriginal = () => {
showBatchUpload.value = true
}
// 上传
const BatchUpload = () => {
let form = new FormData()
form.append('type', '1')
fileList.value.forEach((item: any) => {
form.append('files', item.raw)
})
importReport(form)
.then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功!')
handleClose()
tableStore.index()
} else {
ElMessage.error('上传失败!')
}
})
.catch(response => {
// console.log(response);
})
// fileList.value
}
const chooseBatch = (e: any) => {
fileList.value.push(e)
}
const handleRemove = (e: any) => {
fileList.value = fileList.value.filter((item: any) => item.uid !== e.uid)
}
const handleClose = () => {
fileList.value = []
showBatchUpload.value = false
}
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -94,7 +94,7 @@ const tableStore = new TableStore({
}
/* {
title: '操作',
title: '操作',fixed: 'right',
minWidth: 150,
fixed: 'right',
render: 'buttons',

View File

@@ -1,390 +1,390 @@
<template>
<div>
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="项目名称">
<el-input style="width: 200px" placeholder="请输入项目名称" v-model="tableStore.table.params.projectName"
clearable maxlength="32" show-word-limit></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
<el-option v-for="item in areaOptionList" :key="item.id" :label="item.name"
:value="item.name"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate"
:loading="loading">模板下载</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<el-dialog title="详情" width="80%" v-model="dialogShow" v-if="dialogShow">
<DetailInfo :id="userId" :openType="'sourcesOfInterference'"></DetailInfo>
</el-dialog>
<!-- 批量导入 -->
<sensitive-user-popup ref="sensitiveUserPopup" />
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref="addForms" @onSubmit="tableStore.index()" :openType="'sourcesOfInterference'"></addForm>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import addForm from '@/views/pqs/supervise/interfere/components/undocumented/addForm.vue'
import SensitiveUserPopup from './sensitiveUserPopup.vue'
import { useDictData } from '@/stores/dictData'
import { useRouter } from 'vue-router'
import { downloadSensitiveReportTemplate } from '@/api/supervision-boot/userReport/form'
import DetailInfo from '../../interfere/components/undocumented/detail.vue'
import { cancelFormData, getUserReportById } from '@/api/supervision-boot/interfere/index'
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
const addForms = ref()
const dictData = useDictData()
const sensitiveUserPopup = ref()
const TableHeaderRef = ref()
const loading = ref(false)
const areaOptionList = dictData.getBasicData('jibei_area')
const { push, options, currentRoute } = useRouter()
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getInterferenceUserPage',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号', width: 80, formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'city', title: '所在地市', minWidth: 80 },
{ field: 'substation', title: '厂站名称', minWidth: 100 },
{ field: 'projectName', title: '项目名称', minWidth: 170 },
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
{ field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详细信息',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
lookInfo(row.id)
}
},
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
// showDisabled: row => {
// return (
// (row.city != adminInfo.$state.deptName && row.createBy != adminInfo.$state.id) ||
// !(row.dataType == 1)
// )
// },
disabled: row => {
return !(row.status == 0)
},
click: row => {
addForms.value.filterUsers([6])
addForms.value.open({
title: '编辑',
row: row
})
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.setcontroFlag()
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
}
})
tableStore.table.params.city = ''
tableStore.table.params.orgId = adminInfo.$state.deptId
tableStore.table.params.projectName = ''
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
const userId = ref()
const dialogShow = ref(false)
const lookInfo = (id: string) => {
userId.value = id
dialogShow.value = true
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
dataType: 1,
reason: value
}
await cancelFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
// 新增
const addFormModel = () => {
addForms.value.filterUsers([6])
setTimeout(() => {
addForms.value.open({
title: '用户档案录入'
})
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
//导出模板
const exportExcelTemplate = async () => {
loading.value = true
await downloadSensitiveReportTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '干扰源用户台账模板'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
}, 0)
}
//批量导入用户数据
const importUserData = () => {
sensitiveUserPopup.value.open('导入干扰源用户')
}
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getUserReportById(fullId).then(res => {
if (res && res.code == 'A0000') {
addForms.value.setcontroFlag()
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}, { immediate: true })
</script>
<template>
<div>
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="项目名称">
<el-input style="width: 200px" placeholder="请输入项目名称" v-model="tableStore.table.params.projectName"
clearable maxlength="32" show-word-limit></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
<el-option v-for="item in areaOptionList" :key="item.id" :label="item.name"
:value="item.name"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate"
:loading="loading">模板下载</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<el-dialog title="详情" width="80%" v-model="dialogShow" v-if="dialogShow">
<DetailInfo :id="userId" :openType="'sourcesOfInterference'"></DetailInfo>
</el-dialog>
<!-- 批量导入 -->
<sensitive-user-popup ref="sensitiveUserPopup" />
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref="addForms" @onSubmit="tableStore.index()" :openType="'sourcesOfInterference'"></addForm>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import addForm from '@/views/pqs/supervise/interfere/components/undocumented/addForm.vue'
import SensitiveUserPopup from './sensitiveUserPopup.vue'
import { useDictData } from '@/stores/dictData'
import { useRouter } from 'vue-router'
import { downloadSensitiveReportTemplate } from '@/api/supervision-boot/userReport/form'
import DetailInfo from '../../interfere/components/undocumented/detail.vue'
import { cancelFormData, getUserReportById } from '@/api/supervision-boot/interfere/index'
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
const addForms = ref()
const dictData = useDictData()
const sensitiveUserPopup = ref()
const TableHeaderRef = ref()
const loading = ref(false)
const areaOptionList = dictData.getBasicData('jibei_area')
const { push, options, currentRoute } = useRouter()
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getInterferenceUserPage',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号', width: 80, formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'city', title: '所在地市', minWidth: 80 },
{ field: 'substation', title: '厂站名称', minWidth: 100 },
{ field: 'projectName', title: '项目名称', minWidth: 170 },
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
{ field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
minWidth: 150,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详细信息',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
lookInfo(row.id)
}
},
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
// showDisabled: row => {
// return (
// (row.city != adminInfo.$state.deptName && row.createBy != adminInfo.$state.id) ||
// !(row.dataType == 1)
// )
// },
disabled: row => {
return !(row.status == 0)
},
click: row => {
addForms.value.filterUsers([6])
addForms.value.open({
title: '编辑',
row: row
})
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.setcontroFlag()
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
}
})
tableStore.table.params.city = ''
tableStore.table.params.orgId = adminInfo.$state.deptId
tableStore.table.params.projectName = ''
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
const userId = ref()
const dialogShow = ref(false)
const lookInfo = (id: string) => {
userId.value = id
dialogShow.value = true
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
dataType: 1,
reason: value
}
await cancelFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
// 新增
const addFormModel = () => {
addForms.value.filterUsers([6])
setTimeout(() => {
addForms.value.open({
title: '用户档案录入'
})
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
//导出模板
const exportExcelTemplate = async () => {
loading.value = true
await downloadSensitiveReportTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '干扰源用户台账模板'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
}, 0)
}
//批量导入用户数据
const importUserData = () => {
sensitiveUserPopup.value.open('导入干扰源用户')
}
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getUserReportById(fullId).then(res => {
if (res && res.code == 'A0000') {
addForms.value.setcontroFlag()
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}, { immediate: true })
</script>

View File

@@ -113,7 +113,7 @@ const tableStore = new TableStore({
/* {
title: '操作',
title: '操作',fixed: 'right',
minWidth: 150,
fixed: 'right',
render: 'buttons',

View File

@@ -1,372 +1,372 @@
<template>
<div>
<div>
<TableHeader area ref="TableHeaderRef">
<template #select>
<el-form-item label="终端名称">
<el-input
v-model="tableStore.table.params.name"
clearable
placeholder="请输入终端名称"
></el-input>
</el-form-item>
<el-form-item label="生产厂家">
<el-select
v-model="tableStore.table.params.manufacture"
placeholder="请选择生产厂家"
multiple
collapse-tags
clearable
class="select"
>
<el-option
v-for="item in manufactorList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检测结果">
<el-select
v-model="tableStore.table.params.testResults"
placeholder="请选择检测结果"
clearable
class="select"
>
<el-option
v-for="item in testResultsList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出</el-button>
<el-button icon="el-icon-Download" type="primary" @click="Export">下载模板</el-button>
<el-upload
ref="uploadRef"
action=""
accept=".xls"
:on-change="choose"
:show-file-list="false"
:auto-upload="false"
>
<template #trigger>
<el-button
icon="el-icon-Upload"
type="primary"
style="margin-left: 12px; margin-right: 12px"
>
excel导入
</el-button>
</template>
</el-upload>
<el-button icon="el-icon-Upload" type="primary" @click="UploadOriginal">上传原始报告</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增 -->
<newlyIncreased ref="addRef" @onsubmit="tableStore.index()" />
<!-- 上传原始报告 -->
<el-dialog
draggable
title="上传原始报告__支持批量上传"
v-model="showBatchUpload"
width="30%"
:before-close="handleClose"
>
<el-upload
multiple
action=""
:auto-upload="false"
:limit="999"
accept=".doc,.docx"
:file-list="fileList"
:on-remove="handleRemove"
:on-change="chooseBatch"
ref="upload"
>
<el-button type="primary" icon="el-icon-Upload">选择文件</el-button>
<span :style="`color:#f58003`">  (*传入的原始数据文件格式(终端编号-原始数据报告.docx))</span>
</el-upload>
<template #footer>
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="BatchUpload"> </el-button>
</template>
</el-dialog>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import newlyIncreased from './add.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
DownloadExport,
reportDownload,
batchTerminal,
delTerminal,
getTerminalPage,
importReport
} from '@/api/process-boot/terminal'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const manufactorList = dictData.getBasicData('Dev_Manufacturers')
const testResultsList = [
{
id: 0,
name: '未展开'
},
{
id: 1,
name: '已展开'
}
]
const fileList: any = ref([])
const TableHeaderRef = ref()
const addRef = ref()
const showBatchUpload = ref(false)
const tableRef = ref()
const ruleFormRef = ref()
const tableStore = new TableStore({
url: '/process-boot/process/pmsTerminalDetection/getTerminalPage',
publicHeight: 85,
method: 'POST',
column: [
// { width: '60', type: 'checkbox' },
{ field: 'orgName', title: '所属单位' },
{ field: 'id', title: '终端编号' },
{ field: 'name', title: '终端名称' },
{
field: 'manufacture',
title: '生产厂家',
formatter(row: any) {
return manufactorList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'installPlace', title: '安装位置' },
{ field: 'inspectionUnit', title: '送检单位' },
{
field: 'testResults',
title: '检测结果',
render: 'tag',
custom: {
0: 'warning',
1: 'success'
},
replaceValue: {
0: '未展开',
1: '已展开'
}
},
{ field: 'inspectionTime', title: '检测时间' },
{ field: 'nextInspectionTime', title: '下次检测时间' },
{
title: '操作',
width: '250',
render: 'buttons',
fixed: 'right',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
addRef.value.open({
title: '编辑',
row: row
})
}
},
{
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
delTerminal([row.id]).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
},
{
name: 'edit',
title: '下载原始数据报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.originalReport == null
},
click: row => {
download(row, 0)
}
},
{
name: 'edit',
title: '下载检测报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.inspectionReport == null
},
click: row => {
download(row, 1)
}
}
]
}
]
})
tableStore.table.params.name = ''
tableStore.table.params.id = dictData.state.area[0].id
tableStore.table.params.testResults = ''
tableStore.table.params.manufacture = []
tableStore.table.params.type = 0
provide('tableStore', tableStore)
const add = () => {
addRef.value.open({
title: '新增'
})
}
// 下载模版
const Export = () => {
DownloadExport().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '终端入网检测录入模板' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// 下载报告
const download = (row: any, type: number) => {
reportDownload({
id: row.id,
type: type
}).then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = type == 1 ? row.inspectionName : row.originalName // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// excel导入
const choose = (e: any) => {
batchTerminal(e.raw).then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功,无错误数据!')
tableStore.index()
} else {
ElMessage.warning('上传成功,有错误数据 自动下载 请查看')
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '模板错误信息' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
}
})
}
// 导出
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getTerminalPage(form).then(res => {
tableRef.value.getRef().exportData({
filename: '终端入网检测', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
// 上传原始报告
const UploadOriginal = () => {
showBatchUpload.value = true
}
// 上传
const BatchUpload = () => {
let form = new FormData()
form.append('type', '0')
fileList.value.forEach((item: any) => {
form.append('files', item.raw)
})
importReport(form)
.then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功!')
handleClose()
tableStore.index()
} else {
ElMessage.error('上传失败!')
}
})
.catch(response => {
// console.log(response);
})
// fileList.value
}
const chooseBatch = (e: any) => {
fileList.value.push(e)
}
const handleRemove = (e: any) => {
fileList.value = fileList.value.filter((item: any) => item.uid !== e.uid)
}
const handleClose = () => {
fileList.value = []
showBatchUpload.value = false
}
onMounted(() => {
tableStore.index()
})
</script>
<template>
<div>
<div>
<TableHeader area ref="TableHeaderRef">
<template #select>
<el-form-item label="终端名称">
<el-input
v-model="tableStore.table.params.name"
clearable
placeholder="请输入终端名称"
></el-input>
</el-form-item>
<el-form-item label="生产厂家">
<el-select
v-model="tableStore.table.params.manufacture"
placeholder="请选择生产厂家"
multiple
collapse-tags
clearable
class="select"
>
<el-option
v-for="item in manufactorList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检测结果">
<el-select
v-model="tableStore.table.params.testResults"
placeholder="请选择检测结果"
clearable
class="select"
>
<el-option
v-for="item in testResultsList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出</el-button>
<el-button icon="el-icon-Download" type="primary" @click="Export">下载模板</el-button>
<el-upload
ref="uploadRef"
action=""
accept=".xls"
:on-change="choose"
:show-file-list="false"
:auto-upload="false"
>
<template #trigger>
<el-button
icon="el-icon-Upload"
type="primary"
style="margin-left: 12px; margin-right: 12px"
>
excel导入
</el-button>
</template>
</el-upload>
<el-button icon="el-icon-Upload" type="primary" @click="UploadOriginal">上传原始报告</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增 -->
<newlyIncreased ref="addRef" @onsubmit="tableStore.index()" />
<!-- 上传原始报告 -->
<el-dialog
draggable
title="上传原始报告__支持批量上传"
v-model="showBatchUpload"
width="30%"
:before-close="handleClose"
>
<el-upload
multiple
action=""
:auto-upload="false"
:limit="999"
accept=".doc,.docx"
:file-list="fileList"
:on-remove="handleRemove"
:on-change="chooseBatch"
ref="upload"
>
<el-button type="primary" icon="el-icon-Upload">选择文件</el-button>
<span :style="`color:#f58003`">  (*传入的原始数据文件格式(终端编号-原始数据报告.docx))</span>
</el-upload>
<template #footer>
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="BatchUpload"> </el-button>
</template>
</el-dialog>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import newlyIncreased from './add.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
DownloadExport,
reportDownload,
batchTerminal,
delTerminal,
getTerminalPage,
importReport
} from '@/api/process-boot/terminal'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const manufactorList = dictData.getBasicData('Dev_Manufacturers')
const testResultsList = [
{
id: 0,
name: '未展开'
},
{
id: 1,
name: '已展开'
}
]
const fileList: any = ref([])
const TableHeaderRef = ref()
const addRef = ref()
const showBatchUpload = ref(false)
const tableRef = ref()
const ruleFormRef = ref()
const tableStore = new TableStore({
url: '/process-boot/process/pmsTerminalDetection/getTerminalPage',
publicHeight: 85,
method: 'POST',
column: [
// { width: '60', type: 'checkbox' },
{ field: 'orgName', title: '所属单位' },
{ field: 'id', title: '终端编号' },
{ field: 'name', title: '终端名称' },
{
field: 'manufacture',
title: '生产厂家',
formatter(row: any) {
return manufactorList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'installPlace', title: '安装位置' },
{ field: 'inspectionUnit', title: '送检单位' },
{
field: 'testResults',
title: '检测结果',
render: 'tag',
custom: {
0: 'warning',
1: 'success'
},
replaceValue: {
0: '未展开',
1: '已展开'
}
},
{ field: 'inspectionTime', title: '检测时间' },
{ field: 'nextInspectionTime', title: '下次检测时间' },
{
title: '操作',fixed: 'right',
width: '250',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
addRef.value.open({
title: '编辑',
row: row
})
}
},
{
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: row => {
delTerminal([row.id]).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
},
{
name: 'edit',
title: '下载原始数据报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.originalReport == null
},
click: row => {
download(row, 0)
}
},
{
name: 'edit',
title: '下载检测报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.inspectionReport == null
},
click: row => {
download(row, 1)
}
}
]
}
]
})
tableStore.table.params.name = ''
tableStore.table.params.id = dictData.state.area[0].id
tableStore.table.params.testResults = ''
tableStore.table.params.manufacture = []
tableStore.table.params.type = 0
provide('tableStore', tableStore)
const add = () => {
addRef.value.open({
title: '新增'
})
}
// 下载模版
const Export = () => {
DownloadExport().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '终端入网检测录入模板' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// 下载报告
const download = (row: any, type: number) => {
reportDownload({
id: row.id,
type: type
}).then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = type == 1 ? row.inspectionName : row.originalName // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
})
}
// excel导入
const choose = (e: any) => {
batchTerminal(e.raw).then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功,无错误数据!')
tableStore.index()
} else {
ElMessage.warning('上传成功,有错误数据 自动下载 请查看')
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '模板错误信息' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link)
}
})
}
// 导出
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getTerminalPage(form).then(res => {
tableRef.value.getRef().exportData({
filename: '终端入网检测', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
// 上传原始报告
const UploadOriginal = () => {
showBatchUpload.value = true
}
// 上传
const BatchUpload = () => {
let form = new FormData()
form.append('type', '0')
fileList.value.forEach((item: any) => {
form.append('files', item.raw)
})
importReport(form)
.then((res: any) => {
if (res.type == 'application/json') {
ElMessage.success('上传成功!')
handleClose()
tableStore.index()
} else {
ElMessage.error('上传失败!')
}
})
.catch(response => {
// console.log(response);
})
// fileList.value
}
const chooseBatch = (e: any) => {
fileList.value.push(e)
}
const handleRemove = (e: any) => {
fileList.value = fileList.value.filter((item: any) => item.uid !== e.uid)
}
const handleClose = () => {
fileList.value = []
showBatchUpload.value = false
}
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -1,285 +1,285 @@
<template>
<div>
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="项目名称">
<el-input style="width: 200px" placeholder="请输入项目名称" v-model="tableStore.table.params.projectName"
clearable maxlength="32" show-word-limit></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
<el-option v-for="item in areaOptionList" :key="item.id" :label="item.name"
:value="item.name"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate" :loading="loading">模版下载</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<el-dialog title="详情" width="80%" v-model="dialogShow">
<DetailInfo :id="userId"></DetailInfo>
</el-dialog>
<sensitive-user-popup ref="sensitiveUserPopup" />
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref="addForms" @onSubmit="tableStore.index()" openType="create" :submissionControl="false"></addForm>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } 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 DetailInfo from '../../interfere/components/undocumented/detail.vue'
import { downloadSensitiveUserTemplate } from '@/api/supervision-boot/userReport/form'
import SensitiveUserPopup from './sensitiveUserPopup.vue'
import addForm from '@/views/pqs/supervise/interfere/components/undocumented/addForm.vue'
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
import { ElMessage } from 'element-plus'
const dictData = useDictData()
const sensitiveUserPopup = ref()
const TableHeaderRef = ref()
const loading = ref(false)
const areaOptionList = dictData.getBasicData('jibei_area')
const loadLevelOptionList = dictData.getBasicData('load_level')
const powerSupplyInfoOptionList = dictData.getBasicData('supply_condition')
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getSensitiveUserPage',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'city', title: '所在地市', minWidth: 80 },
{
field: 'substation',
title: '厂站名称',
minWidth: 100,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'projectName', title: '项目名称', minWidth: 170 },
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userReportSensitivePO.loadLevel',
title: '负荷级别',
minWidth: 170,
formatter: (row: any) => {
return loadLevelOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'userReportSensitivePO.powerSupplyInfo',
title: '供电电源情况',
minWidth: 170,
formatter: (row: any) => {
return powerSupplyInfoOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详细信息',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
lookInfo(row.id)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return (
(row.city != adminInfo.$state.deptName && row.createBy != adminInfo.$state.id) ||
!(row.dataType == 1)
)
},
// disabled: row => {
// return !(row.status == 0)
// },
click: row => {
addForms.value.filterUsers([5, 4, 3, 2, 1, 0])
addForms.value.open({
title: '编辑',
row: row
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
}
})
tableStore.table.params.city = ''
tableStore.table.params.projectName = ''
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.orgId = adminInfo.$state.deptId
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
const addForms = ref()
const userId = ref()
const dialogShow = ref(false)
const lookInfo = (id: string) => {
userId.value = id
dialogShow.value = true
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
// 新增
const addFormModel = () => {
addForms.value.filterUsers([5, 4, 3, 2, 1, 0])
addForms.value.open({
title: '用户档案录入'
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
//导出模板
const exportExcelTemplate = async () => {
loading.value = true
await downloadSensitiveUserTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '敏感及重要用户模板'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
}, 0)
}
//批量导入用户数据
const importUserData = () => {
sensitiveUserPopup.value.open('导入敏感及重要用户')
}
</script>
<template>
<div>
<TableHeader ref="TableHeaderRef">
<template #select>
<el-form-item label="项目名称">
<el-input style="width: 200px" placeholder="请输入项目名称" v-model="tableStore.table.params.projectName"
clearable maxlength="32" show-word-limit></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
<el-option v-for="item in areaOptionList" :key="item.id" :label="item.name"
:value="item.name"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate" :loading="loading">模版下载</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<el-dialog title="详情" width="80%" v-model="dialogShow">
<DetailInfo :id="userId"></DetailInfo>
</el-dialog>
<sensitive-user-popup ref="sensitiveUserPopup" />
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref="addForms" @onSubmit="tableStore.index()" openType="create" :submissionControl="false"></addForm>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } 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 DetailInfo from '../../interfere/components/undocumented/detail.vue'
import { downloadSensitiveUserTemplate } from '@/api/supervision-boot/userReport/form'
import SensitiveUserPopup from './sensitiveUserPopup.vue'
import addForm from '@/views/pqs/supervise/interfere/components/undocumented/addForm.vue'
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
import { ElMessage } from 'element-plus'
const dictData = useDictData()
const sensitiveUserPopup = ref()
const TableHeaderRef = ref()
const loading = ref(false)
const areaOptionList = dictData.getBasicData('jibei_area')
const loadLevelOptionList = dictData.getBasicData('load_level')
const powerSupplyInfoOptionList = dictData.getBasicData('supply_condition')
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getSensitiveUserPage',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'city', title: '所在地市', minWidth: 80 },
{
field: 'substation',
title: '厂站名称',
minWidth: 100,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'projectName', title: '项目名称', minWidth: 170 },
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userReportSensitivePO.loadLevel',
title: '负荷级别',
minWidth: 170,
formatter: (row: any) => {
return loadLevelOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'userReportSensitivePO.powerSupplyInfo',
title: '供电电源情况',
minWidth: 170,
formatter: (row: any) => {
return powerSupplyInfoOptionList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',fixed: 'right',
minWidth: 150,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详细信息',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
lookInfo(row.id)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return (
(row.city != adminInfo.$state.deptName && row.createBy != adminInfo.$state.id) ||
!(row.dataType == 1)
)
},
// disabled: row => {
// return !(row.status == 0)
// },
click: row => {
addForms.value.filterUsers([5, 4, 3, 2, 1, 0])
addForms.value.open({
title: '编辑',
row: row
})
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
}
})
tableStore.table.params.city = ''
tableStore.table.params.projectName = ''
tableStore.table.params.loadType = ''
tableStore.table.params.userName = ''
tableStore.table.params.orgId = adminInfo.$state.deptId
tableStore.table.params.relationUserName = ''
tableStore.table.params.aisFileUpload = ''
const addForms = ref()
const userId = ref()
const dialogShow = ref(false)
const lookInfo = (id: string) => {
userId.value = id
dialogShow.value = true
}
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
// 新增
const addFormModel = () => {
addForms.value.filterUsers([5, 4, 3, 2, 1, 0])
addForms.value.open({
title: '用户档案录入'
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
//导出模板
const exportExcelTemplate = async () => {
loading.value = true
await downloadSensitiveUserTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '敏感及重要用户模板'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
}, 0)
}
//批量导入用户数据
const importUserData = () => {
sensitiveUserPopup.value.open('导入敏感及重要用户')
}
</script>

View File

@@ -1,286 +1,286 @@
<!---终端入网检测-->
<template>
<TableHeader area ref='TableHeaderRef'>
<template #select>
<el-form-item label='搜索'>
<el-input
v-model='tableStore.table.params.searchValue'
placeholder='输入变电站.终端名称'
clearable maxlength="32" show-word-limit
></el-input>
</el-form-item>
<el-form-item label='流程状态'>
<el-select v-model='tableStore.table.params.status' clearable placeholder='请选择流程状态'>
<el-option
v-for='item in statusSelect'
:key='item.id'
:label='item.name'
:value='item.id'
></el-option>
</el-select>
</el-form-item>
<el-form-item label='处理状态'>
<el-select v-model='tableStore.table.params.state' clearable placeholder='请选处理状态'>
<el-option
v-for='item in stateSelect'
:key='item.id'
:label='item.name'
:value='item.id'
></el-option>
</el-select>
</el-form-item>
</template>
</TableHeader>
<Table ref='tableRef' />
<Form ref='FormRef' @onSubmit='tableStore.index()' />
</template>
<script setup lang='ts'>
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import { ElMessage, ElMessageBox } from 'element-plus'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import Form from './form.vue'
import { cancel, getInfoById } from '@/api/supervision-boot/cycleDetection/index'
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const TableHeaderRef = ref()
const tableRef = ref()
const FormRef = ref()
const statusSelect = dictData.statusSelect()
const stateSelect = [
{
id: 0,
name: '未处理'
},
{
id: 1,
name: '处理中'
},
{
id: 2,
name: '已处理'
}
]
//申请联调
const debugForms = ref()
const tableStore = new TableStore({
url: '/supervision-boot/checkDevice/list',
publicHeight: 65,
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ field: 'substation', title: '变电站' },
{ field: 'dept', title: '供电公司' },
{
field: 'deviceName',
title: '终端名称'
},
{
field: 'thisTimeCheck',
title: '本次定检时间'
},
{
field: 'nextTimeCheck',
title: '下次定检时间'
},
{
field: 'overdueDay',
title: '逾期天数',
type: 'html',
formatter: (row: any) => {
let text = row.row.status == 2
? '/'
: `<span style='color: ${
row.row.overdueDay > 10 ? 'red' : row.row.overdueDay > 3 ? 'yellow' : ''
};text-decoration: none'>${row.row.overdueDay}</span>`
return text
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
5: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
5: '同步台账成功',
null: '/'
}
},
{
title: '操作',
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
},
disabled: row => {
return !row.processInstanceId
}
},
{
name: 'edit',
title: '报告上传',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.status != null
},
click: row => {
FormRef.value.open('报告上传', row)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
FormRef.value.open('重新发起', row)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: async row => {
// cancelLeave(row)
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancel(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.deptId = tableStore.table.params.deptIndex
tableStore.table.params.statveList = [2]
// tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.status = ''
tableStore.table.params.state = ''
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
const addFormModel = () => {
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
const props = defineProps(['id', 'businessKey'])
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getInfoById({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
if (props.businessKey == '3') {
FormRef.value.open('报告上传', res.data)
} else {
FormRef.value.open('重新发起', res.data)
}
}
})
}, { immediate: true })
</script>
<style scoped lang='scss'>
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
</style>
<!---终端入网检测-->
<template>
<TableHeader area ref='TableHeaderRef'>
<template #select>
<el-form-item label='搜索'>
<el-input
v-model='tableStore.table.params.searchValue'
placeholder='输入变电站.终端名称'
clearable maxlength="32" show-word-limit
></el-input>
</el-form-item>
<el-form-item label='流程状态'>
<el-select v-model='tableStore.table.params.status' clearable placeholder='请选择流程状态'>
<el-option
v-for='item in statusSelect'
:key='item.id'
:label='item.name'
:value='item.id'
></el-option>
</el-select>
</el-form-item>
<el-form-item label='处理状态'>
<el-select v-model='tableStore.table.params.state' clearable placeholder='请选处理状态'>
<el-option
v-for='item in stateSelect'
:key='item.id'
:label='item.name'
:value='item.id'
></el-option>
</el-select>
</el-form-item>
</template>
</TableHeader>
<Table ref='tableRef' />
<Form ref='FormRef' @onSubmit='tableStore.index()' />
</template>
<script setup lang='ts'>
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import { ElMessage, ElMessageBox } from 'element-plus'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import Form from './form.vue'
import { cancel, getInfoById } from '@/api/supervision-boot/cycleDetection/index'
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const TableHeaderRef = ref()
const tableRef = ref()
const FormRef = ref()
const statusSelect = dictData.statusSelect()
const stateSelect = [
{
id: 0,
name: '未处理'
},
{
id: 1,
name: '处理中'
},
{
id: 2,
name: '已处理'
}
]
//申请联调
const debugForms = ref()
const tableStore = new TableStore({
url: '/supervision-boot/checkDevice/list',
publicHeight: 65,
method: 'POST',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ field: 'substation', title: '变电站' },
{ field: 'dept', title: '供电公司' },
{
field: 'deviceName',
title: '终端名称'
},
{
field: 'thisTimeCheck',
title: '本次定检时间'
},
{
field: 'nextTimeCheck',
title: '下次定检时间'
},
{
field: 'overdueDay',
title: '逾期天数',
type: 'html',
formatter: (row: any) => {
let text = row.row.status == 2
? '/'
: `<span style='color: ${
row.row.overdueDay > 10 ? 'red' : row.row.overdueDay > 3 ? 'yellow' : ''
};text-decoration: none'>${row.row.overdueDay}</span>`
return text
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
5: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
5: '同步台账成功',
null: '/'
}
},
{
title: '操作',fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
},
disabled: row => {
return !row.processInstanceId
}
},
{
name: 'edit',
title: '报告上传',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.status != null
},
click: row => {
FormRef.value.open('报告上传', row)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
FormRef.value.open('重新发起', row)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: async row => {
// cancelLeave(row)
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancel(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.deptId = tableStore.table.params.deptIndex
tableStore.table.params.statveList = [2]
// tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.status = ''
tableStore.table.params.state = ''
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
const addFormModel = () => {
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
const props = defineProps(['id', 'businessKey'])
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getInfoById({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
if (props.businessKey == '3') {
FormRef.value.open('报告上传', res.data)
} else {
FormRef.value.open('重新发起', res.data)
}
}
})
}, { immediate: true })
</script>
<style scoped lang='scss'>
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
</style>

View File

@@ -1,361 +1,361 @@
<!---终端入网检测-->
<template>
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template #select>
<el-form-item label="搜索">
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入变电站、终端、监测点名称"
clearable maxlength="32" show-word-limit style="width: 230px"></el-input>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<!-- <el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button> -->
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 申请联调弹框 -->
<debug ref="debugForms" @onSubmit="tableStore.index()" :debugId="debugId"></debug>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import { ElMessage, ElMessageBox } from 'element-plus'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { getLoadTypeUserList } from '@/api/process-boot/interference'
import {
getMointorPointTempLinedebugDetail,
setTempLinedebugLedgerSync
} from '@/api/supervision-boot/jointDebugList/index'
import debug from './debug.vue'
import { cancelMointorPointTempLinedebug } from '@/api/supervision-boot/jointDebugList/index'
import { useAdminInfo } from '@/stores/adminInfo'
import { deleteTempLineDebugReport } from '@/api/supervision-boot/delete/index'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const TableHeaderRef = ref()
const tableRef = ref()
const statusSelect = dictData.statusSelect()
statusSelect.push({ name: '同步台账成功', id: 5 })
const tableStore = new TableStore({
url: '/supervision-boot/tempLinedebug/list',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{
field: 'powerSubstationName',
title: '电网侧变电站',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'lineName', title: '监测点名称', minWidth: 170 },
{
field: 'reason',
title: '调试原因',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'lineId', title: '监测点编号', minWidth: 170 },
// { field: 'monitoringTerminalCode', title: '终端编码', minWidth: 170 },
{ field: 'monitoringTerminalName', title: '终端名称', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
5: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
5: '同步台账成功',
null: '/'
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
},
disabled: row => {
return !row.processInstanceId
}
},
// {
// name: 'edit',
// title: '编辑',
// type: 'primary',
// icon: 'el-icon-Open',
// render: 'basicButton',
// showDisabled: row => {
// return row.createBy != adminInfo.$state.id || !(row.status == 0)
// },
// disabled: row => {
// return !(row.status == 0)
// },
// click: row => {
// debugForms.value.open('编辑', row)
// }
// },
{
name: 'productSetting',
title: '申请联调',
type: 'primary',
icon: 'el-icon-add',
render: 'basicButton',
click: row => {
// handleDebug(row)
debugForms.value.open('申请联调', row)
},
disabled: row => {
return row.reason
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
debugForms.value.open('重新发起', row)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
},
{
name: 'productSetting',
title: '同步台账',
type: 'primary',
icon: 'el-icon-add',
render: 'basicButton',
click: row => {
setTempLinedebugLedgerSync({ id: row.id }).then(res => {
if (res.code == 'A0000') {
ElMessage({
message: '台账同步成功',
type: 'success'
})
tableStore.index()
}
})
},
disabled: row => {
return row.status != 2
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.statveList = [2]
// tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.status = ''
tableStore.table.params.searchValue = ''
// tableStore.table.params.loadType = ''
// tableStore.table.params.userName = ''
// tableStore.table.params.fileUploadflag = ''
provide('tableStore', tableStore)
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getLoadTypeUserList(form).then(res => {
tableRef.value.getRef().exportData({
filename: '未建档非线性用户', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteTempLineDebugReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
onMounted(() => {
tableStore.index()
})
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
//申请联调
const debugForms = ref()
const debugId = ref('')
const handleDebug = (row: any) => {
debugId.value = row.id
console.log(debugId.value)
debugForms.value.open('申请联调', row)
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelMointorPointTempLinedebug(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getMointorPointTempLinedebugDetail({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
debugForms.value.open('重新发起', res.data)
}
})
}, { immediate: true })
</script>
<style scoped lang="scss">
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
</style>
<!---终端入网检测-->
<template>
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template #select>
<el-form-item label="搜索">
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入变电站、终端、监测点名称"
clearable maxlength="32" show-word-limit style="width: 230px"></el-input>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<!-- <el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button> -->
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 申请联调弹框 -->
<debug ref="debugForms" @onSubmit="tableStore.index()" :debugId="debugId"></debug>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import { ElMessage, ElMessageBox } from 'element-plus'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { getLoadTypeUserList } from '@/api/process-boot/interference'
import {
getMointorPointTempLinedebugDetail,
setTempLinedebugLedgerSync
} from '@/api/supervision-boot/jointDebugList/index'
import debug from './debug.vue'
import { cancelMointorPointTempLinedebug } from '@/api/supervision-boot/jointDebugList/index'
import { useAdminInfo } from '@/stores/adminInfo'
import { deleteTempLineDebugReport } from '@/api/supervision-boot/delete/index'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const TableHeaderRef = ref()
const tableRef = ref()
const statusSelect = dictData.statusSelect()
statusSelect.push({ name: '同步台账成功', id: 5 })
const tableStore = new TableStore({
url: '/supervision-boot/tempLinedebug/list',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{
field: 'powerSubstationName',
title: '电网侧变电站',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'lineName', title: '监测点名称', minWidth: 170 },
{
field: 'reason',
title: '调试原因',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'lineId', title: '监测点编号', minWidth: 170 },
// { field: 'monitoringTerminalCode', title: '终端编码', minWidth: 170 },
{ field: 'monitoringTerminalName', title: '终端名称', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
5: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
5: '同步台账成功',
null: '/'
}
},
{
title: '操作',fixed: 'right',
minWidth: 150,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
},
disabled: row => {
return !row.processInstanceId
}
},
// {
// name: 'edit',
// title: '编辑',
// type: 'primary',
// icon: 'el-icon-Open',
// render: 'basicButton',
// showDisabled: row => {
// return row.createBy != adminInfo.$state.id || !(row.status == 0)
// },
// disabled: row => {
// return !(row.status == 0)
// },
// click: row => {
// debugForms.value.open('编辑', row)
// }
// },
{
name: 'productSetting',
title: '申请联调',
type: 'primary',
icon: 'el-icon-add',
render: 'basicButton',
click: row => {
// handleDebug(row)
debugForms.value.open('申请联调', row)
},
disabled: row => {
return row.reason
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
debugForms.value.open('重新发起', row)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
},
{
name: 'productSetting',
title: '同步台账',
type: 'primary',
icon: 'el-icon-add',
render: 'basicButton',
click: row => {
setTempLinedebugLedgerSync({ id: row.id }).then(res => {
if (res.code == 'A0000') {
ElMessage({
message: '台账同步成功',
type: 'success'
})
tableStore.index()
}
})
},
disabled: row => {
return row.status != 2
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.statveList = [2]
// tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.status = ''
tableStore.table.params.searchValue = ''
// tableStore.table.params.loadType = ''
// tableStore.table.params.userName = ''
// tableStore.table.params.fileUploadflag = ''
provide('tableStore', tableStore)
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getLoadTypeUserList(form).then(res => {
tableRef.value.getRef().exportData({
filename: '未建档非线性用户', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteTempLineDebugReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
onMounted(() => {
tableStore.index()
})
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
//申请联调
const debugForms = ref()
const debugId = ref('')
const handleDebug = (row: any) => {
debugId.value = row.id
console.log(debugId.value)
debugForms.value.open('申请联调', row)
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelMointorPointTempLinedebug(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getMointorPointTempLinedebugDetail({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
debugForms.value.open('重新发起', res.data)
}
})
}, { immediate: true })
</script>
<style scoped lang="scss">
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
</style>

View File

@@ -1,328 +1,328 @@
<!---终端入网检测-->
<template>
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template #select>
<el-form-item label="搜索">
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入变电站、终端、监测点名称"
clearable maxlength="32" show-word-limit style="width: 230px"></el-input>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 新增弹框 -->
<addForm ref="addForms" @onSubmit="tableStore.index()"></addForm>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { getLoadTypeUserList } from '@/api/process-boot/interference'
import addForm from './addForm.vue'
import { useAdminInfo } from '@/stores/adminInfo'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import { cancelMointorPointFormData, getTempLineDetailsById } from '@/api/supervision-boot/monitorpoint/index'
import { deleteTempLineReport } from '@/api/supervision-boot/delete/index'
import { getTerminalDetailsById } from "@/api/supervision-boot/terminal";
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const TableHeaderRef = ref()
const tableRef = ref()
const areaOptionList = dictData.getBasicData('jibei_area')
const statusSelect = dictData.statusSelect()
const ruleFormRef = ref()
const show: any = ref(false)
const fileList = ref([])
const tableStore = new TableStore({
url: '/supervision-boot/tempLine/list',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
// { field: 'orgName', title: '填报部门名称', minWidth: 170 },
{
field: 'powerSubstationName',
title: '电网侧电站',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'connectedBus', title: '关联母线', minWidth: 170 },
{ field: 'monitoringTerminalName', title: '所属终端', minWidth: 170 },
{ field: 'lineName', title: '监测点名称', minWidth: 150 },
{ field: 'reportDate', title: '填报日期', minWidth: 150 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
addForms.value.open({
title: '编辑',
row: row
})
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
// tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.status = ''
tableStore.table.params.searchValue = ''
// tableStore.table.params.loadType = ''
// tableStore.table.params.userName = ''
// tableStore.table.params.fileUploadflag = ''
provide('tableStore', tableStore)
const addForms = ref()
const addFormModel = () => {
setTimeout(() => {
addForms.value.open({
title: '监测点信息'
})
}, 0)
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelMointorPointFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteTempLineReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getLoadTypeUserList(form).then(res => {
tableRef.value.getRef().exportData({
filename: '未建档非线性用户', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
onMounted(() => {
tableStore.index()
})
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getTempLineDetailsById({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}, { immediate: true })
</script>
<style scoped lang="scss">
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
</style>
<!---终端入网检测-->
<template>
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template #select>
<el-form-item label="搜索">
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入变电站、终端、监测点名称"
clearable maxlength="32" show-word-limit style="width: 230px"></el-input>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 新增弹框 -->
<addForm ref="addForms" @onSubmit="tableStore.index()"></addForm>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { getLoadTypeUserList } from '@/api/process-boot/interference'
import addForm from './addForm.vue'
import { useAdminInfo } from '@/stores/adminInfo'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import { cancelMointorPointFormData, getTempLineDetailsById } from '@/api/supervision-boot/monitorpoint/index'
import { deleteTempLineReport } from '@/api/supervision-boot/delete/index'
import { getTerminalDetailsById } from "@/api/supervision-boot/terminal";
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const flag = ref(false)
const TableHeaderRef = ref()
const tableRef = ref()
const areaOptionList = dictData.getBasicData('jibei_area')
const statusSelect = dictData.statusSelect()
const ruleFormRef = ref()
const show: any = ref(false)
const fileList = ref([])
const tableStore = new TableStore({
url: '/supervision-boot/tempLine/list',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
// { field: 'orgName', title: '填报部门名称', minWidth: 170 },
{
field: 'powerSubstationName',
title: '电网侧电站',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'connectedBus', title: '关联母线', minWidth: 170 },
{ field: 'monitoringTerminalName', title: '所属终端', minWidth: 170 },
{ field: 'lineName', title: '监测点名称', minWidth: 150 },
{ field: 'reportDate', title: '填报日期', minWidth: 150 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
title: '操作',fixed: 'right',
minWidth: 150,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
addForms.value.open({
title: '编辑',
row: row
})
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
// tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.status = ''
tableStore.table.params.searchValue = ''
// tableStore.table.params.loadType = ''
// tableStore.table.params.userName = ''
// tableStore.table.params.fileUploadflag = ''
provide('tableStore', tableStore)
const addForms = ref()
const addFormModel = () => {
setTimeout(() => {
addForms.value.open({
title: '监测点信息'
})
}, 0)
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelMointorPointFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteTempLineReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getLoadTypeUserList(form).then(res => {
tableRef.value.getRef().exportData({
filename: '未建档非线性用户', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
onMounted(() => {
tableStore.index()
})
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getTempLineDetailsById({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}, { immediate: true })
</script>
<style scoped lang="scss">
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
</style>

View File

@@ -1,372 +1,372 @@
<template>
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template #select>
<el-form-item label="搜索">
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入变电站、终端名称"
clearable maxlength="32" show-word-limit style="width: 180px"></el-input>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate"
:loading="loading">模版下载</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 新增弹框 -->
<addForm ref="addForms" @onSubmit="tableStore.index()"></addForm>
<!-- 上传模版 -->
<uploadATemplate ref="uploadATemplateRef" />
<!-- 上传模版 详情 -->
<el-dialog title="详情" width="80%" v-model="dialogShow" v-if="dialogShow">
<DetailInfo :id="userId"></DetailInfo>
</el-dialog>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { downloadDevTemplate } from '@/api/supervision-boot/userReport/form'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import DetailInfo from '@/views/pqs/supervise/terminalNetworkDetection/components/terminainal/detail.vue'
import { cancelTerminalFormData, getTerminalDetailsById } from '@/api/supervision-boot/terminal/index'
import uploadATemplate from './uploadATemplate.vue'
import addForm from './addForm.vue'
import { useAdminInfo } from '@/stores/adminInfo'
import { deleteDevReport } from '@/api/supervision-boot/delete/index'
import { getUserReportById } from "@/api/supervision-boot/interfere";
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const TableHeaderRef = ref()
const userId = ref()
const loading = ref(false)
const tableRef = ref()
const areaOptionList = dictData.getBasicData('jibei_area')
const statusSelect = dictData.statusSelect()
const ruleFormRef = ref()
const uploadATemplateRef = ref()
const show: any = ref(false)
const fileList = ref([])
const dialogShow = ref(false)
const flag = ref(false)
const tableStore = new TableStore({
url: '/supervision-boot/deVReport/list',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{
field: 'orgName',
title: '填报部门名称',
minWidth: 170,
formatter: (row: any) => {
row.cellValue = row.cellValue ? row.cellValue : ''
return row.cellValue
}
},
{
field: 'substationName',
title: '所属变电站',
minWidth: 170,
formatter: (row: any) => {
row.cellValue = row.cellValue ? row.cellValue : '/'
return row.cellValue
}
},
{ field: 'monitoringTerminalName', title: '终端名称', minWidth: 170 },
{ field: 'monitoringTerminalCode', title: '终端编号', minWidth: 170 },
{ field: 'reportDate', title: '填报日期', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.importType != 0 || !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'productSetting',
title: '详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.importType != 1
},
click: row => {
userId.value = row.id
dialogShow.value = true
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.importType == 1 ? false : row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return row.importType == 1 ? false : !(row.status == 0)
},
click: row => {
addForms.value.open({
title: '编辑',
row: row
})
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
// tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.status = ''
tableStore.table.params.searchValue = ''
// tableStore.table.params.loadType = ''
// tableStore.table.params.userName = ''
// tableStore.table.params.fileUploadflag = ''
provide('tableStore', tableStore)
const addForms = ref()
const addFormModel = () => {
setTimeout(() => {
addForms.value.open({
title: '终端信息'
})
}, 0)
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelTerminalFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteDevReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
//导出模板
const exportExcelTemplate = async () => {
loading.value = true
downloadDevTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '终端入网检测模板'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
}, 0)
}
//批量导入用户数据
const importUserData = () => {
uploadATemplateRef.value.open('导入终端入网检测')
}
onMounted(() => {
tableStore.index()
})
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getTerminalDetailsById({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}, { immediate: true })
</script>
<style scoped lang="scss">
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
</style>
<template>
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template #select>
<el-form-item label="搜索">
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入变电站、终端名称"
clearable maxlength="32" show-word-limit style="width: 180px"></el-input>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option v-for="item in statusSelect" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate"
:loading="loading">模版下载</el-button>
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button>
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 新增弹框 -->
<addForm ref="addForms" @onSubmit="tableStore.index()"></addForm>
<!-- 上传模版 -->
<uploadATemplate ref="uploadATemplateRef" />
<!-- 上传模版 详情 -->
<el-dialog title="详情" width="80%" v-model="dialogShow" v-if="dialogShow">
<DetailInfo :id="userId"></DetailInfo>
</el-dialog>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, watch } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { downloadDevTemplate } from '@/api/supervision-boot/userReport/form'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import DetailInfo from '@/views/pqs/supervise/terminalNetworkDetection/components/terminainal/detail.vue'
import { cancelTerminalFormData, getTerminalDetailsById } from '@/api/supervision-boot/terminal/index'
import uploadATemplate from './uploadATemplate.vue'
import addForm from './addForm.vue'
import { useAdminInfo } from '@/stores/adminInfo'
import { deleteDevReport } from '@/api/supervision-boot/delete/index'
import { getUserReportById } from "@/api/supervision-boot/interfere";
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const TableHeaderRef = ref()
const userId = ref()
const loading = ref(false)
const tableRef = ref()
const areaOptionList = dictData.getBasicData('jibei_area')
const statusSelect = dictData.statusSelect()
const ruleFormRef = ref()
const uploadATemplateRef = ref()
const show: any = ref(false)
const fileList = ref([])
const dialogShow = ref(false)
const flag = ref(false)
const tableStore = new TableStore({
url: '/supervision-boot/deVReport/list',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{
field: 'orgName',
title: '填报部门名称',
minWidth: 170,
formatter: (row: any) => {
row.cellValue = row.cellValue ? row.cellValue : ''
return row.cellValue
}
},
{
field: 'substationName',
title: '所属变电站',
minWidth: 170,
formatter: (row: any) => {
row.cellValue = row.cellValue ? row.cellValue : '/'
return row.cellValue
}
},
{ field: 'monitoringTerminalName', title: '终端名称', minWidth: 170 },
{ field: 'monitoringTerminalCode', title: '终端编号', minWidth: 170 },
{ field: 'reportDate', title: '填报日期', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
title: '操作',fixed: 'right',
minWidth: 150,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.importType != 0 || !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'productSetting',
title: '详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.importType != 1
},
click: row => {
userId.value = row.id
dialogShow.value = true
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.importType == 1 ? false : row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return row.importType == 1 ? false : !(row.status == 0)
},
click: row => {
addForms.value.open({
title: '编辑',
row: row
})
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
// tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.status = ''
tableStore.table.params.searchValue = ''
// tableStore.table.params.loadType = ''
// tableStore.table.params.userName = ''
// tableStore.table.params.fileUploadflag = ''
provide('tableStore', tableStore)
const addForms = ref()
const addFormModel = () => {
setTimeout(() => {
addForms.value.open({
title: '终端信息'
})
}, 0)
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelTerminalFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteDevReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
//导出模板
const exportExcelTemplate = async () => {
loading.value = true
downloadDevTemplate().then((res: any) => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '终端入网检测模板'
document.body.appendChild(link)
link.click()
link.remove()
})
await setTimeout(() => {
loading.value = false
}, 0)
}
//批量导入用户数据
const importUserData = () => {
uploadATemplateRef.value.open('导入终端入网检测')
}
onMounted(() => {
tableStore.index()
})
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
}
)
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
const props = defineProps({ id: { type: String, default: 'null' } })
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getTerminalDetailsById({ id: fullId }).then(res => {
if (res && res.code == 'A0000') {
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}, { immediate: true })
</script>
<style scoped lang="scss">
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
</style>

View File

@@ -138,9 +138,9 @@ const tableStore = new TableStore({
}
},
{
title: '操作',
title: '操作',fixed: 'right',
minWidth: 230,
fixed: 'right',
render: 'buttons',
buttons: [
{

Some files were not shown because too many files have changed in this diff Show More