图:
一:主要是看审核方式,prop="status"和保存按钮的scope.row
<el-table-column prop="status" label="审核方式" align="center">
<template slot-scope="scope">
<el-select v-model="scope.row.status" placeholder="请选择">
<el-option
v-for="item in statusOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button size="mini" type="danger" @click="save(scope.row)">保存</el-button>
</template>
</el-table-column>
二:js
data()
// 状态数据字典
statusOptions: [{
"id": "1",
"value": "1",
"label": "不审核"
},
{
"id": "2",
"value": "2",
"label": "自动审核"
},
{
"id": "3",
"value": "3",
"label": "人工审核"
}]
methods:保存审核状态
// 保存审核方式
save(row, index) {
const column = {id:row.id,status:row.status}
updateDataColumn(column).then((response) => {
if (response.success) {
this.$message.success('保存成功')
} else {
this.$message.error('保存失败')
}
})
},