|
|
@{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Index.cshtml"; } <script> $(function () { gridList(); }) function gridList() { var $gridList = $("#gridList"); $gridList.dataGrid({ url: "/ProductManage/Maintain/GetGridJson", height: $(window).height() - 96, colModel: [ { label: "主键", name: "F_Id", hidden: true, key: true }, { label: 'Product No', name: 'ProductSN', width: 80, align: 'left' }, { label: 'Measurement', name: 'Measurement', width: 90, align: 'left' },//尺寸 { label: 'FinishedWeight', name: 'Weight', width: 100, align: 'left', formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 3 } }, { label: 'RoughWeight', name: 'GrossWeight', width: 90, align: 'left', formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 3 } }, { label: 'Shape', name: 'Shape', width: 60, align: 'left' },//形状 { label: 'Certificate No', name: 'CertificateNo', width: 100, align: 'left' },//证书号码 { label: 'Price', name: 'Price', width: 60, align: 'left' },//价格 //{ label: '色度', name: 'Color', width: 60, align: 'left' },//色度 //{ label: '净度', name: 'Clarity', width: 60, align: 'left' },//净度 //{ label: '抛光', name: 'Polish', width: 60, align: 'left' },//抛光 //{ label: '对称性', name: 'Symmetry', width: 70, align: 'left' },//对称性 //{ label: '切', name: 'Cut', width: 50, align: 'left' },//切 { label: 'Sort', name: 'Other', width: 60, align: 'left' },//其他 { label: 'InvQty', name: 'InvQty', width: 50, align: 'left' },//库存量 { label: 'Location', name: 'Location', width: 120, align: 'left' },//位置 { label: "Is Lock", name: "IsLock", width: 60, align: "left", formatter: function (cellvalue) { return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; } }, //{ label: '维护人', name: 'F_LastModifyUserId', width: 100, align: 'left' },//维护人 { label: 'Modify User', name: 'F_LastModifyUserId', width: 90, align: 'left', formatter: function (cellvalue, options, rowObject) { return top.clients.user[cellvalue] == null ? "" : top.clients.user[cellvalue].realname; } }, { label: 'Modify Time', 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: 'ProductSN asc,Weight desc,F_CreatorTime desc', viewrecords: true }); $("#warehouse a.btn-default").click(function () { $("#warehouse a.btn-default").removeClass("active"); $(this).addClass("active"); $('#btn_search').trigger("click"); }); $("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { keyword: $("#txt_keyword").val(), warehouse: $("#warehouse a.active").attr('data-value'), } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid'); }); } function btn_add() { $.modalOpen({ id: "Form", title: "Add Product", url: "/ProductManage/Maintain/Form", width: "500px", height: "600px", callBack: function (iframeId) { top.frames[iframeId].submitForm(); } }); } function btn_edit() { var keyValue = $("#gridList").jqGridRowValue().F_Id; $.modalOpen({ id: "Form", title: "Edit Product", url: "/ProductManage/Maintain/Form?keyValue=" + keyValue, width: "550px", height: "420px", callBack: function (iframeId) { top.frames[iframeId].submitForm(); } }); } function btn_delete() { $.deleteForm({ url: "/ProductManage/Maintain/DeleteForm", param: { keyValue: $("#gridList").jqGridRowValue().F_Id }, success: function () { $.currentWindow().$("#gridList").trigger("reloadGrid"); } }) } function btn_details() { var keyValue = $("#gridList").jqGridRowValue().F_Id; $.modalOpen({ id: "Details", title: "Look", url: "/ProductManage/Maintain/Details?keyValue=" + keyValue, width: "550px", height: "390px", btn: null, }); } </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>Add Product</a> </div> <div class="operate"> <ul class="nav nav-pills"> <li class="first">Already Selected<span>1</span>Item</li> <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>Edit Product</a></li> <li><a id="NF-delete" authorize="yes" onclick="btn_delete()"><i class="fa fa-trash-o"></i>Delete Product</a></li> <li><a id="NF-Details" authorize="yes" onclick="btn_details()"><i class="fa fa-search-plus"></i>Look Product</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="Product SN" 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> <td style="padding-left: 10px;"> @*<div id="warehouse" class="btn-group"> <a class="btn btn-default active" data-value="0">All</a> <a class="btn btn-default" data-value="10">成品仓(Finished WH)</a> <a class="btn btn-default" data-value="12">评估仓(Assessment WH)</a> <a class="btn btn-default" data-value="18">委外待发仓(Outsourcing WH)</a> </div>*@ </td> </tr> </table> </div> </div> <div class="gridPanel"> <table id="gridList"></table> <div id="gridPager"></div> </div>
|