Commit 8b6019f2 authored by YLKCNK's avatar YLKCNK

【管理端】内容管理—新闻资讯,列表中点击状态按钮切换状态,在二次确认时点击取消,状态还是会变更

parent c266524d
...@@ -405,23 +405,40 @@ export default { ...@@ -405,23 +405,40 @@ export default {
// 修改状态 // 修改状态
handleStatusChange(row) { handleStatusChange(row) {
const text = row.flag === '1' ? '启用' : '停用' const text = row.flag === '1' ? '启用' : '停用'
const params = {
businessId: row.businessId,
flag: row.flag
}
this.$confirm('是否确认操作?', '警告', { this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(function() { }).then(function() {
return updateStatus(params) return updateStatus(row)
}).then(() => { }).then(() => {
this.$message({ this.$message({
message: text + '成功', message: text + '成功',
type: 'success' type: 'success'
}) })
}).catch(function() {
row.flag = row.flag === '0' ? '1' : '0'
}) })
}, },
// handleStatusChange(row) {
// const text = row.flag === '1' ? '启用' : '停用'
// const params = {
// businessId: row.businessId,
// flag: row.flag
// }
// this.$confirm('是否确认操作?', '警告', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(function() {
// return updateStatus(params)
// }).then(() => {
// this.$message({
// message: text + '成功',
// type: 'success'
// })
// })
// },
handleExamination(data) { handleExamination(data) {
console.log('data', data) console.log('data', data)
this.$router.push({ this.$router.push({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment