master
yulingwei 5 years ago
commit 469a037b0f

@ -20,46 +20,165 @@ class PromoteCompanyController extends ThinkController
{
$model = M($this->modelName, 'tab_');
$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")
->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);
/* 查询记录总数 */
$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 +187,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,35 +200,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 (!in_array($status, [0, 1])) {
$this->error('参数异常');
}
$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['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());
@ -116,6 +239,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()
@ -123,52 +273,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 (!in_array($status, [0, 1]) || $id == 0) {
$this->error('参数异常');
}
$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['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')->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();
}
}
@ -176,24 +326,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,121 @@
<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" >
<input type="text" class="txt " name="settlement_contact" value="" 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="contact_phone" value="" 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="address" value="" 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="bank_card" value="" 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="bank_cardname" value="" 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="bank_name" value="" 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="bank_address" value="" 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="" placeholder="">
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>显示状态:</td>
<td class="r table_radio">
@ -49,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">
@ -71,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">
@ -82,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,54 +53,363 @@
<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" >
<input type="text" class="txt " name="settlement_contact" value="{$data.settlement_contact}" 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="contact_phone" value="{$data.contact_phone}" 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="address" value="{$data.address}" 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="bank_card" value="{$data.bank_card}" 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="bank_cardname" value="" 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="bank_name" value="{$data.bank_name}" 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="bank_address" value="{$data.bank_address}" 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}" placeholder="">
</td>
</tr>
<tr>
<td class="l noticeinfo"><i class="mustmark" style="margin-left:-7px">*</i>显示状态:</td>
<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>

@ -29,28 +29,53 @@
.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>
</div>
</div>
@ -58,37 +83,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 +215,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>

@ -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>

@ -459,14 +459,33 @@ class SafeController extends BaseController{
}
public function safeDocument() {
$realname = $_REQUEST['realname'];
$phone = $_REQUEST['phone'];
$email = $_REQUEST['email'];
$address = $_REQUEST['address'];
if (empty($realname)) {
$realname = '您未填写真实姓名';
}
if (empty($email)) {
$email = '您未填写联系邮箱';
}
if (empty($address)) {
$address = '您未填写注册地址';
}
if (empty($phone)) {
$phone = '您未填写联系号码';
}
$time = time();
$loginPromote = $this->getLoginPromote();
$sn = date('Ymd') . '-' . strtoupper(substr(md5($loginPromote['id']), 8, 16));
$endTime = date('Y-m-d',strtotime('+1 year'));
$this->assign('time',date('Y-m-d',$time));
$this->assign('endTime',$endTime);
$this->assign('sn',$sn);
$this->assign('realname',$realname);
$this->assign('email',$email);
$this->assign('address',$address);
$this->assign('phone',$phone);
$this->display();
}
}

@ -304,7 +304,8 @@
<tr>
<td class="l"></td>
<td class="r"><input type="checkbox" class="input txt" id="agree" style="margin-left:20px" name="agree" >我已仔细阅读,并同意<a href="{:U('safe/safeDocument',array('username'=>$promoteinfo['account']))}"><span style="color:#26c7dbd4" id="read">《游戏推广服务框架协议》</span></a>
<!-- <td class="r"><input type="checkbox" class="input txt" id="agree" style="margin-left:20px" name="agree" >我已仔细阅读,并同意<a href="{:U('safe/safeDocument',array('username'=>$promoteinfo['account'],'email'=>$promoteinfo['email'],'realname'=>$promoteinfo['real_name'],'phone'=>$promoteinfo['mobile_phone'],'address'=>$promoteinfo['address']))}"><span style="color:#26c7dbd4" id="read">《游戏推广服务框架协议》</span></a> -->
<td class="r"><input type="checkbox" class="input txt" id="agree" style="margin-left:20px" name="agree" >我已仔细阅读,并同意<span style="color:#26c7dbd4" id="read" onclick="read_detail('{$promoteinfo.account}','{$promoteinfo.email}','{$promoteinfo.real_name}','{$promoteinfo.mobile_phone}','{$addr}')">《游戏推广服务框架协议》</span>
<span id="confirm_password_tip"></span></td>
</tr>
<tr>
@ -329,6 +330,27 @@
</block>
<block name="script">
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js"></script>
<script>
function read_detail(username,email,realname,phone,address) {
console.log('xx')
console.log(address)
layer.open({
type: 2,
title: "游戏推广服务框架协议",
shadeClose: true,
shade: 0.8,
area: ['70%', '82%'],
btn:['同意'],
content: ['index.php?s=/Home/safe/safeDocument/username/'+ username +'/email/' + email + '/realname/' + realname + '/phone/' + phone +'/address/' + address + '', 'no'],
yes:function(index) {
window.localStorage.setItem('checked','checked');
layer.close(index);
}
});
}
</script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/mail_suffix.js"></script>
<script type="text/javascript" src="__STATIC__/bank.js"></script>

