auditor.cshtml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. @{
  2. ViewBag.Title = "手机审核";
  3. Layout = "~/Views/Shared/_LayoutIndex.cshtml";
  4. }
  5. <script>
  6. $(function () {
  7. GetGrid();
  8. })
  9. function GetGrid() {
  10. var $gridTable = $('#gridTable');
  11. $gridTable.jqGrid({
  12. url: "../../SystemManage/MobileAuditor/GetMobileAuditorJson",
  13. datatype: "json",
  14. height: $(window).height() - 50.5,
  15. autowidth: true,
  16. colModel: [
  17. { name: "RealName", label: "名称", width: 80, align: "center" },
  18. { name: "AuditingIMEI", label: "审核IMEI", width: 150, align: "center" },
  19. { name: "Auditor", label: "审核人", width: 110, align: "center" },
  20. { name: "AuditingTime", label: "审核时间", width: 130 },
  21. { name: "ApplyIMEI", Index: "ApplyIMEI", label: "申请IMEI", width: 250, align: "center" },
  22. { name: "ApplyTime", label: "申请时间", width: 130, align: "left" },
  23. {
  24. name: "IsAllow", label: "状态", width: 100, align: "center",
  25. formatter: function (cellvalue, options, rowObject) {
  26. var temp = '';
  27. if (cellvalue == 0) {
  28. temp = '不允许';
  29. } else {
  30. temp = '允许';
  31. }
  32. return temp;
  33. }
  34. }
  35. ],
  36. viewrecords: true,
  37. rowNum: 1000,
  38. footerrow: true,
  39. gridComplete: function () {
  40. var ids = $gridTable.jqGrid('getDataIDs');
  41. for (var i = 0; i < ids.length; i++) {
  42. var cl = ids[i];
  43. var str = $gridTable.jqGrid('getCell', cl, 'ApplyIMEI');
  44. console.log(str);
  45. be = "<span>" + str + "</span>&nbsp&nbsp&nbsp";
  46. se = "<input style='height:22px;width:80px;line-height:14px' type='button' value='通过授权' onclick=\"UpdateMobileIMEI("
  47. + cl + ");\" />";
  48. var ss = be + se;
  49. if (str == '') {
  50. ss = '';
  51. }
  52. $gridTable.jqGrid('setRowData', ids[i],
  53. {
  54. ApplyIMEI: ss
  55. });
  56. }
  57. //var totalamount = $(this).getCol("amount", false, "sum");
  58. ////合计
  59. //$(this).footerData("set", {
  60. // "location": "合计:",
  61. // "amount": totalamount,
  62. //});
  63. $('table.ui-jqgrid-ftable td').prevUntil().css("border-right-color", "#fff");
  64. }
  65. }).trigger('reloadGrid');
  66. //查询条件
  67. $("#queryCondition .dropdown-menu li").click(function () {
  68. var text = $(this).find('a').html();
  69. var value = $(this).find('a').attr('data-value');
  70. $("#queryCondition .dropdown-text").html(text).attr('data-value', value)
  71. });
  72. //查询事件
  73. $("#btn_Search").click(function () {
  74. var queryJson = {
  75. condition: $("#queryCondition").find('.dropdown-text').attr('data-value'),
  76. keyword: $("#txt_Keyword").val()
  77. }
  78. $gridTable.jqGrid('setGridParam', {
  79. postData: { queryJson: JSON.stringify(queryJson) },
  80. page: 1
  81. }).trigger('reloadGrid');
  82. });
  83. //查询回车
  84. $('#txt_Keyword').bind('keypress', function (event) {
  85. if (event.keyCode == "13") {
  86. $('#btn_Search').trigger("click");
  87. }
  88. });
  89. }
  90. function UpdateMobileIMEI(id)
  91. {
  92. $.ajax({
  93. url: '../../SystemManage/MobileAuditor/UpdateMobileAuditor',
  94. data: {
  95. Id: id
  96. },
  97. datatype: 'json',
  98. success: function (data) {
  99. console.log(data.code);
  100. var json = JSON.parse(data);
  101. if (json.code == 1) {
  102. GetGrid();
  103. }
  104. else {
  105. alert("验证失败!")
  106. }
  107. },
  108. complete: function (data) {
  109. GetGrid();
  110. },
  111. error: function (data) { }
  112. });
  113. }
  114. //打印
  115. function btn_print() {
  116. $("#gridPanel").printTable();
  117. }
  118. //导出
  119. function btn_export() {
  120. dialogOpen({
  121. id: "ExcelIExportDialog",
  122. title: '导出销售报表',
  123. url: '/Utility/ExcelExportForm?gridId=gridTable',
  124. width: "500px",
  125. height: "380px",
  126. callBack: function (iframeId) {
  127. top.frames[iframeId].AcceptClick();
  128. }, btn: ['导出Excel', '关闭']
  129. });
  130. }
  131. </script>
  132. <div class="ui-report">
  133. <div class="gridPanel" id="gridPanel">
  134. <div class="printArea">
  135. <div class="grid-title">手机审核</div>
  136. <div class="grid-subtitle"></div>
  137. <table id="gridTable"></table>
  138. </div>
  139. </div>
  140. </div>