<el-table-column fixed="right" label="操作" width="200" align="center">
<template slot-scope="scope">
<el-button @click="open(scope.row)" type="button" class="confirmbtn">{{sure}}</el-button>
<el-button @click="handleClick(scope.row)" type="button" class="seebtn">详细</el-button>
</template>
</el-table-column>
async open(e) {
console.log(e,'id');
this.getinfo.finance_id = this.rowdata.id || e.id
const res = await this.$http.post("/finance/agree", this.getinfo)
console.log(res, 'process');
this.$message({
message: "您已成功确认",
type: "success",
});
// this.sure='1'
},
open再传个索引过去,变量sure放到列表去
<el-button @click="open(scope.row,scope.$index)" type="button" class="confirmbtn">{{scope.row.sure}}</el-button>
async open(e,index) {
console.log(e,'id');
this.getinfo.finance_id = this.rowdata.id || e.id
const res = await this.$http.post("/finance/agree", this.getinfo)
console.log(res, 'process');
this.$message({
message: "您已成功确认",
type: "success",
});
this.tableList[index].sure='确认成功' // tableList是表格列表数组
// this.sure='1'
},
你点击确认成功之后,接口成功后台已经把这个状态更改了;你只需要在确认成功的接口那里再调用一下查询接口就可以了呢