import.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. define(function (require) {
  2. return function (context) {
  3. var $dlg, $grid1, $form;
  4. // 输入搜索文本后点击回车按钮查询列表
  5. function enterQueryGrid1(e) {
  6. if (e.keyCode === 13) {
  7. var tmp = $(this).val();
  8. $form.formSet({queryProperties: tmp});
  9. queryGrid1();
  10. }
  11. }
  12. function queryGrid() {
  13. $grid1.jqGrid("clearGridData");
  14. var queryForm = $form.formGet();
  15. $grid1.reload({
  16. mtype: 'POST',
  17. url: api('/sys/importExcel/getAllPeopleInfo'),
  18. queryParams: queryForm
  19. }, true);
  20. }
  21. var queryToolbar = {
  22. xtype: 'toolbar',
  23. title: '需求统计',
  24. items: [
  25. {
  26. text: '查询', iconCls: 'fa fa-search', onClick: function () {
  27. queryGrid();
  28. }
  29. }, {
  30. text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
  31. $form.formClear();
  32. queryGrid();
  33. }
  34. }, {
  35. text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
  36. $dlg.window('close');
  37. }
  38. }
  39. ]
  40. };
  41. // 搜索条件
  42. var queryForm = {
  43. onRender: function () {
  44. $form = $(this);
  45. },
  46. xtype: 'form',
  47. items: [[
  48. {
  49. xtype: 'textbox',
  50. label: '检索条件',
  51. name: 'queryProperties',
  52. prompt: '小区',
  53. labelWidth: 'auto',
  54. events: {keydown: enterQueryGrid1}, width: 350
  55. },
  56. ]]
  57. };
  58. // 列表2增删改查按钮
  59. var gridToolbar2 = {
  60. xtype: 'toolbar',
  61. title: '需求列表',
  62. items: [
  63. {
  64. text: '导出excel', iconCls: 'fa fa-external-link-square', onClick: function () {
  65. $.yvan.download({
  66. method: 'get',
  67. url: api('/sys/importExcel/errorPeopleInfo'),
  68. fileName: '人员基本信息错误数据-' + $.yvan.getMoment().format('YYYY-MM-DD HH:mm:ss') + '.xlsx'
  69. });
  70. }
  71. },
  72. ]
  73. };
  74. return {
  75. xtype: 'dialog',
  76. dialogId: 'dialogimport',
  77. title: '',
  78. width: '100%',
  79. height: '100%',
  80. onOpen: function () {
  81. $dlg = $(this);
  82. queryGrid();
  83. },
  84. north: {
  85. height: 90,
  86. split: true,
  87. border: false,
  88. items: [
  89. queryToolbar,
  90. queryForm
  91. ]
  92. },
  93. center: {
  94. border: false,
  95. items: {
  96. onRender: function () {
  97. $grid1 = $(this);
  98. },
  99. autoSizeColumns: true,
  100. xtype: 'grid',
  101. toolbar: gridToolbar2,
  102. idField: 'peopleId',
  103. columns: [[
  104. {field: 'peopleId', hidden: true},
  105. {field: 'excelNum', title: '序号', align: "right", maxWidth: 100, },
  106. {field: 'peopleCode', title: '小区名称', minWidth: 100, maxWidth: 200},
  107. {field: 'name', title: '楼栋', minWidth: 100, maxWidth: 200},
  108. {field: 'nativePlace', title: '单元', minWidth: 100, maxWidth: 200},
  109. {field: 'birthday', title: '门牌号', minWidth: 100, maxWidth: 200},
  110. {field: 'joIdAffiliated', title: '数量', minWidth: 100, maxWidth: 200},
  111. {field: 'joIdCode', title: '联系方式', minWidth: 100, maxWidth: 200},
  112. {field: 'phone', title: '需求备注', minWidth: 100, maxWidth: 200},
  113. ]],
  114. }
  115. }
  116. };
  117. };
  118. });