reject(row) {
let that = this;
this.$prompt('驳回理由', '提示', {
inputPlaceholder: '请输入驳回理由',
confirmButtonText: '确定',
cancelButtonText: '取消',
inputErrorMessage: '输入不能为空',
inputValidator: (value) => { // 点击按钮时,对文本框里面的值进行验证
if(!value) {
return '输入不能为空';
}
},
callback: function (action, instance) {
if(action === 'confirm') {
new Promise((resolve,reject)=>{ // 点击确定,进行的异步操作
audit({id: row.id, status: row.status, cause: instance.inputValue}).then( res => {
if(res.code === 'R0000') {
that.$message({
type: 'success',
message: '驳回成功'
});
}
})
}).then((error) => {
console.log(error);
})
}else {
that.$message({
type: 'info',
message: '取消驳回'
});
}
}
})
}
elementUi里面的messageBox的$prompt使用(里面进行异步操作)
最新推荐文章于 2024-05-19 16:51:01 发布