lingyunUser2.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  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. // name: 'isBand',
  176. // xtype: 'combobox',
  177. // label: '是否迁移',
  178. // data: [{id: '', text: '全部'}, {id: '1', text: '否'}, {id: '2', text: '是'}],
  179. // value: '',
  180. // onChange: function (value) {
  181. // queryGrid1();
  182. // },
  183. // },
  184. ]]
  185. };
  186. return {
  187. north: {
  188. height: 132,
  189. /* split: true,
  190. border: false,*///底框是否可变动
  191. items: [
  192. queryToolbar,
  193. queryForm
  194. ]
  195. },
  196. center: {
  197. height: '60%',
  198. split: true,
  199. items:
  200. {
  201. onRender: function () {
  202. $grid1 = $(this);
  203. queryGrid1()
  204. },
  205. xtype: 'grid',
  206. toolbar: {
  207. xtype: 'toolbar',
  208. title: '用户列表',
  209. items: [
  210. // {
  211. // text: '生成健康及旅居申请表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  212. // var row = $grid1.checkedData();
  213. // if (row.length == 0) {
  214. // $.yvan.msg('请至少选择一行数据');
  215. // return;
  216. // }
  217. // var ids = "";
  218. // for (var i = 0; i < row.length; i++) {
  219. // ids += row[i].userId + ","
  220. // }
  221. // ids=ids.substring(0,ids.length-1);
  222. // window.open(api('/export/lyReports?userId=' + ids));
  223. // }
  224. // },
  225. // {
  226. // text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  227. // var row = $grid1.checkedData();
  228. // if (row.length == 0) {
  229. // $.yvan.msg('请至少选择一行数据');
  230. // return;
  231. // }
  232. // var ids = "";
  233. // for (var i = 0; i < row.length; i++) {
  234. // ids += row[i].userId + ","
  235. // }
  236. // ids=ids.substring(0,ids.length-1);
  237. // window.open(api('/export/lyApproves?userId=' + ids));
  238. // }
  239. // },
  240. {
  241. text: '查看人员接种记录', iconCls: 'fa fa-search', onClick: function () {
  242. var row = $grid1.rowData();
  243. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  244. $.yvan.msg('请选择数据');
  245. return
  246. }
  247. if ( row.inoculateStatus.indexOf("是") < 0) {
  248. $.yvan.msg('该员工没有接种新冠疫苗');
  249. return
  250. }
  251. $.yvan.showDialog(this,
  252. require('/app/whepi/lingyun/dialogVaccine.js')({
  253. userId: row.userId,
  254. linkman: row.linkman,
  255. confirm: function () {
  256. // $grid2.reload();
  257. }
  258. })
  259. );
  260. }
  261. },
  262. {
  263. text: '导出接种明细', iconCls: 'fa fa-cloud-upload', onClick: function () {
  264. var unitId = $form.formGet().unitId;
  265. var departmentId = $form.formGet().departmentId;
  266. if (unitId == null || unitId == "") {
  267. unitId = 0
  268. }
  269. if (departmentId == null || departmentId == "") {
  270. departmentId = 0
  271. }
  272. window.open(api('/sweepCode/exSelectVaccine?unitId='+unitId+'&departmentId='+departmentId));
  273. }
  274. },
  275. {
  276. text: '导出人员报表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  277. var queryProperties = $form.formGet().queryProperties;
  278. var date = $form.formGet().date;
  279. if ( date == null || date == "") {
  280. $.yvan.msg('请选择导出时间');
  281. return
  282. }
  283. // var isBand = $form.formGet().isBand;
  284. var msStatus = $form.formGet().msStatus;
  285. var isContact = $form.formGet().isContact;
  286. var isSuspected = $form.formGet().isSuspected;
  287. var isTrip = $form.formGet().isTrip;
  288. var departmentId = $form.formGet().departmentId;
  289. window.open(api('/sweepCode/exSelectLingyunUser?queryProperties='+queryProperties+"&unitId=0&date="+date+
  290. '&msStatus='+msStatus+'&isContact='+isContact+'&isSuspected='+isSuspected+'&isTrip='+isTrip + '&departmentId=' + departmentId));
  291. }
  292. },
  293. {
  294. text: '导出正常复工人员', iconCls: 'fa fa-cloud-upload', onClick: function () {
  295. var unitId = $form.formGet().unitId;
  296. window.open(api('/returnWork/exReturnWork?unitId=0'));
  297. }
  298. },
  299. {
  300. text: '查看人员上报情况', iconCls: 'fa fa-search', onClick: function () {
  301. var row = $grid1.rowData();
  302. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  303. $.yvan.msg('请选择数据');
  304. return
  305. }
  306. $.yvan.showDialog(this,
  307. require('/app/whepi/lingyun/dialogDetail2.js')({
  308. userId: row.userId,
  309. linkman: row.linkman,
  310. confirm: function () {
  311. // $grid2.reload();
  312. }
  313. })
  314. );
  315. }
  316. },
  317. {
  318. text: '查看人员可复工状况', iconCls: 'fa fa-search', onClick: function () {
  319. var row = $grid1.rowData();
  320. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  321. $.yvan.msg('请选择数据');
  322. return
  323. }
  324. $.yvan.showDialog(this,
  325. require('/app/whepi/lingyun/dialogFugong.js')({
  326. userId: row.userId,
  327. confirm: function () {
  328. // $grid2.reload();
  329. }
  330. })
  331. );
  332. }
  333. },
  334. ]
  335. },
  336. multiselect: true, /// 表格多选
  337. idField: 'userId',
  338. editable: true,
  339. editOnSelected: true,
  340. autoSizeColumns: true,
  341. columns:
  342. [
  343. [
  344. {field: 'userId', title: '用户ID', hidden: true},
  345. {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
  346. {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
  347. {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
  348. {
  349. field: 'inoculateStatus', title: '是否接种新冠疫苗', maxWidth: 130, align: 'center', formatter: function (value) {
  350. if (value == 1) {
  351. return "<span style='color: green;'>是<span>";
  352. } else if (value == 0) {
  353. return "<span style='color: red;'>否<span>";
  354. } else {
  355. return "";
  356. }
  357. }
  358. },
  359. {field: 'reason', title: '未接种原因', maxWidth: 200, align: 'left',},
  360. {
  361. field: 'vaccineType', title: '接种疫苗类别', maxWidth: 100, align: 'center', formatter: function (value) {
  362. if (value == 1) {
  363. return "<span>腺病毒疫苗<span>";
  364. } else if (value == 2) {
  365. return "<span>灭活疫苗<span>";
  366. } else if (value == 3) {
  367. return "<span>重组亚单位疫苗<span>";
  368. } else {
  369. return "";
  370. }
  371. }
  372. },
  373. {
  374. field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
  375. if (value == 1) {
  376. return "<span style='color: green;'>是<span>";
  377. } else if (value == 2) {
  378. return "<span style='color: red;'>否<span>";
  379. } else {
  380. return "";
  381. }
  382. }
  383. },
  384. {
  385. field: 'travelRecords', title: '出行轨迹', maxWidth: 100, align: 'center', formatter: function (value) {
  386. if (value == 1) {
  387. return "<span style='color: red;'>是<span>";
  388. } else if (value == 2) {
  389. return "<span style='color: green;'>否<span>";
  390. } else {
  391. return "";
  392. }
  393. }
  394. },
  395. {
  396. field: 'returnWork', title: '今日复工', maxWidth: 100, align: 'center', formatter: function (value) {
  397. if (value == 1) {
  398. return "<span style='color: green;'>允许复工<span>";
  399. } else if (value == 0) {
  400. return "<span style='color: red;'>禁止复工<span>";
  401. }
  402. }
  403. },
  404. {field: 'reportStatus', title: '上报', hidden: true},
  405. {
  406. field: 'msStatus', title: '个人上报状态', maxWidth: 100, align: 'center', formatter: function (value, row) {
  407. if (row.rowData.reportStatus == 0) {
  408. return "<span style='color: #ffb717;'>未上报<span>";
  409. } else if (value == 1) {
  410. return "<span style='color: green;'>正常<span>";
  411. } else {
  412. return "<span style='color: red;'>异常<span>";
  413. }
  414. }
  415. },
  416. {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
  417. {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
  418. {field: 'oldOpenId', title: '旧openId',hidden: true},
  419. {field: 'isBand', title: '是否迁移',hidden: true, maxWidth: 200, align: 'center', formatter: function (value, row) {
  420. if (row.rowData.oldOpenId) {
  421. return "<span style='color: green;'>是<span>";
  422. } else {
  423. return "<span style='color: red;'>否<span>";
  424. }
  425. }
  426. },
  427. {field: 'bingqingDesc', title: '病情表述', maxWidth: 200, align: 'left',},
  428. {field: 'isContactDesc', title: '密切接触人员', align: 'left',formatter: function (value) {
  429. if (value == "正常") {
  430. return "<span style='color: green;'>正常<span>";
  431. } else {
  432. return "<span style='color: red;'>异常<span>";
  433. }
  434. }
  435. },
  436. {field: 'isSuspectedDesc', title: '家人健康异常', align: 'left',formatter: function (value) {
  437. if (value == "否") {
  438. return "<span style='color: green;'>否<span>";
  439. } else {
  440. return "<span style='color: red;'>是<span>";
  441. }
  442. }
  443. },
  444. {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
  445. {field: 'tripDetDesc', title: '出行详细', align: 'left',},
  446. ]
  447. ]
  448. }
  449. }
  450. };
  451. };
  452. }
  453. );