dialogDetail.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. define(function (require) {
  2. return function (context) {
  3. var $dlg, $grid;
  4. function queryGrid1() {
  5. $grid.reload({
  6. mtype: 'GET',
  7. url: api('/sweepCode/selectLingyunUserHistory'),
  8. queryParams: {userId: context.userId}
  9. }, true);
  10. }
  11. return {
  12. xtype: 'dialog',
  13. dialogId: 'dialogDetail',
  14. title: '历史上报' + context.linkman,
  15. width: '85%',
  16. height: '60%',
  17. onOpen: function () {
  18. $dlg = $(this);
  19. },
  20. center: {
  21. items: {
  22. onRender: function () {
  23. $grid = $(this);
  24. queryGrid1();
  25. },
  26. toolbar: {
  27. xtype: 'toolbar',
  28. title: '历史上报',
  29. items: [
  30. {
  31. text: '出行轨迹', iconCls: 'fa fa-search', onClick: function () {
  32. var row = $grid.rowData();
  33. if ( row == null || row == undefined || row.userId == null || row.userId == "") {
  34. $.yvan.msg('请选择数据');
  35. return
  36. }
  37. const reportDate = $.fn.fmatter.tsymd(row.reportDate);
  38. $.yvan.showDialog(this,
  39. require('/app/whepi/lingyun/dialogDetailLog.js')({
  40. userId: row.userId,
  41. linkman: context.linkman,
  42. reportDate: reportDate,
  43. confirm: function () {
  44. }
  45. })
  46. );
  47. }
  48. },
  49. ]
  50. },
  51. xtype: 'grid',
  52. idField: "reportDate",
  53. pagination: true,
  54. columns: [[
  55. {field: 'reportDate', title: '上报时间', align: 'left', formatter: 'tsymd'},
  56. {field: 'userId', title: '用户ID', hidden: true},
  57. // {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
  58. {
  59. field: 'reportStatus', title: '上报', maxWidth: 100, align: 'center', formatter: function (value) {
  60. if (value == 0) {
  61. return "<span style='color: #ffb717;'>未上报<span>";
  62. } else {
  63. return "<span style='color: green;'>已上报<span>";
  64. }
  65. }
  66. },
  67. {
  68. field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
  69. if (value == 1) {
  70. return "<span style='color: red;'>是<span>";
  71. } else if (value == 2) {
  72. return "<span style='color: green;'>否<span>";
  73. } else {
  74. return "";
  75. }
  76. }
  77. },
  78. {
  79. field: 'travelRecords', title: '出行轨迹', maxWidth: 100, align: 'center', formatter: function (value) {
  80. if (value == 1) {
  81. return "<span style='color: red;'>是<span>";
  82. } else if (value == 2) {
  83. return "<span style='color: green;'>否<span>";
  84. } else {
  85. return "";
  86. }
  87. }
  88. },
  89. {
  90. field: 'msStatus', title: '个人上报状态', maxWidth: 100, align: 'center', formatter: function (value, row) {
  91. if (row.rowData.reportStatus == 0) {
  92. return "<span style='color: #ffb717;'>未上报<span>";
  93. } else if (value == 1) {
  94. return "<span style='color: green;'>正常<span>";
  95. } else {
  96. return "<span style='color: red;'>异常<span>";
  97. }
  98. }
  99. },
  100. {field: 'temperature', title: '温度', maxWidth: 100, align: 'right',},
  101. {field: 'bingqingDesc', title: '病情表述', maxWidth: 300, align: 'left',},
  102. {field: 'isContactDesc', title: '密切接触人员', align: 'left',formatter: function (value) {
  103. if (value == "正常") {
  104. return "<span style='color: green;'>正常<span>";
  105. } else {
  106. return "<span style='color: red;'>异常<span>";
  107. }
  108. }
  109. },
  110. {field: 'isSuspectedDesc', title: '家人健康异常', align: 'left',formatter: function (value) {
  111. if (value == "否") {
  112. return "<span style='color: green;'>否<span>";
  113. } else {
  114. return "<span style='color: red;'>是<span>";
  115. }
  116. }
  117. },
  118. {field: 'workLoalDesc', title: '工作驻地', maxWidth: 100, align: 'left',},
  119. {field: 'todayLoalDesc', title: '今晚住地', maxWidth: 100, align: 'left',},
  120. {field: 'autoLocal', title: '定位地区', maxWidth: 200, align: 'left',},
  121. {field: 'autoAddr', title: '定位地址', maxWidth: 200, align: 'left',},
  122. {field: 'isTrip', title: '是否出行', maxWidth: 100, align: 'center',formatter: function (value) {
  123. if (value == 0) {
  124. return "<span style='color: green;'>否<span>";
  125. } else {
  126. return "<span style='color: #ff6d02;'>是<span>";
  127. }
  128. }
  129. },
  130. {field: 'tripDetDesc', title: '出行详细', align: 'left'},
  131. ]],
  132. }
  133. },
  134. buttons: [
  135. {
  136. text: "关闭", iconCls: "fa fa-times", onClick: function () {
  137. // $dlg.dialog('close');
  138. $dlg.window('close');
  139. }
  140. }
  141. ]
  142. };
  143. };
  144. });