lingyunUser2.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  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-cloud-upload', onClick: function () {
  242. var queryProperties = $form.formGet().queryProperties;
  243. var date = $form.formGet().date;
  244. if ( date == null || date == "") {
  245. $.yvan.msg('请选择导出时间');
  246. return
  247. }
  248. // var isBand = $form.formGet().isBand;
  249. var msStatus = $form.formGet().msStatus;
  250. var isContact = $form.formGet().isContact;
  251. var isSuspected = $form.formGet().isSuspected;
  252. var isTrip = $form.formGet().isTrip;
  253. var departmentId = $form.formGet().departmentId;
  254. window.open(api('/sweepCode/exSelectLingyunUser?queryProperties='+queryProperties+"&unitId=0&date="+date+
  255. '&msStatus='+msStatus+'&isContact='+isContact+'&isSuspected='+isSuspected+'&isTrip='+isTrip + '&departmentId=' + departmentId));
  256. }
  257. },
  258. {
  259. text: '导出正常复工人员', iconCls: 'fa fa-cloud-upload', onClick: function () {
  260. var unitId = $form.formGet().unitId;
  261. window.open(api('/returnWork/exReturnWork?unitId=0'));
  262. }
  263. },
  264. {
  265. text: '查看人员上报情况', iconCls: 'fa fa-search', onClick: function () {
  266. var row = $grid1.rowData();
  267. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  268. $.yvan.msg('请选择数据');
  269. return
  270. }
  271. $.yvan.showDialog(this,
  272. require('/app/whepi/lingyun/dialogDetail2.js')({
  273. userId: row.userId,
  274. linkman: row.linkman,
  275. confirm: function () {
  276. // $grid2.reload();
  277. }
  278. })
  279. );
  280. }
  281. },
  282. {
  283. text: '查看人员可复工状况', iconCls: 'fa fa-search', onClick: function () {
  284. var row = $grid1.rowData();
  285. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  286. $.yvan.msg('请选择数据');
  287. return
  288. }
  289. $.yvan.showDialog(this,
  290. require('/app/whepi/lingyun/dialogFugong.js')({
  291. userId: row.userId,
  292. confirm: function () {
  293. // $grid2.reload();
  294. }
  295. })
  296. );
  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. if ( row.inoculateStatus.indexOf("是") < 0) {
  307. $.yvan.msg('该员工没有接种新冠疫苗');
  308. return
  309. }
  310. $.yvan.showDialog(this,
  311. require('/app/whepi/lingyun/dialogVaccine.js')({
  312. userId: row.userId,
  313. linkman: row.linkman,
  314. confirm: function () {
  315. // $grid2.reload();
  316. }
  317. })
  318. );
  319. }
  320. },
  321. {
  322. name: 'file',
  323. text: '凭证上传',
  324. iconCls: 'fa fa-cloud-upload',
  325. // accept: 'image/jpeg,image/png',
  326. accept: {
  327. title: 'file',
  328. // extensions: 'jpg,mp4,pdf,png,ppt,doc,xls,docx,xlsx,pptx',
  329. // mimeTypes: 'image/jpeg,video/mp4,application/pdf,image/png,application/vnd.ms-powerpoint,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation'
  330. extensions: 'jpg,png',
  331. mimeTypes: 'image/jpeg,image/png'
  332. },
  333. onClick: function () {
  334. var row = $grid1.rowData();
  335. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  336. $.yvan.msg('请选择数据');
  337. return
  338. }
  339. $.yvan.showUploadWindow($(this), {
  340. url: api('/sweepCode/file/uploadVaccine'), //上传路径
  341. param: JSON.stringify({userId: row.userId, userName: row.linkman}),
  342. uploadSuccess: function (file) {
  343. //上传一个文件,成功之后的回调.
  344. //如果有多个文件会回调多次
  345. // console.log(file);
  346. }
  347. });
  348. }
  349. },
  350. {
  351. text: '查看人员凭证', iconCls: 'fa fa-search', onClick: function () {
  352. var row = $grid1.rowData();
  353. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  354. $.yvan.msg('请选择数据');
  355. return
  356. }
  357. if ( row.imgCount <= 0) {
  358. $.yvan.msg('该员工没有上传相关凭证');
  359. return
  360. }
  361. $.yvan.showDialog(this,
  362. require('/app/whepi/lingyun/dialogVaccineImage.js')({
  363. userId: row.userId,
  364. linkman: row.linkman,
  365. confirm: function () {
  366. }
  367. })
  368. );
  369. }
  370. },
  371. {
  372. text: '导出接种明细', iconCls: 'fa fa-cloud-upload', onClick: function () {
  373. var unitId = $form.formGet().unitId;
  374. var departmentId = $form.formGet().departmentId;
  375. if (unitId == null || unitId == "") {
  376. unitId = 0
  377. }
  378. if (departmentId == null || departmentId == "") {
  379. departmentId = 0
  380. }
  381. window.open(api('/sweepCode/exSelectVaccine?unitId='+unitId+'&departmentId='+departmentId));
  382. }
  383. },
  384. ]
  385. },
  386. multiselect: true, /// 表格多选
  387. idField: 'userId',
  388. editable: true,
  389. editOnSelected: true,
  390. autoSizeColumns: true,
  391. columns:
  392. [
  393. [
  394. {field: 'userId', title: '用户ID', hidden: true},
  395. {field: 'imgCount', hidden: true},
  396. {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
  397. {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
  398. {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
  399. {
  400. field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
  401. if (value == 1) {
  402. return "<span style='color: green;'>是<span>";
  403. } else if (value == 2) {
  404. return "<span style='color: red;'>否<span>";
  405. } else {
  406. return "";
  407. }
  408. }
  409. },
  410. {
  411. field: 'travelRecords', title: '出行轨迹', maxWidth: 100, align: 'center', formatter: function (value) {
  412. if (value == 1) {
  413. return "<span style='color: red;'>是<span>";
  414. } else if (value == 2) {
  415. return "<span style='color: green;'>否<span>";
  416. } else {
  417. return "";
  418. }
  419. }
  420. },
  421. {
  422. field: 'returnWork', title: '今日复工', maxWidth: 100, align: 'center', formatter: function (value) {
  423. if (value == 1) {
  424. return "<span style='color: green;'>允许复工<span>";
  425. } else if (value == 0) {
  426. return "<span style='color: red;'>禁止复工<span>";
  427. }
  428. }
  429. },
  430. {field: 'reportStatus', title: '上报', hidden: true},
  431. {
  432. field: 'msStatus', title: '个人上报状态', maxWidth: 100, align: 'center', formatter: function (value, row) {
  433. if (row.rowData.reportStatus == 0) {
  434. return "<span style='color: #ffb717;'>未上报<span>";
  435. } else if (value == 1) {
  436. return "<span style='color: green;'>正常<span>";
  437. } else {
  438. return "<span style='color: red;'>异常<span>";
  439. }
  440. }
  441. },
  442. {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
  443. {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
  444. {field: 'oldOpenId', title: '旧openId',hidden: true},
  445. {field: 'isBand', title: '是否迁移',hidden: true, maxWidth: 200, align: 'center', formatter: function (value, row) {
  446. if (row.rowData.oldOpenId) {
  447. return "<span style='color: green;'>是<span>";
  448. } else {
  449. return "<span style='color: red;'>否<span>";
  450. }
  451. }
  452. },
  453. {field: 'bingqingDesc', title: '病情表述', maxWidth: 200, align: 'left',},
  454. {field: 'isContactDesc', title: '密切接触人员', align: 'left',formatter: function (value) {
  455. if (value == "正常") {
  456. return "<span style='color: green;'>正常<span>";
  457. } else {
  458. return "<span style='color: red;'>异常<span>";
  459. }
  460. }
  461. },
  462. {field: 'isSuspectedDesc', title: '家人健康异常', align: 'left',formatter: function (value) {
  463. if (value == "否") {
  464. return "<span style='color: green;'>否<span>";
  465. } else {
  466. return "<span style='color: red;'>是<span>";
  467. }
  468. }
  469. },
  470. {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
  471. {field: 'tripDetDesc', title: '出行详细', align: 'left',},
  472. {
  473. field: 'inoculateStatus', title: '是否接种新冠疫苗', maxWidth: 130, align: 'center', formatter: function (value) {
  474. if (value == 1) {
  475. return "<span style='color: green;'>是<span>";
  476. } else if (value == 0) {
  477. return "<span style='color: red;'>否<span>";
  478. } else {
  479. return "";
  480. }
  481. }
  482. },
  483. {field: 'reason', title: '未接种原因', maxWidth: 200, align: 'left',},
  484. {
  485. field: 'vaccineType', title: '接种疫苗类别', maxWidth: 100, align: 'center', formatter: function (value) {
  486. if (value == 1) {
  487. return "<span>腺病毒疫苗<span>";
  488. } else if (value == 2) {
  489. return "<span>灭活疫苗<span>";
  490. } else if (value == 3) {
  491. return "<span>重组亚单位疫苗<span>";
  492. } else {
  493. return "";
  494. }
  495. }
  496. },
  497. ]
  498. ]
  499. }
  500. }
  501. };
  502. };
  503. }
  504. );