lingyunUser2.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. define(function (require) {
  2. return function (context) {
  3. var $grid1, $form, $coma;
  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. function reloadValuea(_datas) {
  14. if ($coma) {
  15. $coma.combobox('clear');// 清除当前的选项
  16. $coma.combobox('loadData', _datas);// 重新加载数据
  17. }
  18. }
  19. // 获取联机下拉选二级信息
  20. function getList() {
  21. var _datas = [];
  22. _datas.push({
  23. "id": "",
  24. "text": "全部",
  25. "selected": true
  26. });
  27. $.yvan.ajax({
  28. url: api('/home/getDepartmentIdLYepi.json?unitId=0'),
  29. method: 'GET',
  30. async: true,
  31. success: function (data) {
  32. if (data.data != null && data.data != undefined) {
  33. for (var i = 0; i < data.data.length; i++) {
  34. _datas.push({
  35. "id": data.data[i].departmentId,
  36. "text": data.data[i].departmentName
  37. })
  38. }
  39. reloadValuea(_datas);
  40. }
  41. }
  42. });
  43. return _datas;
  44. }
  45. // 弹框的方式
  46. var widgets = {
  47. // 搜索分类检索
  48. selectTableUnit: {
  49. url: 'app/whepi/home/selectLYbumen.js',
  50. bind: {
  51. unitId: 'unitId',
  52. unit: 'unit',
  53. },
  54. },
  55. };
  56. // 检索条件查询
  57. function queryGrid1() {
  58. var queryForm = $form.formGet();
  59. $grid1.reload({
  60. mtype: 'POST',
  61. url: api('/sweepCode/selectLingyunUser'),
  62. queryParams: queryForm
  63. }, true);
  64. }
  65. var queryToolbar = {
  66. xtype: 'toolbar',
  67. title: '用户管理',
  68. items: [
  69. {
  70. text: '查询', iconCls: 'fa fa-search', onClick: function () {
  71. queryGrid1();
  72. }
  73. }, {
  74. text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
  75. $form.formClear();
  76. queryGrid1();
  77. }
  78. }, {
  79. text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
  80. App.closeMe(this);
  81. }
  82. }
  83. ]
  84. };
  85. var queryForm = {
  86. onRender: function () {
  87. $form = $(this);
  88. },
  89. xtype: 'form',
  90. items: [[
  91. {
  92. xtype: 'textbox',
  93. label: '检索条件',
  94. name: 'queryProperties',
  95. prompt: "用户名称/电话号码",
  96. labelWidth: 'auto',
  97. events: {keydown: enterQueryGrid1}, width: 350
  98. },
  99. {
  100. name: 'reportStatus',
  101. xtype: 'combobox',
  102. label: '是否上报',
  103. data: [{id: '', text: '全部'}, {id: '3', text: '否'}, {id: '1', text: '是'}],
  104. value: '',
  105. onChange: function (value) {
  106. queryGrid1();
  107. },
  108. },
  109. {
  110. xtype: 'combobox',
  111. label: '二级部门',
  112. name: 'departmentId',
  113. labelWidth: 'auto',
  114. width: 280,
  115. value: '',
  116. data: getList(),
  117. onRender: function () {
  118. $coma = $(this);
  119. },
  120. onValue: function (data) {
  121. },
  122. onChange: function () {
  123. queryGrid1();
  124. }
  125. },
  126. {
  127. name: 'date',
  128. label: '导出时间',
  129. prompt: '导出时间',
  130. xtype: 'datebox',
  131. labelWidth: 'auto',
  132. width: 250,
  133. },],[
  134. {
  135. name: 'msStatus',
  136. xtype: 'combobox',
  137. label: '个人上报状态',
  138. data: [{id: '', text: '全部'}, {id: '1', text: '未上报'}, {id: '2', text: '正常'}, {id: '3', text: '异常'}],
  139. value: '',
  140. onChange: function (value) {
  141. queryGrid1();
  142. },
  143. },
  144. {
  145. name: 'isContact',
  146. xtype: 'combobox',
  147. label: '家人确诊或接触',
  148. data: [{id: '', text: '全部'}, {id: '1', text: '否'}, {id: '2', text: '是'}],
  149. value: '',
  150. onChange: function (value) {
  151. queryGrid1();
  152. },
  153. },
  154. {
  155. name: 'isSuspected',
  156. xtype: 'combobox',
  157. label: '家人健康异常',
  158. data: [{id: '', text: '全部'}, {id: '1', text: '否'}, {id: '2', text: '是'}],
  159. value: '',
  160. onChange: function (value) {
  161. queryGrid1();
  162. },
  163. },
  164. {
  165. name: 'isTrip',
  166. xtype: 'combobox',
  167. label: '是否出行',
  168. data: [{id: '', text: '全部'}, {id: '1', text: '否'}, {id: '2', text: '是'}],
  169. value: '',
  170. onChange: function (value) {
  171. queryGrid1();
  172. },
  173. },
  174. ]]
  175. };
  176. return {
  177. north: {
  178. height: 132,
  179. /* split: true,
  180. border: false,*///底框是否可变动
  181. items: [
  182. queryToolbar,
  183. queryForm
  184. ]
  185. },
  186. center: {
  187. height: '60%',
  188. split: true,
  189. items:
  190. {
  191. onRender: function () {
  192. $grid1 = $(this);
  193. queryGrid1()
  194. },
  195. xtype: 'grid',
  196. toolbar: {
  197. xtype: 'toolbar',
  198. title: '用户列表',
  199. items: [
  200. {
  201. text: '生成健康及旅居申请表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  202. var row = $grid1.checkedData();
  203. if (row.length == 0) {
  204. $.yvan.msg('请至少选择一行数据');
  205. return;
  206. }
  207. var ids = "";
  208. for (var i = 0; i < row.length; i++) {
  209. ids += row[i].userId + ","
  210. }
  211. ids=ids.substring(0,ids.length-1);
  212. window.open(api('/export/lyReports?userId=' + ids));
  213. }
  214. },
  215. {
  216. text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  217. var row = $grid1.checkedData();
  218. if (row.length == 0) {
  219. $.yvan.msg('请至少选择一行数据');
  220. return;
  221. }
  222. var ids = "";
  223. for (var i = 0; i < row.length; i++) {
  224. ids += row[i].userId + ","
  225. }
  226. ids=ids.substring(0,ids.length-1);
  227. window.open(api('/export/lyApproves?userId=' + ids));
  228. }
  229. },
  230. {
  231. text: '导出人员报表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  232. var queryProperties = $form.formGet().queryProperties;
  233. var date = $form.formGet().date;
  234. if ( date == null || date == "") {
  235. $.yvan.msg('请选择导出时间');
  236. return
  237. }
  238. var msStatus = $form.formGet().msStatus;
  239. var isContact = $form.formGet().isContact;
  240. var isSuspected = $form.formGet().isSuspected;
  241. var isTrip = $form.formGet().isTrip;
  242. var departmentId = $form.formGet().departmentId;
  243. window.open(api('/sweepCode/exSelectLingyunUser?queryProperties='+queryProperties+"&unitId=0&date="+date+
  244. '&msStatus='+msStatus+'&isContact='+isContact+'&isSuspected='+isSuspected+'&isTrip='+isTrip + '&departmentId=' + departmentId));
  245. }
  246. },
  247. {
  248. text: '导出正常复工人员', iconCls: 'fa fa-cloud-upload', onClick: function () {
  249. var unitId = $form.formGet().unitId;
  250. window.open(api('/returnWork/exReturnWork?unitId=0'));
  251. }
  252. },
  253. {
  254. text: '查看人员上报情况', iconCls: 'fa fa-search', onClick: function () {
  255. var row = $grid1.rowData();
  256. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  257. $.yvan.msg('请选择数据');
  258. return
  259. }
  260. $.yvan.showDialog(this,
  261. require('/app/whepi/lingyun/dialogDetail2.js')({
  262. userId: row.userId,
  263. linkman: row.linkman,
  264. confirm: function () {
  265. // $grid2.reload();
  266. }
  267. })
  268. );
  269. }
  270. },
  271. {
  272. text: '查看人员可复工状况', iconCls: 'fa fa-search', onClick: function () {
  273. var row = $grid1.rowData();
  274. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  275. $.yvan.msg('请选择数据');
  276. return
  277. }
  278. $.yvan.showDialog(this,
  279. require('/app/whepi/lingyun/dialogFugong.js')({
  280. userId: row.userId,
  281. confirm: function () {
  282. // $grid2.reload();
  283. }
  284. })
  285. );
  286. }
  287. },
  288. ]
  289. },
  290. multiselect: true, /// 表格多选
  291. idField: 'userId',
  292. editable: true,
  293. editOnSelected: true,
  294. autoSizeColumns: true,
  295. columns:
  296. [
  297. [
  298. {field: 'userId', title: '用户ID', hidden: true},
  299. {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
  300. {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
  301. {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
  302. {
  303. field: 'returnWork', title: '今日复工', maxWidth: 100, align: 'center', formatter: function (value) {
  304. if (value == 1) {
  305. return "<span style='color: green;'>允许复工<span>";
  306. } else if (value == 0) {
  307. return "<span style='color: red;'>禁止复工<span>";
  308. }
  309. }
  310. },
  311. {field: 'reportStatus', title: '上报', hidden: true},
  312. {
  313. field: 'msStatus', title: '个人上报状态', maxWidth: 100, align: 'center', formatter: function (value, row) {
  314. if (row.rowData.reportStatus == 0) {
  315. return "<span style='color: #ffb717;'>未上报<span>";
  316. } else if (value == 1) {
  317. return "<span style='color: green;'>正常<span>";
  318. } else {
  319. return "<span style='color: red;'>异常<span>";
  320. }
  321. }
  322. },
  323. {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
  324. {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
  325. {field: 'bingqingDesc', title: '病情表述', maxWidth: 200, align: 'left',},
  326. {field: 'isContactDesc', title: '家人确诊或接触', align: 'left',formatter: function (value) {
  327. if (value == "否") {
  328. return "<span style='color: green;'>否<span>";
  329. } else {
  330. return "<span style='color: red;'>是<span>";
  331. }
  332. }
  333. },
  334. {field: 'isSuspectedDesc', title: '家人健康异常', align: 'left',formatter: function (value) {
  335. if (value == "否") {
  336. return "<span style='color: green;'>否<span>";
  337. } else {
  338. return "<span style='color: red;'>是<span>";
  339. }
  340. }
  341. },
  342. {field: 'workLoalDesc', title: '工作驻地', maxWidth: 200, align: 'left',},
  343. {field: 'todayLoalDesc', title: '今晚住地', maxWidth: 200, align: 'left',},
  344. {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
  345. {field: 'tripDetDesc', title: '出行详细', align: 'left',},
  346. ]
  347. ]
  348. }
  349. }
  350. };
  351. };
  352. }
  353. );