bfe17fd52396b701025d6bf58d6cec70.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:81:"/data/gitcode/yuanchengpasc/public/../application/manage/view/messages/index.html";i:1540802456;s:47:"../application/manage/view/commons/headers.html";i:1540801947;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <title>TODO supply a title</title>
  6. <meta charset="UTF-8"><?php $req_rmd= rand(1,9999999) ?>
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <link href="/static/js/jquery-easyui-1.5.5.6/themes/material/easyui.css?t=<?php echo $req_rmd; ?>" rel="stylesheet" type="text/css" />
  9. <link href="/static/js/jquery-easyui-1.5.5.6/themes/material/panel.css?t=<?php echo $req_rmd; ?>" rel="stylesheet" type="text/css" />
  10. <link href="/static/manage/css/manage.css?t=<?php echo $req_rmd; ?>" rel="stylesheet" type="text/css" />
  11. <link href="/static/js/jquery-easyui-1.5.5.6/themes/icon.css?t=<?php echo $req_rmd; ?>" rel="stylesheet" type="text/css" />
  12. <script src="/static/js/jquery-easyui-1.5.5.6/jquery.min.js?t=<?php echo $req_rmd; ?>" type="text/javascript" ></script>
  13. <script src="/static/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js?t=<?php echo $req_rmd; ?>" type="text/javascript" ></script>
  14. <script src="/static/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js?t=<?php echo $req_rmd; ?>" type="text/javascript" ></script>
  15. <script src="/static/js/commons.js?t=<?php echo $req_rmd; ?>" type="text/javascript" ></script>
  16. <script >
  17. // 编辑窗口
  18. var $editWin;
  19. $(function(){
  20. $editWin = $('#edit-window').window({
  21. title: '关键词编辑',
  22. width: 820,height: 500,
  23. top: ($(window).height() -500 ) /2 ,
  24. left: ($(window).width() -820 ) /2 ,
  25. shadow: true,modal: true,
  26. iconCls: 'icon-edit',closed: true,
  27. minimizable: false,maximizable: false,collapsible: false
  28. });
  29. })
  30. function dateFormatter(date){
  31. if(typeof date=="undefined"){ return "--"; }
  32. return new Date(date).format("yyyyMMdd hh:mm:ss");
  33. }
  34. function commandsFormatter(id,row){
  35. var cmdEdit="<a href='#' onclick=\"javascript:showEditWin('"+row.id+"');\" >编辑</a>&nbsp;";
  36. if(row.status == 0){
  37. cmdEdit+="<a href='#' onclick=\"javascript:deleteRow('"+row.id+"');\" >删除</a>";
  38. }
  39. return cmdEdit;
  40. }
  41. function chargereadFormatter(mode){
  42. if(typeof mode=="undefined"){ return "--"; }
  43. if(mode=="1"){ return "已读";
  44. }else if(mode=="0"){ return "未读";
  45. }else{ return "--";
  46. }
  47. }
  48. function delstatusFormatter(mode){
  49. if(mode == '1'){ return "屏蔽";
  50. }else if(mode=="0"){ return "正常";
  51. }else{ return "--";
  52. }
  53. }
  54. $(function(){
  55. var height=$(document).height();
  56. $("#dg").height(height);
  57. $('#dg').datagrid({
  58. url:'/manage/messages/datas',
  59. idField:'id',method: 'get',rownumbers: true,showFooter: true,
  60. toolbar: '#tb',pageList: [dgRowSize,dgRowSize*2,100],pagination:true,pageSize:dgRowSize,
  61. columns:[[
  62. {field:'id',title:'ID',width:180 ,hidden:true },
  63. {field:'title',title:'标题',align: 'center',width:180},
  64. {field:'content',title:'内容',width:"15%",align: 'center'},
  65. {field:'is_read',title:'是否已读',width:80,align: 'center',formatter:chargereadFormatter},
  66. {field:'doctor_id',title:'所属医生',width:"20%",align: 'center',hidden:true },
  67. {field:'doctor_name',title:'所属医生',width:"20%",align: 'center' },
  68. {field:'status',title:'删除状态',width:"20%",align: 'center',formatter:delstatusFormatter },
  69. {field:'createdAt',title:'创建时间',align: 'center', width:135, formatter:dateFormatter },
  70. {field:'grid_commands',title:'操作',align: 'center',width:100, formatter:commandsFormatter },
  71. ]],
  72. onDblClickRow :function(rowData){
  73. showEditWin(rowData.id);
  74. },
  75. });
  76. $('#institution_id').combotree({
  77. required:true,multiple:false,editable:false,
  78. valueField:'id',textField:'name',panelWidth:350,
  79. url:"/manage/doctors/insCombobox"
  80. });
  81. });
  82. function reload(){
  83. var insId=$('#institution_id').combotree("getValue");
  84. var status=$('#status').combobox("getValue");
  85. var url="/manage/messages/datas?status="+(status==null?"":status)+"&insId="+(insId==null?"":insId)+"&t="+new Date();
  86. $('#dg').datagrid("reload",url);
  87. }
  88. // 显示编辑窗口
  89. function showEditWin(id){
  90. if("undefined"== typeof id){
  91. $editWin.window('open');$('#editFrame').attr('src','/manage/messages/edit');
  92. }else{
  93. $editWin.window('open');$('#editFrame').attr('src','/manage/messages/edit?id='+id);
  94. }
  95. }
  96. function deleteRow(id){
  97. $.messager.confirm('Confirm','确定要删除这条记录吗?',function(r){
  98. if(r){
  99. $.ajax({
  100. url:"/manage/messages/delete",
  101. data:"ids="+id+"&t="+new Date(),
  102. success:function(rs){
  103. if(rs=="delete_ok"){
  104. alert("操作已成功!");
  105. document.location.reload();
  106. }else{
  107. alert("操作失败!");
  108. }
  109. }
  110. });
  111. }
  112. });
  113. }
  114. // 关闭编辑窗口
  115. function closeEditWin(isReload){
  116. $editWin.window('close');
  117. if(isReload=="reload"){
  118. document.location.reload();
  119. }
  120. }
  121. </script>
  122. </head>
  123. <body>
  124. <div id="dg" class="easyui-datagrid" style="width:100%;height:auto;" ></div>
  125. <div id="tb" class="editform" style="display: none; padding-top: 1px;">&nbsp;
  126. 机构:<input name="institution_id" id="institution_id" type="text" size="20" value="" />&nbsp;
  127. 读取状态:<select id="status" class="easyui-combobox" name="params.status" style="width: 100px; " >
  128. <option value="" >查询全部</option><option value="0" >未读</option><option value="1" >已读</option>
  129. </select>&nbsp;
  130. <a id="submit" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width: 80px">查询</a>
  131. <a id="reset" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear'" style="width: 80px" onclick="reset()" >重置</a>
  132. &nbsp;&nbsp;&nbsp;&nbsp;
  133. </div>
  134. <div id="edit-window" class="easyui-window" style="width: 80%;height: 450px;" ><iframe src="about:blank" id="editFrame" width="100%" height="100%" frameborder="0" scrolling="no" ></iframe></div>
  135. </body>
  136. </html>