lingyunUser2.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. define(function (require) {
  2. return function (context) {
  3. var $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. // 弹框的方式
  13. var widgets = {
  14. // 搜索分类检索
  15. selectTableUnit: {
  16. url: 'app/whepi/home/selectLYbumen.js',
  17. bind: {
  18. unitId: 'unitId',
  19. unit: 'unit',
  20. },
  21. },
  22. };
  23. // 检索条件查询
  24. function queryGrid1() {
  25. var queryForm = $form.formGet();
  26. $grid1.reload({
  27. mtype: 'POST',
  28. url: api('/sweepCode/selectLingyunUser'),
  29. queryParams: queryForm
  30. }, true);
  31. }
  32. var queryToolbar = {
  33. xtype: 'toolbar',
  34. title: '用户管理',
  35. items: [
  36. {
  37. text: '查询', iconCls: 'fa fa-search', onClick: function () {
  38. queryGrid1();
  39. }
  40. }, {
  41. text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
  42. $form.formClear();
  43. queryGrid1();
  44. }
  45. }, {
  46. text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
  47. App.closeMe(this);
  48. }
  49. }
  50. ]
  51. };
  52. var queryForm = {
  53. onRender: function () {
  54. $form = $(this);
  55. },
  56. xtype: 'form',
  57. items: [[
  58. {
  59. xtype: 'textbox',
  60. label: '检索条件',
  61. name: 'queryProperties',
  62. prompt: "用户名称/电话号码",
  63. labelWidth: 'auto',
  64. events: {keydown: enterQueryGrid1}, width: 350
  65. },
  66. ]]
  67. };
  68. return {
  69. north: {
  70. height: 88,
  71. /* split: true,
  72. border: false,*///底框是否可变动
  73. items: [
  74. queryToolbar,
  75. queryForm
  76. ]
  77. },
  78. center: {
  79. height: '60%',
  80. split: true,
  81. items:
  82. {
  83. onRender: function () {
  84. $grid1 = $(this);
  85. queryGrid1()
  86. },
  87. xtype: 'grid',
  88. toolbar: {
  89. xtype: 'toolbar',
  90. title: '用户列表',
  91. items: [
  92. {
  93. text: '生成健康及旅居申请表', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
  94. var row = $grid1.checkedData();
  95. if (row.length == 0) {
  96. $.yvan.msg('请至少选择一行数据');
  97. return;
  98. }
  99. var ids = "";
  100. for (var i = 0; i < row.length; i++) {
  101. ids += row[i].userId + ","
  102. }
  103. ids=ids.substring(0,ids.length-1);
  104. window.open(api('/export/lyReports?userId=' + ids));
  105. }
  106. },
  107. {
  108. text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
  109. var row = $grid1.checkedData();
  110. if (row.length == 0) {
  111. $.yvan.msg('请至少选择一行数据');
  112. return;
  113. }
  114. var ids = "";
  115. for (var i = 0; i < row.length; i++) {
  116. ids += row[i].userId + ","
  117. }
  118. ids=ids.substring(0,ids.length-1);
  119. window.open(api('/export/lyApproves?userId=' + ids));
  120. }
  121. }
  122. ]
  123. },
  124. multiselect: true, /// 表格多选
  125. idField: 'userId',
  126. editable: true,
  127. editOnSelected: true,
  128. autoSizeColumns: true,
  129. columns:
  130. [
  131. [
  132. {field: 'userId', title: '用户ID', hidden: true},
  133. {field: 'linkman', title: '用户名', maxWidth: 200, align: 'left',},
  134. {field: 'dept', title: '部门名称', maxWidth: 200, align: 'left',},
  135. {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
  136. {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
  137. {field: 'door', title: '病情表述', maxWidth: 200, align: 'left',},
  138. ]
  139. ]
  140. }
  141. }
  142. };
  143. };
  144. }
  145. );