Merge remote-tracking branch 'origin/release' into release

master
zhengyongxing 5 years ago
commit 5626dfaf99

@ -19,47 +19,178 @@ class PromoteCompanyController extends ThinkController
public function lists()
{
$model = M($this->modelName, 'tab_');
$is_export= false;
if (isset($_REQUEST['export']) && $_REQUEST['export']==1){
$is_export = true;
}
$map = [];
$id = intval(I('id', 0));
$promotemap=[];
$company_name = trim(I('company_name'));
if (!empty($id)) {
$map['tab_promote_company.id'] = $id;
$parameter['id'] = $id;
}
if($company_name)
$map['tab_promote_company.company_name'] = array('like',"%{$company_name}%");
if($company_name) $map['tab_promote_company.company_name'] = array('like',"%{$company_name}%");
if (isset($_REQUEST['status']) && $_REQUEST['status'] !== '') {
$status = intval($_REQUEST['status']);
$map['tab_promote_company.status'] = $status;
$parameter['status'] = $status;
}
if (isset($_REQUEST['promote_id'])) {
$map['id'] = M("Promote","tab_")->field("company_id")->where("id={$_REQUEST['promote_id']}")->find()['company_id'];
$promotemap['id']=$_REQUEST['promote_id'];
}
if (isset($_REQUEST['company_type'])) {
$map['company_type'] = $_REQUEST['company_type'];
}
$page = intval(I('get.p', 0));
$page = $page ? $page : 1; //默认显示第一页数据
$row = intval(I('row', 0));
$row = empty($row) ? 10 : $row;//每页条数
$data = $model
->field('tab_promote_company.id,tab_promote_company.company_name,tab_promote_company.status,
tab_promote_company.create_time,sys_member.nickname')
->join('left join sys_member on sys_member.uid = tab_promote_company.uid')
->where($map)
->order('id desc')
->page($page, $row)
->select();
//获取分页公司数据
$companyres = $model->field("*")
->where($map)
->order("last_up_time desc");
if($is_export){
$companyres = $companyres->select();
}else{
$companyres = $companyres->page($page,$row)->select();
}
//获取公司id
$companyids = implode(',', array_column($companyres, 'id'));
//获取所属会长及其游戏分成
$promotemap['company_id']=["in",$companyids];
$promoteres = M("Promote","tab_")
->field("id,company_id,account,settlement_type")
->where($promotemap)
->select();
//获取会长id
$promoteids = implode(',', array_column($promoteres, 'id'));
//获取游戏比例
$gameradiores = M("PromoteGameRatio","tab_")
->alias("pg")
->field("pg.ratio,pg.relation_game_id,pg.turnover_ratio,pg.game_id,pg.promote_id,ga.relation_game_name,ga.game_type_name")
->join("tab_game ga ON pg.game_id = ga.id")
->where(array(
"status"=>1,
"promote_id"=>["in",$promoteids]
))
->group("relation_game_id,promote_id")
->select();
//比例数据处理
$gameradiotemp = array();
foreach($gameradiores as $k=>$v){
$turnover_ratio = json_decode($v['turnover_ratio'],true);
$v['turnover_ratio'] = array(
array("ratio"=>$v['ratio']."%","name"=>"默认比例")
);
foreach($turnover_ratio as $ke=>$va){
$t=array("ratio"=>$va["ratio"]."%");
if(array_key_exists("instanceof",$va)){
//存在
if($va['instanceof']=='1'){
$t['name']="月流水≥".$va['turnover'];
}else{
$t['name']="月流水>".$va['turnover'];
}
}else{
$t['name']="月流水≥".$va['turnover'];
}
$v['turnover_ratio'][]=$t;
}
$v['row'] = count($v['turnover_ratio']);
unset($v["ratio"]);
unset($v["relation_game_id"]);
unset($v["game_id"]);
$gameradiotemp[$v['promote_id']][]=$v;
}
unset($gameradiores);
//会长数据处理
$promoterestemp=[];
foreach($promoteres as $k=>$v){
if(array_key_exists($v['id'],$gameradiotemp)){
//存在
$v['list'] = $gameradiotemp[$v['id']];
foreach($gameradiotemp[$v['id']] as $ke=>$va){
$v['row'] += $va['row'];
}
}else{
$v['list']=[
["relation_game_name"=>"--","game_type_name"=>"--",
"turnover_ratio"=>[
["name"=>"--","ratio"=>"--"]
],
"row"=>1
]
];
$v["row"]=1;
}
if($v['settlement_type'] == 1){
$v['settlement_type']="周结";
}else{
$v['settlement_type']="月结";
}
$promoterestemp[$v['company_id']]["list"][]=$v;
}
unset($promoteres);
//处理公司数据
foreach($companyres as $k=>&$v){
if(array_key_exists($v['id'],$promoterestemp)){
//存在
$v['list'] = $promoterestemp[$v['id']]['list'];
foreach($promoterestemp[$v['id']] as $ke=>$va){
foreach($va as $key=>$val){
$v['row'] += $val['row'];
}
}
}else{
//空值
$v['list']=[
[
"account"=>"--",
"settlement_type"=>"--",
'list'=>[
[
"relation_game_name"=>"--",
"game_type_name"=>"--",
"turnover_ratio"=>[
["name"=>"--","ratio"=>"--"]
],
"row"=>1
]
]
]
];
$v['row'] += 1;
}
if( $v["contact_begin"] >0 ){
$v["contact_begin"] = date('Y/m/d', $v["contact_begin"]);
}else{
$v["contact_begin"] = "--";
}
if( $v["contact_end"] > 0){
$v["contact_end"] = date('Y/m/d', $v["contact_end"]);
}else{
$v["contact_end"] = "--";
}
if($v['platform_name'] == '' || $v['platform_name'] == "0"){
$v['platform_name'] = "--";
}
$v["is_sign_contact"] = ($v["is_sign_contact"]=="1" ? "是" :'否');
}
// dd($companyres);
if($is_export){
$this->assign('listData', $companyres);
$this->display("export");
die();
}
/* 查询记录总数 */
$count = $model
->where($map)
->count();
if (!empty($data)) {
foreach ($data as &$list) {
$list['status'] = ($list['status'] == 0) ? '已关闭' : '已开启';
$list['create_time'] = date('Y-m-d H:i:s', $list['create_time']);
}
}
//分页
$parameter['p'] = $page;
$parameter['row'] = $row;
@ -68,8 +199,9 @@ class PromoteCompanyController extends ThinkController
$this->assign('_page', $page);
}
$this->assign('listData', $data);
$this->assign('listData', $companyres);
$this->assign('count', $count);
$this->assign('promoteList', getPromoteByLevel(1));
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Partner/lists'])->find());
$this->meta_title = '推广公司';
$this->display();
@ -80,77 +212,38 @@ class PromoteCompanyController extends ThinkController
{
if ($_POST) {
$company_name = I('post.company_name', '');
$status = intval(I('post.status', 1));
if (empty($company_name)) {
$this->error('请输入推广公司名称');
}
if (empty(I('post.settlement_contact'))) {
$this->error('请输入结算联系人');
}
if (empty(I('post.contact_phone'))) {
$this->error('请输入联系人电话');
}
$pattern = "/^1[3|5|7|8]\\d{9}$/i";
if(!preg_match($pattern, I('post.contact_phone'))) {
$this->error("手机号码格式不合法");
return false;
}
if (empty(I('post.address'))) {
$this->error('请输入所在地址');
}
if (empty(I('post.bank_card'))) {
$this->error('请输入银行卡号');
}
$bank_card_pattern = "/^\d{10,19}$/u";
if (!preg_match($bank_card_pattern, I('post.bank_card'))) {
$this->error('卡号格式错误');
return false;
}
if (empty(I('post.bank_cardname'))) {
$this->error('请输入银行卡名');
}
if (empty(I('post.bank_name'))) {
$this->error('请输入收款银行');
}
if (empty(I('post.bank_address'))) {
$this->error('请输入开户网点');
}
if (!in_array($status, [0, 1])) {
$this->error('参数异常');
}
if (!empty(I('post.content'))) {
$save['content'] = I('post.content');
}
$model = M($this->modelName, 'tab_');
$map['company_name'] = $company_name;
$res = $model->where($map)->getField('id');
if ($res) {
$this->error('推广公司已存在');
$this->ajaxReturn(array(
'status' => 0,
'info' => "推广公司已经存在"
));
}
$time = time();
$save['company_name'] = $company_name;
$save['status'] = $status;
$save['uid'] = UID;
$save = I('post.');//前端已经验证
$save['create_time'] = $time;
$save['last_up_time'] = $time;
$save['settlement_contact'] = I('post.settlement_contact');
$save['contact_phone'] = I('post.contact_phone');
$save['address'] = I('post.address');
$save['bank_card'] = I('post.bank_card');
$save['bank_cardname'] = I('post.bank_cardname');
$save['bank_name'] = I('post.bank_name');
$save['bank_address'] = I('post.bank_address');
$save['contact_begin']=strtotime($save['contact_begin']);
$save['contact_end']=strtotime($save['contact_end']);
if(isset($save['resources'])){
$save['resources'] = json_encode($save['resources'],JSON_UNESCAPED_UNICODE);
}
$res = $model->add($save);
if ($res) {
\Think\Log::actionLog('PromoteCompany/add', 'partner', $res);
$this->success('保存成功', U('lists'));
$array=array(
"info"=>"添加成功",
"status"=>1
);
$this->ajaxReturn($array);
} else {
$this->error('保存失败');
$this->ajaxReturn(array(
'status' => 0,
'info' => "保存失败"
));
}
} else {
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'PromoteCompany/add'])->find());
@ -158,6 +251,33 @@ class PromoteCompanyController extends ThinkController
$this->display();
}
}
//查看
public function view()
{
$model = M($this->modelName, 'tab_');
$id = $_REQUEST['id'] ?: 0;
$map['id'] = $id;
$data = $model->field('*')->find($id);
if (empty($data)) {
$this->error('数据异常', U('lists'));
}
if($data['contact_begin'] >0){
$data['contact_begin']=date("Y-m-d",$data['contact_begin']);
}else{
$data['contact_begin']='';
}
if($data['contact_end'] >0){
$data['contact_end']=date("Y-m-d",$data['contact_end']);
}else{
$data['contact_end']='';
}
if($data['resources'] == ''){
$data['resources'] ="[]";
}
$this->assign('data', $data);
$this->display();
}
//编辑
public function edit()
@ -165,92 +285,52 @@ class PromoteCompanyController extends ThinkController
$model = M($this->modelName, 'tab_');
if ($_POST) {
$company_name = I('post.company_name', '');
$status = intval(I('post.status', 1));
$id = intval(I('post.id', 0));
if (empty($company_name)) {
$this->error('请输入推广公司名称');
}
if (empty(I('post.settlement_contact'))) {
$this->error('请输入结算联系人');
}
if (empty(I('post.contact_phone'))) {
$this->error('请输入联系人电话');
}
$pattern = "/^1[3|5|7|8]\\d{9}$/i";
if(!preg_match($pattern, I('post.contact_phone'))) {
$this->error("手机号码格式不合法");
return false;
}
if (empty(I('post.address'))) {
$this->error('请输入所在地址');
}
if (empty(I('post.bank_card'))) {
$this->error('请输入银行卡号');
}
$bank_card_pattern = "/^\d{10,19}$/u";
if (!preg_match($bank_card_pattern, I('post.bank_card'))) {
$this->error('卡号格式错误');
return false;
}
if (empty(I('post.bank_cardname'))) {
$this->error('请输入银行卡名');
}
if (empty(I('post.bank_name'))) {
$this->error('请输入收款银行');
}
if (empty(I('post.bank_address'))) {
$this->error('请输入开户网点');
}
if (!in_array($status, [0, 1]) || $id == 0) {
$this->error('参数异常');
}
if (!empty(I('post.content'))) {
$save['content'] = I('post.content');
}
$data = $model->field('id,company_name')->find($id);
if (empty($data)) {
$this->error('数据异常');
}
$map['company_name'] = $company_name;
$res = $model->where($map)->getField('id');
if ($res && $res != $id) {
$this->error('推广公司已存在');
}
$time = time();
$save['id'] = $id;
$save['company_name'] = $company_name;
$save['status'] = $status;
$save = I('post.');//前端已经验证
$save['create_time'] = $time;
$save['last_up_time'] = $time;
$save['settlement_contact'] = I('post.settlement_contact');
$save['contact_phone'] = I('post.contact_phone');
$save['address'] = I('post.address');
$save['bank_card'] = I('post.bank_card');
$save['bank_cardname'] = I('post.bank_cardname');
$save['bank_name'] = I('post.bank_name');
$save['bank_address'] = I('post.bank_address');
$save['contact_begin']=strtotime($save['contact_begin']);
$save['contact_end']=strtotime($save['contact_end']);
if(isset($save['resources'])){
$save['resources'] = json_encode($save['resources'],JSON_UNESCAPED_UNICODE);
}
$res = $model->save($save);
if ($res === false) {
$this->error('保存失败');
if ($res) {
\Think\Log::actionLog('PromoteCompany/edit', 'partner', $res);
$array=array(
"info"=>"修改成功",
"status"=>1
);
$this->ajaxReturn($array);
} else {
\Think\Log::actionLog('PromoteCompany/edit', 'PromoteCompany', $id);
$this->success('保存成功', U('lists'));
$this->ajaxReturn(array(
'status' => 0,
'info' => "修改失败"
));
}
} else {
$id = intval(I('get.id', 0));
$id = $_REQUEST['id'] ?: 0;
$map['id'] = $id;
$data = $model->field('id,company_name,status,settlement_contact,contact_phone,address,bank_card,bank_cardname,bank_name,bank_address,content')->find($id);
$data = $model->field('*')->find($id);
if (empty($data)) {
$this->error('数据异常', U('lists'));
}
if($data['contact_begin'] >0){
$data['contact_begin']=date("Y-m-d",$data['contact_begin']);
}else{
$data['contact_begin']='';
}
if($data['contact_end'] >0){
$data['contact_end']=date("Y-m-d",$data['contact_end']);
}else{
$data['contact_end']='';
}
if($data['resources'] == ''){
$data['resources'] ="[]";
}
$this->assign('data', $data);
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'PromoteCompany/edit'])->find());
$this->meta_title = '编辑推广公司';
$this->display();
}
}
@ -258,24 +338,92 @@ class PromoteCompanyController extends ThinkController
//删除
public function del()
{
if (!empty($_POST['ids'])) {
if (!is_array($_POST['ids'])) {
$model = M($this->modelName, 'tab_');
if (!empty($_POST['id'])) {
if (!is_array($_POST['id'])) {
$this->error('参数异常');
}
$id = implode(',', $_POST['ids']);
$id = $_POST['id'];
} else {
$id = intval(I('get.id', 0));
if ($id == 0) {
$this->error('参数异常');
}
}
$res = M($this->modelName, 'tab_')->delete($id);
//删除所有资源
$data = $model->field('resources')->find($id)['resources'];
$data = json_encode($data,true);
if(is_array($data) && count($data) >0){
foreach($data as $k=>$v){
unlink("./".$v['file_path']);
}
}
$res = $model->delete($id);
//删除对应的推广员
if ($res === false) {
$this->error('删除失败');
}
$this->success('删除成功', U('lists'));
}
//处理上传图片
public function saveFile()
{
$path = '/Uploads/';
$upload = new \Think\Upload();// 实例化上传类
$upload->maxSize = 0 ;// 设置附件上传大小
$upload->exts = '';// 设置附件上传类型
$upload->rootPath = '.'.$path; // 设置附件上传根目录
$upload->savePath = ''; // 设置附件上传(子)目录
// 上传文件
$info = $upload->upload();
// dump($info);
if(!$info) {// 上传错误提示错误信息
$msg = $upload->getError();
$array= array('status' => 0, 'info' => $msg);
}else{// 上传成功
$array=array(
"info"=>"上传成功",
"status"=>1,
"file_path"=>$path.$info['file']['savepath'].$info['file']['savename'],
"file_name"=>$_POST['file_name'],
"file_type"=>$_FILES['file']['type'],
"file_size"=>$_FILES['file']['size'],
"upload_time"=>date("Y-m-d H:i:s",time())
);
}
$this->ajaxReturn($array);
}
//删除图片
public function delFile()
{
$id = $_REQUEST['id'];
$file_path = $_REQUEST['file_path'] ?: false;
unlink("./".$file_path);
if($id == 0){
$this->ajaxReturn(array(
'status' => 1,
'info' => "删除成功"
));
}else{
//需要修改
$array = array(
"resources"=>json_encode($_REQUEST['resources'],JSON_UNESCAPED_UNICODE)
);
$res = M($this->modelName, 'tab_')->where("id='{$id}'")->save($array);
if($res === false){
$this->ajaxReturn(array(
'status' => 0,
'info' => "删除保存失败"
));
}else{
$this->ajaxReturn(array(
'status' => 1,
'info' => "删除成功"
));
}
}
# code...
}
}

@ -2,6 +2,8 @@
<block name="css">
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<link rel="stylesheet" type="text/css" href="__STATIC__/webuploader/webuploader.css" media="all">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<style>
#form .txt_area.download_url {width:400px;}
.tabcon1711 .table_radio2 .table_btn {width:215px;}
@ -14,7 +16,23 @@
<script type="text/javascript" src="__STATIC__/webuploader/webuploader.js"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"charset="UTF-8"></script>
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
<script src="__STATIC__/czinputcheck.js?v=1.29" type="text/javascript"></script>
<style>
.coin-detail{
display: block;
float: left;
text-align: center;
line-height: 35px;
width: 100px;
height: 35px;
font-size: 14px;
border-radius: 4px;
cursor: pointer;
}
</style>
<!-- 标签页导航 -->
<div class="tab-wrap">
@ -24,7 +42,7 @@
<div class="tab-content tabcon1711">
<!-- 表单 -->
<form id="form" action="{:U('add')}" method="post" class="form-horizontal">
<!-- <form id="form" action="{:U('add')}" method="post" class="form-horizontal"> -->
<!-- 基础 -->
<div id="tab1" class="tab-pane in tab1 ">
<table border="0" cellspacing="0" cellpadding="0">
@ -35,6 +53,73 @@
<input type="text" class="txt " name="company_name" value="" placeholder="请输入推广公司名称">
</td>
</tr>
<tr>
<td class="l">对应平台(简称):</td>
<td class="r" >
<input type="text" class="txt " name="platform_name" value="" placeholder="请输入对应平台">
</td>
</tr>
<tr>
<td class="l">合同期限:</td>
<td class="r" >
<div class="input-list" style="margin:0;">
<input type="text" readonly id="contact_begin" name="contact_begin" class="" value="{:I('contact_begin')}"
placeholder="合同开始时间" />
&nbsp;-&nbsp;
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="contact_end" name="contact_end" class="" value="{:I('contact_end')}"
placeholder="合同结束时间" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
</td>
</tr>
<tr>
<td class="l">开票税点:</td>
<td class="r" >
<input type="number" class="txt" name="fax_ratio" value="0" placeholder="请输入开票税点">
<span>%</span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>公司性质:</td>
<td class="r" >
<div class="input-list input-list-server search_label_rehab" style="margin:0;">
<select id="company_type" name="company_type" class="select_gallery" style="width: 215px;">
<option value="">请选择公司性质</option>
<option value="1">公司</option>
<option value="2">个人</option>
</select>
</div>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>是否签署合同:</td>
<td class="r" >
<div class="input-list input-list-server search_label_rehab" style="margin:0;">
<select id="is_sign_contact" name="is_sign_contact" class="select_gallery" style="width: 215px;">
<option value="">请选择是否签署合同</option>
<option value="0"></option>
<option value="1"></option>
</select>
</div>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>团体归属:</td>
<td class="r" >
<div class="input-list input-list-server search_label_rehab" style="margin:0;">
<select id="company_belong" name="company_belong" class="select_gallery" style="width: 215px;">
<option value="">请选择团体归属</option>
<option value="0">内团</option>
<option value="1">外团</option>
<option value="2">外团-分发</option>
<option value="3">其他</option>
</select>
</div>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>联系结算人:</td>
<td class="r" >
@ -59,12 +144,12 @@
<input type="text" class="txt " name="bank_card" value="" placeholder="请输入银行卡号">
</td>
</tr>
<tr>
<!-- <tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>银行卡名:</td>
<td class="r" >
<input type="text" class="txt " name="bank_cardname" value="" placeholder="请输入银行卡名">
</td>
</tr>
</tr> -->
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>收款银行:</td>
<td class="r" >
@ -97,18 +182,30 @@
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">文档管理</td>
<td class="r table_radio">
<div class="coin-detail" data-url="{:U('PromoteCompany/addfile')}" style="margin:0px;background: #fff;color: #333;font-weight: 400;border: 1px solid #777;">
添加
</div>
</td>
</tr>
</tbody>
</table>
<table border="1" style="width: 600px;text-align: center;" cellspacing="0" cellpadding="0" id="docShow">
</table>
</div>
<div class="form-item cf">
<button class="submit_btn ajax-post" id="submit" type="submit" target-form="form-horizontal" style="margin-left:210px;">
<div class="form-item cf" style="margin-bottom: 40px;">
<button class="submit_btn " id="submit" style="margin-left:210px;">
保存
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:history.back(-1);" >
返回
</a>
</div>
</form>
<!-- </form> -->
</div>
</div>
<div class="common_settings">
@ -119,7 +216,29 @@
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
<script type="text/html" id="doctpl">
{@each list as it,index}
{@if index==0}
<thead>
<tr>
<th>文档名称</th>
<th>上传时间</th>
<th style="width:150px;">操作</th>
</tr>
</thead>
{@/if}
<tr>
<td style="padding:0;">${it.file_name}</td>
<td>${it.upload_time}</td>
<td>
<a class="filedown" data-index="${index}" data-path="${it.file_path}">下载</a>
<a class="filedel" data-index="${index}" data-path="${it.file_path}">删除</a>
</td>
</tr>
{@/each}
</script>
</block>
<block name="script">
@ -130,4 +249,137 @@
$('#form').submit();
});
</script>
<script>
var doc = [];
function addFile(info) {
doc.push(info);
layer.closeAll();
PROMOTE.juicerFun();
// window.parent.addFile(info);
}
$('#contact_begin').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left'
})
$(".coin-detail").click(function () {
var url = $(this).data('url');
var title = '文档添加';
layer.open({
type: 2,
title: title,
shadeClose: true,
shade: 0.8,
area: ['40%', '60%'],
content: url
});
});
$("#submit").on("click",function(){
var obj = {
"company_name":["required","推广公司名称不允许为空"],
"platform_name":["nocheck"],
"contact_begin":["date","合同开始时间不能为空"],
"contact_end":["date","合同结束时间不能为空"],
"fax_ratio":["number","开票税率必须是数字如果无此项请填0"],
"company_type":["required","公司性质不能为空","select"],
"is_sign_contact":["required","是否签署合同项不能为空","select"],
"company_belong":["required","团体归属不能为空","select"],
"settlement_contact":["required","结算联系人不能为空"],
"contact_phone":["phone","联系人电话格式不对或不能为空"],
"address":["required","联系人地址不能为空"],
"bank_card":["bankid","银行卡格式错误或不能为空"],
"bank_name":["required","银行名称不能为空"],
"bank_address":["required","银行开户网点不能为空"],
"content":["nocheck"],
"status":["nocheck","","radio"]
}
var cres = CIC.checkAddInput(obj);
if(!cres){
return false;
}
if (Date.parse(cres.contact_begin) > Date.parse(cres.contact_end)) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
//验证通过
if(doc.length > 0){
cres.resources = doc;
}
//添加
$.ajax({
url:"{:U('PromoteCompany/add')}",
type:"post",
data:cres,
dataType:"json",
success:function(data){
if(data.status == 1){
layer.msg(data.info,function(){
window.location.href="{:U('PromoteCompany/lists')}";
});
}else{
layer.msg(data.info);
}
},
error:function(e){
}
});
})
var PROMOTE = {
juicerFun(){
var tpl =$("#doctpl").html();
var html = juicer(tpl, {list:doc});
$("#docShow").html(html);
PROMOTE.juicerEvent();
},
juicerEvent(){
$(".filedown,.filedel").off("click");
$(".filedown").on("click",function(){
var url = window.location.protocol+"//"+window.location.host+$(this).data("path");
// window.open(url,"_blank");
var link = document.createElement('a');
link.setAttribute("download", "");
link.href = url;
link.click()
});
$(".filedel").on("click",function(){
var path = $(this).data("path");
var index = $(this).data("index");
console.log(index);
var id = 0;
$.ajax({
url:"{:U('PromoteCompany/delFile')}",
type:"post",
data:{
"id":0,
"file_path":path
},
dataType:"json",
success:function(data){
if(data.status == 1){
doc.splice(index,1)
PROMOTE.juicerFun();
}else{
layer.alert(data.info);
}
},
error:function(e){
}
});
})
}
}
</script>
</block>

