普测计划页面调整

This commit is contained in:
2024-05-31 08:44:45 +08:00
parent 97bc531697
commit 5de72c310f
8 changed files with 859 additions and 106 deletions

View File

@@ -5,25 +5,11 @@
<el-button icon="el-icon-Plus" type="primary" @click="add">新增计划</el-button>
<!-- <el-button icon="el-icon-Download" type="primary" @click="exportFn">导出</el-button> -->
</template>
</TableHeader >
</TableHeader>
<Table ref="tableRef" />
<!-- 新增 -->
<planAdd ref="planAddRef" @onsubmit="tableStore.index()" />
<!-- 选择审核人 -->
<el-dialog draggable v-model="dialogVisible" title="审核" width="300" :before-close="handleClose">
选择审核人: <el-select v-model="auditUser" clearable placeholder="请选择计划状态">
<el-option v-for="item in auditList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<template #footer>
<span class="dialog-footer">
<el-button type="primary" @click="planReviewFn">确定</el-button>
<el-button @click="handleClose">取消</el-button>
</span>
</template>
</el-dialog>
</template>
@@ -33,14 +19,12 @@ 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 { submitAuditUser,cancel } from '@/api/process-boot/generalTest'
import { cancel } from '@/api/process-boot/generalTest'
import planAdd from './planAdd.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { queryPlan,removeSurvey } from '@/api/process-boot/generalTest'
import { getUserByRoleType } from '@/api/user-boot/user'
const dictData = useDictData()
const { push } = useRouter()
const dialogVisible=ref(false)
const tableRef = ref()
@@ -51,23 +35,26 @@ const TableHeaderRef = ref()
const auditList:any = ref([])
const auditUser = ref('')
const ruleFormRef = ref()
const tableStore = new TableStore({
url: '/supervision-boot/generalSurvey/getSurvey',
url: '/supervision-boot/surveyPlan/surveyPlanPage',
publicHeight: 65,
method: 'POST',
column: [
{ width: '60', type: 'checkbox' },
{ field: 'orgName', title: '单位' },
{
title: '序号',
width: 60,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'deptName', title: '普测负责单位' },
{
field: 'planName',
title: '普测计划名称'
},
{ field: 'leader', title: '计划负责人' },
{ field: 'substation', title: '变电站' },
{ field: 'planStartTime', title: '计划开始时间' },
{ field: 'planEndTime', title: '计划结束时间' },
{
field: 'status',
title: '计划状态',
@@ -85,7 +72,6 @@ const tableStore = new TableStore({
4: '已取消'
}
},
{
title: '操作',
width: '180',
@@ -129,41 +115,6 @@ const tableStore = new TableStore({
cancelLeave(row)
}
}
// {
// name: 'edit',
// title: '编辑',
// type: '',
// disabled: row => {
// return !(row.status == 0 || row.status == 3|| row.status == 4)
// },
// icon: 'el-icon-Plus',
// render: 'basicButton',
// click: async row => {
// planAddRef.value.open('编辑计划', row)
// }
// },
// {
// name: 'del',
// title: '删除',
// type: 'danger',
// icon: 'el-icon-Delete',
// render: 'confirmButton',
// disabled: row => {
// return !(row.status == 0 || row.status == 3|| row.status == 4)
// },
// popconfirm: {
// confirmButtonText: '确认',
// cancelButtonText: '取消',
// confirmButtonType: 'danger',
// title: '确定删除吗?'
// },
// click: row => {
// removeSurvey([row.planNo]).then(res => {
// ElMessage.success('删除成功')
// tableStore.index()
// })
// }
// }
]
}
],
@@ -182,27 +133,6 @@ const add = () => {
planAddRef.value.open('普测计划新增')
}
// 提交审核
const planReviewFn = () => {
if(auditUser.value == ''){
return ElMessage.warning('请选择审核人')
}
let planNo: any = []
tableStore.table.selection.forEach(item => {
if (item.status == 0 || item.status == 2) {
planNo.push(item.planNo)
}
})
submitAuditUser({
auditUser: auditUser.value,
planIds: planNo
}).then(res => {
dialogVisible.value = false
ElMessage.success('提交成功!')
tableStore.index()
})
}
const exportFn = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1
@@ -232,7 +162,7 @@ const cancelLeave = async (row: any) => {
})
// 发起取消
let data = {
id: row.planNo,
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}