/**
|
* 跨城站点管理管理初始化
|
*/
|
var TSite = {
|
id: "TSiteTable", //表格id
|
seItem: null, //选中的条目
|
table: null,
|
layerIndex: -1,
|
picture:"",
|
fileUrl:"",
|
img:"",
|
plan:"",
|
goodsPicArray:[],
|
validateFields: {
|
}
|
};
|
/**
|
* 初始化表格的列
|
*/
|
TSite.initColumn = function () {
|
return [
|
{field: 'selectItem', checkbox: true},
|
{title: '主键ID', field: 'id', visible: false, align: 'center', valign: 'middle'},
|
{title: '所在城市', field: 'provinceAndCity', visible: true, align: 'center', valign: 'middle',width:'20%',},
|
{title: '管理员姓名', field: 'userName', visible: true, align: 'center', valign: 'middle',},
|
{title: '管理员手机号', field: 'phone', visible: true, align: 'center', valign: 'middle'},
|
{title: '认证平台', field: 'platform', visible: true, align: 'center', valign: 'middle'},
|
{title: '认证类型', field: 'type', visible: true, align: 'center', valign: 'middle'},
|
{title: '分账比例', field: 'proportion', visible: true, align: 'center', valign: 'middle'},
|
{title: '审核状态', field: 'state', visible: true, align: 'center', valign: 'middle',
|
formatter:function (data) {
|
return {1:"待审核",2:"审核中",3:"已通过",4:"已拒绝"}[data]
|
}
|
},
|
];
|
};
|
|
/**
|
* 检查是否选中
|
*/
|
TSite.check = function () {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
if(selected.length == 0){
|
Feng.info("请先选中表格中的某一记录!");
|
return false;
|
}else{
|
TSite.seItem = selected[0];
|
return true;
|
}
|
};
|
/**
|
* 分账比例
|
*/
|
TSite.openAddTSite = function () {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
if(selected.length >1 ){
|
Feng.info("只能选择一个运营商商户设置分账比例!");
|
}else {
|
if (this.check()) {
|
var index = layer.load(1,{
|
type: 1
|
, title: '添加分账比例'
|
, area: ['50%', '50%']
|
, offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset
|
, id: 'layerDemo' //防止重复弹出cge
|
, content: '<div class="form-horizontal">' +
|
' <div class="col-sm-11" >' +
|
' <div class="col-sm-11">' +
|
' <div class="form-group">\n' +
|
' <label class="col-sm-3 control-label">支付宝分账比例:</label>\n' +
|
' <div class="col-sm-9">\n' +
|
' <input class="form-control" placeholder="请输入分账比例" type="text" id="alipay"> '+
|
' </div>\n' +
|
' </div>\n' +
|
' <div class="form-group">\n' +
|
' <label class="col-sm-3 control-label">微信分账比例:</label>\n' +
|
' <div class="col-sm-9">\n' +
|
' <input class="form-control" placeholder="请输入分账比例" type="text" id="wechat"> '+
|
' </div>\n' +
|
' </div>\n' +
|
' </div>' +
|
' </div>' +
|
'</div>'
|
, btn: ['关闭', '保存']
|
, btnAlign: 'c' //按钮居中
|
, shade: 0.5 //不显示遮罩
|
,load:1
|
, yes: function () {
|
layer.closeAll();
|
},
|
btn2:function () {
|
let wechat = $("#wechat").val()
|
let alipay = $("#alipay").val()
|
if(alipay==''){
|
Feng.info("请输入支付宝分账比例")
|
return false;
|
}
|
if(wechat==''){
|
Feng.info("请输入微信分账比例")
|
return false;
|
}
|
var ajax = new $ax(Feng.ctxPath + "/operatorUser/addProportion", function (data) {
|
Feng.success("设置成功!");
|
window.location.reload();
|
window.parent.layer.closeAll();
|
}, function (data) {
|
Feng.error("操作失败!")
|
});
|
ajax.set("id", TSite.seItem.id);
|
ajax.set("alipay", alipay);
|
ajax.set("wechat", wechat);
|
ajax.start();
|
layer.closeAll();
|
}
|
});
|
this.layerIndex = index;
|
}
|
}
|
|
};
|
function UploadFileFn(){
|
$('#upFile').click();
|
}
|
TSite.oneChange = function (e) {
|
console.log("进入!")
|
var oneId=$(e).val();
|
console.log(oneId)
|
var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function(data){
|
var content='<option value="">选择市</option>';
|
$.each(data, function(k,v) {
|
content += "<option value='"+v.code+"'>"+v.name+"</option>";
|
});
|
$("#cCode").empty().append(content);
|
});
|
if (oneId==""){
|
var temp = '<option value="">请先选择省</option>';
|
$("#cCode").empty().append(temp);
|
}
|
ajax.set("oneId",oneId);
|
ajax.start();
|
}
|
/**
|
* 打开场地管理查看详情
|
*/
|
TSite.openInfo = function () {
|
var index = layer.open({
|
type: 2,
|
title: "认证",
|
area: ['100%', '100%'], //宽高
|
fix: false, //不固定
|
maxmin: true,
|
content: Feng.ctxPath + '/operatorUser/proportion/' + 5
|
});
|
this.layerIndex = index;
|
|
};
|
/**
|
* 关闭此对话框
|
*/
|
TSite.close = function() {
|
parent.layer.close(window.parent.TSite.layerIndex);
|
};
|
|
TSite.search = function () {
|
var queryData = {};
|
queryData['province'] = $("#pCode").val();
|
queryData['city'] =$("#cCode").val();
|
queryData['userName'] =$("#name").val();
|
queryData['phone'] =$("#phone").val();
|
queryData['platform'] =$("#platform").val();
|
queryData['type'] =$("#type").val();
|
queryData['state'] =$("#state").val();
|
TSite.table.refresh({query: queryData});
|
};
|
|
TSite.resetSearch = function () {
|
$("#pCode").val("");
|
$("#cCode").val("");
|
$("#name").val("");
|
$("#phone").val("");
|
$("#platform").val("");
|
$("#type").val("");
|
$("#state").val("");
|
TSite.search();
|
};
|
TSite.tradeYse = function () {
|
var tradeT = document.getElementById('tradeT');
|
var IDCardT = document.getElementById('IDCardT');
|
var tradeTime = document.getElementById('tradeTime');
|
var IDCardTime = document.getElementById('IDCardTime');
|
// 判断是否被选中
|
if (tradeT.checked) {
|
tradeTime.disabled = true;
|
} else {
|
tradeTime.disabled = false;
|
}
|
if (IDCardT.checked) {
|
IDCardTime.disabled = true;
|
} else {
|
IDCardTime.disabled = false;
|
}
|
};
|
$(function () {
|
$("#benefit").hide()
|
var defaultColunms = TSite.initColumn();
|
var table = new BSTable(TSite.id, "/operatorUser/listAll", defaultColunms);
|
table.setPaginationType("server");
|
TSite.table = table.init();
|
var c1 = new $WebUpload("license");
|
var c2 = new $WebUpload("IDCardImg");
|
var c3 = new $WebUpload("IDCardImg1");
|
var c4 = new $WebUpload("bImg1");
|
var c5 = new $WebUpload("bImg2");
|
var c6 = new $WebUpload("Img");
|
c1.setUploadBarId("progressBar");
|
c1.init();
|
c2.setUploadBarId("progressBar");
|
c2.init();
|
c3.setUploadBarId("progressBar");
|
c3.init();
|
c4.setUploadBarId("progressBar");
|
c4.init();
|
c5.setUploadBarId("progressBar");
|
c5.init();
|
c6.setUploadBarId("progressBar");
|
c6.init();
|
|
});
|