lingyunUser2.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  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. },
  301. multiselect: true, /// 表格多选
  302. idField: 'userId',
  303. editable: true,
  304. editOnSelected: true,
  305. autoSizeColumns: true,
  306. columns:
  307. [
  308. [
  309. {field: 'userId', title: '用户ID', hidden: true},
  310. {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
  311. {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
  312. {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
  313. {
  314. field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
  315. if (value == 1) {
  316. return "<span style='color: green;'>是<span>";
  317. } else if (value == 2) {
  318. return "<span style='color: red;'>否<span>";
  319. } else {
  320. return "";
  321. }
  322. }
  323. },
  324. {
  325. field: 'returnWork', title: '今日复工', maxWidth: 100, align: 'center', formatter: function (value) {
  326. if (value == 1) {
  327. return "<span style='color: green;'>允许复工<span>";
  328. } else if (value == 0) {
  329. return "<span style='color: red;'>禁止复工<span>";
  330. }
  331. }
  332. },
  333. {field: 'reportStatus', title: '上报', hidden: true},
  334. {
  335. field: 'msStatus', title: '个人上报状态', maxWidth: 100, align: 'center', formatter: function (value, row) {
  336. if (row.rowData.reportStatus == 0) {
  337. return "<span style='color: #ffb717;'>未上报<span>";
  338. } else if (value == 1) {
  339. return "<span style='color: green;'>正常<span>";
  340. } else {
  341. return "<span style='color: red;'>异常<span>";
  342. }
  343. }
  344. },
  345. {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
  346. {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
  347. {field: 'oldOpenId', title: '旧openId',hidden: true},
  348. {field: 'isBand', title: '是否迁移',hidden: true, maxWidth: 200, align: 'center', formatter: function (value, row) {
  349. if (row.rowData.oldOpenId) {
  350. return "<span style='color: green;'>是<span>";
  351. } else {
  352. return "<span style='color: red;'>否<span>";
  353. }
  354. }
  355. },
  356. {field: 'bingqingDesc', title: '病情表述', maxWidth: 200, align: 'left',},
  357. {field: 'isContactDesc', title: '密切接触人员', align: 'left',formatter: function (value) {
  358. if (value == "正常") {
  359. return "<span style='color: green;'>正常<span>";
  360. } else {
  361. return "<span style='color: red;'>异常<span>";
  362. }
  363. }
  364. },
  365. {field: 'isSuspectedDesc', title: '家人健康异常', align: 'left',formatter: function (value) {
  366. if (value == "否") {
  367. return "<span style='color: green;'>否<span>";
  368. } else {
  369. return "<span style='color: red;'>是<span>";
  370. }
  371. }
  372. },
  373. {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
  374. {field: 'tripDetDesc', title: '出行详细', align: 'left',},
  375. ]
  376. ]
  377. }
  378. }
  379. };
  380. };
  381. }
  382. );