@ -0,0 +1,86 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title></title>
<link href="http://admin.vlcms.com/Public/icon.ico" type="image/x-icon" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/module.css">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
</head>
<style>
html {
min-width:100%;
}
body {
padding: 0px;
}
</style>
<body>
<div id="main" class="main" style="min-height: 342px;margin-top: 20px;padding-left: 50px;">
<table border="0" cellspacing="0" cellpadding="0">
<tr style="padding: 10px;height: 50px;">
<td class="l" style="width: 100px;">文件名称:</td>
<td class="r" style="margin-left: 10px;">
<input type="text" id="filename" name="company_name" value="" placeholder="请输入文件名称">
</td>
</tr>
<tr style="padding: 10px;height: 50px;">
<td class="l">文件选择:</td>
<td >
<input type="file" id="fileinput" name="file">
</td>
</tr>
</table>
<div class="jssearch search_list fl cf">
<div class="input-list">
<div class="sch-btn uploadfile" style="width: 100px;padding: 5px;">确认添加</div>
</div>
</div>
</div>
<script>
$(function(){
$(".uploadfile").on("click",function(){
var formData = new FormData();
var filename = $("#filename").val();
if(filename == ''){
layer.msg("文件名不能为空");
return false;
}
formData.append("file_name", filename);
formData.append("file", document.getElementById("fileinput").files[0]);
var index = layer.load();
$.ajax({
url:"{:U('PromoteCompany/saveFile')}",
type:"post",
data:formData,
processData:false,
contentType:false,
success:function(data){
layer.close(index);
if(data.status == 1){
delete data.status;
delete data.info;
window.parent.addFile(data);
}else{
layer.alert(data.info);
}
},
error:function(e){
}
});
})
});
</script>
</body>
</html>

