lingyunUser2.js 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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: 'reportStatus',
  68. xtype: 'combobox',
  69. label: '是否上报',
  70. data: [{id: '', text: '全部'}, {id: '3', text: '否'}, {id: '1', text: '是'}],
  71. value: '',
  72. onChange: function (value) {
  73. queryGrid1();
  74. },
  75. },
  76. {
  77. name: 'date',
  78. label: '导出时间',
  79. prompt: '导出时间',
  80. xtype: 'datebox',
  81. labelWidth: 'auto',
  82. width: 250,
  83. },
  84. ]]
  85. };
  86. return {
  87. north: {
  88. height: 88,
  89. /* split: true,
  90. border: false,*///底框是否可变动
  91. items: [
  92. queryToolbar,
  93. queryForm
  94. ]
  95. },
  96. center: {
  97. height: '60%',
  98. split: true,
  99. items:
  100. {
  101. onRender: function () {
  102. $grid1 = $(this);
  103. queryGrid1()
  104. },
  105. xtype: 'grid',
  106. toolbar: {
  107. xtype: 'toolbar',
  108. title: '用户列表',
  109. items: [
  110. {
  111. text: '生成健康及旅居申请表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  112. var row = $grid1.checkedData();
  113. if (row.length == 0) {
  114. $.yvan.msg('请至少选择一行数据');
  115. return;
  116. }
  117. var ids = "";
  118. for (var i = 0; i < row.length; i++) {
  119. ids += row[i].userId + ","
  120. }
  121. ids=ids.substring(0,ids.length-1);
  122. window.open(api('/export/lyReports?userId=' + ids));
  123. }
  124. },
  125. {
  126. text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  127. var row = $grid1.checkedData();
  128. if (row.length == 0) {
  129. $.yvan.msg('请至少选择一行数据');
  130. return;
  131. }
  132. var ids = "";
  133. for (var i = 0; i < row.length; i++) {
  134. ids += row[i].userId + ","
  135. }
  136. ids=ids.substring(0,ids.length-1);
  137. window.open(api('/export/lyApproves?userId=' + ids));
  138. }
  139. },
  140. {
  141. text: '导出人员报表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  142. var queryProperties = $form.formGet().queryProperties;
  143. var date = $form.formGet().date;
  144. if ( date == null || date == "") {
  145. $.yvan.msg('请选择导出时间');
  146. return
  147. }
  148. window.open(api('/sweepCode/exSelectLingyunUser?queryProperties='+queryProperties+"&unitId=0&date="+date));
  149. }
  150. },
  151. {
  152. text: '查看人员上报情况', iconCls: 'fa fa-search', onClick: function () {
  153. var row = $grid1.rowData();
  154. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  155. $.yvan.msg('请选择数据');
  156. return
  157. }
  158. $.yvan.showDialog(this,
  159. require('/app/whepi/lingyun/dialogDetail2.js')({
  160. userId: row.userId,
  161. linkman: row.linkman,
  162. confirm: function () {
  163. // $grid2.reload();
  164. }
  165. })
  166. );
  167. }
  168. },
  169. {
  170. text: '查看人员可复工状况', iconCls: 'fa fa-search', onClick: function () {
  171. var row = $grid1.rowData();
  172. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  173. $.yvan.msg('请选择数据');
  174. return
  175. }
  176. $.yvan.showDialog(this,
  177. require('/app/whepi/lingyun/dialogFugong.js')({
  178. userId: row.userId,
  179. confirm: function () {
  180. // $grid2.reload();
  181. }
  182. })
  183. );
  184. }
  185. },
  186. ]
  187. },
  188. multiselect: true, /// 表格多选
  189. idField: 'userId',
  190. editable: true,
  191. editOnSelected: true,
  192. autoSizeColumns: true,
  193. columns:
  194. [
  195. [
  196. {field: 'userId', title: '用户ID', hidden: true},
  197. {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
  198. {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
  199. {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
  200. {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
  201. {field: 'bingqingDesc', title: '病情表述', maxWidth: 200, align: 'left',},
  202. {field: 'isContactDesc', title: '家人确诊或接触', align: 'left',formatter: function (value) {
  203. if (value == "否") {
  204. return "<span style='color: green;'>否<span>";
  205. } else {
  206. return "<span style='color: red;'>是<span>";
  207. }
  208. }
  209. },
  210. {field: 'isSuspectedDesc', title: '家人健康异常', align: 'left',formatter: function (value) {
  211. if (value == "否") {
  212. return "<span style='color: green;'>否<span>";
  213. } else {
  214. return "<span style='color: red;'>是<span>";
  215. }
  216. }
  217. },
  218. {field: 'workLoalDesc', title: '工作驻地', maxWidth: 200, align: 'left',},
  219. {field: 'todayLoalDesc', title: '今晚住地', maxWidth: 200, align: 'left',},
  220. {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
  221. {field: 'tripDetDesc', title: '出行详细', align: 'left',},
  222. ]
  223. ]
  224. }
  225. }
  226. };
  227. };
  228. }
  229. );