diff --git a/Application/Payment/Controller/ExcelPaymentController.class.php b/Application/Payment/Controller/ExcelPaymentController.class.php index 15173f0b4..42461ce48 100644 --- a/Application/Payment/Controller/ExcelPaymentController.class.php +++ b/Application/Payment/Controller/ExcelPaymentController.class.php @@ -146,13 +146,13 @@ class ExcelPaymentController extends BaseController $v['create_time'] = time(); $v['statement_num'] = "JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5); if(!isset($company_info['ali_user']) || !isset($company_info['ali_account']) || $company_info['ali_user'] == '' || $company_info['ali_account'] == ''){ - M('ExcelStatementInfo',"tab_")->where("statement_num = '{$v['statement_num']}'")->delete(); - $this->ajaxReturn(["status"=>0,"msg"=>"添加失败"]); + M('ExcelStatementInfo',"tab_")->where("batch_num = '{$v['batch_num']}'")->delete(); + $this->ajaxReturn(["status"=>0,"msg"=>"支付宝真实姓名及登陆账号不允许为空"]); } $res = $ExcelStatementInfo->add($v); if($res === false){ - M('ExcelStatementInfo',"tab_")->where("statement_num = '{$v['statement_num']}'")->delete(); + M('ExcelStatementInfo',"tab_")->where("batch_num = '{$v['batch_num']}'")->delete(); $this->ajaxReturn(["status"=>0,"msg"=>"添加失败"]); } } diff --git a/Application/Payment/View/ExcelPayment/add.html b/Application/Payment/View/ExcelPayment/add.html index 725f16190..b3f83ef70 100644 --- a/Application/Payment/View/ExcelPayment/add.html +++ b/Application/Payment/View/ExcelPayment/add.html @@ -204,6 +204,19 @@ page++; COMPARE.loopCheck(page,callback) }); + }, + checkData:function(callback){ + MSG.showmsg("数据校验中..."); + var d = sendDefaultData.filedata; + for (const key in d) { + var c = d[key].company_info; + if(!c.hasOwnProperty('ali_user') || c.ali_user == '' || !c.hasOwnProperty('ali_account') || c.ali_account == ''){ + MSG.hidemsg(); + layer.msg('支付宝真实姓名及登陆账号不允许为空'); + return false; + } + } + callback(); } } @@ -259,12 +272,14 @@ sendDefaultData.check_page = Math.ceil(sendDefaultData.filedata_count/check_size); sendDefaultData.begin_time = start; sendDefaultData.end_time = end; - - COMPARE.loopCheck(1,function(){ - setTimeout(function(){ - window.location.href="{:U('lists',['row'=>100,'page'=>1,'batch_num'=>$batch])}"; - },1500); - }) + COMPARE.checkData(function(){ + COMPARE.loopCheck(1,function(){ + setTimeout(function(){ + window.location.href="{:U('lists',['row'=>100,'page'=>1,'batch_num'=>$batch])}"; + },1500); + }) + }); + }) }) @@ -297,7 +312,7 @@ reader.readAsBinaryString(f); } reader.onload = function (e) { - MSG.showmsg("文件读取完成,比较命令初始化。。。"); + MSG.showmsg("文件读取完成,添加命令初始化。。。"); var data = e.target.result; if (rABS) { wb = XLSX.read(btoa(fixdata(data)), {