联调 技术监督 所有流程删除功能

This commit is contained in:
GGJ
2024-09-10 14:07:25 +08:00
parent d9bcec8ea0
commit bc83dea947
16 changed files with 416 additions and 42 deletions

View File

@@ -23,10 +23,10 @@
</el-form-item>
</template>
<template #operation>
<!-- <el-button icon="el-icon-Download" type="primary" @click="exportFn">导出</el-button> -->
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 新增 -->
<planTest ref="planTestRef" @onsubmit="tableStore.index()" />
</template>
@@ -42,7 +42,7 @@ 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'
@@ -63,6 +63,10 @@ const tableStore = new TableStore({
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 60,
@@ -228,7 +232,30 @@ 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 {
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