123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>TODO supply a title</title>
- {include file="../application/manage/view/commons/headers.html" }
- <script >
- // 编辑窗口
- var $editWin;
- $(function(){
- $editWin = $('#edit-window').window({
- title: '关键词编辑',
- width: 820,height: 500,
- top: ($(window).height() -500 ) /2 ,
- left: ($(window).width() -820 ) /2 ,
- shadow: true,modal: true,
- iconCls: 'icon-edit',closed: true,
- minimizable: false,maximizable: false,collapsible: false
- });
- })
- function dateFormatter(date){
- if(typeof date=="undefined"){ return "--"; }
- return new Date(date).format("yyyyMMdd hh:mm:ss");
- }
- function commandsFormatter(id,row){
- var cmdEdit="<a href='#' onclick=\"javascript:showEditWin('"+row.id+"');\" >编辑</a> ";
- if(row.status == 0){
- cmdEdit+="<a href='#' onclick=\"javascript:deleteRow('"+row.id+"');\" >删除</a>";
- }
- return cmdEdit;
- }
- function chargereadFormatter(mode){
- if(typeof mode=="undefined"){ return "--"; }
- if(mode=="1"){ return "已读";
- }else if(mode=="0"){ return "未读";
- }else{ return "--";
- }
- }
- function delstatusFormatter(mode){
- if(mode == '1'){ return "屏蔽";
- }else if(mode=="0"){ return "正常";
- }else{ return "--";
- }
- }
- $(function(){
- var height=$(document).height();
- $("#dg").height(height);
- $('#dg').datagrid({
- url:'/manage/messages/datas',
- idField:'id',method: 'get',rownumbers: true,showFooter: true,
- toolbar: '#tb',pageList: [dgRowSize,dgRowSize*2,100],pagination:true,pageSize:dgRowSize,
- columns:[[
- {field:'id',title:'ID',width:180 ,hidden:true },
- {field:'title',title:'标题',align: 'center',width:180},
- {field:'content',title:'内容',width:"15%",align: 'center'},
- {field:'is_read',title:'是否已读',width:80,align: 'center',formatter:chargereadFormatter},
- {field:'doctor_id',title:'所属医生',width:"20%",align: 'center',hidden:true },
- {field:'doctor_name',title:'所属医生',width:"20%",align: 'center' },
- {field:'status',title:'删除状态',width:"20%",align: 'center',formatter:delstatusFormatter },
- {field:'ctime',title:'创建时间',align: 'center', width:135, formatter:dateFormatter },
- {field:'grid_commands',title:'操作',align: 'center',width:100, formatter:commandsFormatter },
- ]],
- onDblClickRow :function(rowData){
- showEditWin(rowData.id);
- },
- });
-
- $('#institution_id').combotree({
- required:true,multiple:false,editable:false,
- valueField:'id',textField:'name',panelWidth:350,
- url:"/manage/doctors/insCombobox"
- });
- });
-
- function reload(){
- var insId=$('#institution_id').combotree("getValue");
- var status=$('#status').combobox("getValue");
- var url="/manage/messages/datas?status="+(status==null?"":status)+"&insId="+(insId==null?"":insId)+"&t="+new Date();
- $('#dg').datagrid("reload",url);
- }
- // 显示编辑窗口
- function showEditWin(id){
- if("undefined"== typeof id){
- $editWin.window('open');$('#editFrame').attr('src','/manage/messages/edit');
- }else{
- $editWin.window('open');$('#editFrame').attr('src','/manage/messages/edit?id='+id);
- }
- }
- function deleteRow(id){
- $.messager.confirm('Confirm','确定要删除这条记录吗?',function(r){
- if(r){
- $.ajax({
- url:"/manage/messages/delete",
- data:"ids="+id+"&t="+new Date(),
- success:function(rs){
- if(rs=="delete_ok"){
- alert("操作已成功!");
- document.location.reload();
- }else{
- alert("操作失败!");
- }
- }
- });
- }
- });
- }
- // 关闭编辑窗口
- function closeEditWin(isReload){
- $editWin.window('close');
- if(isReload=="reload"){
- document.location.reload();
- }
- }
- </script>
- </head>
- <body>
- <div id="dg" class="easyui-datagrid" style="width:100%;height:auto;" ></div>
- <div id="tb" class="editform" style="display: none; padding-top: 1px;">
- 机构:<input name="institution_id" id="institution_id" type="text" size="20" value="" />
- 读取状态:<select id="status" class="easyui-combobox" name="params.status" style="width: 100px; " >
- <option value="" >查询全部</option><option value="0" >未读</option><option value="1" >已读</option>
- </select>
- <a id="submit" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width: 80px">查询</a>
- <a id="reset" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear'" style="width: 80px" onclick="reset()" >重置</a>
-
- </div>
- <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>
- </body>
- </html>
|