lingyunUser2.js 12 KB

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