12月功能提交

master
zhengyongxing 4 years ago
parent 2758c608ad
commit 16f514d084

@ -493,16 +493,32 @@ class PaymentController extends BaseController
{
$data = $_POST;
if(!$data['id']) {
$this->ajaxReturn(['status'=>0,'msg'=>'id不能传输为空']);
// $this->error('名称不能为空');
}
if(!$data['name']) {
$this->error('名称不能为空');
$this->ajaxReturn(['status'=>0,'msg'=>'名称不能为空']);
// $this->error('名称不能为空');
}
if(!$data['mobile']) {
$this->error('手机号不能为空');
$this->ajaxReturn(['status'=>0,'msg'=>'手机号不能为空']);
// $this->error('手机号不能为空');
}
if ($data['id'] == 1) {
$verify = $_REQUEST['verify'];
if (!A("Public")->checksafecode($data['mobile'], $verify)) {
$this->ajaxReturn(["error"=>"验证码错误"]);
}
}
if(strlen($data['mobile']) < 11) {
$this->error('手机号格式错误');
$this->ajaxReturn(['status'=>0,'msg'=>'手机号格式错误']);
// $this->error('手机号格式错误');
}
$is_hav = M("payment_member")
@ -510,7 +526,8 @@ class PaymentController extends BaseController
->find();
if (!$is_hav) {
$this->error('账号不存在');
$this->ajaxReturn(['status'=>0,'msg'=>'账号不存在']);
// $this->error('账号不存在');
}
$is_hav = M("payment_member")
@ -518,7 +535,8 @@ class PaymentController extends BaseController
->select();
if($is_hav) {
$this->error('名称重复请验证');
$this->ajaxReturn(['status'=>0,'msg'=>'名称重复请验证']);
// $this->error('名称重复请验证');
}
$is_hav = M("payment_member")
@ -526,7 +544,8 @@ class PaymentController extends BaseController
->find();
if($is_hav) {
$this->error('手机号重复请验证');
$this->ajaxReturn(['status'=>0,'msg'=>'手机号重复请验证']);
// $this->error('手机号重复请验证');
}
$is_success = M("payment_member")
@ -537,9 +556,11 @@ class PaymentController extends BaseController
]);
if ($is_success) {
$this->success('添加成功',U('Payment/memberList'));
$this->ajaxReturn(['status'=>1,'msg'=>'修改成功']);
// $this->success('添加成功',U('Payment/memberList'));
} else {
$this->error('添加失败');
$this->ajaxReturn(['status'=>0,'msg'=>'尚未修改数据,修改失败']);
// $this->error('添加失败');
}
} else {
@ -630,34 +651,37 @@ class PaymentController extends BaseController
public function doPayment()
{
$id = $_REQUEST['id'];
$limit_amount = 20000;
$remark = $_REQUEST['remark'];
if(empty(C("ALI_PAYMENT"))){
$this->ajaxReturn(["success"=>"配置错误,无法打款","data"=>[]]);
}
Vendor("Alipay2020/Fund");
// $fund = new \Fund(C("ALI_PAYMENT"));
$fund = new \Fund(C("ALI_PAYMENT"));
$dbres = M("company_statement_info", "tab_")->where("id='{$id}'")->find();
$company_info = json_decode($dbres['company_info'], true);
if ($dbres['pay_status'] != 1 && $dbres['verify_status'] == 1) {
//执行打款
$title = "信息服务费";
$amount = $dbres['statement_money'];
// $payres = $fund->transfer($company_info['ali_account'], $company_info['ali_user'], $dbres['statement_num'], $amount, $title);
// $resultCode = $payres->code;
$payres = $fund->transfer($company_info['ali_account'], $company_info['ali_user'], $dbres['statement_num'], $amount, $title);
$resultCode = $payres->code;
$savedata = ["id"=>$dbres['id']];
if (!empty($resultCode)&&$resultCode == 10000) {
$savedata["pay_status"]=1;
} else {
$savedata["pay_status"]=-1;
}
// $payres = json_decode(json_encode($payres), true);
// $payres["remark"] = $remark;
//
// $savedata["pay_info"] = json_encode($payres, JSON_UNESCAPED_UNICODE);
// $savedata["pay_type"]=2;
// $savedata["pay_time"]=time();
}
// M("company_statement_info","tab_")->save($savedata);
$payres = json_decode(json_encode($payres), true);
$payres["remark"] = $remark;
$savedata["pay_info"] = json_encode($payres, JSON_UNESCAPED_UNICODE);
$savedata["pay_type"]=2;
$savedata["pay_time"]=time();
}
M("company_statement_info","tab_")->save($savedata);
$this->ajaxReturn(["success"=>"打款成功","data"=>[]]);
}
/**
@ -748,5 +772,64 @@ class PaymentController extends BaseController
}
/**
* 验证订单
*/
public function checkOrder() {
if(!$_REQUEST['ids']) {
$this->ajaxReturn(['data'=>[]]);
}
$ids = $_REQUEST['ids'];
$data = M("company_statement_info","tab_")
->field("id,statement_money,company_name,statement_begin_time,statement_end_time,pay_time")
->where(['id'=>['in',$ids]])
->select();
$return = [];
foreach ($data as $key => $value) {
$check_data = M("excel_statement_info","tab_")
->where([
'statement_money'=>$value['statement_money'],
'company_name'=>$value['company_name'],
'statement_begin_time'=>$value['statement_begin_time'],
'statement_end_time'=>$value['statement_end_time'],
// 'id'=>['neq',$value['id']],
'pay_status'=>1
])
->select();
$check_company_statement_info = M("company_statement_info","tab_")
->where([
'pay_status'=>1,
'company_name'=>$value['company_name'],
'statement_begin_time'=>$value['statement_begin_time'],
'statement_end_time'=>$value['statement_end_time'],
'statement_money'=>$value['statement_money'],
])
->select();
$return = array_merge($return,$check_data,$check_company_statement_info);
}
foreach ($return as $key => $value) {
$return[$key]['time'] = ($value['statement_begin_time']?date("Y-m-d",$value['statement_begin_time']):'无').'-'.($value['statement_end_time']?date("Y-m-d",$value['statement_end_time']):'无');
$return[$key]['pay_time'] = date("Y-m-d H:m:s",$value['pay_time']);
}
$this->ajaxReturn(['data'=>$return]);
}
}

