新增cp对账单删除

master
chenzhi 5 years ago
parent da420ceb5c
commit 1275c740d5

@ -45,6 +45,17 @@ class StatementController extends ThinkController
$this->display();
}
public function delCpStatement()
{
if(!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id'];
$res = M("statement","tab_")->where("id = '{$id}'")->delete();
if($res !== false){
$this->ajaxReturn(array("success"=>"ok","code"=>0));
}else{
$this->ajaxReturn(array("error"=>"database error","code"=>2000));
}
}
//获取推广公司基础信息
public function getCpCompanyInfo()
{

@ -601,11 +601,11 @@
}
}
console.log(DATAOBJ);
// layer.load(2);
// $("#createStatement").off("click");//自我解绑
layer.load(2);
$("#createStatement").off("click");//自我解绑
PUBLIC.postData("{:U('doAddCpStatement',['id'=>$id])}",DATAOBJ,function(data){
if(data.success){
if(data.code == 0){
layer.closeAll('loading');
layer.msg('修改成功');
setTimeout(function(){

@ -60,8 +60,8 @@
<div class="input-list input-list-promote search_label_rehab">
<select id="statement_type" name="statement_type" class="select_gallery" style="width:150px;">
<option value="">对账类型</option>
<option value="1">公会对账单</option>
<option value="0">CP对账单</option>
<option value="0">上游对账单</option>
<option value="1">下游对账单</option>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
@ -131,10 +131,10 @@
<td><if condition="$data['is_confirm'] eq 0">未确认<elseif condition="$data['is_confirm'] eq 1"/>确认</if></td>
<td>
<a class="confirm statement_view" data-id="{$data.id}">查看</a>
<a class="confirm " href="{:U('Member/del?id='.$data['id'])}">撤销</a>
<if condition="$data['is_confirm'] eq 0">
<a class="confirm statement_edit" data-id="{$data.id}" data-type="{$data.statement_type}" ext_field="{$data.ext_field}">编辑</a>
</if>
<a class="confirm statement_del" data-type="{$data.statement_type}" data-id="{$data.id}">撤销</a>
</td>
</tr>
</volist>
@ -223,7 +223,6 @@
var edit = $(this).data();
var ext_field = $(this).attr('ext_field');
console.log(ext_field)
if(edit.type == 0){
var url = "/admin.php?s=/Statement/editCpStatement/id/"+edit.id;
}else{
@ -251,7 +250,42 @@
content: url
});
});
$(".statement_del").click(function () {
var del = $(this).data();
layer.confirm('【警告】撤销后将不可回退,如需继续请点击确认', {
btn: ['确认','取消'],
title:false
}, function(){
if(del.type == 0){
var url = "/admin.php?s=/Statement/delCpStatement/id/"+del.id;
}else{
var url = "/admin.php?s=/StatementMangement/delStatementData/id/"+del.id;
}
layer.load(2);
$.ajax({
url: url,
type: "get",
dataType: "json",
success: function (data) {
if(data.code == 0){
layer.closeAll('loading');
layer.msg("<font style='color:#fff'>删除成功</font>");
setTimeout(function(){
window.location.reload();
},350);
}else{
alert("删除失败,请联系管理员")
}
}
})
}, function(){
});
});
$("#search").click(function(){
var url = $(this).attr('url');

Loading…
Cancel
Save