@ -47,7 +47,7 @@ and open the template in the editor.
</style>
<body>
<div class="docContain">
<div class="docContain" style="overflow:scroll; width:800px; height:800px;">
<div class="title"><h2>游戏推广服务框架协议</h1></div>
<div class="text">
<p>本协议由以下双方于<span>{$time}</span>签订:</p>
@ -57,11 +57,11 @@ and open the template in the editor.
<p>联系电话13067391751</p>
<p>联系人:雷丽华</p>
<p>邮箱号383166987@qq.com</p>
<p>乙方:</p>
<p>注册地址:</p>
<p>联系电话:</p>
<p>联系人:</p>
<p>邮箱号:</p>
<p>乙方:{$realname}</p>
<p>注册地址:{$address}</p>
<p>联系电话:{$phone}</p>
<p>联系人:{$realname}</p>
<p>邮箱号:{$email}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;经甲乙双方协商一致,在平等互利的基础上,就乙方推广甲方拥有知识产权
或合法授权的游戏(以下简称“产品”)达成如下协议:</p>
<p style="font-weight: bold">1 合作内容及合作期限</p>
@ -236,7 +236,7 @@ and open the template in the editor.
<br><br><br><br>
</div>
<button id="ag" style="width:120px;height:40px;background: #26C7DB;color:white;border:none" >同意</button>
<!-- <button id="ag" style="width:120px;height:40px;background: #26C7DB;color:white;border:none" >同意</button> -->
<br><br><br><br>
<br><br><br><br>
</div>

@ -1074,6 +1074,22 @@ CREATE TABLE `sys_document_pop_rules` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
--广--
CREATE TABLE `tab_sociaty_games` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`promote_id` int(11) NOT NULL COMMENT '会长ID',
`game_id` int(11) NOT NULL COMMENT '游戏ID',
`status` tinyint(1) NOT null DEFAULT '0' COMMENT '状态 0 禁用 1 启用',
`create_time` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT '工会授权游戏';
----
ALTER TABLE `tab_game`
ADD COLUMN `apply_auth` INT(11) NULL DEFAULT '1' COMMENT '申请权限(1为全部可申请2为部分会长可申请)' AFTER `game_detail_cover`;
-- 2020-01-14
-- cxj
ALTER TABLE `tab_promote_game_ratio`
@ -1148,6 +1164,24 @@ CREATE TABLE `tab_company_info` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COMMENT='内部公司信息';
-- 2020-02-10 liaojinling 会长押金
CREATE TABLE `tab_president_deposit` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`promote_id` varchar(60) NOT NULL COMMENT '会长ID',
`payer` varchar(50) NOT NULL DEFAULT '' COMMENT '付款人',
`amount` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '金额',
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态',
`pay_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '押金付款方式',
`pay_way` tinyint(1) NOT NULL DEFAULT '0' COMMENT '付款方式',
`pay_account` varchar(60) NOT NULL DEFAULT '' COMMENT '付款账号',
`pay_confirm_time` int(10) NOT NULL DEFAULT '0' COMMENT '押金确认时间',
`refund_time` int(10) NOT NULL DEFAULT '0' COMMENT '退款时间',
`create_time` int(10) NOT NULL DEFAULT '0' COMMENT '添加时间',
`update_time` int(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会长押金';
-- 2020-02-10 yulingwei 推广工会管理 新增属性类型
ALTER TABLE `tab_promote_belong`
MODIFY COLUMN `company_belong` tinyint(1) UNSIGNED NOT NULL DEFAULT 3 COMMENT '工会归属0-内团1-外团 2-分发联盟 3 无' AFTER `verify_status`,
@ -1161,4 +1195,27 @@ MODIFY COLUMN `company_relation` tinyint(1) NOT NULL DEFAULT 0 COMMENT '工会
-- 2020-02-10 cxj 推广提现--新增审核模式
ALTER TABLE `tab_withdraw`
ADD COLUMN `review_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '审核模式1-人工审核 2-自动审核';
ADD COLUMN `review_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '审核模式1-人工审核 2-自动审核';
--2020-02-10 sunke --
ALTER TABLE `tab_promote_company`
ADD COLUMN `settlement_contact` VARCHAR(60) NOT NULL DEFAULT '0' COMMENT '结算联系人' AFTER `last_up_time`,
ADD COLUMN `contact_phone` BIGINT(12) NOT NULL DEFAULT '0' COMMENT '联系电话' AFTER `settlement_contact`,
ADD COLUMN `address` VARCHAR(255) NOT NULL DEFAULT '0' COMMENT '所在地址' AFTER `contact_phone`,
ADD COLUMN `bank_card` VARCHAR(60) NOT NULL DEFAULT '0' COMMENT '银行卡号' AFTER `address`,
ADD COLUMN `bank_cardname` VARCHAR(60) NOT NULL DEFAULT '0' COMMENT '银行卡名' AFTER `bank_card`,
ADD COLUMN `bank_name` VARCHAR(60) NOT NULL DEFAULT '0' COMMENT '收款银行' AFTER `bank_cardname`,
ADD COLUMN `bank_address` VARCHAR(60) NOT NULL DEFAULT '0' COMMENT '开户网点' AFTER `bank_name`,
ADD COLUMN `content` VARCHAR(255) NULL DEFAULT '' COMMENT '备注' AFTER `bank_address`;
--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`;

@ -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