44323
2023-12-28 c31f9914a85889bbe090d907ed53cc7a2fdcf8b6
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
/**
 * 跨城站点管理管理初始化
 */
var TSite = {
    id: "TSiteTable",    //表格id
    seItem: null,        //选中的条目
    table: null,
    layerIndex: -1,
    picture:"",
    fileUrl:"",
    img:"",
    plan:"",
    goodsPicArray:[],
    validateFields: {
    }
};
/**
 * 初始化表格的列
 */
TSite.initColumn = function () {
    return [
        {field: 'selectItem', radio: true},
        {title: '主键ID', field: 'id', visible: false, align: 'center', valign: 'middle'},
        {title: '管理员姓名', field: 'userName', visible: true, align: 'center', valign: 'middle',},
        {title: '运营商ID', field: 'operatorId', visible: false, 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',
            formatter:function (data) {
                if (data==1){
                    return "个人"
                }else if (data==2){
                    return "企业"
                }else{
                    return "未认证"
                }
 
            }
        },
        {title: '分账比例', field: 'proportion', visible: true, align: 'center', valign: 'middle'},
        {title: '审核状态', field: 'audit', visible: true, align: 'center', valign: 'middle',
            formatter:function (data) {
                return {0:"未认证",1:"待审核",2:"审核通过",3:"审核失败"}[data]
            }
        },
        {title: '操作', field: 'audit', visible: true, align: 'center', valign: 'middle',
            formatter: function (data,row) {
                var btn = "";
                if(data==0) {
                    var str = '<button class="btn btn-outline btn-primary" onclick="TSite.auth('+row.operatorId+')" >去认证</button>'
                    btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="" onfocus="TUser.tooltip()">' + str + '</p>']
                }else {
                    var str = '<button class="btn btn-outline btn-primary" onclick="TSite.auth1(' + row.operatorId + ')" >详情</button>'
                    btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="" onfocus="TUser.tooltip()">' + str + '</p>']
                }
                return btn;
            }
        },
    ];
};
TSite.auth = function () {
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: "商户认证",
            area: ['100%', '100%'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/operator/proportionAuth/' + TSite.seItem.operatorId
        });
        this.layerIndex = index;
    }
};
/**
 * 商户号认证页面回显
 */
