<!-- 操作 -->
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-switch
v-model="scope.row.recipeStatus"
:active-value="3"
:active-text="scope.row.recipeStatus === 3 ? '通过' : '拒绝'"
:inactive-value="2"
active-color="#48DC74"
inactive-color="#DBDFE6"
@change="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
handleStatusChange(row) {
let text = row.recipeStatus === 3 ? '通过' : '拒绝'
this.$confirm('确认要' + text + '"' + row.itemName + '"吗?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
// .then(function () {
// return changeUserStatus(row.id, row.recipeStatus)
// })
.then(() => {
this.msgSuccess(text + '成功')
})
.catch(function () {
row.recipeStatus = row.recipeStatus === 3 ? 2 : 3
})
},