@ -115,6 +115,7 @@
::-webkit-scrollbar-thumb:active {
cursor: pointer;
}
</style>
@ -270,7 +271,7 @@
{$_page|default=''}
</div>
<div style="width: 800vw;height:600vh;padding: 0;position: absolute;top: 0;z-index: 9999;background-color:rgba(0,0,0,.6);right: 1px;display: none" id="window">
<div class="layui-layer layui-layer-hui" style="width:600px;height:440px;z-index: 19891015; top:28%; left:35%;border-radius: 2%;background-color:white;color: #0a001f;">
<div class="layui-layer layui-layer-hui" style="width:800px;height:440px;z-index: 19891015; top:28%; left:35%;border-radius: 2%;background-color:white;color: #0a001f;">
<div style="padding: 15px 30px 15px 20px;font-size: 28px;">打款提示</div>
<div class="layui-layer-content" style="font-size: 22px;padding: 0 25px;">您所选打款单与以下打款单可能存在重复,请谨慎操作</div>
<!-- <div style="padding: 0 25px">-->
@ -361,7 +362,7 @@
$(function(){
$("#back").click(function() {
$("#back,#window").click(function() {
$('#window').hide();
});

@ -2,7 +2,7 @@
<block name="body">
<div class="tabcon1711">
<form action="{:U('edit')}" method="post" class="form-horizontal form_info_ml">
<form action="{:U('edit')}" method="post" id ="form">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">编辑复核人</h3>
@ -14,26 +14,29 @@
<tr>
<td class="l"><i class="mustmark">*</i>姓名:</td>
<td class="r">
<input name="name" type="text" class="" placeholder="请输入姓名" value="{$data['name']}" onkeyup="value=value.replace(/[^\a-zA-Z\u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\a-zA-Z\u4E00-\u9FA5]/g,''))">
<input name="name" id="name" type="text" class="" placeholder="请输入姓名" value="{$data['name']}" onkeyup="value=value.replace(/[^\a-zA-Z\u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\a-zA-Z\u4E00-\u9FA5]/g,''))">
<!-- <span class="notice-text">制单人姓名</span>-->
</td>
</tr>
<tr>
<td class="l"><i class="mustmark">*</i>手机号码:</td>
<td class="r">
<input name="mobile" type="text" class="" placeholder="请输入手机号码" value="{$data['mobile']}" onkeyup="value=value.replace(/[^\d]/g,'')" maxlength=11>
<input name="mobile" id="mobile" type="text" class="" placeholder="请输入手机号码" value="{$data['mobile']}" onkeyup="value=value.replace(/[^\d]/g,'')" maxlength=11>
<!-- <span class="notice-text">制单人登陆用的手机</span>-->
</td>
</tr>
</tbody>
</table>
<div class="form-item cf">
<input name="id" value="{$_REQUEST['id']}" type="hidden">
<button class="submit_btn ajax-post mlspacing" id="submit" type="submit" target-form="form-horizontal">
保存
</button>
<input name="id" value="{$_REQUEST['id']}" type="hidden" id = "id">
<!-- <button class="submit_btn mlspacing" id="submit" >-->
<!-- 保存-->
<!-- </button>-->
<a class="submit_btn mlspacing " alt="保存" title="保存" id="submit" >
保存
</a>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back(-1);" >
返回
</a>
@ -44,8 +47,91 @@
</block>
<block name="script">
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script src="__STATIC__/layer/extend/layer.ext.js"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Payment/memberList')}');
$(function(){
$("#submit").click(function () {
var id = $("#id").val();
var name = $("#name").val();
var mobile = $("#mobile").val();
var url = "{:U('edit')}";
var data = {id:id,name:name,mobile:mobile};
if (id != 1) {
publicAjax(url,data,function (data) {
layer.msg(data.msg);
if (data.status ==1) {
setTimeout(function(){
window.location.href = "{:U('memberList')}";
},2000)
}
});
return;
}
$.ajax({
type:'post',
dataType:'json',
data:'phone='+mobile,
url:'{:U("Public/telsafecode")}',
success:function(data) {
if (data.status ==1) {
layer.open({
title : '验证码已发送到原手机,请输入验证码',
content : `<input style="margin-left: 30px;width: 230px" type="number" id="verify" name="verify" value="" placeholder="请输入验证码"/>`,
success : function() {
},
yes : function(index, layero) {
var verify = $("#verify").val();
data = {id:id,name:name,mobile:mobile,verify:verify};
publicAjax(url,data,function (data) {
layer.msg(data.msg);
if (data.status ==1) {
setTimeout(function(){
window.location.href = "{:U('memberList')}";
},2000)
}
});
return;
}
});
} else {
alert(data.msg);
}
},
error:function() {
alert('服务器开小差了,请稍后再试。');
}
});
});
function publicAjax(url,senddata,callback) {
$.ajax({
type: 'post',
url: url,
data:senddata,
success: function(data) {
callback(data);
},
error:function(){
MSG.hidemsg();
layer.alert("网络错误或超时");
return false;
}
});
}
});
</script>
</block>

@ -93,6 +93,29 @@
display: block;
}
.page .sch-btn:before{
content: '';
padding: 0;
}
::-webkit-scrollbar {
width: 3px;
height: 3px;
}
::-webkit-scrollbar-track {
border-radius: 3px; /*滚动条的背景区域的圆角*/
}
::-webkit-scrollbar-thumb {
border-radius: 3px; /*滚动条的圆角*/
background-color: #ccc; /*滚动条的背景颜色*/
}
::-webkit-scrollbar-thumb:hover {
background-color: #bbb;
}
::-webkit-scrollbar-thumb:active {
cursor: pointer;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
@ -257,6 +280,68 @@
</if>
{$_page|default=''}
</div>
<div style="width: 800vw;height:600vh;padding: 0;position: absolute;top: 0;z-index: 9999;background-color:rgba(0,0,0,.6);right: 1px;display: none" id="window">
<div class="layui-layer layui-layer-hui" style="width:800px;height:440px;z-index: 19891015; top:28%; left:35%;border-radius: 2%;background-color:white;color: #0a001f;">
<div style="padding: 15px 30px 15px 20px;font-size: 28px;">打款提示</div>
<div class="layui-layer-content" style="font-size: 22px;padding: 0 25px;">您所选打款单与以下打款单可能存在重复,请谨慎操作</div>
<!-- <div style="padding: 0 25px">-->
<!-- <span style="width: 135px;display: block;float: left;height: 30px;text-align: center;border:#c7c7c7 1px solid;border-right:none;"><span style="display: block;padding: 6px 10px">公司</span></span>-->
<!-- <span style="width: 135px;display: block;float: left;height: 30px;text-align: center;border:#c7c7c7 1px solid;border-right:none;"><span style="display: block;padding: 6px 10px">结算时间</span></span>-->
<!-- <span style="width: 135px;display: block;float: left;height: 30px;text-align: center;border:#c7c7c7 1px solid;border-right:none;"><span style="display: block;padding: 6px 10px">结算金额</span></span>-->
<!-- <span style="width: 136px;display: block;float: left;height: 30px;text-align: center;border:#c7c7c7 1px solid;"><span style="display: block;padding: 6px 10px">支付时间</span></span>-->
<!-- </div>-->
<div class="layui-layer-content" style="font-size: 22px;padding: 5px 25px;height: 200px;overflow-x:hidden;overflow-y:scroll">
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>公司</th>
<th>结算时间</th>
<th>结算金额</th>
<th>支付时间</th>
</tr>
</thead>
<!-- 列表 -->
<tbody id="tbody">
<tr>
<td >13214</td>
<td>13214</td>
<td>13214</td>
<td>13214</td>
</tr>
<tr>
<td >13214</td>
<td>13214</td>
<td>13214</td>
<td>13214</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div style="text-align: right;margin-top: 20px">
<div style="font-size: 28px;display: inline-block;">
<div class="search_list" style="justify-content:flex-end;width:100%;">
<div class="input-list" style="float: right;">
<a class="sch-btn" href="javascript:;" style="width: 150px;background: white;border: 1px solid black;color: black" id="back">返回</a>
</div>
</div>
</div>
<div style="padding: 0 20px 0 0;font-size: 28px;display: inline-block;">
<div class="search_list" style="justify-content:flex-end;width:100%;">
<div class="input-list" style="float: right;">
<a class="sch-btn" href="javascript:;" style="width: 150px;" id="commit">确认打款</a>
</div>
</div>
</div>
</div>
</div>
</div>
</block>
<block name="script">
@ -285,6 +370,10 @@
window.location.reload();
}
$("#back,#window").click(function() {
$('#window').hide();
});
$(function(){
$(".verify").click(function () {
@ -406,6 +495,73 @@
});
});
function checkPaymentOrder() {
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
var verifystatus = $(elem).data('verifystatus');
if($(elem).data("pay") == 1 && verifystatus == 1){
return $(elem).val();
}
}).get();
console.log(text)
// text = "47,99,100";
$("#tbody").empty();
$.ajax({
type:'post',
dataType:'json',
data: {'ids':text},
url:"{:U('checkOrder')}",
success:function(data) {
if (data.data.length >0) {
var datas = data.data;
var str = "";
$('#window').show();
for (var key in datas) {
str += "<tr><td>" + datas[key]['company_name'] + "</td>"
+ "<td>"+ datas[key]['time'] + "</td>"
+ "<td>"+ datas[key]['statement_money'] + "</td>"
+ "<td>"+ datas[key]['pay_time'] + "</td></tr>";
}
$("#tbody").append(str);
return true;
} else {
return;
doPayment();
return false;
}
},
error:function() {
alert('服务器开小差了,请稍后再试。');
}
})
}
function doPayment() {
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
var verifystatus = $(elem).data('verifystatus');
if($(elem).data("pay") == 1 && verifystatus == 1){
return $(elem).val();
}
}).get();
text = text.join(",");
window.location.href = "{:U('showPayment')}"+"&ids="+text;
}
$("#commit").on("click",function () {
doPayment();
});
$("#doPayment").on("click",function(){
var verifytip = 0;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
@ -428,6 +584,10 @@
layer.msg("<font style='color:white'>请先选择需要打款的结算单</font>");
return;
}
checkPaymentOrder();
return;
text = text.join(",");
window.location.href = "{:U('showPayment')}"+"&ids="+text;
});

@ -192,7 +192,7 @@
var id = $(this).data("value");
var url = "{:U('del')}"+"&id="+id
layer.confirm('【警告】删除操作将不可回退,如需继续请点击确认', {
layer.confirm('<font style="color: black">是否确定删除该账号,删除后,该账号将无法登入。</font>', {
btn: ['确认','取消'],
title:false
}, function(){

Loading…
Cancel
Save