HCUser.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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/selectHCbumen.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/HCUser'),
  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: 200
  65. },
  66. {xtype: 'hidden', name: 'unitId'},
  67. {
  68. name: 'reportStatus',
  69. xtype: 'combobox',
  70. label: '是否上报',
  71. data: [{id: '', text: '全部'}, {id: '0', text: '有数据未上报'}, {id: '1', text: '已上报'}, {id: '2', text: '无数据'}],
  72. value: '',
  73. onChange: function (value) {
  74. queryGrid1();
  75. },
  76. },
  77. {
  78. xtype: 'searchbox',
  79. label: '部门',
  80. labelWidth: 'auto',
  81. name: 'unit',
  82. prompt: "部门",
  83. width: 250,
  84. widget: widgets.selectTableUnit,// 弹出框方法
  85. onChange: function (value) {
  86. if (!isNotNullOrEmpty(value)) {
  87. $form.formSet({
  88. unitId : ''
  89. })
  90. }
  91. queryGrid1();
  92. },
  93. },
  94. {
  95. name: 'date',
  96. label: '导出时间',
  97. prompt: '导出时间',
  98. xtype: 'datebox',
  99. labelWidth: 'auto',
  100. width: 200,
  101. },
  102. ]]
  103. };
  104. return {
  105. north: {
  106. height: 88,
  107. /* split: true,
  108. border: false,*///底框是否可变动
  109. items: [
  110. queryToolbar,
  111. queryForm
  112. ]
  113. },
  114. center: {
  115. height: '60%',
  116. split: true,
  117. items:
  118. {
  119. onRender: function () {
  120. $grid1 = $(this);
  121. queryGrid1()
  122. },
  123. xtype: 'grid',
  124. toolbar: {
  125. xtype: 'toolbar',
  126. title: '用户列表',
  127. items: [
  128. {
  129. text: '导出人员报表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  130. var queryProperties = $form.formGet().queryProperties;
  131. var unitId = $form.formGet().unitId;
  132. var date = $form.formGet().date;
  133. if ( date == null || date == "") {
  134. $.yvan.msg('请选择导出时间');
  135. return
  136. }
  137. window.open(api('/sweepCode/exSelectHCUser?queryProperties='+queryProperties+"&unitId="+unitId + "&date="+date));
  138. }
  139. },
  140. {
  141. text: '查看人员上报情况', iconCls: 'fa fa-search', onClick: function () {
  142. var row = $grid1.rowData();
  143. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  144. $.yvan.msg('请选择数据');
  145. return
  146. }
  147. $.yvan.showDialog(this,
  148. require('/app/whepi/lingyun/HCDialogDetail.js')({
  149. userId: row.userId,
  150. linkman: row.linkman,
  151. confirm: function () {
  152. // $grid2.reload();
  153. }
  154. })
  155. );
  156. }
  157. },
  158. {
  159. text: '查看人员可复工状况', iconCls: 'fa fa-search', onClick: function () {
  160. var row = $grid1.rowData();
  161. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  162. $.yvan.msg('请选择数据');
  163. return
  164. }
  165. $.yvan.showDialog(this,
  166. require('/app/whepi/lingyun/dialogFugong.js')({
  167. userId: row.userId,
  168. confirm: function () {
  169. // $grid2.reload();
  170. }
  171. })
  172. );
  173. }
  174. },
  175. ]
  176. },
  177. multiselect: true, /// 表格多选
  178. idField: 'userId',
  179. editable: true,
  180. editOnSelected: true,
  181. autoSizeColumns: true,
  182. columns:
  183. [
  184. [
  185. {field: 'userId', title: '用户ID', hidden: true},
  186. {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
  187. {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
  188. {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
  189. {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
  190. {field: 'bingqingDesc', title: '病情表述', align: 'left',},
  191. {field: 'isContactDesc', title: '密切接触人员', align: 'left',formatter: function (value) {
  192. if (value == "正常") {
  193. return "<span style='color: green;'>正常<span>";
  194. } else {
  195. return "<span style='color: red;'>异常<span>";
  196. }
  197. }
  198. },
  199. {field: 'isSuspectedDesc', title: '家人健康异常', align: 'left',formatter: function (value) {
  200. if (value == "否") {
  201. return "<span style='color: green;'>否<span>";
  202. } else {
  203. return "<span style='color: red;'>是<span>";
  204. }
  205. }
  206. },
  207. ]
  208. ]
  209. }
  210. }
  211. };
  212. };
  213. }
  214. );