index.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>TODO supply a title</title>
  5. {include file="../application/manage/view/commons/headers.html" }
  6. <script >
  7. // 编辑窗口
  8. var $editWin;
  9. var winHeight=$(window).height();
  10. var frameHeight=winHeight*0.9;
  11. $(function(){
  12. $editWin = $('#edit-window').window({
  13. title: '关键词编辑',
  14. width: 800,height: frameHeight,
  15. top: ($(document).height() -frameHeight ) /2 ,
  16. left: ($(document).width() -820 ) /2 ,
  17. shadow: true,modal: true,
  18. iconCls: 'icon-edit',closed: true,
  19. minimizable: false,maximizable: false,collapsible: false
  20. });
  21. })
  22. function dateFormatter(date){
  23. if(typeof date=="undefined"){ return "--"; }
  24. return new Date(date).format("yyyyMMdd hh:mm:ss");
  25. }
  26. function commandsFormatter(id,row){
  27. var cmdEdit="<a href='#' onclick=\"javascript:showEditWin('"+row.id+"');\" >编辑</a>&nbsp;";
  28. if(row.status == 0){
  29. cmdEdit+="<a href='#' onclick=\"javascript:deleteRow('"+row.id+"');\" >删除</a>";
  30. }
  31. return cmdEdit;
  32. }
  33. function delstatusFormatter(mode){
  34. if(mode == '1'){ return "屏蔽";
  35. }else if(mode=="0"){ return "正常";
  36. }else{ return "--";
  37. }
  38. }
  39. function sexFormatter(mode){
  40. if(mode == 'F'){ return "女";
  41. }else if(mode=="M"){ return "男";
  42. }else{ return "--";
  43. }
  44. }
  45. function marryFormatter(mode){
  46. if(mode == '1'){ return "已婚";
  47. }else if(mode=="0"){ return "未婚";
  48. }else{ return "--";
  49. }
  50. }
  51. $(function(){
  52. var height=$(document).height();
  53. $("#dg").height(height);
  54. $('#dg').datagrid({
  55. url:'/manage/patientinfo/datas',
  56. idField:'id',method: 'get',rownumbers: true,showFooter: true,singleSelect:true,selectOnCheck:false,
  57. toolbar: '#tb',pageList: [ dgRowSize , dgRowSize*2 , 100 ],pagination:true, pageSize: dgRowSize ,
  58. columns:[[
  59. {field:'id',title:'ID',width:180 ,hidden:true },
  60. {field:'name',title:'患者姓名',align: 'center',width:100},
  61. {field:'institution_id',title:'所在机构', hidden:true, align: 'center',width:80},
  62. {field:'institution_name',title:'所在机构',align: 'left',width:150},
  63. {field:'sex',title:'性别',width:"80",align: 'center'},
  64. {field:'card_num',title:'身份证号',width:180,align: 'center'},
  65. {field:'phone',title:'手机号',width:"100",align: 'center'},
  66. {field:'birthday',title:'生日',align: 'center', width:135, formatter:dateFormatter },
  67. {field:'age',title:'年龄',width:"50",align: 'center'},
  68. {field:'card_type',title:'证件类型',width:"100",align: 'center' },
  69. {field:'nationality',title:'国籍',width:"100",align: 'center' },
  70. {field:'nation',title:'民族',width:"50",align: 'center' },
  71. {field:'marry',title:'婚否',width:"50",align: 'center',formatter:marryFormatter },
  72. {field:'professional',title:'职业',width:"100",align: 'center' },
  73. {field:'address',title:'联系地址',width:"100",align: 'center' },
  74. {field:'temp_patient_id',title:'检查临时患者id',width:"120",align: 'center' },
  75. {field:'status',title:'删除状态',width:80,align: 'center',formatter:delstatusFormatter },
  76. {field:'ctime',title:'创建时间',align: 'center', width:135, formatter:dateFormatter },
  77. {field:'grid_commands',title:'操作',align: 'center',width:100, formatter:commandsFormatter },
  78. ]],
  79. onDblClickRow :function(rowIndex,rowData){
  80. showEditWin(rowData.id);
  81. },
  82. });
  83. });
  84. function reload(){
  85. var institution_id=$("#institution_id").combotree("getValue");
  86. var username=$("#username").textbox("getValue");
  87. var tel=$("#tel").textbox("getValue");
  88. var queryParams = $('#dg').datagrid('options').queryParams;
  89. queryParams.insid=institution_id;
  90. queryParams.username=username;
  91. queryParams.tel=tel;
  92. $('#dg').datagrid('options').queryParams=queryParams;
  93. $('#dg').datagrid("reload");
  94. }
  95. // 显示编辑窗口
  96. function showEditWin(id){
  97. if("undefined"== typeof id){
  98. $editWin.window('open');$('#editFrame').attr('src','/manage/patientinfo/edit');
  99. }else{
  100. $editWin.window('open');$('#editFrame').attr('src','/manage/patientinfo/edit?id='+id);
  101. }
  102. }
  103. function deleteRow(id){
  104. $.messager.confirm('Confirm','确定要删除这条记录吗?',function(r){
  105. if(r){
  106. $.ajax({
  107. url:"/manage/patientinfo/delete",
  108. data:"ids="+id+"&t="+new Date(),
  109. success:function(rs){
  110. if(rs=="delete_ok"){
  111. alert("操作已成功!");
  112. document.location.reload();
  113. }else{
  114. alert("操作失败!");
  115. }
  116. }
  117. });
  118. }
  119. });
  120. }
  121. // 关闭编辑窗口
  122. function closeEditWin(isReload){
  123. $editWin.window('close');
  124. if(isReload=="reload"){
  125. document.location.reload();
  126. }
  127. }
  128. $(function(){
  129. $('#institution_id').combotree({
  130. required:true,multiple:false,editable:false,
  131. valueField: 'id', textField: 'name', panelWidth: 550,
  132. url: "/manage/institution/insCombobox"
  133. });
  134. });
  135. </script>
  136. </head>
  137. <body>
  138. <div id="dg" class="easyui-datagrid" style="width:100%;height:auto;" ></div>
  139. <div id="tb" class="editform" style="display: none; padding-top: 1px;">&nbsp;
  140. 所在机构:<input type="text" name="institution_id" id="institution_id" style="width:150px;" />&nbsp;
  141. 姓名:<input type="text" id="username" name="username" class="easyui-textbox" style="width: 200px; vertical-align: middle;" title="菜单名称" />&nbsp;
  142. 手机:<input type="text" id="tel" name="tel" class="easyui-textbox" style="width: 200px; vertical-align: middle;" title="菜单名称" />&nbsp;
  143. <a id="submit" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width: 80px" onclick="reload()" >查询</a>
  144. <a id="reset" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear'" style="width: 80px" onclick="reset()" >重置</a>
  145. &nbsp;&nbsp;&nbsp;&nbsp;
  146. </div>
  147. <div id="edit-window" class="easyui-window" style="overflow: hidden" ><iframe src="about:blank" id="editFrame" width="100%" height="100%" frameborder="0" scrolling="yes" ></iframe></div>
  148. </body>
  149. </html>