template
<div class="dial-header">
<el-dialog title="选择批次" :visible.sync="Index.BatchEdit">
<el-table ref="multipleTable" :data="tableDataEdit" tooltip-effect="dark" style="width:100%" @selection-change="handleSelectionChangeEdit">
<el-table-column type="selection" prop="id"></el-table-column>
<el-table-column prop="id" label="批次ID"></el-table-column>
<el-table-column prop="batch_name" label="批次名称"></el-table-column>
<el-table-column prop="create_time" label="创建时间"></el-table-column>
<el-table-column prop="remain_count" label="剩余条数"></el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveChangeEdit">确定</el-button>
</div>
<div class="pagination">
<div class="block">
<el-pagination
@current-change="handleCurrentChangeEdit"
:current-page="pag.currentPage"
:page-sizes="[10]"
:total="pag.total"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</div>
</div>
<el-dialog>
</div>
//下面是根据后台返回的数组中的asrcall_id 字段是否为0判断的(主要是setTimeout)
<script>
this.tableDataEdit.forEach((row,index)=>{
if(row.asrcall_id != 0){
setTimeout(()=>{
this.batchIds.push(row.id)
this.$refs.multipleTable.toggleRowSelection(this.tableDataEdit[index])
},1)
}
})
</script>
网友评论