liaodan.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. define(function (require) {
  2. return function (context) {
  3. var $grid,$grid2, $form;
  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 queryGrid1() {
  14. var queryUrl = '/home/queryRibaoTest';// 自行替换此参数
  15. $grid.jqGrid("clearGridData");
  16. var queryForm = $form.formGet();
  17. $grid.reload({
  18. mtype: 'get',
  19. url: api(queryUrl),
  20. queryParams: queryForm
  21. });
  22. }
  23. function queryGrid2(rowid) {
  24. var row = $grid.rowData(rowid);
  25. if (!row) {
  26. $.yvan.msg('请先选择一行数据');
  27. return;
  28. }
  29. var queryUrl = '/home/queryRibaoTestxq';// 自行替换此参数
  30. var queryForm = $form.formGet();
  31. queryForm.reportId = row.reportId;
  32. queryForm.reportDate = row.reportDate;
  33. $grid2.reload({
  34. mtype: 'get',
  35. url: api(queryUrl),
  36. queryParams: queryForm
  37. }, true);
  38. }
  39. //删除
  40. function deleteRow1() {
  41. var row = $grid.rowData();
  42. if (!row) {
  43. $.yvan.msg('请先选择一行数据');
  44. return;
  45. }
  46. $.yvan.confirm('确定上报[' + row.reportDate + "] ?", {
  47. yes: function (index) {
  48. $.yvan.ajax({
  49. url: api('/home/shaobaoReport'),
  50. data: {
  51. reportDate: row.reportDate,
  52. },
  53. method: 'post',
  54. success: function (data) {
  55. $.yvan.msg(data.msg);
  56. $grid.reload();
  57. $grid2.reload();
  58. }
  59. });
  60. }
  61. });
  62. }
  63. // 搜索按钮
  64. var queryToolbarTitle = '个人管理';
  65. var queryToolbar = {
  66. xtype: 'toolbar', title: queryToolbarTitle, items: [
  67. {
  68. text: '查询', iconCls: 'fa fa-search', onClick: function () {
  69. queryGrid1();
  70. }
  71. }, {
  72. text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
  73. $form.formClear();
  74. queryGrid1();
  75. }
  76. }, {
  77. text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
  78. App.closeMe(this);
  79. }
  80. }
  81. ]
  82. };
  83. // 搜索条件
  84. var queryFormPrompt = '检索条件';
  85. var queryForm = {
  86. onRender: function () {
  87. $form = $(this);
  88. },
  89. xtype: 'form',
  90. items: [
  91. [
  92. {
  93. xtype: 'yvselect',
  94. label: '上报状态',
  95. name: 'reportStatus',
  96. labelWidth: 'auto',
  97. width: 200,
  98. data: [
  99. {id: '', text: '全部'},
  100. {id: '0', text: '未上报'},
  101. {id: '1', text: '已上报'},
  102. ],
  103. onChange: function (data) {
  104. queryGrid1();
  105. },
  106. },
  107. ]
  108. ]
  109. };
  110. // 列表增删改查按钮
  111. var gridToolbarTitle = '上报列表';
  112. var gridToolbar = {
  113. xtype: 'toolbar', title: gridToolbarTitle,items: [
  114. {
  115. text: '上报', iconCls: 'fa fa-pencil-square-o', onClick: function () {
  116. deleteRow1();
  117. }
  118. }
  119. ]
  120. }
  121. return {
  122. center: {
  123. border: false,
  124. items: {
  125. onRender: function () {
  126. $grid = $(this);
  127. queryGrid1();
  128. },
  129. xtype: 'grid',
  130. idField: "reportId",
  131. pagination: false,
  132. toolbar: {
  133. xtype: 'div',
  134. items: [
  135. queryToolbar,
  136. queryForm,
  137. gridToolbar
  138. ]
  139. },
  140. columns: [[
  141. {title: '账号ID', field: 'reportId', hidden: true},
  142. {title: '上报日期', field: 'reportDate'},
  143. {
  144. title: '上报状态', field: 'reportStatus', formatter: function (value) {
  145. if (value == 0)
  146. return "未上报";
  147. else
  148. return "<span style='color:green'>已上报</span>";
  149. }
  150. },
  151. {
  152. title: '异常状态', field: 'msStatus', formatter: function (value) {
  153. if (value == 1)
  154. return "<span style='color:green'>正常</span>";
  155. if (value == 2)
  156. return "<span style='color:red'>异常</span>";
  157. }
  158. },
  159. {title: '居家人数', field: 'safetyNum'},
  160. {title: '确诊人数', field: 'sureNum'},
  161. {title: '疑似人数', field: 'suspectedNum'},
  162. {title: '正常人数', field: 'normalNum'},
  163. {title: '隔离人数', field: 'singleNum'},
  164. {title: '新增人', field: 'userCreateName'},
  165. {title: '新增时间', field: 'timeCreate', formatter: 'ts'},
  166. {title: '更新人', field: 'userUpdateName'},
  167. {title: '更新时间', field: 'timeUpdate', formatter: 'ts'}
  168. ]],
  169. onSelectRow: function (rowid) {
  170. var row = $grid.rowData(rowid);
  171. if (!row) {
  172. $.yvan.msg('请先选择一行数据');
  173. return;
  174. }
  175. clearGrid($grid2);
  176. queryGrid2(rowid);
  177. }
  178. }
  179. },
  180. south:
  181. {
  182. height: '40%',
  183. border: false,
  184. items:
  185. {
  186. onRender: function () {
  187. $grid2 = $(this);
  188. },
  189. xtype: 'grid',
  190. toolbar:
  191. {
  192. xtype: 'div',
  193. items: [{
  194. xtype: 'toolbar', title: '详情列表',
  195. items: [{
  196. text: '编辑上报信息', iconCls: 'fa fa-pencil-square-o', onClick: function () {
  197. var row = $grid2.rowData();
  198. if (!row) {
  199. $.yvan.msg('请先选择一行数据');
  200. return;
  201. }
  202. $.yvan.showDialog(this,
  203. require('/app/whepi/lingyun/dialogLiaodan.js')({
  204. isEdit: true,
  205. row: row,
  206. confirm: function () {
  207. $grid2.reload();
  208. }
  209. })
  210. );
  211. }
  212. }]
  213. }],
  214. },
  215. autoSizeColumns: true,
  216. sortable: true,
  217. pagination: false,
  218. columns:
  219. [
  220. [{title: '疑似ID', field: 'suspectedId', hidden: true},
  221. {title: '性别', field: 'grender', hidden: true},
  222. {title: '新冠肺炎', field: 'medical', hidden: true},
  223. {title: '咳嗽现象', field: 'cough', hidden: true},
  224. {title: '肌肉酸疼', field: 'muscle', hidden: true},
  225. {title: '呼吸困难', field: 'dyspnea', hidden: true},
  226. {title: '乏力现象', field: 'fatigue', hidden: true},
  227. {title: '腹泻现象', field: 'diarrhea', hidden: true},
  228. {title: '姓名', field: 'userName'},
  229. {
  230. title: '性别', field: 'grenderStr', formatter: function (value) {
  231. if (value == 1)
  232. return "男";
  233. else
  234. return "女";
  235. }
  236. },
  237. {
  238. title: '岁数', field: 'age'
  239. },
  240. {title: '基本情况', field: 'familyStatus'},
  241. {title: '本人身体情况', field: 'medicalStr',formatter:function(value){
  242. if(value == 0){
  243. return "正常"
  244. }else if(value == 1){
  245. return "异常"
  246. }else if(value == 2){
  247. return "疑似"
  248. }else if(value == 3){
  249. return "有接触史"
  250. }else if(value == 4){
  251. return "解除隔离"
  252. }
  253. }},
  254. {title: '体温', field: 'temperature'},
  255. {title: '咳嗽现象', field: 'coughStr',formatter:function(value){
  256. if(value == 0){
  257. return "无咳嗽"
  258. }else if(value == 1){
  259. return "偶有短暂咳嗽"
  260. }else if(value == 2){
  261. return "咳嗽轻度影响生活"
  262. }else if(value == 3){
  263. return "咳嗽严重影响生活"
  264. }
  265. }},
  266. {title: '肌肉酸疼', field: 'muscleStr',formatter:function(value){
  267. if(value == 0){
  268. return "无"
  269. }else if(value == 1){
  270. return "按压有"
  271. }else if(value == 2){
  272. return "偶尔"
  273. }else if(value == 3){
  274. return "持续有"
  275. }
  276. }},
  277. {title: '呼吸困难', field: 'dyspneaStr',formatter:function(value){
  278. if(value == 0){
  279. return "无"
  280. }else if(value == 1){
  281. return "急走或上坡气短"
  282. }else if(value == 2){
  283. return "气短而走路变慢"
  284. }else if(value == 3){
  285. return "走路数分钟后气短"
  286. }else if(value == 4){
  287. return "气短无法离开房间"
  288. }
  289. }},
  290. {title: '乏力现象', field: 'fatigueStr',formatter:function(value){
  291. if(value == 0){
  292. return "无"
  293. }else if(value == 1){
  294. return "体力劳动后不能恢复"
  295. }else if(value == 2){
  296. return "轻体力活非常累"
  297. }else if(value == 3) {
  298. return "不能正常生活"
  299. }
  300. }},
  301. {title: '腹泻现象', field: 'diarrheaStr',formatter:function(value){
  302. if(value == 0){
  303. return "无"
  304. }else if(value == 1){
  305. return "轻度腹泻少于于3次"
  306. }else if(value == 2){
  307. return "中度腹泻4-6次"
  308. }else if(value == 3) {
  309. return "3重度腹泻超过6次"
  310. }
  311. }},
  312. {title: '其它描述', field: 'others'},
  313. {title: '工作驻地', field: 'workLocalOther',hidden: true},
  314. {title: '工作驻地', field: 'workLocal',hidden: true},
  315. {title: '工作驻地', field: 'workLocalOtherStr'},
  316. {title: '今晚驻地', field: 'todayLocalOther',hidden: true},
  317. {title: '今晚驻地', field: 'todayLocal',hidden: true},
  318. {title: '今晚驻地', field: 'todayLocalOtherStr'},
  319. {title: '是否出行', field: 'isTrip',hidden: true},
  320. {title: '是否出行', field: 'isTripStr',formatter:function(value){
  321. if(value == 0){
  322. return "否"
  323. }else if(value == 1){
  324. return "是"
  325. }
  326. }},
  327. {title: '出发地', field: 'startLocalOther',hidden: true},
  328. {title: '出发地', field: 'startLocal',hidden: true},
  329. {title: '出发地', field: 'startLocalOtherStr'},
  330. {title: '目的地', field: 'endLocalOther',hidden: true},
  331. {title: '目的地', field: 'endLocal',hidden: true},
  332. {title: '目的地', field: 'endLocalOtherStr'},
  333. {title: '车次/车牌号/航班', field: 'tripTypeDesp'},
  334. {title: '出行方式', field: 'tripTypeStr',formatter:function(value){
  335. if(value == 1){
  336. return "长途汽车"
  337. }else if(value == 2){
  338. return "火车"
  339. }else if(value == 3){
  340. return "飞机"
  341. }else if(value ==undefined){
  342. return ""
  343. }else if(value ==null){
  344. return ""
  345. }else if(value ==""){
  346. return ""
  347. }
  348. }},
  349. {title: '出行方式', field: 'tripType',hidden: true},
  350. ]
  351. ]
  352. }
  353. }
  354. };
  355. };
  356. });