TSite.auth1 = function () {
    if (this.check()) {
        var index = layer.open({
            type: 2,
            title: "商户认证详情",
            area: ['100%', '100%'], //宽高
            fix: false, //不固定
            maxmin: true,
            content: Feng.ctxPath + '/operator/proportionAuth1/' + TSite.seItem.operatorId
        });
        this.layerIndex = index;
    }
};
TSite.proportion = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length >1 ){
        Feng.info("只能选择一个运营商商户设置分账比例!");
    }else {
        if (this.check()) {
            var index = layer.open({
                type: 2,
                title: "认证",
                area: ['100%', '100%'], //宽高
                fix: false, //不固定
                maxmin: true,
                content: Feng.ctxPath + '/operator/proportion/' + TSite.seItem.operatorId
            });
            this.layerIndex = index;
        }
    }
};
TSite.commit = function(){
    var alipayProportion  = $("#alipayProportion").val();
    var wechatProportion  = $("#wechatProportion").val();
    if($("#alipayProportion").val()=='' ){
        Feng.info("请输入支付宝分账比例")
        return;
    }
    if($("#wechatProportion").val()=='' ){
        Feng.info("请输入微信分账比例")
        return;
    }
    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/operator/proportion", function(data){
            Feng.success("设置成功!");
            window.parent.TSite.table.refresh();
            TSite.close();
    },function(data){
        Feng.error("操作失败!");
    });
    ajax.set("operatorIdOne",        $("#id").val()    );
    ajax.set("alipayProportion",        $("#alipayProportion").val()    );
    ajax.set("alipayNum",        $("#alipayNum").val()    );
    ajax.set("wechatProportion",        $("#wechatProportion").val()    );
    ajax.set("wechatNum",        $("#wechatNum").val()    );
    ajax.start();
};
// 银行卡使用
TSite.oneChange2 = function (e) {
    var oneId=$(e).val();
    console.log(oneId)
    console.log("!!!!!!!!!!!!!")
    var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange3", function(data){
        if(data!=null){
            var content='<option value="">选择市</option>';
            $.each(data, function(k,v) {
                content += "<option value='"+v.code+"'>"+v.name+"</option>";
            });
            $("#cCode").empty().append(content);
        }
    });
    ajax.set("oneId",oneId);
    ajax.start();
};
// 经营地址使用
TSite.oneChange6 = function (e) {
    var oneId=$(e).val();
    console.log(oneId)
    console.log("!!!!!!!!!!!!!")
    var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange3", function(data){
        if(data!=null){
            var content='<option value="">选择市</option>';
            $.each(data, function(k,v) {
                content += "<option value='"+v.code+"'>"+v.name+"</option>";
            });
            $("#bcCode").empty().append(content);
        }
    });
    ajax.set("oneId",oneId);
    ajax.start();
};
// 经营地址使用
TSite.twoChange = function (e) {
    var oneId=$(e).val();
    console.log(oneId)
    console.log("!!!!!!!!!!!!!")
    var ajax = new $ax(Feng.ctxPath + "/operator/getDistrict", function(data){
        if(data!=null){
            var content='<option value="">选择区(县)</option>';
            $.each(data, function(k,v) {
                content += "<option value='"+v.code+"'>"+v.name+"</option>";
            });
            $("#bdCode").empty().append(content);
        }
    });
    ajax.set("cityCode",oneId);
    ajax.start();
};
TSite.addSubmit = function(){
    var bodyType = $("input[name='bodyType']:checked").val();
    var type = $("input[name='type']:checked").val();
    if (bodyType=="" || null == bodyType){
        Feng.error("请选择主体类型");
        return;
    }
    if ("" == $("#businessName").val() ){
        Feng.error("请输入商户名称");
        return;
    }
    if ("" == $("#aliasName").val() ){
        Feng.error("请输入商户别名");
        return;
    }
    if ("" == $("#businessNumber").val() ){
        Feng.error("请输入营业执照编号");
        return;
    }
    if ("" == $("#businessNumber").val() ){
        Feng.error("请上传营业执照");
        return;
    }
    if ("" == $("#name").val() ){
        Feng.error("请输入联系人姓名");
        return;
    }
    if ("" == $("#phone").val() ){
        Feng.error("请输入联系人电话");
        return;
    }
    if ("" == $("#legalPerson").val()){
        Feng.error("请输入法人姓名");
        return;
    }
 
    if ("" == $("#lIDNumber").val()){
        Feng.error("请输入法人身份证号");
        return;
    }
    if ("" == $("#zfbAccount").val()){
        Feng.error("请输入签约支付宝账号");
        return;
    }
    // 结算账户类型
    var accountType = $("input[name='accountType']:checked").val();
    // 结算到银行卡
    if (accountType == "bankCard"){
        if ("" == $("#bankCard").val()){
            Feng.error("请输入银行卡号");
            return;
        }
        if ("" == $("#bankName").val()){
            Feng.error("请选择开户银行");
            return;
        }
        if ("" == $("#bankName1").val()){
            Feng.error("请输入开户支行名称");
            return;
        }
        if ("" == $("#bankUserName").val()){
            Feng.error("请输入开户名称");
            return;
        }
        if ("" == $("#pCode").val()){
            Feng.error("请选择开户银行所在省");
            return;
        }
        if ("" == $("#cCode").val()){
            Feng.error("请选择开户银行所在市");
            return;
        }
    }else{
        // 结算到支付宝
        if ("" == $("#alipayAccount").val()){
            Feng.error("请输入支付宝账号");
            return;
        }
    }
 
 
    //提交信息
    var ajax = new $ax(Feng.ctxPath + "/operator/auth", function(data){
        if (data==5001){
            Feng.error("未上传营业执照!");
            return;
        }else if(data==5002){
            Feng.error("未上传法人身份证正面照!");
            return;
        }else if(data==5003){
            Feng.error("未上传法人身份证背面照!");
            return;
        }else if(data==5007){
            Feng.error("输入的开户银行名称有误!");
            return;
        } else if (data.code==500){
            console.log(data)
            Feng.error("认证失败:"+data.msg);
            return;
        }else{
            Feng.success("认证成功!请等待支付宝审核");
            window.parent.TSite.table.refresh();
            TSite.close();
        }
    },function(data){
        Feng.error("操作失败!");
    });
    ajax.set("operatorId",        $("#id").val());
    ajax.set("bodyType",        bodyType );
    ajax.set("businessName",        $("#businessName").val());
    ajax.set("aliasName",        $("#aliasName").val());
    ajax.set("businessNumber",        $("#businessNumber").val()    );
    ajax.set("license",        $("#license").val()    );
    ajax.set("name",        $("#name").val()    );
    ajax.set("phone",        $("#phone").val()    );
    ajax.set("shopProvinceCode",        $("#bpCode").val()    );
    ajax.set("shopProvince",        $('#bpCode option:selected').text());
    ajax.set("shopCityCode",        $("#bcCode").val()    );
    ajax.set("shopCity",        $('#bcCode option:selected').text());
    ajax.set("shopDistrictCode",        $("#bdCode").val()    );
    ajax.set("shopDistrict",        $('#bdCode option:selected').text());
    ajax.set("registerAddress",        $("#registerAddress").val()    );
    ajax.set("legalPerson",        $("#legalPerson").val()    );
    ajax.set("leagleNumber",        $("#leagleNumber").val()    );
    ajax.set("legalFront",        $("#IDCardImg").val()    );
    ajax.set("legalBack",        $("#IDCardImg1").val()    );
    ajax.set("accountType",        accountType    );
    ajax.set("alipayAccount",        $("#alipayAccount").val()    );
    ajax.set("bankCard",        $("#bankCard").val()    );
    // 结算账户类型
    var useType = $("input[name='useType']:checked").val();
    ajax.set("useType",        useType    );
    // 银行卡类型
    var cardType = $("input[name='cardType']:checked").val();
    ajax.set("cardType",        cardType    );
    ajax.set("bankName",        $("#bankName").val()    );
    ajax.set("bankNameTwo",        $("#bankName1").val()    );
    ajax.set("accountName",        $("#bankUserName").val()    );
    ajax.set("provinceCode",        $("#pCode").val()    );
    ajax.set("province",        $('#pCode option:selected').text());
    ajax.set("cityCode",        $("#cCode").val()    );
    ajax.set("city",        $('#cCode option:selected').text());
    ajax.set("iqImage",        $("#iqImage").val()    );
    ajax.set("zfbAccount",        $("#zfbAccount").val()    );
    ajax.start();
};
/**
 * 检查是否选中
 */
