Add.cshtml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. @using Bowin.Web.Controls.Mvc;
  2. @model EMIS.ViewModel.TeachingMaterial.TeachersOrderView
  3. @using EMIS.Web.Controls;
  4. @{
  5. ViewBag.Title = "Add";
  6. Guid schoolyear = ViewData["SchoolyearID"] == null ? Guid.Empty : new Guid(ViewData["SchoolyearID"].ToString());
  7. ComboGridOptions Psop = new ComboGridOptions
  8. {
  9. TextField = "UnitName",
  10. ValueField = "PublishID",
  11. ID = "PublishDropdown",
  12. Name = "PublishDropdown",
  13. OnSelect = "QueryPublishDropdownList",
  14. GridOptions = new DataGridOptions
  15. {
  16. Columns = new List<DataGridColumn>()
  17. {
  18. new BoundFieldColumn { FieldName="UnitName", Align=AlignStyle.Center }
  19. },
  20. IsCheckOnSelect = true,
  21. DataSourceUrl = Url.Content("~/Publisher/List"),
  22. IsPagination = true,
  23. IsShowRowNumbers = true,
  24. IsSingleSelect = false
  25. }
  26. };
  27. ComboGridOptions CsopName = new ComboGridOptions
  28. {
  29. TextField = "CourseName",
  30. ValueField = "CoursematerialID",
  31. ID = "CourseDropdown",
  32. Name = "CourseDropdown",
  33. OnSelect = "QueryCourseDropdownList",
  34. GridOptions = new DataGridOptions
  35. {
  36. Columns = new List<DataGridColumn>()
  37. {
  38. // new LinkButtonColumn { FieldName="CourseCode", HeaderText="课程代码", Align=AlignStyle.Center },
  39. new BoundFieldColumn { FieldName="CourseName", HeaderText="课程名称", Align=AlignStyle.Center }
  40. },
  41. IsCheckOnSelect = true,
  42. DataSourceUrl = Url.Content("~/Coursematerial/ListForDropdown"),
  43. IsPagination = true,
  44. IsShowRowNumbers = true,
  45. IsSingleSelect = false
  46. }
  47. };
  48. ComboGridOptions TMName = new ComboGridOptions
  49. {
  50. TextField = "TeachingMaterialName",
  51. ValueField = "TeachingMaterialPoolID",
  52. ID = "TeachingMaterialDropdown",
  53. Name = "TeachingMaterialDropdown",
  54. OnSelect = "QueryTeachingMaterialDropdownList",
  55. GridOptions = new DataGridOptions
  56. {
  57. Columns = new List<DataGridColumn>()
  58. {
  59. new BoundFieldColumn { FieldName="TeachingMaterialName",HeaderText="教材名称", Align=AlignStyle.Center },
  60. // new BoundFieldColumn { FieldName="TeachingMaterialCode",HeaderText="教材编号", Align=AlignStyle.Center }
  61. },
  62. IsCheckOnSelect = true,
  63. DataSourceUrl = Url.Content("~/TeachingMaterialPool/List"),
  64. IsPagination = true,
  65. IsShowRowNumbers = true,
  66. IsSingleSelect = false
  67. }
  68. };
  69. string orderJsonStr = ViewData["orderJsonStr"] as string;
  70. }
  71. @section scripts{
  72. <script src="../../Scripts/Business/TeachingMaterial/TeachingMaterialPool.js" type="text/javascript"></script>
  73. <script type="text/javascript">
  74. function QuerySchoolyear(data) {
  75. reload();
  76. }
  77. //获取选中的数据
  78. function validChooseOrder() {
  79. var d = [];
  80. $.each($("#dgTeachingMaterialPoolList").cmsXDataTable("getSelections"), function (index) {
  81. d.push(this);
  82. });
  83. return d;
  84. }
  85. function TeachersOrder_Save() {
  86. var d = validChooseOrder();
  87. var schoolYearIDStr = $('#SchoolyearID').combobox('getValue');
  88. var orderDescStr = document.getElementById("OrderDesc").value;;
  89. if (d.length == 0) {
  90. $.messager.alert("提示", "请选择您要申请征订的信息!");
  91. return;
  92. }
  93. if (schoolYearIDStr == "") {
  94. $.messager.alert("提示", "请选择您要申请征订的学期!");
  95. return;
  96. }
  97. //if (orderDescStr == "") {
  98. // $.messager.alert("提示", "请填写征订说明信息!!");
  99. // return;
  100. //}
  101. var reg = /^[0-9]\d*$/;
  102. for (var i = 0; i < d.length; i++) {
  103. if (!reg.test(d[i].OrderQty)) {
  104. $.messager.alert("系统提示", "选中信息,存在征订数量数据格式不正确,请检查!");
  105. return;
  106. }
  107. }
  108. $.messager.confirm("系统提示", "您确定要申请征订该教材?", function (r) {
  109. if (r) {
  110. orderJsonStr = JSON.stringify(d);
  111. $("#hid_orderJsonStr").val(orderJsonStr); //将json赋值给隐藏域
  112. $(document.forms[0]).submit(); //提交Form表单
  113. }
  114. });
  115. }
  116. </script>
  117. <style type="text/css">
  118. textarea {
  119. min-height: 35px;
  120. }
  121. </style>
  122. }
  123. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  124. @using (Ajax.BeginForm(new AjaxOptions
  125. {
  126. Url = "/TeachersOrder/TeachersSave",
  127. OnSuccess = "EMISFunction.FormSuccess",
  128. OnBegin = "EMISFunction.FormSubmit",
  129. OnComplete = "EMISFunction.FormComplete"
  130. }))
  131. { @Html.Hidden("hid_orderJsonStr")
  132. <div class="p_title">
  133. @*<div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  134. 征订申请信息
  135. </div>*@
  136. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Edit")</div>
  137. </div>
  138. <div class="search_list popupWindowContent">
  139. <table cellpadding="0" cellspacing="0" id="departmenttable" width="100%" height="100%">
  140. <tr>
  141. <td>@Html.Label("学年学期"):
  142. </td>
  143. <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" } })
  144. </td>
  145. </tr>
  146. <tr>
  147. <td>@Html.LabelFor(x => x.OrderDesc):
  148. </td>
  149. <td colspan="3">@Html.TextAreaFor(x => x.OrderDesc, new Dictionary<string, object> { { "style", "width: 390px;" } })
  150. </td>
  151. </tr>
  152. <tr>
  153. <td>@Html.Label("查询信息"):</td>
  154. <td colspan="3">
  155. <div class="search_keyword">
  156. <div class="search_input">
  157. <ul>
  158. <li class="sn" style="padding-left: 5px;">教材名称:</li>
  159. <li class="sv">
  160. @Html.ComboGrid(TMName, new Dictionary<string, string> { { "data-condition", "dgTeachingMaterialPoolList" } })
  161. </li>
  162. <li class="sn" style="padding-left: 5px;">课程名称:</li>
  163. <li class="sv">
  164. @Html.ComboGrid(CsopName, new Dictionary<string, string> { { "data-condition", "dgTeachingMaterialPoolList" } })
  165. </li>
  166. </ul>
  167. </div>
  168. </div>
  169. </td>
  170. </tr>
  171. <tr>
  172. <td>@Html.Label("信息列表"):
  173. </td>
  174. <td colspan="3" valign="top">
  175. @Html.ContextMenuBar("Edit-RoleViewGrid")
  176. @Html.DataGrid(new DataGridOptions
  177. {
  178. Columns = new List<DataGridColumn>()
  179. {
  180. new CheckBoxFieldColumn{ HeaderText="", FieldName="TeachingMaterialPoolID" },
  181. new TextBoxColumn { FieldName="OrderQty", HeaderText="征订数量", Align=AlignStyle.Center, IsRequired=true, Validator=new OnlyNumberValidator(), Width = 0.08},
  182. new BoundFieldColumn { FieldName="TeachingMaterialCode", HeaderText="教材编号", Align=AlignStyle.Center, Width = 0.08 },
  183. new BoundFieldColumn { FieldName="CoursematerialName", HeaderText="课程名称", Align=AlignStyle.Center,OverflowLength=28, Width = 0.16 },
  184. new BoundFieldColumn { FieldName="TeachingMaterialName", HeaderText="教材名称", Align=AlignStyle.Center,OverflowLength=28, Width = 0.16 },
  185. new BoundFieldColumn { FieldName="ISBN", HeaderText="ISBN", Align=AlignStyle.Center, Width = 0.14 },
  186. new BoundFieldColumn { FieldName="PublishTime", HeaderText="版本时间", Align=AlignStyle.Center, Width = 0.1},
  187. new BoundFieldColumn { FieldName="PublishName", HeaderText="出版单位", Align=AlignStyle.Center,OverflowLength=28, Width = 0.14 },
  188. new BoundFieldColumn { FieldName="Author", HeaderText="作者", Align=AlignStyle.Center,OverflowLength=28, Width = 0.12 },
  189. new BoundFieldColumn { FieldName="Price", HeaderText="单价", Align=AlignStyle.Center, Width = 0.08 }
  190. },
  191. IsCheckOnSelect = true,
  192. DataSourceUrl = Url.Content("~/TeachersOrder/GetTeachingMaterialPoolList"),
  193. IsPostBack = true,
  194. ID = "dgTeachingMaterialPoolList",
  195. IsPagination = true,
  196. IsShowRowNumbers = true,
  197. IsSingleSelect = false
  198. })
  199. </td>
  200. </tr>
  201. </table>
  202. </div>
  203. }
  204. </div>