重点认证标准/政策合规性项目审查流程 带入数据的批量删除
This commit is contained in:
@@ -23,12 +23,13 @@
|
|||||||
<div class="tableTitle">
|
<div class="tableTitle">
|
||||||
<div class="tableButton">
|
<div class="tableButton">
|
||||||
<el-button plain class="common-button-primary" size="mini" @click="handleSearchStandard">调取</el-button>
|
<el-button plain class="common-button-primary" size="mini" @click="handleSearchStandard">调取</el-button>
|
||||||
<el-button plain class="common-button-primary" size="mini" @click="">删除</el-button>
|
<el-button plain class="common-button-primary" size="mini" @click="handleDeleteStandard">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="table-wrap">
|
<div class="table-wrap">
|
||||||
<el-table
|
<el-table
|
||||||
|
@selection-change="deleteSelectChange"
|
||||||
:data="infoTableDatas"
|
:data="infoTableDatas"
|
||||||
ref="multipleTable"
|
ref="multipleTable"
|
||||||
tooltip-effect="dark"
|
tooltip-effect="dark"
|
||||||
@@ -367,6 +368,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
selectedList: [],
|
||||||
infoTableDatas: [],
|
infoTableDatas: [],
|
||||||
productTypeOptions: [{label: '树形结构', value: 'TREE'}, {label: '下拉选项', value: 'SEL_OPTION'}],
|
productTypeOptions: [{label: '树形结构', value: 'TREE'}, {label: '下拉选项', value: 'SEL_OPTION'}],
|
||||||
loadSarStandard: false,
|
loadSarStandard: false,
|
||||||
@@ -477,6 +479,54 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
deleteSelectChange(data) {
|
||||||
|
console.log('483',data)
|
||||||
|
this.deleteSelectedList = []
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
this.deleteSelectedList.push(data[i].id)
|
||||||
|
}
|
||||||
|
// this.deleteSelectedList = data
|
||||||
|
console.log('498',this.deleteSelectedList)
|
||||||
|
},
|
||||||
|
handleDeleteStandard() {
|
||||||
|
this.$confirm('是否删除该数据?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
//拿出deleteSelectedList里的每一个元素
|
||||||
|
this.deleteSelectedList.map(item => {
|
||||||
|
let index;
|
||||||
|
index = this.infoTableDatas.findIndex(items => {
|
||||||
|
//返回infoTableDatas里id和deleteSelectedList的id相同的元素对应的位置
|
||||||
|
return items.id === item;
|
||||||
|
});
|
||||||
|
//如果符合条件,就删除(==-1是没有符合条件的意思)
|
||||||
|
if (index > -1) {
|
||||||
|
this.infoTableDatas.splice(index, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.selectList = [];
|
||||||
|
// for (let i = 0; i < this.infoTableDatas.length; i++) {
|
||||||
|
// for (let j = 0; j < this.deleteSelectedList.length; j++) {
|
||||||
|
// if (this.infoTableDatas[i].id === this.deleteSelectedList[j].id){
|
||||||
|
// console.log('表里的数据',i,this.infoTableDatas[i])
|
||||||
|
// console.log('要删的数据',j,this.deleteSelectedList[j])
|
||||||
|
// this.infoTableDatas.splice(i,1)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '删除成功!'
|
||||||
|
});
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消删除'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
handleProcessStandardNext(status) {
|
handleProcessStandardNext(status) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
// 新增
|
// 新增
|
||||||
@@ -490,9 +540,7 @@ export default {
|
|||||||
// 带入
|
// 带入
|
||||||
case 2:
|
case 2:
|
||||||
if (this.standardCheckedList && this.standardCheckedList.length >= 1) {
|
if (this.standardCheckedList && this.standardCheckedList.length >= 1) {
|
||||||
console.log('504',this.standardCheckedList)
|
|
||||||
this.infoTableDatas = this.standardCheckedList
|
this.infoTableDatas = this.standardCheckedList
|
||||||
console.log('505',this.infoTableDatas)
|
|
||||||
this.standardDrawer = false
|
this.standardDrawer = false
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('请选择要带入的数据')
|
this.$message.warning('请选择要带入的数据')
|
||||||
|
|||||||
Reference in New Issue
Block a user