| | |
| | | {title: '参与比赛', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '比赛时间', field: 'startTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '比分', field: 'score', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '结果', field: 'matchResult', visible: true, align: 'center', valign: 'middle'} |
| | | {title: '结果', field: 'matchResult', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data, item) { |
| | | return '<a href="#" onclick="UserGameRecord.changeScore(\'' + data + '\',' + item.blue + ',' + item.red + ')" style="color:blue;">修改比分</a>'; |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | UserGameRecord.changeScore = function (id, blue, red) { |
| | | const str = '<div class="row">\n' + |
| | | ' <div class="form-group" style="height: 50px;">\n' + |
| | | ' <label class="col-sm-3 control-label" style="text-align: right;">蓝方得分:</label>' + |
| | | ' <div class="col-sm-8">\n' + |
| | | ' <input id="blue" class="form-control" type="number" min="0" value="' + blue + '"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group" style="height: 50px;">\n' + |
| | | ' <label class="col-sm-3 control-label" style="text-align: right;">红方得分:</label>' + |
| | | ' <div class="col-sm-8">\n' + |
| | | ' <input id="red" class="form-control" type="number" min="0" value="' + red + '"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' |
| | | layer.open({ |
| | | type: 1 |
| | | ,title: '修改比分' |
| | | ,area: ['500px', '300px'] |
| | | ,offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | ,id: 'layerDemo' //防止重复弹出 |
| | | ,content: '<div style="padding: 20px">' + str + '</div>' |
| | | ,btnAlign: 'c' //按钮居中 |
| | | ,shade: 0.5 //不显示遮罩 |
| | | ,btn: ['确认', '关闭'] |
| | | ,yes: function (){ |
| | | let blue = $('#blue').val(); |
| | | let red = $('#red').val(); |
| | | if(null == blue || '' == blue){ |
| | | Feng.error("请填写有效的得分"); |
| | | return |
| | | } |
| | | if(null == red || '' == red){ |
| | | Feng.error("请填写有效的得分"); |
| | | return |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/worldCupRecords/changeScore", function (res) { |
| | | if (res.code==200){ |
| | | Feng.success("修改成功!"); |
| | | WorldCupGameStatisticsListInfo.search(); |
| | | layer.closeAll(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set({ |
| | | 'id': id, |
| | | 'blue': blue, |
| | | 'red': red |
| | | }); |
| | | ajax.start(); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |