liujie
2023-10-07 44311853fa68f04db11d341bd374a4ac9b5ea567
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/**
 * 跨城站点管理管理初始化
 */
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();
 
});