Merge remote-tracking branch 'origin/feature/admin_optimize' into feature/admin_optimize

master
liuweiwen 5 years ago
commit 6d13be7863

@ -110,6 +110,8 @@ class StatementController extends ThinkController
$Statement = M("statement","tab_");
$repart =false;
$errorstr = '';
$errorstr1 = '';
$errorstr2 = '';
//开始时间被重叠部分
$checkmap = array(
"statement_begin_time"=>array("ELT",strtotime($_REQUEST['time_start'])),
@ -126,7 +128,7 @@ class StatementController extends ThinkController
}else{
$end = $_REQUEST['time_end'];
}
$errorstr .= ($begin."到".$end."期间的数据已经结算过<br/>");
$errorstr = ($begin."到".$end."期间的数据已经结算过<br/>");
}
//结束被重复的部分
$checkmap = array(
@ -134,18 +136,41 @@ class StatementController extends ThinkController
"statement_end_time"=>array("EGT",strtotime($_REQUEST['time_end'])),
"company_id"=>$CompanyId
);
if($repart){
$checkmap["id"]=array("NEQ",$bres["id"]);
}
$bres = $Statement->field("statement_begin_time,statement_end_time")->where($checkmap)->find();
if($bres){
$repart=true;
$begin = date("Y-m-d",$bres["statement_begin_time"]);
//统计相交时间
$end = $_REQUEST['time_end'];
$errorstr .= ($begin."到".$end."期间的数据已经结算过<br/>");
$errorstr1 = ($begin."到".$end."期间的数据已经结算过<br/>");
}
//中间被包住
$checkmap = array(
"statement_begin_time"=>array("EGT",strtotime($_REQUEST['time_start'])),
"statement_end_time"=>array("ELT",strtotime($_REQUEST['time_end'])),
"company_id"=>$CompanyId
);
$bres = $Statement->field("statement_begin_time,statement_end_time")->where($checkmap)->find();
if($bres){
$repart=true;
$begin = date("Y-m-d",$bres["statement_begin_time"]);
//统计相交时间
$end = date("Y-m-d",$bres["statement_end_time"]);
$errorstr2 = ($begin."到".$end."期间的数据已经结算过<br/>");
}
if($repart){
if($errorstr1 == $errorstr){
$errorstr1 ='';
}
if($errorstr1 == $errorstr2){
$errorstr1 ='';
}
if($errorstr == $errorstr2){
$errorstr2 ='';
}
$errorstr .=($errorstr1.$errorstr2);
$this->ajaxReturn(array("error"=>$errorstr,"code"=>2001));
}

@ -566,6 +566,11 @@
}
$("#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(){
@ -624,7 +629,7 @@
//CP上游公司
company_id = $("#first_partner_id").find("option:selected").val();
}else{
company_type = $("#second_partner_id").find("option:selected").val();
company_id = $("#second_partner_id").find("option:selected").val();
}
//发起查询
var selectData = {
@ -869,6 +874,10 @@
EVENT.changeStatementType();
$("#statement_type").change();//默认支付给乙方
// TPLSHOW.showPartPayInfo();//查看底下是否有值
}else{
var str = "<option value=''>请选择合作公司</option>";
$("#statement_type").html(str);
EVENT.changeStatementType();
}
},
//支付信息显示

Loading…
Cancel
Save