lingyunUser2.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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-cloud-upload', 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-cloud-upload', 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. text: '导出人员报表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  124. var queryProperties = $form.formGet().queryProperties;
  125. window.open(api('/sweepCode/exSelectLingyunUser?queryProperties='+queryProperties+"&unitId=0"));
  126. }
  127. },
  128. ]
  129. },
  130. multiselect: true, /// 表格多选
  131. idField: 'userId',
  132. editable: true,
  133. editOnSelected: true,
  134. autoSizeColumns: true,
  135. columns:
  136. [
  137. [
  138. {field: 'userId', title: '用户ID', hidden: true},
  139. {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
  140. {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
  141. {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
  142. {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
  143. {field: 'bingqingDesc', title: '病情表述', maxWidth: 200, align: 'left',},
  144. {field: 'workLoalDesc', title: '工作驻地', maxWidth: 200, align: 'left',},
  145. {field: 'todayLoalDesc', title: '今晚住地', maxWidth: 200, align: 'left',},
  146. {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
  147. {field: 'tripDetDesc', title: '出行详细', align: 'left',},
  148. ]
  149. ]
  150. }
  151. }
  152. };
  153. };
  154. }
  155. );