当前位置:首页 > 编程笔记 > 正文
已解决

AJAX: 对话框大全

来自网友在路上 165865提问 提问时间:2023-10-21 23:12:40阅读次数: 65

最佳答案 问答题库658位专家为你答疑解惑

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

AJAX:$.ajax({url: "/admin/cutting/getDataWeek",type: "GET",data:{},dataType:'json',success: function (res) {if (res.code == 1) {}},error:function (error) {console.log('请求失败');console.log(error);}});      	$('.sub').unbind('click').click(function() {var id = $(this).data('id');swal({title: "确认完成后,数据将不可再修改?",type: "warning",showCancelButton: true,confirmButtonColor: "#DD6B55",confirmButtonText: "确认",showLoaderOnConfirm: true,cancelButtonText: "取消",preConfirm: function() {return new Promise(function(resolve) {$.ajax({method: 'post',url: '/admin/patfabric/checksuccess',data: {id:id,type:2,_token:LA.token,},success: function (data) {$.pjax.reload('#pjax-container');resolve(data);}});});}}).then(function(result) {var data = result.value;if (typeof data === 'object') {if (data.status) {swal(data.message, '', 'success');} else {swal(data.message, '', 'error');}}});
});	supplyCheck:function () {this.$confirm('确认审批通过, 是否继续?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {$.ajax({url:"/feed_check_store",data:{'_token':'{{ csrf_token() }}','user_id':this.user_id)},type:'POST',cache:false,dataType:'json',success: function (res) {location.reload();},error: function (xhr, textStatus, errorThrown) {}});this.$message({type: 'success',message: '审批通过!'});}).catch(() => {this.$message({type: 'info',message: '取消操作'});});},checkBack:function () {this.$prompt('请输入驳回原因', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',}).then(({ value }) => {$.ajax({url:"/feed_check_store",data:{'_token':'{{ csrf_token() }}','user_id':this.user_id,'id':this.feed_id,'reject_remark': value},type:'POST',cache:false,dataType:'json',success: function (res) {location.reload();},error: function (xhr, textStatus, errorThrown) {}});this.$message({type: 'success',message: '驳回完成!'});}).catch(() => {this.$message({type: 'info',message: '取消操作'});// this.$notify({//   title: '警告',//   message: data.message,//   type: 'warning'// });//this.$alert(res.msg, '提示', {//       confirmButtonText: '确定',//});//sweetAlert(res.msg);//swal(data.msg, '', 'error');});},
查看全文

99%的人还看了

猜你感兴趣

版权申明

本文"AJAX: 对话框大全":http://eshow365.cn/6-21105-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!