普测测试流程

This commit is contained in:
2024-06-04 10:51:54 +08:00
parent b919fb8447
commit 031c0d178d
9 changed files with 412 additions and 498 deletions

View File

@@ -1,100 +1,114 @@
<template>
<TableHeader area datePicker ref="TableHeaderRef">
<TableHeader area datePicker ref='TableHeaderRef'>
<template #operation>
<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>
<Table ref="tableRef" />
<Table ref='tableRef' />
<!-- 新增 -->
<planTest ref="planTestRef" @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>
<planTest ref='planTestRef' @onsubmit='tableStore.index()' />
</template>
<script setup lang="ts">
<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 { submitAuditUser,cancel } from '@/api/process-boot/generalTest'
import { cancel } from '@/api/process-boot/generalTest'
import planTest from './planTest.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { queryPlan,removeSurvey } from '@/api/process-boot/generalTest'
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()
const planTestRef = ref()
const TableHeaderRef = ref()
const auditList:any = ref([])
const auditUser = ref('')
const auditList: any = ref([])
const tableStore = new TableStore({
url: '/supervision-boot/surveyTest/surveyTestPage',
publicHeight: 65,
method: 'POST',
column: [
{ width: '60', type: 'checkbox' },
{ field: 'orgName', title: '单位' },
{
field: 'planName',
title: '普测计划名称'
title: '序号',
width: 60,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'leader', title: '计划负责人' },
{ field: 'planStartTime', title: '计划开始时间' },
{ field: 'planEndTime', title: '计划结束时间' },
{ field: 'planName', title: '普测计划', minWidth: 140 },
{ 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: {
6: 'primary',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
6: '待测试',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
title: '操作',
width: '180',
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.status == 4
},
click: row => {
// planTestRef.value.open('查看计划', row)
handleAudit(row.processInstanceId)
@@ -107,7 +121,7 @@ const tableStore = new TableStore({
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.status == 1 || row.status == 2
return row.status == 6 || row.status == 1 || row.status == 2
},
click: row => {
// deviceQuitPopup.value.open('重新发起退运', row)
@@ -121,47 +135,12 @@ const tableStore = new TableStore({
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.status == 3 || row.status == 2 || row.status == 4
return row.status == 6 || row.status == 2 || row.status == 3 || row.status == 4
},
click: row => {
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 => {
// planTestRef.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()
// })
// }
// }
]
}
],
@@ -175,32 +154,11 @@ tableStore.table.params.status = ''
provide('tableStore', tableStore)
// 新增计划
const add = () => {
// title.value = '普测计划新增'
planTestRef.value.open('普测计划新增')
const add = (id: string) => {
planTestRef.value.open('普测计划测试填报',id,true)
}
// 提交审核
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
@@ -212,7 +170,7 @@ const exportFn = () => {
type: 'xlsx', //导出文件类型 xlsx 和 csv
useStyle: true,
data: res.data.records, // 数据源 // 过滤那个字段导出
columnFilterMethod: function (column: any) {
columnFilterMethod: function(column: any) {
return !(column.$columnIndex === 0)
}
})
@@ -240,10 +198,6 @@ const cancelLeave = async (row: any) => {
tableStore.index()
}
const handleClose = () => {
dialogVisible.value = false
auditUser.value = ''
}
/** 处理审批按钮 */
const handleAudit = (instanceId: any) => {
@@ -257,7 +211,6 @@ const handleAudit = (instanceId: any) => {
// 取消
onMounted(() => {
TableHeaderRef.value.setInterval(1)
tableStore.index()
getUserByRoleType(3).then(res => {
auditList.value = res.data
@@ -265,4 +218,4 @@ onMounted(() => {
})
</script>
<style scoped lang="scss"></style>
<style scoped lang='scss'></style>