TSite.check = function () {
    var selected = $('#' + this.id).bootstrapTable('getSelections');
    if(selected.length == 0){
        Feng.info("请先选中表格中的某一记录!");
        return false;
    }else{
        TSite.seItem = selected[0];
        return true;
    }
};
 
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/' + TSite.seItem.operatorId
    });
    this.layerIndex = index;
 
};
/**
 * 关闭此对话框
 */
TSite.close = function() {
    parent.layer.close(window.parent.TSite.layerIndex);
};
 
TSite.search = function () {
    var queryData = {};
    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 () {
    $("#name").val("");
    $("#phone").val("");
    $("#platform").val("");
    $("#type").val("");
    $("#state").val("");
    TSite.search();
};
TSite.tradeYse = function () {
 
    var tradeT = document.getElementById('tradeE');
    var endTime = document.getElementById('endTime');
    var IDCardT = document.getElementById('IDCardE');
    var bIDCardT = document.getElementById('bIDCardT');
    var tradeTime = document.getElementById('tradeTime');
    var IDCardTime = document.getElementById('IDCardEnd');
    var bTime = document.getElementById('bEnd');
    console.log("进入")
// 判断是否被选中
    if (tradeT.checked) {
        endTime.disabled = true;
        endTime.value="";
    } else {
        endTime.disabled = false;
    }
    if (IDCardT.checked) {
        IDCardTime.value="";
        IDCardTime.disabled = true;
    } else {
        IDCardTime.disabled = false;
    }
    if (bIDCardT.checked) {
        bTime.value="";
        bTime.disabled = true;
    } else {
        bTime.disabled = false;
    }
};
 
 
$(function () {
    var defaultColunms = TSite.initColumn();
    var table = new BSTable(TSite.id, "/operatorUser/listAll", defaultColunms);
    table.setPaginationType("client");
    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");
    var inDoorImages = new $WebUpload("inDoorImages");
    var outDoorImages = new $WebUpload("outDoorImages");
    var iqImage = new $WebUpload("iqImage");
    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();
    inDoorImages.setUploadBarId("progressBar");
    inDoorImages.init();
    outDoorImages.setUploadBarId("progressBar");
    outDoorImages.init();
    iqImage.setUploadBarId("progressBar");
    iqImage.init();
});