123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- @using Bowin.Web.Controls.Mvc;
- @model EMIS.ViewModel.TeachingMaterial.TeachersOrderView
- @using EMIS.Web.Controls;
- @{
- ViewBag.Title = "Add";
- Guid schoolyear = ViewData["SchoolyearID"] == null ? Guid.Empty : new Guid(ViewData["SchoolyearID"].ToString());
- ComboGridOptions Psop = new ComboGridOptions
- {
- TextField = "UnitName",
- ValueField = "PublishID",
- ID = "PublishDropdown",
- Name = "PublishDropdown",
- OnSelect = "QueryPublishDropdownList",
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- new BoundFieldColumn { FieldName="UnitName", Align=AlignStyle.Center }
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/Publisher/List"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false
- }
- };
- ComboGridOptions CsopName = new ComboGridOptions
- {
- TextField = "CourseName",
- ValueField = "CoursematerialID",
- ID = "CourseDropdown",
- Name = "CourseDropdown",
- OnSelect = "QueryCourseDropdownList",
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- // new LinkButtonColumn { FieldName="CourseCode", HeaderText="课程代码", Align=AlignStyle.Center },
- new BoundFieldColumn { FieldName="CourseName", HeaderText="课程名称", Align=AlignStyle.Center }
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/Coursematerial/ListForDropdown"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false
- }
- };
- ComboGridOptions TMName = new ComboGridOptions
- {
- TextField = "TeachingMaterialName",
- ValueField = "TeachingMaterialPoolID",
- ID = "TeachingMaterialDropdown",
- Name = "TeachingMaterialDropdown",
- OnSelect = "QueryTeachingMaterialDropdownList",
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- new BoundFieldColumn { FieldName="TeachingMaterialName",HeaderText="教材名称", Align=AlignStyle.Center },
- // new BoundFieldColumn { FieldName="TeachingMaterialCode",HeaderText="教材编号", Align=AlignStyle.Center }
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/TeachingMaterialPool/List"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false
- }
- };
- string orderJsonStr = ViewData["orderJsonStr"] as string;
- }
- @section scripts{
- <script src="../../Scripts/Business/TeachingMaterial/TeachingMaterialPool.js" type="text/javascript"></script>
- <script type="text/javascript">
- function QuerySchoolyear(data) {
- reload();
- }
- //获取选中的数据
- function validChooseOrder() {
- var d = [];
- $.each($("#dgTeachingMaterialPoolList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- function TeachersOrder_Save() {
- var d = validChooseOrder();
- var schoolYearIDStr = $('#SchoolyearID').combobox('getValue');
- var orderDescStr = document.getElementById("OrderDesc").value;;
- if (d.length == 0) {
- $.messager.alert("提示", "请选择您要申请征订的信息!");
- return;
- }
- if (schoolYearIDStr == "") {
- $.messager.alert("提示", "请选择您要申请征订的学期!");
- return;
- }
- //if (orderDescStr == "") {
- // $.messager.alert("提示", "请填写征订说明信息!!");
- // return;
- //}
- var reg = /^[0-9]\d*$/;
- for (var i = 0; i < d.length; i++) {
- if (!reg.test(d[i].OrderQty)) {
- $.messager.alert("系统提示", "选中信息,存在征订数量数据格式不正确,请检查!");
- return;
- }
- }
- $.messager.confirm("系统提示", "您确定要申请征订该教材?", function (r) {
- if (r) {
- orderJsonStr = JSON.stringify(d);
- $("#hid_orderJsonStr").val(orderJsonStr); //将json赋值给隐藏域
- $(document.forms[0]).submit(); //提交Form表单
- }
- });
- }
- </script>
- <style type="text/css">
- textarea {
- min-height: 35px;
- }
- </style>
- }
- <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
- @using (Ajax.BeginForm(new AjaxOptions
- {
- Url = "/TeachersOrder/TeachersSave",
- OnSuccess = "EMISFunction.FormSuccess",
- OnBegin = "EMISFunction.FormSubmit",
- OnComplete = "EMISFunction.FormComplete"
- }))
- { @Html.Hidden("hid_orderJsonStr")
- <div class="p_title">
- @*<div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
- 征订申请信息
- </div>*@
- <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Edit")</div>
- </div>
-
- <div class="search_list popupWindowContent">
- <table cellpadding="0" cellspacing="0" id="departmenttable" width="100%" height="100%">
- <tr>
- <td>@Html.Label("学年学期"):
- </td>
- <td colspan="3">@Html.DropdownListFor(x => x.SchoolyearID, new DropdownListOptions { ItemSourceUrl = Url.Content("~/SchoolYear/DropDown"), TextField = "Text", ValueField = "Value" }, new Dictionary<string, string> { { "data-condition", "dgTeachingMaterialPoolList" } })
- </td>
- </tr>
- <tr>
- <td>@Html.LabelFor(x => x.OrderDesc):
- </td>
- <td colspan="3">@Html.TextAreaFor(x => x.OrderDesc, new Dictionary<string, object> { { "style", "width: 390px;" } })
- </td>
- </tr>
- <tr>
- <td>@Html.Label("查询信息"):</td>
- <td colspan="3">
- <div class="search_keyword">
- <div class="search_input">
- <ul>
- <li class="sn" style="padding-left: 5px;">教材名称:</li>
- <li class="sv">
- @Html.ComboGrid(TMName, new Dictionary<string, string> { { "data-condition", "dgTeachingMaterialPoolList" } })
- </li>
- <li class="sn" style="padding-left: 5px;">课程名称:</li>
- <li class="sv">
- @Html.ComboGrid(CsopName, new Dictionary<string, string> { { "data-condition", "dgTeachingMaterialPoolList" } })
- </li>
- </ul>
- </div>
- </div>
- </td>
- </tr>
- <tr>
- <td>@Html.Label("信息列表"):
-
- </td>
- <td colspan="3" valign="top">
- @Html.ContextMenuBar("Edit-RoleViewGrid")
- @Html.DataGrid(new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- new CheckBoxFieldColumn{ HeaderText="", FieldName="TeachingMaterialPoolID" },
- new TextBoxColumn { FieldName="OrderQty", HeaderText="征订数量", Align=AlignStyle.Center, IsRequired=true, Validator=new OnlyNumberValidator(), Width = 0.08},
- new BoundFieldColumn { FieldName="TeachingMaterialCode", HeaderText="教材编号", Align=AlignStyle.Center, Width = 0.08 },
- new BoundFieldColumn { FieldName="CoursematerialName", HeaderText="课程名称", Align=AlignStyle.Center,OverflowLength=28, Width = 0.16 },
- new BoundFieldColumn { FieldName="TeachingMaterialName", HeaderText="教材名称", Align=AlignStyle.Center,OverflowLength=28, Width = 0.16 },
- new BoundFieldColumn { FieldName="ISBN", HeaderText="ISBN", Align=AlignStyle.Center, Width = 0.14 },
- new BoundFieldColumn { FieldName="PublishTime", HeaderText="版本时间", Align=AlignStyle.Center, Width = 0.1},
- new BoundFieldColumn { FieldName="PublishName", HeaderText="出版单位", Align=AlignStyle.Center,OverflowLength=28, Width = 0.14 },
- new BoundFieldColumn { FieldName="Author", HeaderText="作者", Align=AlignStyle.Center,OverflowLength=28, Width = 0.12 },
- new BoundFieldColumn { FieldName="Price", HeaderText="单价", Align=AlignStyle.Center, Width = 0.08 }
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/TeachersOrder/GetTeachingMaterialPoolList"),
- IsPostBack = true,
- ID = "dgTeachingMaterialPoolList",
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false
- })
- </td>
- </tr>
- </table>
- </div>
- }
- </div>
|