@ -2,6 +2,8 @@
<block name="css">
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<link rel="stylesheet" type="text/css" href="__STATIC__/webuploader/webuploader.css" media="all">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<style>
#form .txt_area.download_url {width:400px;}
.tabcon1711 .table_radio2 .table_btn {width:215px;}
@ -14,17 +16,33 @@
<script type="text/javascript" src="__STATIC__/webuploader/webuploader.js"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"charset="UTF-8"></script>
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
<script src="__STATIC__/czinputcheck.js?v=1.29" type="text/javascript"></script>
<style>
.coin-detail{
display: block;
float: left;
text-align: center;
line-height: 35px;
width: 100px;
height: 35px;
font-size: 14px;
border-radius: 4px;
cursor: pointer;
}
</style>
<!-- 标签页导航 -->
<div class="tab-wrap">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<h3 class="page_title">推广公司编辑</h3>
</div>
<div class="tab-content tabcon1711">
<!-- 表单 -->
<form id="form" action="{:U('edit')}" method="post" class="form-horizontal">
<!-- <form id="form" action="{:U('add')}" method="post" class="form-horizontal"> -->
<!-- 基础 -->
<div id="tab1" class="tab-pane in tab1 ">
<table border="0" cellspacing="0" cellpadding="0">
@ -35,6 +53,81 @@
<input type="text" class="txt " name="company_name" value="{$data.company_name}" placeholder="请输入推广公司名称">
</td>
</tr>
<tr>
<td class="l">对应平台(简称):</td>
<td class="r" >
<input type="text" class="txt " name="platform_name" value="{$data.platform_name}" placeholder="请输入对应平台">
</td>
</tr>
<tr>
<td class="l">合同期限:</td>
<td class="r" >
<div class="input-list" style="margin:0;">
<input type="text" readonly id="contact_begin" name="contact_begin" class="" value="{$data.contact_begin}"
placeholder="合同开始时间" />
&nbsp;-&nbsp;
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="contact_end" name="contact_end" class="" value="{$data.contact_end}"
placeholder="合同结束时间" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
</td>
</tr>
<tr>
<td class="l">开票税点:</td>
<td class="r" >
<input type="number" class="txt" name="fax_ratio" value="{$data.fax_ratio}" placeholder="请输入开票税点">
<span>%</span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>公司性质:</td>
<td class="r" >
<div class="input-list input-list-server search_label_rehab" style="margin:0;">
<select id="company_type" name="company_type" class="select_gallery" style="width: 215px;">
<option value="">请选择公司性质</option>
<option value="1" <if condition="$data['company_type'] eq 1">selected
</if>>公司</option>
<option value="2" <if condition="$data.company_type eq 2">selected
</if>>个人</option>
</select>
</div>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>是否签署合同:</td>
<td class="r" >
<div class="input-list input-list-server search_label_rehab" style="margin:0;">
<select id="is_sign_contact" name="is_sign_contact" class="select_gallery" style="width: 215px;">
<option value="">请选择是否签署合同</option>
<option value="0" <if condition="$data['is_sign_contact'] eq 0">selected
</if>>否</option>
<option value="1" <if condition="$data['is_sign_contact'] eq 1">selected
</if>>是</option>
</select>
</div>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>团体归属:</td>
<td class="r" >
<div class="input-list input-list-server search_label_rehab" style="margin:0;">
<select id="company_belong" name="company_belong" class="select_gallery" style="width: 215px;">
<option value="">请选择团体归属</option>
<option value="0" <if condition="$data['company_belong'] eq 0">selected
</if>>内团</option>
<option value="1" <if condition="$data['company_belong'] eq 1">selected
</if>>外团</option>
<option value="2" <if condition="$data['company_belong'] eq 2">selected
</if>>外团-分发</option>
<option value="3" <if condition="$data['company_belong'] eq 3">selected
</if>>其他</option>
</select>
</div>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>联系结算人:</td>
<td class="r" >
@ -59,12 +152,12 @@
<input type="text" class="txt " name="bank_card" value="{$data.bank_card}" placeholder="请输入银行卡号">
</td>
</tr>
<tr>
<!-- <tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>银行卡名:</td>
<td class="r" >
<input type="text" class="txt " name="bank_cardname" value="{$data.bank_cardname}" placeholder="请输入银行卡名">
<input type="text" class="txt " name="bank_cardname" value="" placeholder="请输入银行卡名">
</td>
</tr>
</tr> -->
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>收款银行:</td>
<td class="r" >
@ -88,49 +181,235 @@
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<input type="radio" class="inp_radio" value="1" name="status"
<eq name="data.status" value="1"> checked </eq>> 开启
<input type="radio" class="inp_radio" value="1" name="status" <if condition="$data['status'] eq 1">checked
</if>> 开启
</label>
<label>
<input type="radio" class="inp_radio" value="0" name="status"
<eq name="data.status" value="0"> checked </eq>> 关闭
<input type="radio" class="inp_radio" value="0" name="status" <if condition="$data['status'] eq 0">checked
</if>> 关闭
</label>
</span>
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">文档管理</td>
<td class="r table_radio">
<div class="coin-detail" data-url="{:U('PromoteCompany/addfile')}" style="margin:0px;background: #fff;color: #333;font-weight: 400;border: 1px solid #777;">
添加
</div>
<span style="margin-left:30px;color: red;">
* 新增加文档需要保存修改后生效,删除文档即时生效(取消保存修改也生效,请慎重删除)
</span>
</td>
</tr>
</tbody>
</table>
<table border="1" style="width: 600px;text-align: center;margin:10px 0 0 60px;" cellspacing="0" cellpadding="0" id="docShow">
</table>
</div>
<div class="form-item cf">
<input type="hidden" name="id" value="{$data.id}">
<button class="submit_btn ajax-post" id="submit" type="submit" target-form="form-horizontal" style="margin-left:210px;">
<div class="form-item cf" style="margin-bottom: 40px;">
<button class="submit_btn " id="submit" style="margin-left:210px;">
保存
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="{:U('Partner/lists')}" >
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:history.back(-1);" >
返回
</a>
</div>
</form>
<!-- </form> -->
</div>
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$meta_title}">
<input type="hidden" name="url" value="Partner/edit">
<input type="hidden" name="url" value="Partner/add">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
<script type="text/html" id="doctpl">
{@each list as it,index}
{@if index==0}
<thead>
<tr>
<th>文档名称</th>
<th>上传时间</th>
<th style="width:150px;">操作</th>
</tr>
</thead>
{@/if}
<tr>
<td style="padding:0;">${it.file_name}</td>
<td>${it.upload_time}</td>
<td>
<a class="filedown" data-index="${index}" data-path="${it.file_path}">下载</a>
<a class="filedel" data-index="${index}" data-path="${it.file_path}">删除</a>
</td>
</tr>
{@/each}
</script>
</block>
<block name="script">
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('Partner/lists')}");
highlight_subnav("{:U('PromoteCompany/lists')}");
$('#submit').click(function(){
$('#form').submit();
});
var PROMOTE = {
juicerFun(){
var tpl =$("#doctpl").html();
var html = juicer(tpl, {list:doc});
$("#docShow").html(html);
PROMOTE.juicerEvent();
},
juicerEvent(){
$(".filedown,.filedel").off("click");
$(".filedown").on("click",function(){
var url = window.location.protocol+"//"+window.location.host+$(this).data("path");
// window.open(url,"_blank");
var link = document.createElement('a');
link.setAttribute("download", "");
link.href = url;
link.click()
});
$(".filedel").on("click",function(){
layer.confirm('删除将即时生效,并且无法回退。请慎重选择', {icon: 2, title:'删除提示'}, function(index){
var path = $(this).data("path");
var index = $(this).data("index");
var id = {$data.id};
var doccopy = doc.concat();
doccopy.splice(index,1)
$.ajax({
url:"{:U('PromoteCompany/delFile')}",
type:"post",
data:{
"id":id,
"file_path":path,
"resources":doccopy
},
dataType:"json",
success:function(data){
if(data.status == 1){
doc.splice(index,1);
layer.msg(data.info,function(){
PROMOTE.juicerFun();
});
}else{
layer.alert(data.info);
}
},
error:function(e){
}
});
});
})
}
}
</script>
<script>
var doc = {$data.resources};
if(!doc){
doc = [];
}
var id = {$data.id};
PROMOTE.juicerFun();
function addFile(info) {
doc.push(info);
layer.closeAll();
PROMOTE.juicerFun();
// window.parent.addFile(info);
}
$('#contact_begin').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left'
})
$(".coin-detail").click(function () {
var url = $(this).data('url');
var title = '文档添加';
layer.open({
type: 2,
title: title,
shadeClose: true,
shade: 0.8,
area: ['40%', '60%'],
content: url
});
});
$("#submit").on("click",function(){
var obj = {
"company_name":["required","推广公司名称不允许为空"],
"platform_name":["nocheck"],
"contact_begin":["date","合同开始时间不能为空"],
"contact_end":["date","合同结束时间不能为空"],
"fax_ratio":["number","开票税率必须是数字如果无此项请填0"],
"company_type":["required","公司性质不能为空","select"],
"is_sign_contact":["required","是否签署合同项不能为空","select"],
"company_belong":["required","团体归属不能为空","select"],
"settlement_contact":["required","结算联系人不能为空"],
"contact_phone":["phone","联系人电话格式不对或不能为空"],
"address":["required","联系人地址不能为空"],
"bank_card":["bankid","银行卡格式错误或不能为空"],
"bank_name":["required","银行名称不能为空"],
"bank_address":["required","银行开户网点不能为空"],
"content":["nocheck"],
"status":["nocheck","","radio"]
}
var cres = CIC.checkAddInput(obj);
if(!cres){
return false;
}
if (Date.parse(cres.contact_begin) > Date.parse(cres.contact_end)) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
//资源不需要二次修改
cres.resources = doc;
cres.id = id;
//添加
$.ajax({
url:"{:U('PromoteCompany/edit')}",
type:"post",
data:cres,
dataType:"json",
success:function(data){
if(data.status == 1){
layer.msg(data.info,function(){
window.location.href="{:U('PromoteCompany/lists')}";
});
}else{
layer.msg(data.info);
}
},
error:function(e){
}
});
})
</script>
</block>

