| | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | |
| | | var type = $("#type").val() |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所在省', field: 'province', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | {title: '所在省', field: 'province', visible: type==2?false:true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '所在市', field: 'city', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所在市', field: 'city', visible: type==2?false:true, align: 'center', valign: 'middle'}, |
| | | {title: '举办门店', field: 'storeName', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '赛事名称', field: 'name', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | |
| | | }, |
| | | {title: '结束时间', field: 'endTime', visible: true, align: 'center', valign: 'middle',width:'5%', |
| | | }, |
| | | {title: '最大人数-已报名人数', field: 'applicantsNumber', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | {title: '最大人数-已报名人数', field: 'count', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '报名条件', field: 'registerCondition', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | formatter:function (data) { |
| | |
| | | {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | formatter:function (data) { |
| | | return {1:"未开始",2:"已开始",3:"已结束",4:"已取消"}[data] |
| | | } |
| | | }, |
| | | {title: '审核状态', field: 'auditStatus', visible: type==2?true:false, align: 'center', valign: 'middle',width:'8%', |
| | | formatter:function (data) { |
| | | return {1:"待审核",2:"已通过",3:"已拒绝"}[data] |
| | | } |
| | | }, |
| | | ]; |
| | |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | TCompetition.user = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | |
| | | if (this.check()) { |
| | | var nickname = TCompetition.seItem.carLicensePlate; |
| | | if (nickname == "" || nickname == null || nickname == undefined){ |
| | | nickname = "该车辆"; |
| | | nickname = "该赛事"; |
| | | }else{ |
| | | nickname = "【"+nickname+"】"; |
| | | } |
| | | swal({ |
| | | title: language==1?"您是否确认删除" + nickname + "?":(language==2?"Are you sure to delete the" + nickname + "?":"Apakah Anda pasti akan menghapus" + nickname + "?"), |
| | | text: language==1?"请谨慎操作!":(language==2?' Please operate with caution!':'Harap beroperasi dengan hati -hati!'), |
| | | title: "您是否确认取消" + nickname + "?", |
| | | text: "请谨慎操作!", |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: language==1?"删除":(language==2?'Delete':'Hapus'), |
| | | confirmButtonText: "确定", |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/TCompetition/delete", function (data) { |
| | | if(language==1){ |
| | | swal("删除成功", "您已经成功删除了" + nickname + "。", "success"); |
| | | }else if(language==2){ |
| | | swal("Delete succeeded!", "You have successfully deleted it" + nickname + "。", "success"); |
| | | }else { |
| | | swal("Hapus berhasil!", "Anda berhasil menghapus" + nickname + "。", "success"); |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/cancel", function (data) { |
| | | swal("取消成功", "您已经成功取消了" + nickname + "。", "success"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | if(language==1){ |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | }else if(language==2){ |
| | | swal("Failed to delete", data.responseJSON.message + "!", "warning"); |
| | | }else { |
| | | swal("Hapus Gagal", data.responseJSON.message + "!", "warning"); |
| | | } |
| | | |
| | | swal("取消失败", data.responseJSON.message + "!", "warning"); |
| | | }); |
| | | ajax.set("TCompetitionId",TCompetition.seItem.id); |
| | | ajax.start(); |