master
ELF 4 years ago
parent 62d2eaef72
commit ffad0d78c5

@ -667,11 +667,6 @@ class PaymentMerchantController extends ThinkController
public function deleteRule() public function deleteRule()
{ {
$this->ajaxReturn([
'status' => 0,
'message' => '暂不支持删除'
]);
$id = I('id', 0); $id = I('id', 0);
$rule = M('payment_rule', 'tab_')->where(['id' => $id])->find(); $rule = M('payment_rule', 'tab_')->where(['id' => $id])->find();

@ -124,7 +124,6 @@
<div class="input-list"> <div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('PaymentMerchant/rules')}">搜索</a> <a class="sch-btn" href="javascript:;" id="search" url="{:U('PaymentMerchant/rules')}">搜索</a>
<a class="sch-btn" style="width: 100px;" href="{:U('PaymentMerchant/addRule')}">新增配置</a> <a class="sch-btn" style="width: 100px;" href="{:U('PaymentMerchant/addRule')}">新增配置</a>
<!-- <a class="sch-btn" href="javascript:;" id="batch-delete-btn">删除</a> -->
</div> </div>
<!-- <div class="input-list"> <!-- <div class="input-list">
<a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>12,),I('get.')))}">导出</a> <a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>12,),I('get.')))}">导出</a>
@ -175,7 +174,7 @@
<td> <td>
<div class="partakebtn"> <div class="partakebtn">
<a href="<?=U('editRule', ['id' => $data['id']])?>">编辑</a> <a href="<?=U('editRule', ['id' => $data['id']])?>">编辑</a>
<!-- <a class="delete-btn">删除</a> --> <a class="delete-btn">删除</a>
</div> </div>
</td> </td>
</tr> </tr>
@ -253,27 +252,6 @@
minView:'month', minView:'month',
maxView:'month', maxView:'month',
}); });
$('#batch-delete-btn').on({
click: function() {
var ids = getIds();
$.ajax({
url: '{:U("batchDelete")}',
type: 'post',
dataType: 'json',
data: {ids: ids},
success: function(result) {
if (result.status == 1) {
layer.msg(result.message)
setTimeout(function() {
window.location.href = window.location.href
}, 200)
} else {
layer.msg(result.message)
}
}
})
}
})
function getIds() { function getIds() {
var ids = []; var ids = [];
$('.ids:checked').each(function() { $('.ids:checked').each(function() {
@ -281,45 +259,30 @@
}) })
return ids; return ids;
} }
$('.delete-btn').on({
click: function() { function deleteRule(id) {
var id = $(this).parents('tr').eq(0).attr('data-id'); $.ajax({
$.ajax({ url: '{:U("deleteRule")}',
url: '{:U("deleteRule")}', type: 'post',
type: 'post', dataType: 'json',
dataType: 'json', data: {id: id},
data: {id: id}, success: function(result) {
success: function(result) { if (result.status == 1) {
if (result.status == 1) { layer.msg(result.message)
layer.msg(result.message) setTimeout(function() {
setTimeout(function() { window.location.href = window.location.href
window.location.href = window.location.href }, 200)
}, 200) } else {
} else { layer.msg(result.message)
layer.msg(result.message)
}
} }
}) }
} })
}) }
$('.cancel-btn').on({ $('.delete-btn').on({
click: function() { click: function() {
var id = $(this).parents('tr').eq(0).attr('data-id'); var id = $(this).parents('tr').eq(0).attr('data-id')
$.ajax({ layer.confirm('确定要删除该规则 ?请确保删除后时间范围内规则完整!', {icon: 3, title:'提示'}, function(index){
url: '{:U("cancel")}', deleteRule(id)
type: 'post',
dataType: 'json',
data: {id: id},
success: function(result) {
if (result.status == 1) {
layer.msg(result.message)
setTimeout(function() {
window.location.href = window.location.href
}, 200)
} else {
layer.msg(result.message)
}
}
}) })
} }
}) })

Loading…
Cancel
Save