@ -0,0 +1,178 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>游戏登陆列表|----软件管理平台</title>
<link href="http://admin.vlcms.com/Public/icon.ico" type="image/x-icon" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/module.css">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script src="__STATIC__/table2excel.js"></script>
</head>
<style>
html {
min-width:100%;
}
body {
padding: 0px;
}
</style>
<body>
<div style="margin:auto;font-size: 20px;color: red;line-height: 3;padding: 20px;">
导出进行中。。。<br/>
如果导出成功你也可以手动关闭此页面
</div>
<table border="1" id="exporttable" style="opacity: 0;">
<!-- 表头 -->
<thead>
<tr>
<th>合作方名称</th>
<th>对应平台</th>
<th>合同期限</th>
<th>开票税点</th>
<th>开户行</th>
<th>银行账号</th>
<th>是否签署合同</th>
<th>备注</th>
<th>会长账号</th>
<th>结算周期</th>
<th>产品类型</th>
<th>游戏名称</th>
<th colspan="2">合作方分成比例</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="listData">
<td colspan="99" class="text-center">aOh! 暂时还没有内容!</td>
<else />
<volist name="listData" id="data" key="companykey">
<tr>
<td rowspan="{$data.row}">{$data.company_name}</td>
<td rowspan="{$data.row}">{$data.platform_name}</td>
<td rowspan="{$data.row}">{$data.contact_begin} - {$data.contact_end}</td>
<td rowspan="{$data.row}">{$data.fax_ratio}%</td>
<td rowspan="{$data.row}">{$data.bank_name}</td>
<td rowspan="{$data.row}">{$data.bank_card}</td>
<td rowspan="{$data.row}">{$data.is_sign_contact}</td>
<td rowspan="{$data.row}">{$data.content}</td>
<notempty name="data.list">
<foreach name="data['list']" item="promote" key="promotekey">
<if condition="$promotekey gt 0">
<tr>
<td rowspan="{$promote['row']}"> {$promote['account']}</td>
<td rowspan="{$promote['row']}"> {$promote['settlement_type']}</td>
<foreach name="promote['list']" item="game" key="gamekey">
<if condition="$gamekey gt 0">
<tr>
<td rowspan="{$game['row']}">{$game['game_type_name']}</td>
<td rowspan="{$game['row']}">{$game['relation_game_name']}</td>
<foreach name="game['turnover_ratio']" item="ratio" key="ratiokey">
<if condition="$ratiokey gt 0">
<tr>
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</tr>
<else />
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</if>
</foreach>
</tr>
<else />
<td rowspan="{$game['row']}">{$game['game_type_name']}</td>
<td rowspan="{$game['row']}">{$game['relation_game_name']}</td>
<foreach name="game['turnover_ratio']" item="ratio" key="ratiokey">
<if condition="$ratiokey gt 0">
<tr>
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</tr>
<else />
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</if>
</foreach>
</if>
</foreach>
</tr>
<else />
<td rowspan="{$promote['row']}"> {$promote['account']}</td>
<td rowspan="{$promote['row']}"> {$promote['settlement_type']}</td>
<foreach name="promote['list']" item="game" key="gamekey">
<if condition="$gamekey eq 0">
<td rowspan="{$game['row']}">{$game['game_type_name']}</td>
<td rowspan="{$game['row']}">{$game['relation_game_name']}</td>
<foreach name="game['turnover_ratio']" item="ratio" key="ratiokey">
<if condition="$ratiokey gt 0">
<tr>
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</tr>
<else />
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</if>
</foreach>
<else />
<tr>
<td rowspan="{$game['row']}">{$game['game_type_name']}</td>
<td rowspan="{$game['row']}">{$game['relation_game_name']}</td>
<foreach name="game['turnover_ratio']" item="ratio" key="ratiokey">
<if condition="$ratiokey gt 0">
<tr>
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</tr>
<else />
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</if>
</foreach>
</tr>
</if>
</foreach>
</if>
</foreach>
</notempty>
</tr>
</volist>
</empty>
</tbody>
</table>
<script>
$(function(){
$("#exporttable").table2excel({
filename: "推广公司.xls", // do include extension
preserveColors: false // set to true if you want background colors and font colors preserved
});
//搜索功能
$("#search").click(function(){
console.log(222);
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if ( url.indexOf('?')>0 ){
url += '&' + query;
} else {
url += '?' + query;
}
window.parent.reloadIframe(url);
parent.document.getElementsByTagName('iframe').src = url;
});
});
</script>
</body>
</html>

