lingyunUser2.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. name: 'date',
  68. label: '导出时间',
  69. prompt: '导出时间',
  70. xtype: 'datebox',
  71. labelWidth: 'auto',
  72. width: 250,
  73. required: true
  74. },
  75. ]]
  76. };
  77. return {
  78. north: {
  79. height: 88,
  80. /* split: true,
  81. border: false,*///底框是否可变动
  82. items: [
  83. queryToolbar,
  84. queryForm
  85. ]
  86. },
  87. center: {
  88. height: '60%',
  89. split: true,
  90. items:
  91. {
  92. onRender: function () {
  93. $grid1 = $(this);
  94. queryGrid1()
  95. },
  96. xtype: 'grid',
  97. toolbar: {
  98. xtype: 'toolbar',
  99. title: '用户列表',
  100. items: [
  101. {
  102. text: '生成健康及旅居申请表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  103. var row = $grid1.checkedData();
  104. if (row.length == 0) {
  105. $.yvan.msg('请至少选择一行数据');
  106. return;
  107. }
  108. var ids = "";
  109. for (var i = 0; i < row.length; i++) {
  110. ids += row[i].userId + ","
  111. }
  112. ids=ids.substring(0,ids.length-1);
  113. window.open(api('/export/lyReports?userId=' + ids));
  114. }
  115. },
  116. {
  117. text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  118. var row = $grid1.checkedData();
  119. if (row.length == 0) {
  120. $.yvan.msg('请至少选择一行数据');
  121. return;
  122. }
  123. var ids = "";
  124. for (var i = 0; i < row.length; i++) {
  125. ids += row[i].userId + ","
  126. }
  127. ids=ids.substring(0,ids.length-1);
  128. window.open(api('/export/lyApproves?userId=' + ids));
  129. }
  130. },
  131. {
  132. text: '导出人员报表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  133. var queryProperties = $form.formGet().queryProperties;
  134. var date = $form.formGet().date;
  135. if ( date == null || date == "") {
  136. $.yvan.msg('请选择导出时间');
  137. return
  138. }
  139. window.open(api('/sweepCode/exSelectLingyunUser?queryProperties='+queryProperties+"&unitId=0&date="+date));
  140. }
  141. },
  142. ]
  143. },
  144. multiselect: true, /// 表格多选
  145. idField: 'userId',
  146. editable: true,
  147. editOnSelected: true,
  148. autoSizeColumns: true,
  149. columns:
  150. [
  151. [
  152. {field: 'userId', title: '用户ID', hidden: true},
  153. {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
  154. {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
  155. {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
  156. {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
  157. {field: 'bingqingDesc', title: '病情表述', maxWidth: 200, align: 'left',},
  158. {field: 'workLoalDesc', title: '工作驻地', maxWidth: 200, align: 'left',},
  159. {field: 'todayLoalDesc', title: '今晚住地', maxWidth: 200, align: 'left',},
  160. {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
  161. {field: 'tripDetDesc', title: '出行详细', align: 'left',},
  162. ]
  163. ]
  164. }
  165. }
  166. };
  167. };
  168. }
  169. );