:inactive-value="2" @change="changeSwitch($event,scope.row)">
// 开关事件changeSwitch(row) {this.$confirm('是否启用或禁用?', '提示', {confirmButtonText: '是',cancelButtonText: '否',type: 'warning'}).then(() => {outsourceSwitch({ guid: row.guid, status: row.status }) // 接口和参数.then((res) => {if (row.status === 2) {this.$message.success('禁用成功')this.getList()} else {this.$message.success('启用成功')this.getList()}}).catch((err) => {const status = row.status === 1 ? 2 : 1row.status = statusconsole.log(err)})}).catch(() => {const status = row.status === 1 ? 2 : 1row.status = statusthis.$message({type: 'info',message: '已取消'})})}
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!