@ -29,28 +29,56 @@
.data_list table td{
text-indent:0;
}
.data_game_list table td{
line-height:1;
padding: 3px;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">{$meta_title}</h3>
<p class="description_text">说明:该功能是用于录入工会所属的推广公司名称</p>
</div>
<div class="jssearch search_list fl cf">
<div class="cf top_nav_list">
<div class="fl button_list">
<div class="tools">
<a class="" href="{:U('add')}"><span class="button_icon button_icon1"></span>新增</a>
<a class="ajax-post confirm " target-form="ids" url="{:U('del')}"><span class="button_icon button_icon2"></span>删除</a>
<!-- <a class="ajax-post confirm " target-form="ids" url="{:U('del')}"><span class="button_icon button_icon2"></span>删除</a> -->
</div>
</div>
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="sleft">
<input type="text" name="company_name" class="search-input" value="{:I('company_name')}" placeholder="请输入公司名称搜索">
<a class="sch-btn" href="javascript:;" id="search" url="__SELF__">搜索</a>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list">
<input style="width: 200px;" type="text" name="company_name" class="search-input" value="{:I('company_name')}" placeholder="请输入公司名称搜索">&nbsp;
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="promote_id" name="promote_id" class="select_gallery" style="width: 200px;">
<option value="">推广员账号</option>
<volist name="promoteList" id="vo">
<option promote-id="{$vo.id}" value="{$vo.id}">{$vo.account}({$vo.real_name})</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="company_type" name="company_type" class="select_gallery">
<option value="">请选择公司性质</option>
<option value="1" <?php echo I('company_type') === 1 ? "selected" : ''?>>公司</option>
<option value="2" <?php echo I('company_type') == 2 ? "selected" : ''?>>个人</option>
</select>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('PromoteCompany/lists','model='.$model['name'].'&row='.I('row'),false)}">搜索</a>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="downloadexcel" url="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}">导出excel</a>
</div>
</div>
</div>
</div>
@ -58,37 +86,127 @@
<!-- 数据列表 -->
<div class="data_list data_game_list">
<div class="">
<table>
<table border="1">
<!-- 表头 -->
<thead>
<tr>
<th>
<input class="check-all" type="checkbox">
</th>
<th>推广公司</th>
<th>显示状态</th>
<th>添加人</th>
<th>添加时间</th>
<th style="width:10%;min-width:150px;">操作</th>
<th>合作方名称</th>
<th>对应平台</th>
<th>合同期限</th>
<th>开票税点</th>
<th>开户行</th>
<th>银行账号</th>
<th>是否签署合同</th>
<th>备注</th>
<th>会长账号</th>
<th>结算周期</th>
<th>产品类型</th>
<th>游戏名称</th>
<th colspan="2">合作方分成比例</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="listData">
<td colspan="6" class="text-center">aOh! 暂时还没有内容!</td>
<td colspan="99" class="text-center">aOh! 暂时还没有内容!</td>
<else />
<volist name="listData" id="data">
<volist name="listData" id="data" key="companykey">
<tr>
<td><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td>{$data.company_name}</td>
<td>{$data.status}</td>
<td>{$data.nickname}</td>
<td>{$data.create_time}</td>
<td>
<td rowspan="{$data.row}">
<a href="{:U('view',array('id'=>$data['id']))}">查看</a>
<a href="{:U('edit',array('id'=>$data['id']))}">编辑</a>
<a href="{:U('del',array('id'=>$data['id']))}" class="confirm ajax-get">删除</a>
<a href="{:U('del',array('id'=>$data['id']))}" style="color: red;" class="confirm ajax-get">删除</a>
</td>
<td rowspan="{$data.row}">{$data.company_name}</td>
<td rowspan="{$data.row}">{$data.platform_name}</td>
<td rowspan="{$data.row}">{$data.contact_begin} - {$data.contact_end}</td>
<td rowspan="{$data.row}">{$data.fax_ratio}%</td>
<td rowspan="{$data.row}">{$data.bank_name}</td>
<td rowspan="{$data.row}">{$data.bank_card}</td>
<td rowspan="{$data.row}">{$data.is_sign_contact}</td>
<td rowspan="{$data.row}">{$data.content}</td>
<notempty name="data.list">
<foreach name="data['list']" item="promote" key="promotekey">
<if condition="$promotekey gt 0">
<tr>
<td rowspan="{$promote['row']}"> {$promote['account']}</td>
<td rowspan="{$promote['row']}"> {$promote['settlement_type']}</td>
<foreach name="promote['list']" item="game" key="gamekey">
<if condition="$gamekey gt 0">
<tr>
<td rowspan="{$game['row']}">{$game['game_type_name']}</td>
<td rowspan="{$game['row']}">{$game['relation_game_name']}</td>
<foreach name="game['turnover_ratio']" item="ratio" key="ratiokey">
<if condition="$ratiokey gt 0">
<tr>
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</tr>
<else />
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</if>
</foreach>
</tr>
<else />
<td rowspan="{$game['row']}">{$game['game_type_name']}</td>
<td rowspan="{$game['row']}">{$game['relation_game_name']}</td>
<foreach name="game['turnover_ratio']" item="ratio" key="ratiokey">
<if condition="$ratiokey gt 0">
<tr>
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</tr>
<else />
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</if>
</foreach>
</if>
</foreach>
</tr>
<else />
<td rowspan="{$promote['row']}"> {$promote['account']}</td>
<td rowspan="{$promote['row']}"> {$promote['settlement_type']}</td>
<foreach name="promote['list']" item="game" key="gamekey">
<if condition="$gamekey eq 0">
<td rowspan="{$game['row']}">{$game['game_type_name']}</td>
<td rowspan="{$game['row']}">{$game['relation_game_name']}</td>
<foreach name="game['turnover_ratio']" item="ratio" key="ratiokey">
<if condition="$ratiokey gt 0">
<tr>
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</tr>
<else />
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</if>
</foreach>
<else />
<tr>
<td rowspan="{$game['row']}">{$game['game_type_name']}</td>
<td rowspan="{$game['row']}">{$game['relation_game_name']}</td>
<foreach name="game['turnover_ratio']" item="ratio" key="ratiokey">
<if condition="$ratiokey gt 0">
<tr>
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</tr>
<else />
<td>{$ratio['name']}</td>
<td>{$ratio['ratio']}</td>
</if>
</foreach>
</tr>
</if>
</foreach>
</if>
</foreach>
</notempty>
</tr>
</volist>
</empty>
@ -100,14 +218,14 @@
{$_page|default=''}
</div>
<div class="common_settings">
<!-- <div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$meta_title}">
<input type="hidden" name="url" value="Partner/lists">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</div> -->
</block>
@ -151,6 +269,19 @@
window.location.href = url;
});
$("#downloadexcel").on("click",function(){
var url = $(this).attr("url");
var title = '推广公司导出';
layer.open({
type: 2,
title: title,
shadeClose: true,
shade: 0.8,
area: ['40%', '60%'],
content: url
});
})
//回车自动提交
$('.jssearch').find('input').keyup(function(event){

@ -0,0 +1,377 @@
<extend name="Public/base" />
<block name="css">
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<link rel="stylesheet" type="text/css" href="__STATIC__/webuploader/webuploader.css" media="all">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<style>
#form .txt_area.download_url {width:400px;}
.tabcon1711 .table_radio2 .table_btn {width:215px;}
</style>
</block>
<block name="body">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script src="__STATIC__/md5.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="__STATIC__/webuploader/webuploader.js"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"charset="UTF-8"></script>
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
<script src="__STATIC__/czinputcheck.js?v=1.29" type="text/javascript"></script>
<style>
.coin-detail{
display: block;
float: left;
text-align: center;
line-height: 35px;
width: 100px;
height: 35px;
font-size: 14px;
border-radius: 4px;
cursor: pointer;
}
</style>
<!-- 标签页导航 -->
<div class="tab-wrap">
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">推广公司查看</h3>
</div>
<div class="tab-content tabcon1711">
<!-- 表单 -->
<!-- <form id="form" action="{:U('add')}" method="post" class="form-horizontal"> -->
<!-- 基础 -->
<div id="tab1" class="tab-pane in tab1 ">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">推广公司名称:</td>
<td class="r" >
<input type="text" class="txt " name="company_name" value="{$data.company_name}" readonly placeholder="请输入推广公司名称">
</td>
</tr>
<tr>
<td class="l">对应平台(简称):</td>
<td class="r" >
<input type="text" class="txt " name="platform_name" value="{$data.platform_name}" readonly placeholder="请输入对应平台">
</td>
</tr>
<tr>
<td class="l">合同期限:</td>
<td class="r" >
<div class="input-list" style="margin:0;">
<input type="text" readonly id="contact_begin" name="contact_begin" class="" value="{$data.contact_begin}"
placeholder="合同开始时间" />
&nbsp;-&nbsp;
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="contact_end" name="contact_end" class="" value="{$data.contact_end}"
placeholder="合同结束时间" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
</td>
</tr>
<tr>
<td class="l">开票税点:</td>
<td class="r" >
<input type="number" class="txt" name="fax_ratio" value="{$data.fax_ratio}" readonly placeholder="请输入开票税点">
<span>%</span>
</td>
</tr>
<tr>
<td class="l">公司性质:</td>
<td class="r" >
<div class="input-list input-list-server search_label_rehab" style="margin:0;">
<select id="company_type" disabled="true" name="company_type" class="select_gallery" style="width: 215px;">
<option value="">请选择公司性质</option>
<option value="1" <if condition="$data['company_type'] eq 1">selected
</if>>公司</option>
<option value="2" <if condition="$data.company_type eq 2">selected
</if>>个人</option>
</select>
</div>
</td>
</tr>
<tr>
<td class="l">是否签署合同:</td>
<td class="r" >
<div class="input-list input-list-server search_label_rehab" style="margin:0;">
<select id="is_sign_contact" disabled="true" name="is_sign_contact" class="select_gallery" style="width: 215px;">
<option value="">请选择是否签署合同</option>
<option value="0" <if condition="$data['is_sign_contact'] eq 0">selected
</if>>否</option>
<option value="1" <if condition="$data['is_sign_contact'] eq 1">selected
</if>>是</option>
</select>
</div>
</td>
</tr>
<tr>
<td class="l">团体归属:</td>
<td class="r" >
<div class="input-list input-list-server search_label_rehab" style="margin:0;">
<select id="company_belong" disabled="true" name="company_belong" class="select_gallery" style="width: 215px;">
<option value="">请选择团体归属</option>
<option value="0" <if condition="$data['company_belong'] eq 0">selected
</if>>内团</option>
<option value="1" <if condition="$data['company_belong'] eq 1">selected
</if>>外团</option>
<option value="2" <if condition="$data['company_belong'] eq 2">selected
</if>>外团-分发</option>
<option value="3" <if condition="$data['company_belong'] eq 3">selected
</if>>其他</option>
</select>
</div>
</td>
</tr>
<tr>
<td class="l">联系结算人:</td>
<td class="r" >
<input type="text" class="txt " name="settlement_contact" value="{$data.settlement_contact}" readonly placeholder="请输入结算联系人">
</td>
</tr>
<tr>
<td class="l">联系电话:</td>
<td class="r" >
<input type="text" class="txt " name="contact_phone" value="{$data.contact_phone}" readonly placeholder="请输入联系电话">
</td>
</tr>
<tr>
<td class="l">所在地址:</td>
<td class="r" >
<input type="text" class="txt " name="address" value="{$data.address}" readonly placeholder="请输入所在地址">
</td>
</tr>
<tr>
<td class="l">银行卡号:</td>
<td class="r" >
<input type="text" class="txt " name="bank_card" value="{$data.bank_card}" readonly placeholder="请输入银行卡号">
</td>
</tr>
<tr>
<td class="l">收款银行:</td>
<td class="r" >
<input type="text" class="txt " name="bank_name" value="{$data.bank_name}" readonly placeholder="请输入收款银行">
</td>
</tr>
<tr>
<td class="l">开户网点:</td>
<td class="r" >
<input type="text" class="txt " name="bank_address" value="{$data.bank_address}" readonly placeholder="请输入开户网点">
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px"></i>备注:</td>
<td class="r" >
<input type="text" class="txt " name="content" value="{$data.content}" readonly placeholder="">
</td>
</tr>
<tr>
<td class="l noticeinfo">显示状态:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label>
<input type="radio" disabled="true" class="inp_radio" value="1" name="status" <if condition="$data['status'] eq 1">checked
</if>> 开启
</label>
<label>
<input type="radio" disabled="true" class="inp_radio" value="0" name="status" <if condition="$data['status'] eq 0">checked
</if>> 关闭
</label>
</span>
<span class="notice-text"></span>
</td>
</tr>
</tbody>
</table>
<table border="1" style="width: 680px;text-align: center;margin:10px 0 0 60px;" cellspacing="0" cellpadding="0" id="docShow">
</table>
</div>
<div style="width: 100%;height: 60px;"></div>
</div>
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$meta_title}">
<input type="hidden" name="url" value="Partner/add">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
<script type="text/html" id="doctpl">
{@each list as it,index}
{@if index==0}
<thead>
<tr>
<th>文档名称</th>
<th>文档类型</th>
<th>上传时间</th>
<th style="width:150px;">操作</th>
</tr>
</thead>
{@/if}
<tr>
<td style="padding:0;">${it.file_name}</td>
<td>${it.file_type}</td>
<td>${it.upload_time}</td>
<td>
<a class="filedown" data-index="${index}" data-path="${it.file_path}">下载</a>
</td>
</tr>
{@/each}
</script>
</block>
<block name="script">
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('PromoteCompany/lists')}");
$('#submit').click(function(){
$('#form').submit();
});
var PROMOTE = {
juicerFun(){
var tpl =$("#doctpl").html();
var html = juicer(tpl, {list:doc});
$("#docShow").html(html);
PROMOTE.juicerEvent();
},
juicerEvent(){
$(".filedown,.filedel").off("click");
$(".filedown").on("click",function(){
var url = window.location.protocol+"//"+window.location.host+$(this).data("path");
// window.open(url,"_blank");
var link = document.createElement('a');
link.setAttribute("download", "");
link.href = url;
link.click()
});
$(".filedel").on("click",function(){
var path = $(this).data("path");
var index = $(this).data("index");
console.log(index);
var id = 0;
$.ajax({
url:"{:U('PromoteCompany/delFile')}",
type:"post",
data:{
"id":0,
"file_path":path
},
dataType:"json",
success:function(data){
if(data.status == 1){
doc.splice(index,1)
PROMOTE.juicerFun();
}else{
layer.alert(data.info);
}
},
error:function(e){
}
});
})
}
}
</script>
<script>
var doc = {$data.resources};
PROMOTE.juicerFun();
function addFile(info) {
doc.push(info);
layer.closeAll();
PROMOTE.juicerFun();
// window.parent.addFile(info);
}
// $('#contact_begin').datetimepicker({
// format: 'yyyy-mm-dd',
// language: "zh-CN",
// minView: 2,
// autoclose: true
// });
// $('#datetimepicker').datetimepicker({
// format: 'yyyy-mm-dd',
// language: "zh-CN",
// minView: 2,
// autoclose: true,
// pickerPosition: 'bottom-left'
// })
$(".coin-detail").click(function () {
var url = $(this).data('url');
var title = '文档添加';
layer.open({
type: 2,
title: title,
shadeClose: true,
shade: 0.8,
area: ['40%', '60%'],
content: url
});
});
$("#submit").on("click",function(){
var obj = {
"company_name":["required","推广公司名称不允许为空"],
"platform_name":["nocheck"],
"contact_begin":["date","合同开始时间不能为空"],
"contact_end":["date","合同结束时间不能为空"],
"fax_ratio":["number","开票税率必须是数字如果无此项请填0"],
"company_type":["required","公司性质不能为空","select"],
"is_sign_contact":["required","是否签署合同项不能为空","select"],
"company_belong":["required","团体归属不能为空","select"],
"settlement_contact":["required","结算联系人不能为空"],
"contact_phone":["phone","联系人电话格式不对或不能为空"],
"address":["required","联系人地址不能为空"],
"bank_card":["bankid","银行卡格式错误或不能为空"],
"bank_name":["required","银行名称不能为空"],
"bank_address":["required","银行开户网点不能为空"],
"content":["nocheck"],
"status":["nocheck","","radio"]
}
var cres = CIC.checkAddInput(obj);
if(!cres){
return false;
}
if (Date.parse(cres.contact_begin) > Date.parse(cres.contact_end)) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
//验证通过
if(doc.length > 0){
cres.resources = doc;
}
//添加
$.ajax({
url:"{:U('PromoteCompany/add')}",
type:"post",
data:cres,
dataType:"json",
success:function(data){
if(data.status == 1){
layer.msg(data.info,function(){
window.location.href="{:U('PromoteCompany/lists')}";
});
}else{
layer.msg(data.info);
}
},
error:function(e){
}
});
})
</script>
</block>

