Edit.cshtml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. @model EMIS.ViewModel.TeachingMaterial.StockOutView
  2. @using EMIS.Web.Controls;
  3. @using Bowin.Web.Controls.Mvc;
  4. @using EMIS.ViewModel;
  5. @{
  6. ViewBag.Title = "Edit";
  7. ComboGridOptions Psop = new ComboGridOptions
  8. {
  9. TextField = "UnitName",
  10. ValueField = "PublishID",
  11. ID = "PublishDropdown",
  12. Name = "PublishDropdown",
  13. GridOptions = new DataGridOptions
  14. {
  15. Columns = new List<DataGridColumn>()
  16. {
  17. new BoundFieldColumn { FieldName="UnitCode", HeaderText="单位编号", Align=AlignStyle.Center, Width=0.1 },
  18. new BoundFieldColumn { FieldName="UnitName", HeaderText="出版单位", Align=AlignStyle.Center, Width=0.2 }
  19. },
  20. IsCheckOnSelect = true,
  21. DataSourceUrl = Url.Content("~/Publisher/List"),
  22. IsPagination = true,
  23. IsShowRowNumbers = true,
  24. IsSingleSelect = false
  25. }
  26. };
  27. ComboGridOptions cgopLoginID = new ComboGridOptions
  28. {
  29. TextField = "UserName",
  30. ValueField = "UserID",
  31. GridOptions = new DataGridOptions
  32. {
  33. Columns = new List<DataGridColumn>()
  34. {
  35. new BoundFieldColumn { FieldName="LoginID", HeaderText="学号", Align=AlignStyle.Center, Width=0.2 },
  36. new BoundFieldColumn { FieldName="UserName", HeaderText="姓名", Align=AlignStyle.Center, Width=0.1 }
  37. },
  38. IsCheckOnSelect = true,
  39. DataSourceUrl = Url.Content("~/Students/StudentOnlyInSchool"),
  40. IsPagination = true,
  41. IsShowRowNumbers = true,
  42. IsSingleSelect = false,
  43. //IsAutoLoad = false,
  44. }
  45. };
  46. ComboGridOptions staffComboGrid = new ComboGridOptions
  47. {
  48. TextField = "Name",
  49. ValueField = "UserID",
  50. GridOptions = new DataGridOptions
  51. {
  52. Columns = new List<DataGridColumn>()
  53. {
  54. new BoundFieldColumn { FieldName="StaffCode", HeaderText="教职工号", Align=AlignStyle.Center, Width=0.1 },
  55. new BoundFieldColumn { FieldName="Name", HeaderText="姓名", Align=AlignStyle.Center, Width=0.1 }
  56. },
  57. IsCheckOnSelect = true,
  58. DataSourceUrl = Url.Content("~/Staff/List"),
  59. IsPagination = true,
  60. IsShowRowNumbers = true,
  61. IsSingleSelect = false
  62. }
  63. };
  64. string getBookStr = "教师领书";
  65. var stockOutID = Request.Params["stockOutID"];
  66. var stockOutType = Request.Params["stockOutType"];
  67. if (!string.IsNullOrEmpty(Model.StockOutTypeID.ToString()))
  68. {
  69. stockOutType = Model.StockOutTypeID.ToString();
  70. }
  71. if (stockOutType == "1")
  72. {
  73. getBookStr = "学生领书";
  74. }
  75. var isView = false;
  76. var textAreaHtmlAttributes = new Dictionary<string, object> { { "style", "width:500px;" } };
  77. if (Model.StockOutID == Guid.Empty || Model.StockOutID == null)
  78. {
  79. textAreaHtmlAttributes.Add("disabled", "disabled");
  80. }
  81. }
  82. @section scripts{
  83. <script src="~/Scripts/Business/TeachingMaterial/StockOutEdit.js"></script>
  84. <script type="text/javascript">
  85. //保存数据
  86. function StockOut_Save() {
  87. $("#hid_ActionsType").val("Save"); //保存
  88. $(document.forms[0]).submit(); //提交表单
  89. }
  90. //获取选中的数据、保存单头有明细
  91. function validChooseTM() {
  92. var d = [];
  93. $.each($("#dgStockInTMSelectList").cmsXDataTable("getSelections"), function (index) {
  94. d.push(this);
  95. });
  96. return d;
  97. }
  98. </script>
  99. }
  100. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  101. @using (Ajax.BeginForm(new AjaxOptions { Url = "/StockOut/Edit", OnSuccess = "EMISFunction.FormSuccess", OnBegin = "EMISFunction.FormSubmit", OnComplete = "EMISFunction.FormComplete" }))
  102. {
  103. <div class="p_title">
  104. @*<div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;">
  105. @getBookStr
  106. </div>*@
  107. @if (Model.RecordStatus != (int)CF_GeneralPurpose.IsYes)//如果已经提交、那么删除、增加按钮不显示
  108. {
  109. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Edit")</div>
  110. }
  111. </div>
  112. <div class="search_list">
  113. @Html.Hidden("hid_ActionsType")
  114. @Html.HiddenFor(x => x.StockOutID)
  115. <table cellpadding="0" cellspacing="0" id="departmenttable">
  116. <tr>
  117. <td>
  118. @Html.LabelFor(x => x.SchoolyearID):
  119. </td>
  120. <td>
  121. @Html.DropdownListFor(x => x.SchoolyearID, new DropdownListOptions { ItemSourceUrl = Url.Content("~/SchoolYear/YearsDropdownListBanid"), TextField = "Text", ValueField = "Value" })
  122. </td>
  123. <td>
  124. @Html.LabelFor(x => x.StockOutTypeID):
  125. </td>
  126. <td>
  127. @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_StockOutType, (x => x.StockOutTypeID), new DropdownListOptions { IsEnabled = false })
  128. </td>
  129. </tr>
  130. <tr>
  131. <td>
  132. @Html.LabelFor(x => x.StockOutNo):
  133. </td>
  134. <td>
  135. @Html.TextBoxFor(x => x.StockOutNo)
  136. </td>
  137. @if (stockOutType == "1")
  138. {
  139. <td>@Html.LabelFor(x => x.RecipientUserID):
  140. </td>
  141. <td>@Html.ComboGridFor(x => x.RecipientUserID, cgopLoginID)
  142. </td>
  143. }
  144. else
  145. {
  146. <td>@Html.LabelFor(x => x.RecipientUserID):
  147. </td>
  148. <td>@Html.ComboGridFor(x => x.RecipientUserID, staffComboGrid)
  149. </td>
  150. }
  151. </tr>
  152. <tr>
  153. <td>
  154. @Html.LabelFor(x => x.StockOutTime):
  155. </td>
  156. <td>
  157. @Html.TextBoxFor(x => x.StockOutTime, new TextBoxOptions { TextBoxType = TextBoxType.DateTime })
  158. </td>
  159. <td>
  160. @Html.LabelFor(x => x.OutNumber):
  161. </td>
  162. <td>
  163. @Html.TextBoxFor(x => x.OutNumber, new Dictionary<string, object>() { { "readonly", "true" } })
  164. </td>
  165. </tr>
  166. <tr>
  167. <td>
  168. @Html.Label("教材信息"):
  169. </td>
  170. <td colspan="3">
  171. @if (Model.RecordStatus != (int)CF_GeneralPurpose.IsYes)//如果已经提交、那么删除、增加按钮不显示
  172. {
  173. @Html.ContextMenuBar("Edit-StockOutViewGrid")
  174. }
  175. @Html.DataGrid(new DataGridOptions
  176. {
  177. Columns = new List<DataGridColumn>()
  178. {
  179. new CheckBoxFieldColumn{ HeaderText="", FieldName="TeachingMaterialPoolID" },
  180. new BoundFieldColumn { FieldName="TeachingMaterialCode", HeaderText="教材编号", Align=AlignStyle.Center, Width=0.04 },
  181. new BoundFieldColumn { FieldName="TeachingMaterialName", HeaderText="教材名称", Align=AlignStyle.Center, Width=0.1 },
  182. //new BoundFieldColumn { FieldName="CoursematerialName", HeaderText="课程名称", Align=AlignStyle.Center, Width=0.06, OverflowLength=10 },
  183. //new BoundFieldColumn { FieldName="ISBN", HeaderText="ISBN", Align=AlignStyle.Center, Width=0.06 },
  184. //new BoundFieldColumn { FieldName="PublishTime", HeaderText="版本时间", Align=AlignStyle.Center, Width=0.06 },
  185. //new BoundFieldColumn { FieldName="PublishName", HeaderText="出版单位", Align=AlignStyle.Center, Width=0.1 },
  186. //new BoundFieldColumn { FieldName="Author", HeaderText="作者", Align=AlignStyle.Center, Width=0.04 },
  187. new BoundFieldColumn { FieldName="Price", HeaderText="单价", Align=AlignStyle.Center, Width=0.03 },
  188. new BoundFieldColumn { FieldName="Discount", HeaderText="折扣率",Align=AlignStyle.Center, Width=0.03 },
  189. new BoundFieldColumn { FieldName="DiscountPrice", HeaderText="折合价",Align=AlignStyle.Center, Width=0.03 },
  190. new BoundFieldColumn { FieldName="OrderQty", HeaderText="数量", Align=AlignStyle.Center, Width=0.03 },
  191. new BoundFieldColumn { FieldName="PresentInventory", HeaderText="当前库存量", Align=AlignStyle.Center , Width=0.05 },
  192. new BoundFieldColumn { FieldName="IsLateName", HeaderText="是否过期", Align=AlignStyle.Center , Width=0.04 }
  193. },
  194. PageSize = 30,
  195. IsCheckOnSelect = true,
  196. DataSourceUrl = Url.Content("~/StockOut/GetTMViewList?stockOutID=" + Request.Params["stockOutID"]),
  197. ID = "dgStockInTMSelectList",
  198. IsPagination = true,
  199. IsPostBack = true,
  200. IsShowRowNumbers = true,
  201. IsSingleSelect = false,
  202. MaxHeight = 180
  203. })
  204. </td>
  205. </tr>
  206. <tr>
  207. <td>
  208. @Html.LabelFor(x => x.Desc):
  209. </td>
  210. <td colspan="3">
  211. @Html.TextAreaFor(x => x.Desc, new Dictionary<string, object> { { "style", "width: 90%;" } })
  212. </td>
  213. </tr>
  214. </table>
  215. </div>
  216. }
  217. </div>