聚合财务编辑

master
chenzhi 5 years ago
parent bf7c7ed14f
commit 422728ed11

@ -89,8 +89,8 @@ class AggregateFinanceStatementController extends ThinkController
foreach($data as $key => $value) {
$data[$key]['verify_status_str'] = $this->verify_status[$value['verify_status']];
$data[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
$data[$key]['begintime'] = date('Y-m-d H:i:s',$value['begintime']);
$data[$key]['endtime'] = date('Y-m-d H:i:s',$value['endtime']);
$data[$key]['begintime'] = date('Y-m-d',$value['begintime']);
$data[$key]['endtime'] = date('Y-m-d',$value['endtime']);
$data[$key]['withdraw_type_1'] = ($value['withdraw_type'] == 1 ? "月结" :"周结");
$data[$key]['withdraw_type_2'] = ($value['withdraw_type'] == 2 ? "补点" :"正常结算");
}
@ -103,8 +103,6 @@ class AggregateFinanceStatementController extends ThinkController
if ($page) {
$this->assign('_page', $page);
}
// $this->meta_title = '结算单管理';
$this->assign('data',$data);
$this->assign('total',$count['ratio_money']);
$this->assign('channel',$this->getAggChannel());
@ -137,6 +135,10 @@ class AggregateFinanceStatementController extends ThinkController
$statement_info = $_REQUEST['statement_info'];
$admininfo = $_SESSION['onethink_admin']['user_auth'];
$data_count = $_REQUEST['statement_count'];
if(!isset($_REQUEST['statement_id'])){
$this->error("参数错误");
}
//拼凑数据
$adddata = array(
"pay_money"=>$data_count['pay_money'],
@ -147,7 +149,8 @@ class AggregateFinanceStatementController extends ThinkController
"statement_info"=>json_encode($statement_info,JSON_UNESCAPED_UNICODE),
"admin_name"=>$admininfo['username'],
"admin_id"=>$admininfo['uid'],
"verify_status"=>1
"verify_status"=>1,
"create_time"=>time()
);
$id = $_REQUEST['statement_id'];
$res = M("aggregate_statement","tab_")->where("id = '{$id}'")->save($adddata);
@ -191,6 +194,44 @@ class AggregateFinanceStatementController extends ThinkController
}
}
public function editStatement(){
if(!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id'];
$dbres = M("aggregate_statement","tab_")->where("id = '{$id}'")->find();
$first_party_info = json_decode($dbres['first_party_info'],true);
$second_party_info = json_decode($dbres['second_party_info'],true);
$statement_info = json_decode($dbres['statement_info'],true);
// if($dbres['company_name'] == $first_party_info['partner']){
// $first_partner_type=0;
// }else{
// $first_partner_type=1;
// }
// $fine = array_pop($statement_info);
$senddata = array(
// "first_partner_type"=>1,
"statement_id"=>$dbres['id'],
"first_part_company"=>$first_party_info['partner'],
"second_part_company"=>$second_party_info['partner'],
"statement_type"=>$dbres['pay_type'] == 0 ? 1 :0,
"first_party_info"=>$first_party_info,
"second_party_info"=>$second_party_info,
"statement_info"=>$statement_info,
"statement_count"=>array("pay_money"=>$dbres['pay_money'],"ratio_money"=>$dbres['ratio_money'])
);
$this->assign("data",$senddata);
if($dbres['pay_type'] == 0){
$this->assign("company",$second_party_info['partner']);
}else{
$this->assign("company",$first_party_info['partner']);
}
$this->assign("company_id",$dbres['company_id']);
$this->assign("company_name",$dbres['company_name']);
$this->assign("id",$dbres['id']);
$this->display();
}
}

@ -90,12 +90,12 @@
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">公司类型:</td>
<td class="l">甲方类型:</td>
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="first_partner_type" name="first_partner_type" class="select_gallery">
<option value="">请选择甲方公司类型</option>
<option value="0">CP上游公司</option>
<option value="0">合作公司</option>
<option value="1">平台归属公司</option>
</select>
</div>

