lingyunUser7.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  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 getList(id) {
  14. id = id == undefined ? 0 : id
  15. var _datas = [];
  16. _datas.push({
  17. "id": "",
  18. "text": "全部",
  19. "selected": true
  20. });
  21. $.yvan.ajax({
  22. url: api('/home/getDepartmentIdLYepi.json?unitId=' + id),
  23. method: 'GET',
  24. async: true,
  25. success: function (data) {
  26. if (data.data != null && data.data != undefined) {
  27. for (var i = 0; i < data.data.length; i++) {
  28. _datas.push({
  29. "id": data.data[i].departmentId,
  30. "text": data.data[i].departmentName
  31. })
  32. }
  33. reloadValuea(_datas);
  34. }
  35. }
  36. });
  37. return _datas;
  38. }
  39. // 下拉选清空并重新赋值
  40. function reloadValuea(_datas) {
  41. if ($coma) {
  42. $coma.combobox('clear');// 清除当前的选项
  43. $coma.combobox('loadData', _datas);// 重新加载数据
  44. }
  45. }
  46. // 弹框的方式
  47. var widgets = {
  48. // 搜索分类检索
  49. selectTableUnit: {
  50. url: 'app/whepi/home/selectLYbumen.js',
  51. bind: {
  52. unitId: 'unitId',
  53. unit: 'unit',
  54. },
  55. },
  56. };
  57. // 检索条件查询
  58. function queryGrid1() {
  59. var queryForm = $form.formGet();
  60. $grid1.reload({
  61. mtype: 'POST',
  62. url: api('/sweepCode/selectLingyunUser'),
  63. queryParams: queryForm
  64. }, true);
  65. }
  66. var queryToolbar = {
  67. xtype: 'toolbar',
  68. title: '用户管理',
  69. items: [
  70. {
  71. text: '查询', iconCls: 'fa fa-search', onClick: function () {
  72. queryGrid1();
  73. }
  74. }, {
  75. text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
  76. $form.formClear();
  77. queryGrid1();
  78. }
  79. }, {
  80. text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
  81. App.closeMe(this);
  82. }
  83. }
  84. ]
  85. };
  86. var queryForm = {
  87. onRender: function () {
  88. $form = $(this);
  89. },
  90. xtype: 'form',
  91. items: [[
  92. {
  93. xtype: 'textbox',
  94. label: '检索条件',
  95. name: 'queryProperties',
  96. prompt: "工号/用户名称/电话号码",
  97. labelWidth: 'auto',
  98. events: {keydown: enterQueryGrid1}, width: 200
  99. },
  100. {xtype: 'hidden', name: 'unitId'},
  101. {
  102. name: 'reportStatus',
  103. xtype: 'combobox',
  104. label: '是否上报',
  105. data: [{id: '', text: '全部'}, {id: '0', text: '有数据未上报'}, {id: '1', text: '已上报'}, {id: '2', text: '无数据'}],
  106. value: '',
  107. onChange: function (value) {
  108. queryGrid1();
  109. },
  110. },
  111. {
  112. xtype: 'searchbox',
  113. label: '部门',
  114. labelWidth: 'auto',
  115. name: 'unit',
  116. prompt: "部门",
  117. width: 250,
  118. widget: widgets.selectTableUnit,// 弹出框方法
  119. onChange: function (value) {
  120. if (!isNotNullOrEmpty(value)) {
  121. $form.formSet({
  122. unitId : 0
  123. })
  124. }
  125. getList($form.formGet().unitId);
  126. queryGrid1();
  127. },
  128. },
  129. {
  130. xtype: 'combobox',
  131. label: '二级部门',
  132. name: 'departmentId',
  133. labelWidth: 'auto',
  134. width: 280,
  135. value: '',
  136. data: getList(),
  137. onRender: function () {
  138. $coma = $(this);
  139. },
  140. onValue: function (data) {
  141. },
  142. onChange: function () {
  143. queryGrid1();
  144. }
  145. },
  146. {
  147. name: 'date',
  148. label: '导出时间',
  149. prompt: '导出时间',
  150. xtype: 'datebox',
  151. labelWidth: 'auto',
  152. width: 200,
  153. },],[
  154. {
  155. name: 'msStatus',
  156. xtype: 'combobox',
  157. label: '个人上报状态',
  158. data: [{id: '', text: '全部'}, {id: '1', text: '未上报'}, {id: '2', text: '正常'}, {id: '3', text: '异常'}],
  159. value: '',
  160. onChange: function (value) {
  161. queryGrid1();
  162. },
  163. },
  164. {
  165. name: 'isContact',
  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: 'isSuspected',
  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. name: 'isTrip',
  186. xtype: 'combobox',
  187. label: '是否出行',
  188. data: [{id: '', text: '全部'}, {id: '1', text: '否'}, {id: '2', text: '是'}],
  189. value: '',
  190. onChange: function (value) {
  191. queryGrid1();
  192. },
  193. },
  194. // {
  195. // name: 'isBand',
  196. // xtype: 'combobox',
  197. // label: '是否迁移',
  198. // data: [{id: '', text: '全部'}, {id: '1', text: '否'}, {id: '2', text: '是'}],
  199. // value: '',
  200. // onChange: function (value) {
  201. // queryGrid1();
  202. // },
  203. // },
  204. ]]
  205. };
  206. return {
  207. north: {
  208. height: 132,
  209. /* split: true,
  210. border: false,*///底框是否可变动
  211. items: [
  212. queryToolbar,
  213. queryForm
  214. ]
  215. },
  216. center: {
  217. height: '60%',
  218. split: true,
  219. items:
  220. {
  221. onRender: function () {
  222. $grid1 = $(this);
  223. queryGrid1()
  224. },
  225. xtype: 'grid',
  226. toolbar: {
  227. xtype: 'toolbar',
  228. title: '用户列表',
  229. items: [
  230. // {
  231. // text: '生成健康及旅居申请表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  232. // var row = $grid1.checkedData();
  233. // if (row.length == 0) {
  234. // $.yvan.msg('请至少选择一行数据');
  235. // return;
  236. // }
  237. // var ids = "";
  238. // for (var i = 0; i < row.length; i++) {
  239. // ids += row[i].userId + ","
  240. // }
  241. // ids=ids.substring(0,ids.length-1);
  242. // window.open(api('/export/lyReports?userId=' + ids));
  243. // }
  244. // },
  245. // {
  246. // text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  247. // var row = $grid1.checkedData();
  248. // if (row.length == 0) {
  249. // $.yvan.msg('请至少选择一行数据');
  250. // return;
  251. // }
  252. // var ids = "";
  253. // for (var i = 0; i < row.length; i++) {
  254. // ids += row[i].userId + ","
  255. // }
  256. // ids=ids.substring(0,ids.length-1);
  257. // window.open(api('/export/lyApproves?userId=' + ids));
  258. // }
  259. // },
  260. {
  261. text: '查看人员接种记录', iconCls: 'fa fa-search', onClick: function () {
  262. var row = $grid1.rowData();
  263. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  264. $.yvan.msg('请选择数据');
  265. return
  266. }
  267. if ( row.inoculateStatus.indexOf("是") < 0) {
  268. $.yvan.msg('该员工没有接种新冠疫苗');
  269. return
  270. }
  271. $.yvan.showDialog(this,
  272. require('/app/whepi/lingyun/dialogVaccine.js')({
  273. userId: row.userId,
  274. linkman: row.linkman,
  275. confirm: function () {
  276. // $grid2.reload();
  277. }
  278. })
  279. );
  280. }
  281. },
  282. {
  283. name: 'file',
  284. text: '凭证上传',
  285. iconCls: 'fa fa-cloud-upload',
  286. // accept: 'image/jpeg,image/png',
  287. accept: {
  288. title: 'file',
  289. // extensions: 'jpg,mp4,pdf,png,ppt,doc,xls,docx,xlsx,pptx',
  290. // 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'
  291. extensions: 'jpg,png',
  292. mimeTypes: 'image/jpeg,image/png'
  293. },
  294. onClick: function () {
  295. var row = $grid1.rowData();
  296. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  297. $.yvan.msg('请选择数据');
  298. return
  299. }
  300. $.yvan.showUploadWindow($(this), {
  301. url: api('/sweepCode/file/uploadVaccine'), //上传路径
  302. param: JSON.stringify({userId: row.userId, userName: row.linkman}),
  303. uploadSuccess: function (file) {
  304. //上传一个文件,成功之后的回调.
  305. //如果有多个文件会回调多次
  306. // console.log(file);
  307. }
  308. });
  309. }
  310. },
  311. {
  312. text: '查看人员凭证', iconCls: 'fa fa-search', onClick: function () {
  313. var row = $grid1.rowData();
  314. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  315. $.yvan.msg('请选择数据');
  316. return
  317. }
  318. if ( row.imgCount <= 0) {
  319. $.yvan.msg('该员工没有上传相关凭证');
  320. return
  321. }
  322. $.yvan.showDialog(this,
  323. require('/app/whepi/lingyun/dialogVaccineImage.js')({
  324. userId: row.userId,
  325. linkman: row.linkman,
  326. confirm: function () {
  327. }
  328. })
  329. );
  330. }
  331. },
  332. {
  333. text: '导出接种明细', iconCls: 'fa fa-cloud-upload', onClick: function () {
  334. var unitId = $form.formGet().unitId;
  335. var departmentId = $form.formGet().departmentId;
  336. if (unitId == null || unitId == "") {
  337. unitId = 0
  338. }
  339. if (departmentId == null || departmentId == "") {
  340. departmentId = 0
  341. }
  342. window.open(api('/sweepCode/exSelectVaccine?unitId='+unitId+'&departmentId='+departmentId));
  343. }
  344. },
  345. {
  346. text: '导出人员报表', iconCls: 'fa fa-cloud-upload', onClick: function () {
  347. var queryProperties = $form.formGet().queryProperties;
  348. var unitId = $form.formGet().unitId;
  349. var date = $form.formGet().date;
  350. if ( date == null || date == "") {
  351. $.yvan.msg('请选择导出时间');
  352. return
  353. }
  354. var msStatus = $form.formGet().msStatus;
  355. var isContact = $form.formGet().isContact;
  356. var isSuspected = $form.formGet().isSuspected;
  357. var isTrip = $form.formGet().isTrip;
  358. var departmentId = $form.formGet().departmentId;
  359. window.open(api('/sweepCode/exSelectLingyunUser?queryProperties='+queryProperties+"&unitId="+unitId + "&date="+date+
  360. '&msStatus='+msStatus+'&isContact='+isContact+'&isSuspected='+isSuspected+'&isTrip='+isTrip +'&departmentId=' + departmentId));
  361. }
  362. },
  363. {
  364. text: '导出正常复工人员', iconCls: 'fa fa-cloud-upload', onClick: function () {
  365. var unitId = $form.formGet().unitId;
  366. window.open(api('/returnWork/exReturnWork?unitId='+unitId));
  367. }
  368. },
  369. {
  370. text: '查看人员上报情况', iconCls: 'fa fa-search', onClick: function () {
  371. var row = $grid1.rowData();
  372. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  373. $.yvan.msg('请选择数据');
  374. return
  375. }
  376. $.yvan.showDialog(this,
  377. require('/app/whepi/lingyun/dialogDetail2.js')({
  378. userId: row.userId,
  379. linkman: row.linkman,
  380. confirm: function () {
  381. // $grid2.reload();
  382. }
  383. })
  384. );
  385. }
  386. },
  387. {
  388. text: '查看人员可复工状况', iconCls: 'fa fa-search', onClick: function () {
  389. var row = $grid1.rowData();
  390. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  391. $.yvan.msg('请选择数据');
  392. return
  393. }
  394. $.yvan.showDialog(this,
  395. require('/app/whepi/lingyun/dialogFugong.js')({
  396. userId: row.userId,
  397. confirm: function () {
  398. // $grid2.reload();
  399. }
  400. })
  401. );
  402. }
  403. },
  404. ]
  405. },
  406. multiselect: true, /// 表格多选
  407. idField: 'userId',
  408. editable: true,
  409. editOnSelected: true,
  410. autoSizeColumns: true,
  411. columns:
  412. [
  413. [
  414. {field: 'userId', title: '用户ID', hidden: true},
  415. {field: 'imgCount', hidden: true},
  416. {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
  417. {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
  418. {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
  419. {
  420. field: 'inoculateStatus', title: '是否接种新冠疫苗', maxWidth: 130, align: 'center', formatter: function (value) {
  421. if (value == 1) {
  422. return "<span style='color: green;'>是<span>";
  423. } else if (value == 0) {
  424. return "<span style='color: red;'>否<span>";
  425. } else {
  426. return "";
  427. }
  428. }
  429. },
  430. {field: 'reason', title: '未接种原因', maxWidth: 200, align: 'left',},
  431. {
  432. field: 'vaccineType', title: '接种疫苗类别', maxWidth: 100, align: 'center', formatter: function (value) {
  433. if (value == 1) {
  434. return "<span>腺病毒疫苗<span>";
  435. } else if (value == 2) {
  436. return "<span>灭活疫苗<span>";
  437. } else if (value == 3) {
  438. return "<span>重组亚单位疫苗<span>";
  439. } else {
  440. return "";
  441. }
  442. }
  443. },
  444. {
  445. field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
  446. if (value == 1) {
  447. return "<span style='color: green;'>是<span>";
  448. } else if (value == 2) {
  449. return "<span style='color: red;'>否<span>";
  450. } else {
  451. return "";
  452. }
  453. }
  454. },
  455. {
  456. field: 'travelRecords', title: '出行轨迹', maxWidth: 100, align: 'center', formatter: function (value) {
  457. if (value == 1) {
  458. return "<span style='color: red;'>是<span>";
  459. } else if (value == 2) {
  460. return "<span style='color: green;'>否<span>";
  461. } else {
  462. return "";
  463. }
  464. }
  465. },
  466. {
  467. field: 'returnWork', title: '今日复工', maxWidth: 100, align: 'center', formatter: function (value) {
  468. if (value == 1) {
  469. return "<span style='color: green;'>允许复工<span>";
  470. } else if (value == 0) {
  471. return "<span style='color: red;'>禁止复工<span>";
  472. }
  473. }
  474. },
  475. {field: 'reportStatus', title: '上报', hidden: true},
  476. {
  477. field: 'msStatus', title: '个人上报状态', maxWidth: 100, align: 'center', formatter: function (value, row) {
  478. if (row.rowData.reportStatus == 0) {
  479. return "<span style='color: #ffb717;'>未上报<span>";
  480. } else if (value == 1) {
  481. return "<span style='color: green;'>正常<span>";
  482. } else {
  483. return "<span style='color: red;'>异常<span>";
  484. }
  485. }
  486. },
  487. {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
  488. {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
  489. {field: 'oldOpenId', title: '旧openId',hidden: true},
  490. {field: 'isBand', title: '是否迁移',hidden: true, maxWidth: 200, align: 'center', formatter: function (value, row) {
  491. if (row.rowData.oldOpenId) {
  492. return "<span style='color: green;'>是<span>";
  493. } else {
  494. return "<span style='color: red;'>否<span>";
  495. }
  496. }
  497. },
  498. {field: 'bingqingDesc', title: '病情表述', align: 'left',},
  499. {field: 'isContactDesc', title: '密切接触人员', align: 'left',formatter: function (value) {
  500. if (value == "正常") {
  501. return "<span style='color: green;'>正常<span>";
  502. } else {
  503. return "<span style='color: red;'>异常<span>";
  504. }
  505. }
  506. },
  507. {field: 'isSuspectedDesc', title: '家人健康异常', align: 'left',formatter: function (value) {
  508. if (value == "否") {
  509. return "<span style='color: green;'>否<span>";
  510. } else {
  511. return "<span style='color: red;'>是<span>";
  512. }
  513. }
  514. },
  515. // {field: 'autoLocal', title: '定位地区', maxWidth: 200, align: 'left',},
  516. // {field: 'autoAddr', title: '定位地址', maxWidth: 200, align: 'left',},
  517. {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
  518. {field: 'tripDetDesc', title: '出行详细', align: 'left',},
  519. ]
  520. ]
  521. }
  522. }
  523. };
  524. };
  525. }
  526. );