优化推广公司

master
chenzhi 4 years ago
parent 5aa7427504
commit 69adcbabf8

@ -221,7 +221,7 @@ class PromoteCompanyController extends ThinkController
//分页 //分页
$parameter['p'] = $page; $parameter['p'] = $page;
$parameter['row'] = $row; $parameter['row'] = $row;
$page = set_pagination($count, $row, $parameter); $page = set_pagination($count, $row);
if ($page) { if ($page) {
$this->assign('_page', $page); $this->assign('_page', $page);
} }

@ -19,7 +19,7 @@
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.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 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__/juicer-min.js" type="text/javascript"></script>
<script src="__STATIC__/czinputcheck.js?v=0527" type="text/javascript"></script> <script src="__STATIC__/czinputcheck.js?v=07151710" type="text/javascript"></script>
<style> <style>
.coin-detail{ .coin-detail{
display: block; display: block;
@ -42,7 +42,7 @@
<div class="tab-content tabcon1711"> <div class="tab-content tabcon1711">
<!-- 表单 --> <!-- 表单 -->
<!-- <form id="form" action="{:U('add')}" method="post" class="form-horizontal"> --> <form id="form" >
<!-- 基础 --> <!-- 基础 -->
<div id="tab1" class="tab-pane in tab1 "> <div id="tab1" class="tab-pane in tab1 ">
<table border="0" cellspacing="0" cellpadding="0"> <table border="0" cellspacing="0" cellpadding="0">
@ -250,14 +250,12 @@
</table> </table>
</div> </div>
<div class="form-item cf" style="margin-bottom: 40px;"> <div class="form-item cf" style="margin-bottom: 40px;">
<button class="submit_btn " id="submit" style="margin-left:210px;"> <input class="submit_btn" type="button" value="保存" id="submit" target-form="form-horizontal" style="margin-left:210px;">
保存 <a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:history.back(-1);" >
返回 返回
</a> </a>
</div> </div>
<!-- </form> --> </form>
</div> </div>
</div> </div>
<div class="common_settings"> <div class="common_settings">
@ -314,6 +312,12 @@
language: "zh-CN", language: "zh-CN",
minView: 2, minView: 2,
autoclose: true autoclose: true
}).change(function(){
var start = new Date($(this).val()).getTime();
var end = new Date($('#contact_end').val()).getTime();
if(isNaN(end)) {return false;}
if(start>=end) {layer.msg('开始时间必须小于结束时间');$("#contact_begin").val('');return false;}
return false;
}); });
$('#datetimepicker').datetimepicker({ $('#datetimepicker').datetimepicker({
@ -322,7 +326,14 @@
minView: 2, minView: 2,
autoclose: true, autoclose: true,
pickerPosition: 'bottom-left' pickerPosition: 'bottom-left'
}) }).change(function(){
var end = new Date($("#contact_end").val()).getTime();
var start = new Date($('#contact_begin').val()).getTime();
if(isNaN(start)) {return false;}
if(start>=end) {layer.msg('开始时间必须小于结束时间');$("#contact_end").val('');return false;}
return false;
});
$(".coin-detail").click(function () { $(".coin-detail").click(function () {
var url = $(this).data('url'); var url = $(this).data('url');
var title = '文档添加'; var title = '文档添加';
@ -337,45 +348,22 @@
}); });
$("#submit").on("click",function(){ $("#submit").on("click",function(){
var obj = { var obj = {
"company_name":["required","推广公司名称不允许为空"], "company_name":["required",false,"推广公司名称不允许为空"],
"platform_name":["nocheck"], "fax_ratio":["number",true,"开票税率必须是数字如果无此项请填0"],
"contact_begin":["nocheck","合同开始时间不能为空"], "contact_phone":["phone",true,"联系人电话格式不对"],
"contact_end":["nocheck","合同结束时间不能为空"], "bank_card":["bankid",true,"银行卡格式错误"]
"fax_ratio":[["number",true],"开票税率必须是数字如果无此项请填0"],
"company_type":["nocheck","公司性质不能为空","select"],
"is_sign_contact":["nocheck","是否签署合同项不能为空","select"],
"company_belong":["nocheck","团体归属不能为空","select"],
"settlement_contact":["nocheck","结算联系人不能为空"],
"contact_phone":[["phone",true],"联系人电话格式不对"],
"address":["nocheck","联系人地址不能为空"],
"bank_card":[["bankid",true],"银行卡格式错误"],
"bank_name":["nocheck","银行名称不能为空"],
"bank_address":["nocheck","帐户名不能为空"],
"ali_user":["nocheck","支付宝真实姓名不能为空"],
"ali_account":["nocheck","支付宝登陆账号不能为空"],
"content":["nocheck"],
"service_agreement_show":["nocheck","","select"],
"marketing_director_show":["nocheck","","radio"],
"status":["nocheck","","radio"],
"develop_type":["nocheck","开发类型不能为空","select"]
}
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(!CIC.checkInput(obj)){ return false; }
var senddata = $("#form").serializeArray();
//验证通过 //验证通过
if(doc.length > 0){ if(doc.length > 0){
cres.resources = doc; senddata.push({"name":"resources", "value":JSON.stringify(doc)});
} }
//添加 //添加
$.ajax({ $.ajax({
url:"{:U('PromoteCompany/add')}", url:"{:U('PromoteCompany/add')}",
type:"post", type:"post",
data:cres, data:senddata,
dataType:"json", dataType:"json",
success:function(data){ success:function(data){
if(data.status == 1){ if(data.status == 1){

@ -42,7 +42,7 @@
<div class="tab-content tabcon1711"> <div class="tab-content tabcon1711">
<!-- 表单 --> <!-- 表单 -->
<!-- <form id="form" action="{:U('add')}" method="post" class="form-horizontal"> --> <form id="form">
<!-- 基础 --> <!-- 基础 -->
<div id="tab1" class="tab-pane in tab1 "> <div id="tab1" class="tab-pane in tab1 ">
<table border="0" cellspacing="0" cellpadding="0"> <table border="0" cellspacing="0" cellpadding="0">
@ -261,14 +261,12 @@
</table> </table>
</div> </div>
<div class="form-item cf" style="margin-bottom: 40px;"> <div class="form-item cf" style="margin-bottom: 40px;">
<button class="submit_btn " id="submit" style="margin-left:210px;"> <input class="submit_btn" type="button" value="保存" id="submit" target-form="form-horizontal" style="margin-left:210px;">
保存
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:history.back(-1);" > <a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:history.back(-1);" >
返回 返回
</a> </a>
</div> </div>
<!-- </form> --> </form>
</div> </div>
</div> </div>
<div class="common_settings"> <div class="common_settings">
@ -385,6 +383,12 @@
language: "zh-CN", language: "zh-CN",
minView: 2, minView: 2,
autoclose: true autoclose: true
}).change(function(){
var start = new Date($(this).val()).getTime();
var end = new Date($('#contact_end').val()).getTime();
if(isNaN(end)) {return false;}
if(start>=end) {layer.msg('开始时间必须小于结束时间');$("#contact_begin").val('');return false;}
return false;
}); });
$('#datetimepicker').datetimepicker({ $('#datetimepicker').datetimepicker({
@ -393,7 +397,15 @@
minView: 2, minView: 2,
autoclose: true, autoclose: true,
pickerPosition: 'bottom-left' pickerPosition: 'bottom-left'
}) }).change(function(){
var end = new Date($("#contact_end").val()).getTime();
var start = new Date($('#contact_begin').val()).getTime();
if(isNaN(start)) {return false;}
if(start>=end) {layer.msg('开始时间必须小于结束时间');$("#contact_end").val('');return false;}
return false;
});
$(".coin-detail").click(function () { $(".coin-detail").click(function () {
var url = $(this).data('url'); var url = $(this).data('url');
var title = '文档添加'; var title = '文档添加';
@ -408,46 +420,22 @@
}); });
$("#submit").on("click",function(){ $("#submit").on("click",function(){
var obj = { var obj = {
"company_name":["required","推广公司名称不允许为空"], "company_name":["required",false,"推广公司名称不允许为空"],
"platform_name":[["nocheck",true]], "fax_ratio":["number",true,"开票税率必须是数字如果无此项请填0"],
"contact_begin":[["nocheck",true],"合同开始时间不能为空"], "contact_phone":["phone",true,"联系人电话格式不对"],
"contact_end":[["nocheck",true],"合同结束时间不能为空"], "bank_card":["bankid",true,"银行卡格式错误"]
"fax_ratio":[["number",true],"开票税率必须是数字如果无此项请填0"],
"company_type":["nocheck","公司性质不能为空","select"],
"is_sign_contact":["nocheck","是否签署合同项不能为空","select"],
"company_belong":["nocheck","团体归属不能为空","select"],
"settlement_contact":[["nocheck",true],"结算联系人不能为空"],
"contact_phone":[["phone",true],"联系人电话格式不对"],
"address":[["nocheck",true],"联系人地址不能为空"],
"bank_card":[["bankid",true],"银行卡格式错误"],
"bank_name":[["nocheck",true],"银行名称不能为空"],
"bank_address":[["nocheck",true],"帐户名不能为空"],
"ali_user":[["nocheck",true],"支付宝真实姓名不能为空"],
"ali_account":[["nocheck",true],"支付宝登陆账号不能为空"],
"content":[["nocheck",true]],
"develop_type":["nocheck","开发类型不能为空","select"],
"status":["nocheck","","radio"],
"service_agreement_show":["nocheck","","select"],
"marketing_director_show":["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(!CIC.checkInput(obj)){ return false; }
var senddata = $("#form").serializeArray();
senddata.push({"name":"resources", "value":JSON.stringify(doc)});
senddata.push({"name":"id", "value":id});
//资源不需要二次修改 //资源不需要二次修改
cres.resources = doc;
cres.id = id;
console.log(cres);
//添加 //添加
$.ajax({ $.ajax({
url:"{:U('PromoteCompany/edit')}", url:"{:U('PromoteCompany/edit')}",
type:"post", type:"post",
data:cres, data:senddata,
dataType:"json", dataType:"json",
success:function(data){ success:function(data){
if(data.status == 1){ if(data.status == 1){

@ -2110,3 +2110,17 @@ CREATE TABLE `tab_partner_verify` (
KEY `partner_name` (`partner_name`) USING BTREE, KEY `partner_name` (`partner_name`) USING BTREE,
KEY `verify_status` (`verify_status`) USING BTREE KEY `verify_status` (`verify_status`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
ALTER TABLE `tab_promote_company`
ADD COLUMN `validity_start_time` int(11) NOT NULL DEFAULT 0 COMMENT '生效开始时间' AFTER `company_type`,
ADD COLUMN `validity_end_time` int(11) NOT NULL DEFAULT 0 COMMENT '生效结算时间' AFTER `validity_start_time`,
ADD COLUMN `reg_address` varchar(255) NULL DEFAULT NULL COMMENT '注册地址' AFTER `validity_end_time`,
ADD COLUMN `reg_phone` varchar(24) NULL DEFAULT NULL COMMENT '注册电话' AFTER `reg_address`,
ADD COLUMN `has_ratio` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否有比例增量 1是 0否' AFTER `reg_phone`,
ADD COLUMN `turnover_ratio` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '流水分成比例= turnover:流水,ratio:比例,instanceof:1>= || 2>' AFTER `has_ratio`,
ADD COLUMN `has_server_fee` tinyint(1) NOT NULL DEFAULT 0 COMMENT '承担服务费1是 0否' AFTER `turnover_ratio`,
ADD COLUMN `server_fee` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '服务器费用' AFTER `has_server_fee`,
ADD COLUMN `cooperation_status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '合作关系1合作中 0暂停合作' AFTER `server_fee`;

@ -73,6 +73,38 @@
} }
return rearr; return rearr;
}; };
/**
*
* var obj = {
"type": ["required",fale,"点击事件不能为空",'select'], //1 true:为空不验证 false 为空报错
}
*/
cic.checkInput=function(arr){
for(var i in arr) {
var name = "input";
var selecttypename='';
if(typeof arr[i][3] !== "undefined") name = arr[i][3];
if(name == "radio") {
name="input";
selecttypename=":checked";
}
var reg = cic.verify[arr[i][0]][0];
var val = $(name+"[name='"+i+"']"+selecttypename).val();
if(arr[i][1] && val == ''){
continue;
}
if(!reg.test(val)) {
layer.alert(arr[i][2], {
icon: 2,
skin: 'layer-ext-moon'
});
return false;
}
}
return true;
};
cic.setEditData=function(ydata,ndata){ cic.setEditData=function(ydata,ndata){
var data = {}; var data = {};
for (var i in ndata) { for (var i in ndata) {

Loading…
Cancel
Save