@ -89,25 +89,13 @@
<div class="tab-content tabcon1711" id="firstPartBaseInfo">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">公司类型:</td>
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="first_partner_type" name="first_partner_type" class="select_gallery">
<option value="">请选择甲方公司类型</option>
<option value="0">CP上游公司</option>
<option value="1">平台归属公司</option>
</select>
</div>
</td>
</tr>
<tr>
<td class="l">甲方:</td>
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="first_partner_id" name="partner_id" class="select_gallery">
<option value="">请选择合作公司</option>
</select>
<option value="{$data['first_party_info']['id']}" selected>{$data['first_part_company']}</option>
</select>
</div>
</td>
</tr>
@ -143,17 +131,13 @@
<div class="tab-content tabcon1711" id="secondPartBaseInfo">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l"></td>
<td class="r"></td>
</tr>
<tr>
<td class="l">乙方:</td>
<td class="r">
<div class="input-list input-list-game search_label_rehab">
<select id="second_partner_id" name="partner_id" class="select_gallery">
<option value="">请选择合作公司</option>
</select>
<option value="{$data['second_party_info']['id']}" selected>{$data['second_part_company']}</option>
</select>
</div>
</td>
</tr>
@ -189,13 +173,15 @@
</div>
<div style="padding: 30px 0px 10px;display: block;height:30px;">
<div class="input-list input-list-server search_label_rehab">
<p style="font-size: 20px;font-weight: 600;">支付给:</p>
<p style="font-size: 20px;font-weight: 600;">支付给:<spen style="margin-left: 15px;font-size: 16px;">{$company}
</spen>
</p>
</div>
<div class="input-list input-list-server search_label_rehab" style="margin-left: 20px;">
<!-- <div class="input-list input-list-server search_label_rehab" style="margin-left: 20px;">
<select id="statement_type" name="statement_type" class="select_gallery" style="width: 215px;">
<option value="">请选择合作公司</option>
</select>
</div>
</div> -->
</div>
<!-- <div class="search_list" style="display: block;line-height: 30px;height: 10px;">
<div class="input-list input-list-server search_label_rehab">
@ -311,7 +297,7 @@
</div>
<div class="search_list" style="display: flex;justify-content:flex-end;width:960px;">
<div class="input-list" style="margin-left: 30px;float: right;">
<a class="sch-btn" href="javascript:;" id="createStatement" style="width: 150px;">申请开票</a>
<a class="sch-btn" href="javascript:;" id="createStatement" style="width: 150px;">确认修改</a>
</div>
</div>
@ -452,7 +438,7 @@
EVENT.createStatement();
//获取账单信息
TPLSHOW.showStatementList(true);
// $("#first_partner_id").change();//默认甲方只能是我们公司
$("#first_partner_id").change();
});
//基础类
@ -525,99 +511,97 @@
}
}
//数据类
var DATAOBJ = {
first_partner_type:false,
first_part_company:false,
second_part_company:false,
statement_type:false,
first_party_info:false,
second_party_info:false,
statement_info:{$data|json_encode=###,JSON_UNESCAPED_UNICODE},
statement_count:{$data_count|json_encode=###,JSON_UNESCAPED_UNICODE},
fine:0,
// statement_begin_time:false,
// statement_end_time:false,
statement_id:{$id}
}
var DATAOBJ = {$data|json_encode=###,JSON_UNESCAPED_UNICODE};
//事件类
var EVENT = {
changeCompany(){
$("#first_partner_type").on("change",function(){
var type = $(this).find("option:selected").val();
if(type == ''){
type=false;
}
DATAOBJ.first_partner_type = type;
//获取cp和内部公司
var url = "{:U('getCompanyList')}";
PUBLIC.postData(url,{id:DATAOBJ.statement_id},function(data){
var ptCompany = data.success.ptCompany;
var cpCompany = data.success.cpCompany;
var ptstr = '<option value="">请选择平台归属公司</option>';
for (var i in ptCompany) {
ptstr += "<option value='" + ptCompany[i].id + "'>" + ptCompany[i].partner + "</option>"
}
var cpstr = '<option value="">请选择合作公司</option>';
for (var i in cpCompany) {
cpstr += "<option value='" + cpCompany[i].id + "'>" + cpCompany[i].partner + "</option>"
}
//
if(type == 0){
$("#first_partner_id").html(cpstr);
$("#second_partner_id").html(ptstr);
}else{
$("#first_partner_id").html(ptstr);
$("#second_partner_id").html(cpstr);
}
$("#first_partner_id").select2();
$("#second_partner_id").select2();
//重置数据
DATAOBJ.first_part_company=false;
DATAOBJ.second_part_company=false;
TPLSHOW.pushStatementTypeOption();
})
})
$("#first_partner_id").on("change",function(){
//获取数据
var comid = $(this).find("option:selected").val();
//获取基础数据
var url = "{:U('getCpCompanyInfo')}";
var company_type;
if(DATAOBJ.first_partner_type == 0){
//CP上游公司
company_type = "cp";
}else{
company_type = "pt";
}
PUBLIC.postData(url,{company_id:comid,company_type:company_type},function(data){
DATAOBJ.first_part_company = data.success.partner;
DATAOBJ.first_party_info = data.success;
data.success.type = "first_party_info";
TPLSHOW.firstPartInfo(data.success);
})
})
$("#second_partner_id").on("change",function(){
//获取数据
var comid = $(this).find("option:selected").val();
//获取基础数据
var url = "{:U('getCpCompanyInfo')}";
var company_type;
if(DATAOBJ.first_partner_type == 0){
//CP上游公司
company_type = "pt";
}else{
company_type = "cp";
}
PUBLIC.postData(url,{company_id:comid,company_type:company_type},function(data){
DATAOBJ.second_part_company = data.success.partner;
DATAOBJ.second_party_info = data.success;
data.success.type = "second_party_info";
TPLSHOW.secondPartInfo(data.success);
$("#first_partner_id").on("change", function () {
TPLSHOW.firstPartInfo(DATAOBJ.first_party_info);
TPLSHOW.secondPartInfo(DATAOBJ.second_party_info);
TPLSHOW.showPartPayInfo();
TPLSHOW.showStatementList(true);
})
})
// $("#first_partner_id").on("change", function () {
// TPLSHOW.secondPartInfo(DATAOBJ.second_party_info);
// })
// $("#first_partner_type").on("change",function(){
// var type = $(this).find("option:selected").val();
// if(type == ''){
// type=false;
// }
// DATAOBJ.first_partner_type = type;
// //获取cp和内部公司
// var url = "{:U('getCompanyList')}";
// PUBLIC.postData(url,{id:DATAOBJ.statement_id},function(data){
// var ptCompany = data.success.ptCompany;
// var cpCompany = data.success.cpCompany;
// var ptstr = '<option value="">请选择平台归属公司</option>';
// for (var i in ptCompany) {
// ptstr += "<option value='" + ptCompany[i].id + "'>" + ptCompany[i].partner + "</option>"
// }
// var cpstr = '<option value="">请选择合作公司</option>';
// for (var i in cpCompany) {
// cpstr += "<option value='" + cpCompany[i].id + "'>" + cpCompany[i].partner + "</option>"
// }
// //
// if(type == 0){
// $("#first_partner_id").html(cpstr);
// $("#second_partner_id").html(ptstr);
// }else{
// $("#first_partner_id").html(ptstr);
// $("#second_partner_id").html(cpstr);
// }
// $("#first_partner_id").select2();
// $("#second_partner_id").select2();
// //重置数据
// DATAOBJ.first_part_company=false;
// DATAOBJ.second_part_company=false;
// TPLSHOW.pushStatementTypeOption();
// })
// })
// $("#first_partner_id").on("change",function(){
// //获取数据
// var comid = $(this).find("option:selected").val();
// //获取基础数据
// var url = "{:U('getCpCompanyInfo')}";
// var company_type;
// if(DATAOBJ.first_partner_type == 0){
// //CP上游公司
// company_type = "cp";
// }else{
// company_type = "pt";
// }
// PUBLIC.postData(url,{company_id:comid,company_type:company_type},function(data){
// DATAOBJ.first_part_company = data.success.partner;
// DATAOBJ.first_party_info = data.success;
// data.success.type = "first_party_info";
// TPLSHOW.firstPartInfo(data.success);
// })
// })
// $("#second_partner_id").on("change",function(){
// //获取数据
// var comid = $(this).find("option:selected").val();
// //获取基础数据
// var url = "{:U('getCpCompanyInfo')}";
// var company_type;
// if(DATAOBJ.first_partner_type == 0){
// //CP上游公司
// company_type = "pt";
// }else{
// company_type = "cp";
// }
// PUBLIC.postData(url,{company_id:comid,company_type:company_type},function(data){
// DATAOBJ.second_part_company = data.success.partner;
// DATAOBJ.second_party_info = data.success;
// data.success.type = "second_party_info";
// TPLSHOW.secondPartInfo(data.success);
// })
// })
//生成订单
// $("#getSpendStatement").on("click",function(){
// //获取开始结束时间
@ -690,7 +674,6 @@
// return flag;
// }
// }
layer.load(2);
$("#createStatement").off("click");//自我解绑
PUBLIC.postData("{:U('doAddStatement')}",DATAOBJ,function(data){
@ -831,21 +814,21 @@
EVENT.normalchange();
DATAOBJ.statement_type = false;//重新选择
// TPLSHOW.showStatementList(false);
// DATAOBJ.statement_type = false;//重新选择
// // TPLSHOW.showStatementList(false);
if(DATAOBJ.first_part_company && DATAOBJ.second_part_company){
var str = "<option value=''>请选择合作公司</option><option value='0' selected>"+DATAOBJ.first_part_company+"</option>";
str += ("<option value='1' >"+DATAOBJ.second_part_company+"</option>");//默认支付给甲方
$("#statement_type").html(str);
EVENT.changeStatementType();
$("#statement_type").change();//默认支付给乙方
// TPLSHOW.showPartPayInfo();//查看底下是否有值
}else{
var str = "<option value=''>请选择合作公司</option>";
$("#statement_type").html(str);
EVENT.changeStatementType();
}
// if(DATAOBJ.first_part_company && DATAOBJ.second_part_company){
// var str = "<option value=''>请选择合作公司</option><option value='0' selected>"+DATAOBJ.first_part_company+"</option>";
// str += ("<option value='1' >"+DATAOBJ.second_part_company+"</option>");//默认支付给甲方
// $("#statement_type").html(str);
// EVENT.changeStatementType();
// $("#statement_type").change();//默认支付给乙方
// // TPLSHOW.showPartPayInfo();//查看底下是否有值
// }else{
// var str = "<option value=''>请选择合作公司</option>";
// $("#statement_type").html(str);
// EVENT.changeStatementType();
// }
},
//支付信息显示
showPartPayInfo(){

@ -59,7 +59,7 @@
<div class="jssearch fl cf search_list" style="margin-bottom: 0">
<div class="input-list input-list-promote search_label_rehab">
<select id="channel_id" name="channel_id" class="select_gallery" >
<option company-type="" value="">请选择或输入对账公司</option>
<option company-type="" value="">请选择或输入合作公司</option>
<volist name="channel" id="vo">
<option value="{$vo.channel_id}" <?php echo $vo.channel_id == I('channel_id') ? 'selected':''; ?> >{$vo.channel_name}</option>
</volist>
@ -100,10 +100,10 @@
</div>
<div class="input-list">
<input type="text" readonly id="time_start2" name="time_start2" class="" value="{:I('time_start2')}" placeholder="生成开始时间" />
<input type="text" readonly id="time_start2" name="time_start2" class="" value="{:I('time_start2')}" placeholder="操作开始时间" />
&nbsp;-&nbsp;
<div class="input-append date" id="datetimepicker2" style="display:inline-block">
<input type="text" readonly id="time_end2" name="time_end2" class="" value="{:I('time_end2')}" placeholder="生成结束时间" />
<input type="text" readonly id="time_end2" name="time_end2" class="" value="{:I('time_end2')}" placeholder="操作结束时间" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
@ -145,14 +145,14 @@
<tr>
<th><input class="check-all" type="checkbox"></th>
<th>对账公司</th>
<th>合作公司</th>
<th>结算日期</th>
<th>结算周期</th>
<th>结算类型</th>
<th>结算金额</th>
<th>审批状态</th>
<th>操作人</th>
<th>生成时间</th>
<th>操作时间</th>
<th>操作</th>
</tr>
</thead>
@ -342,7 +342,7 @@
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content:'/admin.php?s=/AggregateFinanceStatement/createStatement/id/'+id
content:'/admin.php?s=/AggregateFinanceStatement/editStatement/id/'+id
});
});

Loading…
Cancel
Save