|
|
@{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Index.cshtml"; } <script src="~/Content/js/CreateControl.js"></script> <script> $(function () { gridList(); }) function gridList() { var $gridList = $("#gridList"); $gridList.dataGrid({ url: "/ProductManage/DiscountRate/GetGridJson", height: $(window).height() - 96, colModel: [ { label: "主键", name: "F_Id", hidden: true, key: true }, { label: '客户编码', name: 'CusCode', width: 80, align: 'left' }, { label: '最小值', name: 'StartValue', width: 80, align: 'left', formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 2 } },//尺寸 { label: '最大值', name: 'EndValue', width: 80, align: 'left', formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 2 } },//形状 { label: '折扣率', name: 'Discount', width: 80, align: 'left', formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 2 } },//证书号码 { label: '仓库', name: 'WHType', width: 80, align: 'left', formatter: function (cellvalue) { if (cellvalue == "10") { return "成品仓"; } else if (cellvalue == "12") { return "评估仓"; } else { return ""; } } }, { label: '修改人', name: 'F_LastModifyUserId', width: 90, align: 'left', formatter: function (cellvalue, options, rowObject) { return top.clients.user[cellvalue] == null ? "" : top.clients.user[cellvalue].realname; } }, { label: '修改时间', name: 'F_LastModifyTime', width: 100, align: 'left', formatter: "date", formatoptions: { srcformat: 'Y-m-d H:i', newformat: 'Y-m-d H:i' } } ], pager: "#gridPager", sortname: 'CusCode asc,StartValue asc', viewrecords: true }); $("#btn_search").click(function () { var queryJson = { keyword: $("#txt_keyword").val(), } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid'); }); } function btn_add() { $.modalOpen({ id: "Form", title: "新建折扣率", url: "/ProductManage/DiscountRate/Form", width: "300px", height: "400px", callBack: function (iframeId) { top.frames[iframeId].submitForm(); } }); } function btn_edit() { var keyValue = $("#gridList").jqGridRowValue().F_Id; $.modalOpen({ id: "Forms", title: "修改折扣率", url: "/ProductManage/DiscountRate/Forms?keyValue=" + keyValue, width: "300px", height: "350px", callBack: function (iframeId) { top.frames[iframeId].submitForm(); } }); } function btn_delete() { $.deleteForm({ url: "/ProductManage/DiscountRate/DeleteForm", param: { keyValue: $("#gridList").jqGridRowValue().F_Id }, success: function () { $.currentWindow().$("#gridList").trigger("reloadGrid"); } }) }
function btn_print() { //$.deleteForm({ // url: "/Handler1.ashx", // param: { keyValue: $("#gridList").jqGridRowValue().F_Id }, // success: function () { // $.currentWindow().$("#gridList").trigger("reloadGrid"); // } var keyValue = $("#gridList").jqGridRowValue().F_Id; window.open("/Handler1.ashx?keyValue=" + keyValue, ""); }
var strPrintData = ''; function GetStrPrintData() { $.ajax({ url: "/ChulingHandler.ashx?action=GetUrlPath", data: { keyValue: keyValue }, dataType: "json", async: false, success: function (data) { $("#form1").formSerialize(data); } }); } </script>
<div class="topPanel"> <div class="toolbar"> <div class="btn-group"> <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a> </div> <div class="btn-group"> <a id="NF-add" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>新建折扣率</a> </div> <div class="operate"> <ul class="nav nav-pills"> <li class="first">已选中<span>1</span>项</li> <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改折扣率</a></li> <li><a id="NF-delete" authorize="yes" onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除折扣率</a></li> <li><a id="NF-Details" authorize="yes" onclick="btn_print()"><i class="fa fa-search-plus"></i>grid++打印</a></li> <li><a id="NF-chulingprint" authorize="yes" onclick="btn_chulingprint()"><i class="fa fa-search-plus"></i>chuling打印</a></li> </ul> <a href="javascript:;" class="close"></a> </div> <script>$('.toolbar').authorizeButton()</script> </div> <div class="search"> <table> <tr> <td> <div class="input-group"> <input id="txt_keyword" type="text" class="form-control" placeholder="CusCode" style="width: 100px;"> <span class="input-group-btn"> <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button> </span> </div> </td> </tr> </table> </div> </div> <div class="gridPanel"> <table id="gridList"></table> <div id="gridPager"></div> </div>
|