TeachingMaterial.cshtml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. @using Bowin.Web.Controls.Mvc;
  2. @using EMIS.Web.Controls;
  3. @{
  4. ViewBag.Title = "TMPoolListSelector";
  5. ComboGridOptions TMCode = new ComboGridOptions
  6. {
  7. TextField = "TeachingMaterialCode",
  8. ValueField = "TeachingMaterialPoolID",
  9. ID = "TeachingMaterialCodeDropdown",
  10. Name = "TeachingMaterialCodeDropdown",
  11. OnSelect = "QueryTeachingMaterialDropdownList",
  12. GridOptions = new DataGridOptions
  13. {
  14. Columns = new List<DataGridColumn>()
  15. {
  16. //new BoundFieldColumn { FieldName="TeachingMaterialName",HeaderText="教材名称", Align=AlignStyle.Center, Width=0.3 },
  17. new BoundFieldColumn { FieldName="TeachingMaterialCode",HeaderText="教材编号", Align=AlignStyle.Center, Width=0.1 }
  18. },
  19. IsCheckOnSelect = true,
  20. DataSourceUrl = Url.Content("~/TeachingMaterialPool/List"),
  21. IsPagination = true,
  22. IsShowRowNumbers = true,
  23. IsSingleSelect = false
  24. }
  25. };
  26. ComboGridOptions TMName = new ComboGridOptions
  27. {
  28. TextField = "TeachingMaterialName",
  29. ValueField = "TeachingMaterialPoolID",
  30. ID = "TeachingMaterialDropdown",
  31. Name = "TeachingMaterialDropdown",
  32. OnSelect = "QueryTeachingMaterialDropdownList",
  33. GridOptions = new DataGridOptions
  34. {
  35. Columns = new List<DataGridColumn>()
  36. {
  37. new BoundFieldColumn { FieldName="TeachingMaterialName",HeaderText="教材名称", Align=AlignStyle.Center, Width=0.3 }
  38. // new BoundFieldColumn { FieldName="TeachingMaterialCode",HeaderText="教材编号", Align=AlignStyle.Center, Width=0.1 }
  39. },
  40. IsCheckOnSelect = true,
  41. DataSourceUrl = Url.Content("~/TeachingMaterialPool/List"),
  42. IsPagination = true,
  43. IsShowRowNumbers = true,
  44. IsSingleSelect = false
  45. }
  46. };
  47. }
  48. @section scripts{
  49. <script src="~/Scripts/Business/TeachingMaterial/TeachingMaterialSelector.js"></script>
  50. <script type="text/javascript">
  51. //获取选中的数据
  52. function validChooseTM() {
  53. var d = [];
  54. $.each($("#dgTMPoolList").cmsXDataTable("getSelections"), function (index) {
  55. d.push(this);
  56. });
  57. return d;
  58. }
  59. function TMSelect_Confirm() {
  60. var listData = validChooseTM();
  61. if (listData.length < 1) {
  62. $.messager.alert("系统提示", "请选择需要添加的教材。");
  63. return;
  64. }
  65. var reg = /^[1-9]\d*$/;
  66. for (var i = 0; i < listData.length; i++) {
  67. if (!reg.test(listData[i].OrderQty)) {
  68. $.messager.alert("系统提示", "选中信息,存在出库数量数据格式不正确,请检查!");
  69. return;
  70. }
  71. if (listData[i].OrderQty > listData[i].PresentInventory) {
  72. $.messager.alert("系统提示", "选中信息,存在出库数量大于库存量信息,请检查!");
  73. return;
  74. }
  75. }
  76. top.$("#@(Request["WindowID"])").data("resultData", listData);
  77. top.$("#@(Request["WindowID"])").dialog("close");
  78. }
  79. </script>}
  80. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  81. <form id="formQuery" method="post" action="@Url.Content("~/StockOut/Excel")">
  82. <div class="search_keyword">
  83. @Html.PositionCondition("TeachingMaterial",null)
  84. </div>
  85. @Html.Hidden("hidIsSelectMax", Request["IsSelectMax"], new Dictionary<string, object> { { "data-condition", "dgTMPoolList" } })
  86. </form>
  87. <div class="p_title">
  88. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">
  89. <div class="current_navbar toolbar">
  90. <div class="func_info">
  91. <a class="easyui-linkbutton" href="javascript:TMSelect_Confirm()" data-options="iconCls:'icon-ok',plain:'true'"
  92. onfocus="this.blur()">选中</a>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="search_list">
  98. @Html.DataGrid(new DataGridOptions
  99. {
  100. Columns = new List<DataGridColumn>()
  101. {
  102. new CheckBoxFieldColumn{ HeaderText="", FieldName="TeachingMaterialPoolID" },
  103. new BoundFieldColumn { FieldName="TeachingMaterialCode", HeaderText="教材编号", Align=AlignStyle.Center, Width=0.04 },
  104. new BoundFieldColumn { FieldName="TeachingMaterialName", HeaderText="教材名称", Align=AlignStyle.Center, Width=0.1 },
  105. //new BoundFieldColumn { FieldName="CoursematerialName", HeaderText="课程名称", Align=AlignStyle.Center, Width=0.06, OverflowLength=10 },
  106. //new BoundFieldColumn { FieldName="ISBN", HeaderText="ISBN", Align=AlignStyle.Center, Width=0.06 },
  107. //new BoundFieldColumn { FieldName="PublishTime", HeaderText="版本时间", Align=AlignStyle.Center, Width=0.06 },
  108. //new BoundFieldColumn { FieldName="PublishName", HeaderText="出版单位", Align=AlignStyle.Center, Width=0.1 },
  109. //new BoundFieldColumn { FieldName="Author", HeaderText="作者", Align=AlignStyle.Center, Width=0.04 },
  110. new BoundFieldColumn { FieldName="Price", HeaderText="单价", Align=AlignStyle.Center, Width=0.03 },
  111. new TextBoxColumn { FieldName="Discount", HeaderText="折扣率", Align=AlignStyle.Center, IsRequired=true, Validator=new OnlyDiscountValidator(), OnChangedFunc = "DiscountChange", Width=0.03},
  112. new TextBoxColumn { FieldName="DiscountPrice", HeaderText="折合价",Align=AlignStyle.Center, IsRequired=true, Width=0.03, EnableFieldName="IsEnable" },
  113. new BoundFieldColumn { FieldName="PresentInventory", HeaderText="当前库存量", Align=AlignStyle.Center , Width=0.05 },
  114. new TextBoxColumn { FieldName="OrderQty", HeaderText="数量", Align=AlignStyle.Center, IsRequired=true, Validator=new OnlyNumberValidator(), Width=0.03 },
  115. new BoundFieldColumn { FieldName="IsLateName", HeaderText="是否过期", Align=AlignStyle.Center , Width=0.04 }
  116. },
  117. PageSize =50,
  118. IsCheckOnSelect = true,
  119. DataSourceUrl = Url.Content("~/StockOut/GetTeachingMaterialForRefund"),
  120. ID = "dgTMPoolList",
  121. IsPagination = true,
  122. IsPostBack = true,
  123. IsShowRowNumbers = true,
  124. IsSingleSelect = false
  125. })
  126. </div>
  127. </div>
  128. <script type="text/javascript">
  129. //,OnChangedFunc="checkInventoryQty"
  130. function checkInventoryQty(rowindex, rowdata) {
  131. if (rowdata.OrderQty > rowdata.PresentInventory) {
  132. $.messager.alert("系统提示", "库存不足,出库数量大于当前库存量。");
  133. return;
  134. }
  135. }
  136. </script>