修改表格操作列

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,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: [
{