技术监督计划联调

This commit is contained in:
zhujiyan
2024-05-21 16:36:17 +08:00
parent d57bf17605
commit 0fa6991010
7 changed files with 1162 additions and 287 deletions

View File

@@ -1,25 +1,289 @@
<!-- 技术监督计划 -->
<!---技术监督计划-->
<template>
<div class="default-main">
<plan/>
<TableHeader area datePicker 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-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增弹框 -->
<addForm ref="addForms" @onSubmit="tableStore.index()"></addForm>
<!-- 实施问题弹框 -->
<effectProblem
ref="effectProblemList"
@onSubmit="tableStore.index()"
:effectProblemForm="effectProblemForm"
></effectProblem>
</div>
</template>
<script setup lang="ts">
import { onMounted, reactive, ref, provide } from 'vue'
import plan from './components/index.vue'
import { ref, onMounted, provide, nextTick } from 'vue'
import { mainHeight } from '@/utils/layout'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { getLoadTypeUserList } from '@/api/process-boot/interference'
import { useDictData } from '@/stores/dictData'
import addForm from './components/addForm.vue'
import effectProblem from './components/effectProblem/index.vue'
import { planDetailsAudit } from '@/api/supervision-boot/plan/index'
defineOptions({
name: 'supervise/plan'
name: '/admin/plan'
})
const activeName = ref('1')
const Statistics = ref()
const compatibility = ref()
const layout = mainHeight(63) as any
const dictData = useDictData()
const { push } = useRouter()
const TableHeaderRef = ref()
const tableRef = ref()
//字典获取监督类型
const supvTypeList = dictData.getBasicData('supv_type')
//字典获取监督阶段
const supvStageList = dictData.getBasicData('supv_stage')
//字典获取监督对象类型
const supvObjTypeList = dictData.getBasicData('supv_obj_type')
const tableStore = new TableStore({
url: '/supervision-boot/superPlan/pagePlan',
publicHeight: 65,
method: 'POST',
column: [
{ title: '序号', type: 'seq', width: 80 },
{
field: 'province',
title: '所属省份',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'city',
title: '所属地市',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'county',
title: '所属县区',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'supvOrgId', title: '监督单位', minWidth: 170 },
{ field: 'workPlanName', title: '计划名称', minWidth: 170 },
{ field: 'planSupvDate', title: '计划监督时间', minWidth: 170 },
{
field: 'status',
title: '审核状态',
minWidth: 100,
render: 'tag',
custom: {
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'supvType',
title: '监督类型',
minWidth: 170,
formatter: (row: any) => {
return supvTypeList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'supvStage',
title: '监督阶段',
minWidth: 170,
formatter: (row: any) => {
return supvStageList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'supvObjType',
title: '监督对象类型',
minWidth: 170,
formatter: (row: any) => {
return supvObjTypeList.filter(item => item.id === row.cellValue)[0]?.name
}
},
{
field: 'objType',
title: '监督对象属性',
minWidth: 170,
formatter: (row: any) => {
return row.cellValue == '1' ? '在运站' : '新(改、扩)建站'
}
},
{
title: '操作',
minWidth: 200,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleDetails(row.processInstanceId)
},
disabled: row => {
return !row.processInstanceId
}
},
{
name: 'productSetting',
title: '实施问题',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleEffectProblem(row)
}
},
{
name: 'productSetting',
title: '提交审核',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleAudit(row)
}
}
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
// tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
// tableStore.table.params.loadType = ''
// tableStore.table.params.userName = ''
// tableStore.table.params.fileUploadflag = ''
provide('tableStore', tableStore)
const addForms = ref()
const addFormModel = () => {
setTimeout(() => {
addForms.value.open()
}, 0)
}
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
form.pageSize = tableStore.table.total
getLoadTypeUserList(form).then(res => {
tableRef.value.getRef().exportData({
filename: '未建档非线性用户', // 文件名字
sheetName: 'Sheet1',
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
return !(column.$columnIndex === 0)
}
})
})
}
onMounted(() => {
tableStore.index()
})
//
const handleDetails = (id: any) => {
push({
name: 'BpmProcessInstanceDetail',
query: {
id: id
}
})
}
/** 提交审核按钮 */
const handleAudit = (row: any) => {
planDetailsAudit({ id: row.planId }).then(res => {
tableStore.index()
})
}
// 实施问题按钮
const effectProblemList = ref()
const effectProblemForm: any = ref({})
const handleEffectProblem = (row: any) => {
effectProblemForm.value = row
effectProblemList.value.open()
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
</script>
<style lang="scss" scoped>
<style scoped lang="scss">
:deep(.el-upload-list__item) {
width: 400px;
}
::v-deep .el-input__wrapper {
// width: 200px !important;
}
.bars_w {
width: 100%;
height: 500px;