|
@@ -25,7 +25,7 @@
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table :data="NORMList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table ref="multipleTable" :data="NORMList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="指标分类名称" align="center">
|
|
|
<template slot-scope="scope">
|
|
@@ -101,6 +101,8 @@ export default {
|
|
|
loading: true,
|
|
|
// 选中数组
|
|
|
ids: [],
|
|
|
+ // 要删除的数据项
|
|
|
+ delList:[],
|
|
|
// 非单个禁用
|
|
|
single: true,
|
|
|
// 非多个禁用
|
|
@@ -219,6 +221,8 @@ export default {
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
+ this.delList=selection;
|
|
|
+ console.log(selection);
|
|
|
this.ids = selection.map(item => item.id);
|
|
|
this.single = selection.length !== 1;
|
|
|
this.multiple = !selection.length;
|
|
@@ -261,17 +265,27 @@ export default {
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
+ let that = this;
|
|
|
const ids = row.id || this.ids;
|
|
|
this.$modal
|
|
|
.confirm('是否确认删除?')
|
|
|
.then(function () {
|
|
|
- return delNORM(ids);
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess('删除成功');
|
|
|
+ let is = false;
|
|
|
+ that.delList.forEach(item=>{
|
|
|
+ if(item.status == true){
|
|
|
+ is = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(!is){
|
|
|
+ delNORM(ids);
|
|
|
+ that.$modal.msgSuccess('删除成功');
|
|
|
+ that.getList();
|
|
|
+ }
|
|
|
+ that.$refs.multipleTable.clearSelection();
|
|
|
+ that.$message.error('指标正在启用,无法删除!');
|
|
|
})
|
|
|
- .catch(() => {});
|
|
|
+ .catch(() => {
|
|
|
+ });
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|