123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292 |
- @{
- ViewBag.Title = "比赛项目";
- Layout = "~/Views/Shared/_Layout.cshtml";
- }
- @using MES.Production.Service;
- @using Central.Control.Domain;
- @using Ant.Service.Common;
- @using Ant.Service.Common.Enums;
- @using CommonToolHelper;
- @using MES.Production.Entity;
- @using ChangFa.Machinery.WebPage.Areas;
- @model PageInfo
- <div class="row col-lg-12">
- <div class="wrapper wrapper-content animated fadeInUp" style="overflow-y:scroll;">
- <div class="ibox">
- @if (Convert.ToInt32(ViewData["state"]) == 0)
- {
- <div class="ibox-title">
- <div class="ibox-tools rboor">
- <a class="btn btn-primary btn-xs p310" id="insert" action="add"><i class="im-plus"></i> 增加</a>
- <a class="btn btn-primary btn-xs p310" id="modify" action="edit"><i class="im-pencil2"></i> 修改</a>
- <a class="btn btn-primary btn-xs p310" id="delete" action="remove"><i class="im-remove4"></i> 删除</a>
- </div>
- </div>
- }
- <div class="ibox-content">
- <div class="panel panel-default">
- <div class="panel-heading">
- <h3 class="panel-title">比赛项目</h3>
- </div>
- <div class="panel-body">
- <div class="clearfix f-hafl">
- <div class="row">
- <div class="col-xs-4 col-md-4">
- <label class="col-lg-0 control-label" style="float:left;">比赛大项:</label>
- <div class="col-lg-8 col-sm-7">
- <label class="control-label">@ViewBag.SportsName</label>
- </div>
- </div>
- <div class="col-lg-8 col-sm-8" style="float:right;">
- @*<label class="col-lg-0 control-label" style="float:left;">比赛小项:</label>*@
- <div class="col-xs-10 col-md-4">
- <div class="col-lg-12 col-sm-12 input-group" style="width: 100%; float: right;">
- @Html.Hidden("sportsId", ViewData["sportsIds"])
- @Html.TextBox("SmallEventName", ViewData["SmallEventName"], new
- {
- @class = "input-sm form-control",
- @readonly = "readonly",
- @placeholder = "请选择比赛项目名称",
- style = "display:none;"
- })
- <span class="input-group-btn">
- <a class="btn btn-sm btn-primary" id="selectsport"><i class="im-pencil2"></i>设置组别项目</a>
- </span>
- </div>
- </div>
- </div>
- </div>
- <div class="clearfix f-hafl">
- <div class="col-lg-2 col-sm-3 pl0">
- <div class="form-group">
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div id="example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
- <table id="example" class="table table-striped table-bordered table-hover dataTables-example dataTable" cellspacing="0" width="100%">
- <thead>
- <tr>
- <th class="tn" style="width: 5% !important"><input name="checkall" id="checkall" type="checkbox" value=""></th>
- <th width="10%">组别</th>
- <th width="20%">年龄段</th>
- <th width="10%">男生人数</th>
- <th width="10%">女生人数</th>
- <th width="10%">混合人数</th>
- <th width="10%">类型</th>
- <th width="10%">操作</th>
- </tr>
- </thead>
- <tbody>
- @{foreach (var item in Model.List)
- {
- <tr>
- <td class="tn"><input name="checkbox_name" type="checkbox" value="@item.ID"></td>
- <td>
- <a href="javascript:modify('@item.ID')" listaction="detail">@item.Constituencies</a>
- </td>
- <td>@(Convert.ToDateTime(item.AgeStart).ToString("yyyy-MM-dd"))~@(Convert.ToDateTime(item.AgeEnd).ToString("yyyy-MM-dd"))</td>
- <td>@item.BoysMax</td>
- <td>@item.GirlsMax</td>
- <td>@item.MixedMax</td>
- <td>@item.SchoolSmallType</td>
- <td><a href="javascript:settings(@item.SEPID,@item.ID)">项目规则</a></td>
- </tr>
- }
- }
- </tbody>
- </table>
- <!-- page -->
- <div class="bottom">
- @if (Model != null)
- {
- <div class="dataTables_info" id="example_info" Post="status" aria-live="polite">显示第 @Model.BeginPage 至 @Model.EndPage 项结果,共 @Model.Count 项</div>
- <div class="dataTables_length" id="example_length">
- <label>
- 显示
- <select name="example_length" onchange="submit()" aria-controls="example" class="form-control input-sm">
- <option value="10" @(Model.PageSize == 10 ? "selected" : "")>10</option>
- <option value="25" @(Model.PageSize == 25 ? "selected" : "")>25</option>
- <option value="50" @(Model.PageSize == 50 ? "selected" : "")>50</option>
- <option value="100" @(Model.PageSize == 100 ? "selected" : "")>100</option>
- </select> 项结果
- </label>
- </div>
- @CommonHtmlHelper.PaginationPager(Model.Index, Model.PageSize, Model.Count, 7, Model.Url);
- }
- <div class="clear"></div>
- </div>
- <!-- page -->
- </div>
- </div>
- </div>
- </div>
- @*<div class="hr-line-dashed">
- <div class="form-group" style="margin-top:10px !important;">
- <div class="col-sm-2 col-sm-offset-2">
- <button class="btn btn-primary btn-save" type="submit" id="btn-dig-close"><i class="fa fa-check"></i> <span>确定</span></button>
- </div>
- </div>
- </div>*@
- </div>
- <!-- table end -->
- @section scripts{
- <script type="text/javascript">
- function settings(a, b) {
- @*var states =@ViewData["state"];
- if (states > 0) {
- dig.alertError("提示", "对不起,只有赛事状态为起草的时,才能修改操作!");
- return;
- }*@
- dig.addModel('修改项目规则', '/Sys/ProjectEntry/ProjectEntryList?SEPID=' + a + "&SCID=" + b + "&State=@ViewData["state"]", 1000, 800, function () {
- if (this.returnValue == 'yes') {
- }
- });
- }
- $(function () {
- var dialog = top.dialog.get(window);
- var state =@ViewData["state"];
- //if (parseInt(state) > 0) {
- // dig.alertError("提示", "对不起,只有赛事状态为起草的时,才能修改操作!");
- // return;
- //}
- //添加
- $('#insert').click(function () {
- dig.addModel('添加/修改组别', '/Sys/EntryConditions/Detail?sportsName=@ViewData["sportsName"]&sportsId=@ViewData["sportsId"]&SEPID=@ViewData["ID"]', 800, 600, function () {
- if (this.returnValue == 'yes') {
- location.reload();
- }
- });
- });
- $('#modify').click(function () {
- var vals = '';
- var num = 0;
- $('input[name="checkbox_name"]:checked').each(function () {
- vals = $(this).val();
- num++;
- });
- if (!vals) {
- dig.alertError("提示", "对不起,请选中您要操作的记录!");
- return;
- }
- if (num > 1) {
- dig.alertError("提示", "对不起,每次只能选择一条赛事进行报名!");
- return;
- }
- if (state > 0) {
- dig.alertError("提示", "对不起,只有赛事状态为起草的时,才能修改操作!");
- return;
- }
- dig.addModel('添加/修改组别', '/Sys/EntryConditions/Detail?id=' + vals+'&sportsName=@ViewData["sportsName"]&sportsId=@ViewData["sportsId"]&SEPID=@ViewData["ID"]', 800, 600, function () {
- if (this.returnValue == 'yes') {
- location.reload();
- }
- });
- });
- //删除
- $('#delete').click(function () {
- if (state > 0) {
- dig.alertError("提示", "对不起,只有赛事状态为起草的时,才能删除操作!");
- return;
- }
- else {
- var vals = '';
- var num = 0;
- $('input[name="checkbox_name"]:checked').each(function () {
- if (num == 0)
- vals = $(this).val();
- else
- vals = vals + ',' + $(this).val();
- num++;
- });
- if (vals == '' || vals == ',') {
- dig.alertError("提示", "对不起,请选中您要操作的记录!");
- return;
- }
- var msg = "删除记录后不可恢复,您确定吗?";
- dig.confirm("删除确认", msg, function () {
- $.post('/Sys/EntryConditions/Delete', { idList: vals }, function (res) {
- if (res.Status == "y") {
- dig.alertSuccess('提示', '删除成功', function () {
- location.reload();
- });
- } else {
- dig.alertError("提示", res.Msg);
- }
- }, "json");
- });
- }
- });
- function filter(str) {
- str = str.replace(/\+/g, "%2B");
- str = str.replace(/\&/g, "%26");
- return str;
- }
- $('#selectsport').click(function () {
- var vals = '';
- var num = 0;
- $('input[name="checkbox_name"]:checked').each(function () {
- vals = $(this).val();
- num++;
- });
- if (!vals) {
- dig.alertError("提示", "对不起,请选择需要设置的组别!");
- return false;
- }
- if (num > 1) {
- dig.alertError("提示", "对不起,每次只能选对一条需要设置的组别!");
- return false;
- }
- var scid = "";
- $("input[name='checkbox_name']:checked").each(function (a, b) {
- scid += $(b).val() + ",";
- });
- scid = scid.substring(0, scid.lastIndexOf(','));
- dig.addModel('选择比赛项目', '/Sys/SportsEvent/SelectSport?sportsName=@ViewData["sportsName"]&sportsId=@ViewData["sportsId"]&id=@ViewData["ID"]', 800, 600, function () {
- if (this.returnValue == 'yes') {
- var str = this.returnParas.sportsName;
- str = str.substring(0, str.lastIndexOf(','));
- var strId = this.returnParas.sportsId;
- strId = strId.substring(0, strId.lastIndexOf(','));
- str = filter(str);
- debugger;
- $.post('/Sys/EntryConditions/SetProjectEntry?sportsName=@ViewData["sportsName"]&sportsId=@ViewData["sportsId"]&SEPID=@ViewData["ID"]&smallSport=' + str + '&smallSportId=' + strId+'&SCID=' + scid, { }, function (res) {
- if (res.Status == "y") {
- dig.alertSuccess('提示', '设置成功', function () {
- });
- } else {
- dig.alertError("提示", res.Msg);
- }
- }, "json");
- }
- });
- });
- });
- </script>
- }
|