@ -1192,6 +1192,17 @@ ADD COLUMN `company_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '工
ALTER TABLE `tab_withdraw`
ADD COLUMN `review_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '审核模式1-人工审核 2-自动审核';
--2020-02-11 chenzhi 广--
ALTER TABLE `tab_promote_company`
ADD COLUMN `platform_name` VARCHAR(60) NOT NULL DEFAULT '' COMMENT '平台名称' AFTER `bank_address`,
ADD COLUMN `contact_begin` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '合同开始时间' AFTER `platform_name`,
ADD COLUMN `contact_end` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '合同结束时间' AFTER `contact_begin`,
ADD COLUMN `fax_ratio` VARCHAR(20) NOT NULL DEFAULT '0' COMMENT '开票税率' AFTER `contact_end`,
ADD COLUMN `company_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '公司性质1-公司 2-个人' AFTER `fax_ratio`,
ADD COLUMN `is_sign_contact` tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否签署合同:0-未签署 1-签署' AFTER `company_type`,
ADD COLUMN `company_belong` tinyint(1) UNSIGNED NOT NULL DEFAULT 3 COMMENT '工会归属0-内团1-外团 2-分发联盟 3 无' AFTER `is_sign_contact`,
ADD COLUMN `resources` VARCHAR(2000) NULL DEFAULT '' COMMENT '文档' AFTER `company_belong`;
-- 2020-02-12 zyx 推广提现--新增审核模式
ALTER TABLE `tab_statement`
MODIFY COLUMN `ext_field` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '扩展字段,如果是下游为提现单号' AFTER `pay_type`;
@ -1226,3 +1237,21 @@ ADD COLUMN `file_info` text COMMENT '文档信息json格式';
ALTER TABLE tab_partner
ADD COLUMN `company_type` TINYINT (3) NOT NULL DEFAULT '1' COMMENT '公司性质1-公司 2-个人';
-- 添加测试订单录入表 郑昌隆 2020-02-12
CREATE TABLE `tab_test_order` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_type` tinyint(2) DEFAULT '0' COMMENT '0-未知1-sdk充值2-平台币充值3-超级签充值',
`server_type` tinyint(2) DEFAULT '1' COMMENT '1-测试内网 2-测试外网',
`order_no` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '平台充值订单号',
`cp_order_no` varchar(256) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'CP订单号',
`user_account` varchar(30) COLLATE utf8mb4_bin DEFAULT '' COMMENT '用户账号',
`game_id` int(11) DEFAULT '0' COMMENT '游戏ID',
`game_name` varchar(30) COLLATE utf8mb4_bin DEFAULT '' COMMENT '游戏名称',
`order_amount` decimal(10,2) DEFAULT NULL COMMENT '订单金额',
`pay_amount` decimal(10,2) DEFAULT NULL COMMENT '支付金额',
`pay_time` int(11) DEFAULT '0' COMMENT '交易时间',
`pay_way` int(11) DEFAULT NULL COMMENT '-1绑币,0平台币,1支付宝,2微信,7金猪,9双乾支付-支付宝,10双乾支付-银联,15双乾支付-快捷',
`add_time` int(11) DEFAULT '0' COMMENT '添加时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

