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

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

@@ -24,10 +24,10 @@
</template>
<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> -->
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<Table ref="tableRef" :checkbox-config="checkboxConfig"/>
<!-- 新增 -->
<planAdd ref="planAddRef" @onsubmit="tableStore.index()" :openType="openType" />
</template>
@@ -46,7 +46,7 @@ import { useRouter } from 'vue-router'
import { queryPlan, removeSurvey } from '@/api/process-boot/generalTest'
import { getUserByRoleType } from '@/api/user-boot/user'
import { useDictData } from '@/stores/dictData'
import { deleteSurveyPlan } from '@/api/supervision-boot/delete/index'
const dictData = useDictData()
const supvTypeOptionList = dictData.getBasicData('supv_type')
const statusSelect = dictData.statusSelect()
@@ -64,6 +64,10 @@ const tableStore = new TableStore({
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{
title: '序号',
width: 60,
@@ -213,7 +217,30 @@ const add = () => {
// title.value = '普测计划新增'
planAddRef.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 {
deleteSurveyPlan(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