| | |
| | | ' <div class="form-group" >\n' + |
| | | ' <label class="col-sm-3 control-label">*手机号:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="form-control" id="addPhone" placeholder="请输入">' + |
| | | ' <input class="form-control" id="addPhone" type="text" placeholder="请输入" maxlength="11">' + |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group" >\n' + |
| | |
| | | Feng.info("手机号不能为空"); |
| | | return |
| | | } |
| | | //定义正则表达式 |
| | | var reg='^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-9])|(18[0-9])|166|198|199|191|(147))\\d{8}$'; |
| | | //创建正则表达式对象 |
| | | var regExp=new RegExp(reg); |
| | | //使用test()函数验证数据是否匹配正则表达式,匹配返回true,否则返回false |
| | | if (!regExp.test(addPhone)) { |
| | | Feng.info("手机号格式不正确"); |
| | | return |
| | | } |
| | | if(null == addProvince || '' == addProvince){ |
| | | Feng.info("请选择所在省"); |
| | | return |
| | |
| | | if(res.code == 200){ |
| | | Feng.success("添加成功"); |
| | | layer.closeAll(); |
| | | Referee.table.refresh(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | | MgrUser.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | |
| | | ' <div class="form-group" >\n' + |
| | | ' <label class="col-sm-3 control-label">*手机号:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="form-control" id="addPhone" placeholder="请输入">' + |
| | | ' <input class="form-control" id="addPhone" type="text" placeholder="请输入" maxlength="11"/>' + |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group" >\n' + |
| | |
| | | Feng.info("手机号不能为空"); |
| | | return |
| | | } |
| | | //定义正则表达式 |
| | | var reg='^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-9])|(18[0-9])|166|198|199|191|(147))\\d{8}$'; |
| | | //创建正则表达式对象 |
| | | var regExp=new RegExp(reg); |
| | | //使用test()函数验证数据是否匹配正则表达式,匹配返回true,否则返回false |
| | | if (!regExp.test(addPhone)) { |
| | | Feng.info("手机号格式不正确"); |
| | | return |
| | | } |
| | | if (null == addProvince || '' == addProvince) { |
| | | Feng.info("请选择所在省"); |
| | | return |
| | |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/referee/editReferee", function (res) { |
| | | if (res.code == 200) { |
| | | Feng.success("添加成功"); |
| | | Feng.success("编辑成功"); |
| | | layer.closeAll(); |
| | | Referee.table.refresh(); |
| | | } else { |
| | | Feng.error(res.msg); |
| | | } |
| | | MgrUser.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | |
| | | Referee.delReferee = function (){ |
| | | if(this.check()){ |
| | | var operation = function(){ |
| | | var userId = MgrUser.seItem.id; |
| | | var ajax = new $ax(Feng.ctxPath + "/mgr/delete", function () { |
| | | if(language==1){ |
| | | Feng.success("删除成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Delete succeeded!"); |
| | | }else { |
| | | Feng.success("Hapus berhasil!"); |
| | | var ajax = new $ax(Feng.ctxPath + "/referee/updateState", function (res) { |
| | | if (res.code == 200) { |
| | | Feng.success("删除成功"); |
| | | layer.closeAll(); |
| | | Referee.search(); |
| | | } else { |
| | | Feng.error(res.msg); |
| | | } |
| | | MgrUser.table.refresh(); |
| | | }, function (data) { |
| | | if(language==1){ |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }else if(language==2){ |
| | | Feng.error("Delete failed!" + data.responseJSON.message + "!"); |
| | | }else { |
| | | Feng.error("Hapus gagal!" + data.responseJSON.message + "!"); |
| | | } |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("userId", userId); |
| | | ajax.setData({ |
| | | 'id': Referee.seItem.id, |
| | | 'state': 3 |
| | | }); |
| | | ajax.start(); |
| | | }; |
| | | Feng.confirm("是否删除员工: " + MgrUser.seItem.name + "?",operation); |
| | | Feng.confirm("是否删除裁判:" + Referee.seItem.name + "?",operation); |
| | | } |
| | | } |
| | | |
| | |
| | | * 上架 |
| | | */ |
| | | Referee.onShelf = function () { |
| | | if (this.check()){ |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | const data1 = { |
| | | ids:[], |
| | | state:null |
| | | if(this.check()){ |
| | | var operation = function(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/referee/updateState", function (res) { |
| | | if (res.code == 200) { |
| | | Feng.success("解冻成功"); |
| | | layer.closeAll(); |
| | | Referee.search(); |
| | | } else { |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("解冻失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.setData({ |
| | | 'id': Referee.seItem.id, |
| | | 'state': 1 |
| | | }); |
| | | ajax.start(); |
| | | }; |
| | | selected.forEach(function(obj) { |
| | | console.log("查看选中") |
| | | console.log(obj) |
| | | var id = obj.id; |
| | | data1.ids.push(id); |
| | | }); |
| | | data1.state = 1; |
| | | |
| | | $.ajax({ |
| | | url: Feng.ctxPath + "/referee/changeState", |
| | | type: "POST", |
| | | contentType: "application/json", // 设置请求头的 Content-Type |
| | | data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 |
| | | success: function(response) { |
| | | Feng.success("解冻成功!"); |
| | | Referee.search(); |
| | | }, |
| | | error: function(xhr, status, error) { |
| | | var errorMessage = xhr.responseText ? xhr.responseText : "解冻失败!"; |
| | | } |
| | | }); |
| | | Feng.confirm("是否解冻裁判:" + Referee.seItem.name + "?",operation); |
| | | } |
| | | }; |
| | | |
| | |
| | | * 下架 |
| | | */ |
| | | Referee.offShelf = function () { |
| | | if (this.check()){ |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | const data1 = { |
| | | ids:[], |
| | | state:null |
| | | if(this.check()){ |
| | | var operation = function(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/referee/updateState", function (res) { |
| | | if (res.code == 200) { |
| | | Feng.success("冻结成功"); |
| | | layer.closeAll(); |
| | | Referee.search(); |
| | | } else { |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("冻结失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.setData({ |
| | | 'id': Referee.seItem.id, |
| | | 'state': 2 |
| | | }); |
| | | ajax.start(); |
| | | }; |
| | | selected.forEach(function(obj) { |
| | | var id = obj.id; |
| | | data1.ids.push(id); |
| | | }); |
| | | data1.state = 2; |
| | | $.ajax({ |
| | | url: Feng.ctxPath + "/referee/changeState", |
| | | type: "POST", |
| | | contentType: "application/json", // 设置请求头的 Content-Type |
| | | data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 |
| | | success: function(response) { |
| | | Feng.success("冻结成功!"); |
| | | Referee.search(); |
| | | }, |
| | | error: function(xhr, status, error) { |
| | | var errorMessage = xhr.responseText ? xhr.responseText : "冻结失败!"; |
| | | } |
| | | }); |
| | | Feng.confirm("是否冻结裁判:" + Referee.seItem.name + "?",operation); |
| | | } |
| | | }; |
| | | |
| | |
| | | |
| | | Referee.search = function () { |
| | | var queryData = {}; |
| | | queryData['userName'] = $("#name").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['phone'] =$("#phone").val(); |
| | | queryData['provinceCode'] =$("#provinceCode").val(); |
| | | queryData['cityCode'] =$("#cityCode").val(); |
| | |
| | | var table = new BSTable(Referee.id, "/referee/listAll", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | Referee.table = table.init(); |
| | | |
| | | Referee.region('provinceCode', null); |
| | | }); |