lingyunUserZJ.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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/selectLingyunUserZJ'),
  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. name: 'msStatus',
  104. xtype: 'combobox',
  105. label: '个人上报状态',
  106. data: [{id: '', text: '全部'}, {id: '1', text: '未上报'}, {id: '2', text: '正常'}, {id: '3', text: '异常'}],
  107. value: '',
  108. onChange: function (value) {
  109. queryGrid1();
  110. },
  111. },
  112. {
  113. name: 'isContact',
  114. xtype: 'combobox',
  115. label: '密切接触人员',
  116. data: [{id: '', text: '全部'}, {id: '1', text: '正常'}, {id: '2', text: '异常'}],
  117. value: '',
  118. onChange: function (value) {
  119. queryGrid1();
  120. },
  121. },
  122. {
  123. name: 'isSuspected',
  124. xtype: 'combobox',
  125. label: '家人健康异常',
  126. data: [{id: '', text: '全部'}, {id: '1', text: '否'}, {id: '2', text: '是'}],
  127. value: '',
  128. onChange: function (value) {
  129. queryGrid1();
  130. },
  131. },
  132. {
  133. name: 'isTrip',
  134. xtype: 'combobox',
  135. label: '是否出行',
  136. data: [{id: '', text: '全部'}, {id: '1', text: '否'}, {id: '2', text: '是'}],
  137. value: '',
  138. onChange: function (value) {
  139. queryGrid1();
  140. },
  141. },
  142. ]]
  143. };
  144. return {
  145. north: {
  146. height: 132,
  147. /* split: true,
  148. border: false,*///底框是否可变动
  149. items: [
  150. queryToolbar,
  151. queryForm
  152. ]
  153. },
  154. center: {
  155. height: '60%',
  156. split: true,
  157. items:
  158. {
  159. onRender: function () {
  160. $grid1 = $(this);
  161. queryGrid1()
  162. },
  163. xtype: 'grid',
  164. toolbar: {
  165. xtype: 'toolbar',
  166. title: '用户列表',
  167. items: [
  168. {
  169. text: '导出人员报表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  170. var queryProperties = $form.formGet().queryProperties;
  171. var unitId = $form.formGet().unitId;
  172. var date = $form.formGet().date;
  173. if ( date == null || date == "") {
  174. $.yvan.msg('请选择导出时间');
  175. return
  176. }
  177. var msStatus = $form.formGet().msStatus;
  178. var isContact = $form.formGet().isContact;
  179. var isSuspected = $form.formGet().isSuspected;
  180. var isTrip = $form.formGet().isTrip;
  181. window.open(api('/sweepCode/exSelectLingyunUserZJ?queryProperties='+queryProperties+"&unitId="+unitId + "&date="+date+
  182. '&msStatus='+msStatus+'&isContact='+isContact+'&isSuspected='+isSuspected+'&isTrip='+isTrip));
  183. }
  184. },
  185. // {
  186. // text: '导出正常复工人员', iconCls: 'fa fa-cloud-upload', onClick: function () {
  187. // var unitId = $form.formGet().unitId;
  188. // window.open(api('/returnWork/exReturnWork?unitId='+unitId));
  189. // }
  190. // },
  191. {
  192. text: '查看人员上报情况', iconCls: 'fa fa-search', onClick: function () {
  193. var row = $grid1.rowData();
  194. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  195. $.yvan.msg('请选择数据');
  196. return
  197. }
  198. $.yvan.showDialog(this,
  199. require('/app/whepi/lingyun/dialogDetail.js')({
  200. userId: row.userId,
  201. linkman: row.linkman,
  202. confirm: function () {
  203. // $grid2.reload();
  204. }
  205. })
  206. );
  207. }
  208. },
  209. {
  210. text: '查看人员可复工状况', iconCls: 'fa fa-search', onClick: function () {
  211. var row = $grid1.rowData();
  212. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  213. $.yvan.msg('请选择数据');
  214. return
  215. }
  216. $.yvan.showDialog(this,
  217. require('/app/whepi/lingyun/dialogFugong.js')({
  218. userId: row.userId,
  219. confirm: function () {
  220. // $grid2.reload();
  221. }
  222. })
  223. );
  224. }
  225. },
  226. ]
  227. },
  228. multiselect: true, /// 表格多选
  229. idField: 'userId',
  230. editable: true,
  231. editOnSelected: true,
  232. autoSizeColumns: true,
  233. columns:
  234. [
  235. [
  236. {field: 'userId', title: '用户ID', hidden: true},
  237. {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
  238. {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
  239. {
  240. field: 'returnWork', title: '今日复工', maxWidth: 100, align: 'center', formatter: function (value) {
  241. if (value == 1) {
  242. return "<span style='color: green;'>允许复工<span>";
  243. } else if (value == 0) {
  244. return "<span style='color: red;'>禁止复工<span>";
  245. }
  246. }
  247. },
  248. {field: 'reportStatus', title: '上报', hidden: true},
  249. {
  250. field: 'msStatus', title: '个人上报状态', maxWidth: 100, align: 'center', formatter: function (value, row) {
  251. if (row.rowData.reportStatus == 0) {
  252. return "<span style='color: #ffb717;'>未上报<span>";
  253. } else if (value == 1) {
  254. return "<span style='color: green;'>正常<span>";
  255. } else {
  256. return "<span style='color: red;'>异常<span>";
  257. }
  258. }
  259. },
  260. {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
  261. {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
  262. {field: 'bingqingDesc', title: '病情表述', align: 'left',},
  263. {field: 'isContactDesc', title: '密切接触人员', align: 'left',formatter: function (value) {
  264. if (value == "正常") {
  265. return "<span style='color: green;'>正常<span>";
  266. } else {
  267. return "<span style='color: red;'>异常<span>";
  268. }
  269. }
  270. },
  271. {field: 'isSuspectedDesc', title: '家人健康异常', align: 'left',formatter: function (value) {
  272. if (value == "否") {
  273. return "<span style='color: green;'>否<span>";
  274. } else {
  275. return "<span style='color: red;'>是<span>";
  276. }
  277. }
  278. },
  279. {field: 'workLoalDesc', title: '工作驻地', maxWidth: 200, align: 'left',},
  280. {field: 'todayLoalDesc', title: '今晚住地', maxWidth: 200, align: 'left',},
  281. {field: 'autoLocal', title: '定位地区', maxWidth: 200, align: 'left',},
  282. {field: 'autoAddr', title: '定位地址', maxWidth: 200, align: 'left',},
  283. {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
  284. {field: 'tripDetDesc', title: '出行详细', align: 'left',},
  285. ]
  286. ]
  287. }
  288. }
  289. };
  290. };
  291. }
  292. );