@ -0,0 +1,80 @@
/**
* @info 前端input验证类
* @version 20200213
* @author chenzhi
* var obj = {
"type": ["required", "点击事件不能为空",'select'],
"sort":["number", "排序不能为空"],
"click_option": ["nocheck", "配置信息", "textarea"],
"remark": ["nocheck", "备注无需验证", "textarea"],
}
*/
(function(){
function czinputcheck(){
var cic = this;
cic.verify= {
required: [/[\S]+/, "必填项不能为空"],
phone: [/^1\d{10}$/, "请输入正确的手机号"],
email: [/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/, "邮箱格式不正确"],
url: [/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/, "链接格式不正确"],
intnumber: [/^\d+$/, "数字格式错误,数字不能含有小数"],
number:[/^\d+(\.{1}\d+)?$/,"数字格式错误"],
date: [/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/, "日期格式不正确"],
identity: [/(^\d{15}$)|(^\d{17}(x|X|\d)$)/, "请输入正确的身份证号"],
password:[/^[\S]{6,12}$/,"密码必须6到12位且不能出现空格"],
isbn:[/^\d{13}$/, "isbn格式错误"],
price:[/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,"价格格式错误"],
bankid:[/^([1-9]{1})\d{9,19}$/,"银行卡格式错误"],
nocheck:[false,"无需验证,存在填,不存在舍弃"],
checkno:[false,"验证,存在填,不存在报错"],
};
cic.checkAddInput=function(arr){
var rearr = {};
for(var i in arr) {
var reg = cic.verify[arr[i][0]][0];
var name = "input";
var selecttypename='';
if(typeof arr[i][2] !== "undefined") name = arr[i][2];
if(name == "radio") {
name="input";
selecttypename=":checked";
}
if(!reg){
//nocheck时不验证
var val = $(name+"[name='"+i+"']"+selecttypename).val();
if(val != ''){
rearr[i]=val;
}
}else{
if(reg.test($(name+"[name='"+i+"']"+selecttypename).val())) {
rearr[i] = $(name+"[name='"+i+"']"+selecttypename).val();
}else {
layer.alert(arr[i][1], {
icon: 2,
skin: 'layer-ext-moon'
});
return false;
break;
}
}
}
return rearr;
};
cic.setEditData=function(ydata,ndata){
var data = {};
for (var i in ndata) {
if(ndata[i] != ydata[i]){
data[i] = ndata[i]
}
}
if($.isEmptyObject(data)) {
parent.layer.close(parent.layer.getFrameIndex(window.name));
return false;
}else{
data.id = ydata.id;
return data;
}
};
};
window.CIC = new czinputcheck();
})()
Loading…
Cancel
Save