You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

100 lines
3.6 KiB

  1. /*
  2. * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  3. * Copyright (c) 2013-2018 北京泉江科技有限公司
  4. * 创建人:陈彬彬
  5. * 日 期:2017.11.12
  6. * 描 述:客户开票信息管理
  7. */
  8. var refreshGirdData; // 更新数据
  9. var selectedRow;
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. page.initGrid();
  15. page.bind();
  16. },
  17. bind: function () {
  18. // 查询
  19. $('#btn_Search').on('click', function () {
  20. var keyword = $('#txt_Keyword').val();
  21. page.search({ keyword: keyword });
  22. });
  23. // 刷新
  24. $('#lr_refresh').on('click', function () {
  25. location.reload();
  26. });
  27. // 新增
  28. $('#lr_add').on('click', function () {
  29. selectedRow = null;//新增前请清空已选中行
  30. learun.layerForm({
  31. id: 'form',
  32. title: '新增客户',
  33. url: top.$.rootUrl + '/LR_CRMModule/Invoice/Form',
  34. width: 500,
  35. height: 400,
  36. maxmin: true,
  37. callBack: function (id) {
  38. return top[id].acceptClick(refreshGirdData);
  39. }
  40. });
  41. });
  42. // 编辑
  43. $('#lr_edit').on('click', function () {
  44. selectedRow = $('#gridtable').jfGridGet('rowdata');
  45. var keyValue = $('#gridtable').jfGridValue('F_InvoiceId');
  46. if (learun.checkrow(keyValue)) {
  47. learun.layerForm({
  48. id: 'form',
  49. title: '编辑客户',
  50. url: top.$.rootUrl + '/LR_CRMModule/Invoice/Form',
  51. width: 500,
  52. height: 400,
  53. maxmin: true,
  54. callBack: function (id) {
  55. return top[id].acceptClick(refreshGirdData);
  56. }
  57. });
  58. }
  59. });
  60. // 删除
  61. $('#lr_delete').on('click', function () {
  62. var keyValue = $('#gridtable').jfGridValue('F_InvoiceId');
  63. if (learun.checkrow(keyValue)) {
  64. learun.layerConfirm('是否确认删除该项!', function (res) {
  65. if (res) {
  66. learun.deleteForm(top.$.rootUrl + '/LR_CRMModule/Invoice/DeleteForm', { keyValue: keyValue }, function () {
  67. refreshGirdData();
  68. });
  69. }
  70. });
  71. }
  72. });
  73. },
  74. initGrid: function () {
  75. $('#gridtable').jfGrid({
  76. url: top.$.rootUrl + '/LR_CRMModule/Invoice/GetPageListJson',
  77. headData: [
  78. { label: '客户名称', name: 'F_CustomerName', width: 200, align: 'left' },
  79. { label: '开票信息', name: 'F_InvoiceContent', width: 500, align: 'left' }
  80. ],
  81. mainId: 'F_InvoiceId',
  82. reloadSelected: true,
  83. isPage: true,
  84. sidx: 'F_CreateDate'
  85. });
  86. page.search();
  87. },
  88. search: function (param) {
  89. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  90. }
  91. };
  92. // 保存数据后回调刷新
  93. refreshGirdData = function () {
  94. page.search();
  95. }
  96. page.init();
  97. }