123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- @using Bowin.Web.Controls.Mvc;
- @using EMIS.Web.Controls;
- @{
- ViewBag.Title = "TMPoolListSelector";
- ComboGridOptions TMCode = new ComboGridOptions
- {
- TextField = "TeachingMaterialCode",
- ValueField = "TeachingMaterialPoolID",
- ID = "TeachingMaterialCodeDropdown",
- Name = "TeachingMaterialCodeDropdown",
- OnSelect = "QueryTeachingMaterialDropdownList",
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- //new BoundFieldColumn { FieldName="TeachingMaterialName",HeaderText="教材名称", Align=AlignStyle.Center, Width=0.3 },
- new BoundFieldColumn { FieldName="TeachingMaterialCode",HeaderText="教材编号", Align=AlignStyle.Center, Width=0.1 }
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/TeachingMaterialPool/List"),
- 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, Width=0.3 }
- // new BoundFieldColumn { FieldName="TeachingMaterialCode",HeaderText="教材编号", Align=AlignStyle.Center, Width=0.1 }
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/TeachingMaterialPool/List"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false
- }
- };
- }
- @section scripts{
- <script src="~/Scripts/Business/TeachingMaterial/TeachingMaterialSelector.js"></script>
- <script type="text/javascript">
- //获取选中的数据
- function validChooseTM() {
- var d = [];
- $.each($("#dgTMPoolList").cmsXDataTable("getSelections"), function (index) {
- d.push(this);
- });
- return d;
- }
- function TMSelect_Confirm() {
- var listData = validChooseTM();
- if (listData.length < 1) {
- $.messager.alert("系统提示", "请选择需要添加的教材。");
- return;
- }
- var reg = /^[1-9]\d*$/;
- for (var i = 0; i < listData.length; i++) {
- if (!reg.test(listData[i].OrderQty)) {
- $.messager.alert("系统提示", "选中信息,存在出库数量数据格式不正确,请检查!");
- return;
- }
- if (listData[i].OrderQty > listData[i].PresentInventory) {
- $.messager.alert("系统提示", "选中信息,存在出库数量大于库存量信息,请检查!");
- return;
- }
- }
- top.$("#@(Request["WindowID"])").data("resultData", listData);
- top.$("#@(Request["WindowID"])").dialog("close");
- }
- </script>}
- <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
-
- <form id="formQuery" method="post" action="@Url.Content("~/StockOut/Excel")">
- <div class="search_keyword">
- @Html.PositionCondition("TeachingMaterial",null)
- </div>
- @Html.Hidden("hidIsSelectMax", Request["IsSelectMax"], new Dictionary<string, object> { { "data-condition", "dgTMPoolList" } })
- </form>
- <div class="p_title">
- <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">
- <div class="current_navbar toolbar">
- <div class="func_info">
- <a class="easyui-linkbutton" href="javascript:TMSelect_Confirm()" data-options="iconCls:'icon-ok',plain:'true'"
- onfocus="this.blur()">选中</a>
- </div>
- </div>
- </div>
- </div>
- <div class="search_list">
- @Html.DataGrid(new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- new CheckBoxFieldColumn{ HeaderText="", FieldName="TeachingMaterialPoolID" },
-
- new BoundFieldColumn { FieldName="TeachingMaterialCode", HeaderText="教材编号", Align=AlignStyle.Center, Width=0.04 },
- new BoundFieldColumn { FieldName="TeachingMaterialName", HeaderText="教材名称", Align=AlignStyle.Center, Width=0.1 },
- //new BoundFieldColumn { FieldName="CoursematerialName", HeaderText="课程名称", Align=AlignStyle.Center, Width=0.06, OverflowLength=10 },
- //new BoundFieldColumn { FieldName="ISBN", HeaderText="ISBN", Align=AlignStyle.Center, Width=0.06 },
- //new BoundFieldColumn { FieldName="PublishTime", HeaderText="版本时间", Align=AlignStyle.Center, Width=0.06 },
- //new BoundFieldColumn { FieldName="PublishName", HeaderText="出版单位", Align=AlignStyle.Center, Width=0.1 },
- //new BoundFieldColumn { FieldName="Author", HeaderText="作者", Align=AlignStyle.Center, Width=0.04 },
- new BoundFieldColumn { FieldName="Price", HeaderText="单价", Align=AlignStyle.Center, Width=0.03 },
- new TextBoxColumn { FieldName="Discount", HeaderText="折扣率", Align=AlignStyle.Center, IsRequired=true, Validator=new OnlyDiscountValidator(), OnChangedFunc = "DiscountChange", Width=0.03},
- new TextBoxColumn { FieldName="DiscountPrice", HeaderText="折合价",Align=AlignStyle.Center, IsRequired=true, Width=0.03, EnableFieldName="IsEnable" },
- new BoundFieldColumn { FieldName="PresentInventory", HeaderText="当前库存量", Align=AlignStyle.Center , Width=0.05 },
- new TextBoxColumn { FieldName="OrderQty", HeaderText="数量", Align=AlignStyle.Center, IsRequired=true, Validator=new OnlyNumberValidator(), Width=0.03 },
- new BoundFieldColumn { FieldName="IsLateName", HeaderText="是否过期", Align=AlignStyle.Center , Width=0.04 }
- },
- PageSize =50,
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/StockOut/GetTeachingMaterialForRefund"),
- ID = "dgTMPoolList",
- IsPagination = true,
- IsPostBack = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false
- })
- </div>
- </div>
- <script type="text/javascript">
- //,OnChangedFunc="checkInventoryQty"
- function checkInventoryQty(rowindex, rowdata) {
- if (rowdata.OrderQty > rowdata.PresentInventory) {
- $.messager.alert("系统提示", "库存不足,出库数量大于当前库存量。");
- return;
- }
- }
- </script>
|