联调 技术监督 所有流程删除功能
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="startRunTest">试运行</el-button>
|
||||
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
|
||||
@@ -58,6 +59,7 @@ import { formatDate } from '@/utils/formatTime'
|
||||
import { VxeTablePropTypes } from 'vxe-table'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { getFileNameAndFilePath } from '@/api/system-boot/file'
|
||||
import { deleteTempLineRunTestReport } from '@/api/supervision-boot/delete/index'
|
||||
const dictData = useDictData()
|
||||
const statusSelect = dictData.statusSelect()
|
||||
const { push } = useRouter()
|
||||
@@ -258,6 +260,38 @@ const checkboxConfig = reactive<VxeTablePropTypes.CheckboxConfig>({
|
||||
return !(row.testRunState == 1 || row.testRunState == 2)
|
||||
}
|
||||
})
|
||||
const deleteEven = () => {
|
||||
if (tableStore.table.selection.length == 0) {
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '请选择要删除的数据'
|
||||
})
|
||||
} else {
|
||||
let createBy = tableStore.table.selection.map(item => item.createBy)
|
||||
let status = tableStore.table.selection.map(item => item.status)
|
||||
if (adminInfo.roleCode.includes('delete_info')) {
|
||||
deleteList()
|
||||
} else if (createBy.includes(adminInfo.$state.id) && status.includes(0)) {
|
||||
deleteList()
|
||||
} else {
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '只能删除自己填报的数据!!!'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const deleteList = () => {
|
||||
deleteTempLineRunTestReport(tableStore.table.selection.map(item => item.id)).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
|
||||
/** 处理审批按钮 */
|
||||
const handleAudit = (instanceId: any, historyInstanceId: any) => {
|
||||
push({
|
||||
@@ -369,8 +403,6 @@ const runTestSubmit = (type: number) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
Reference in New Issue
Block a user