qq_41294192
高中时的木槿
2019-03-19 21:50

EXT.Js 弹出事件 为什么不能弹出新生成的单据

  • javascript

/**

  • @author Administrator / / grid.store.on('load', function() { grid.el.select("table[class=x-grid3-row-table]").each(function(x) { x.addClass('x-grid3-cell-text-visible'); }); });

grid.getStore().on('load',function(s,records){
var girdcount=0;
s.each(function(r){
if(r.get('10')=='数据错误'){
grid.getView().getRow(girdcount).style.backgroundColor='#F7FE2E';
}
girdcount=girdcount+1;
});
//scope:this
});
*/
var arrgrid = new Array();
var storenurse = new Ext.data.JsonStore({
data :[],
fields : ['desc', 'id']
});
var storenurse1 = new Ext.data.JsonStore({
data :[],
fields : ['desc', 'id']
});
var patward = new Ext.form.ComboBox({
id : 'patward',
//hiddenName : 'region1',
store : storenurse,
width : 200,
// fieldLabel : '区',
valueField : 'id',
displayField : 'desc',
value:"",
allowBlank : true,
mode : 'local'
});
var CCERR = new Ext.form.ComboBox({
id : 'CCERR',
//hiddenName : 'region1',
store : storenurse1,
width : 150,
fieldLabel : '事件',
valueField : 'id',
value:"",
displayField : 'desc',
allowBlank : true,
mode : 'local'
});

function gethead()
{
/*
var GetCurrHeadDR=document.getElementById('GetCurrHeadDR');
//alert(EmrCode);
var ret=cspRunServerMethod(GetCurrHeadDR.value,EpisodeID,session['LOGON.USERID'],EmrCode);
//alert(ret)
if (ret!="")
{
var dd=ret.split("||");
CurrHeadDr=dd[0]+"_"+dd[1];
}
*/
var GetHead=document.getElementById('GetHead');
var ret=cspRunServerMethod(GetHead.value,EpisodeID);
//alert(ret)
var hh=ret.split("^");
//alert(hh)
//alert(hh[0])
return hh[0]+" "+hh[1];

//debugger;

}
function BodyLoadHandler(){
setsize("mygridpl", "gform", "mygrid");
//fm.doLayout();
//alert(EmrCode)
var but1 = Ext.getCmp("mygridbut1");
but1.on('click', newEvent);
var but = Ext.getCmp("mygridbut2");
but.hide();

var grid = Ext.getCmp('mygrid');
grid.setTitle(gethead());
var mydate = new Date();
var tobar = grid.getTopToolbar();
grid.on('rowdblclick',modccevent);

//tobar.addItem('病区',
//patward,'-' ,'事件',CCERR,'-');
/*
tobar.addItem({
xtype: 'datefield',
format: 'Y-m-d',
id: 'mygridstdate',
value: (diffDate(new Date(), -7))
}, {
xtype: 'datefield',
format: 'Y-m-d',
id: 'mygridenddate',
value: diffDate(new Date(), 1)
});
/
tobar.addButton({
className: 'new-topic-button',
text: "查询",
handler: find,
id: 'mygridSch'
});
tobar.addItem ("-",{
xtype:'checkbox',
id:'IfCancelRec',
checked:false,
boxLabel:'显示作废记录'

});
/*tobar.addItem("-");
tobar.addButton({
className: 'new-topic-button',
text: "提交",
handler: qdtj,
id: 'SubmitFu'
});
/
/*
tobar.addItem("-");
tobar.addButton({
className: 'new-topic-button',
text: "审核",
handler: AuditFu,
id: 'AuditFu'
});
tobar.addItem("-");
tobar.addButton({
className: 'new-topic-button',
text: "退回",
handler: RefundFu,
id: 'RefundFu'
});
/
/*tobar.addItem("-");
tobar.addButton({
className: 'new-topic-button',
text: "删除",
handler: qddelete,
id: 'delete'
});
/
tobar.addItem("-");
tobar.addButton({
//className: 'new-topic-button',
text: "作废",
handler: CancelRecord,
id: 'Cancel'
});
tobar.addItem ("-")
tobar.addButton({
className: 'new-topic-button',
text: "打印",
handler: butPrintFn,
id: 'butPrintFn'
});
tobar.addItem ("-")
tobar.addButton({
className: 'new-topic-button',
text: "生成图片",
handler: MakePicture,
id: 'MakePicture'
});
var bbar = grid.getBottomToolbar ();
bbar.hide();
var bbar2 = new Ext.PagingToolbar({
pageSize:30,
store:grid.store,
displayInfo:true,
displayMsg:'显示第 {0} 条到 {1} 条记录,一共 {2} 条',
emptyMsg:"没有记录"
});
bbar2.render(grid.bbar);
tobar.doLayout();
//inidata("patward","Desc","web.DHCNurblsjflwh:GetWard","Loc$W");
// inidata("CCERR","Desc","web.DHCNurblsjflwh:CRItem","");
patward.setValue(session['LOGON.CTLOCID']);
//layoutset();
find();
//alert();
//debugger;
}
//生成图片
function MakePicture()
{
var mygrid = Ext.getCmp("mygrid");
var rowObj = mygrid.getSelectionModel().getSelections();

var len = rowObj.length;
if (len < 1) {
alert("请选择需要生成图片的数据!");
return;
} else {
id = rowObj[0].get("par")
}
if(id)
{
PrintCommPic.StartMakePic="Y" //图片
//以下4句请参考butPrintFn方法
PrintCommPic.WebUrl=WebIp+"/dthealth/web/DWR.DoctorRound.cls";
PrintCommPic.ItmName = "DHCNURMouldPrn_AYgxheddfxdy";
var subid=id
PrintCommPic.MthArr="Nur.DHCMoudData:getVal&parr:"+subid+"!";
PrintCommPic.PrintOut();

      PrintCommPic.NurRecId=id   //图 片
      PrintCommPic.EmrCode=EmrCode     //图片
      PrintCommPic.EpisodeID=EpisodeID //图片
      PrintCommPic.curPages=0;         //图片
      PrintCommPic.MakeTemp="Y";       //图片
      PrintCommPic.filepath=WebIp+"/DHCMG/HLBLMakePictureSet.xml"       //图片
      //PrintComm.MakeAllPages="Y";    //图片
      PrintCommPic.MakePicture();      //图片
      alert("成功")
    }

}
function butPrintFn()
{
var mygrid = Ext.getCmp("mygrid");
var rowObj = mygrid.getSelectionModel().getSelections();

var len = rowObj.length;
if (len < 1) {
alert("请选择需要打印的数据!")
return;
} else {
id = rowObj[0].get("par")
}
if(id)
{
PrintComm.RHeadCaption='dddd';
PrintComm.LHeadCaption="3333333";
PrintComm.SetConnectStr(CacheDB);
PrintComm.WebUrl=WebIp+"/dthealth/web/DWR.DoctorRound.cls";
PrintComm.ItmName = "DHCNURMouldPrn_AYgxheddfxdy";
var subid=id
PrintComm.MthArr="Nur.DHCMoudData:getVal&parr:"+subid+"!";
PrintComm.PrintOut();

}
}
function qdtj()
{
var grid=Ext.getCmp('mygrid');
var objCancelRecord=document.getElementById('CancelRecord');
var objRow=grid.getSelectionModel().getSelections();
if (objRow.length == 0)
{
alert("请先选择一条护理记录!");
return;
} else
{
var flag = confirm("你确定要作废此条记录吗!")
if (flag)
{
SubmitFu();
}

}
//find();

}
function qddelete()
{
var grid=Ext.getCmp('mygrid');
var objCancelRecord=document.getElementById('CancelRecord');
var objRow=grid.getSelectionModel().getSelections();
if (objRow.length == 0)
{
alert("请先选择一条护理记录!");
return;
} else
{
var flag = confirm("你确定要删除此条记录吗!")
if (flag)
{
delete1();
}
}
//find();
}

function CancelRecord()
{
var grid=Ext.getCmp('mygrid');
var objRow=grid.getSelectionModel().getSelections();
if (objRow.length == 0)
{
alert("请先选择一条护理记录!");
return;
} else
{
var flag = confirm("你确定要删除此条记录吗!")
if (flag)
{
var par=objRow[0].get("par");
var a = tkMakeServerCall("web.DHCNurseRecordComm","CancelMoudRecord", par, session['LOGON.USERID'], session['LOGON.GROUPDESC']);
if (a!=0){
alert(a);
return;
}else
{
find();
}
}

}

}

function delete1()
{
var grid=Ext.getCmp("mygrid");
var objRow=grid.getSelectionModel().getSelections();
if (objRow.length == 0) {
return;
}
else {
var SetStatus=document.getElementById('delete1');
var par = objRow[0].get("par");
var a = cspRunServerMethod(SetStatus.value,par);

find();
}
}
function layoutset()
{
var GetLayoutItem=document.getElementById('GetLayoutItem');
var ret=cspRunServerMethod(GetLayoutItem.value,session['LOGON.GROUPID'] ,EmrCode);
//alert(session['LOGON.GROUPID']+EmrCode);
var arr=ret.split("^");
//alert(arr);
for (var i=0;i<arr.length;i++)
{
var itm=arr[i];
if (itm=="") continue;
var itmarr=itm.split("|");
var com=Ext.getCmp(itmarr[0]);
com.disable();
}
//var com=Ext.getCmp("AuditFu");
//com.disable();
}
function SetStatusFu(stat)
{
var grid=Ext.getCmp("mygrid");
//alert(grid)
var objRow=grid.getSelectionModel().getSelections();
//alert(objRow)
if (objRow.length == 0) {
return;
}
else {
var SetStatus=document.getElementById('SetStatus');
//var rw = objRow[0].get("rw");
var id= objRow[0].get("par");
//var id=rw+"||"+chl;
var a = cspRunServerMethod(SetStatus.value,id,stat,session['LOGON.USERID'] );
if (a=="")
{find();}
}

}
function SubmitFu()
{ //提交
//alert();
SetStatusFu('S');
}
function AuditFu()
{ //审核
SetStatusFu('A');
}
function RefundFu()
{ //退回
SetStatusFu('V');
}
function modccevent()
{
var grid=Ext.getCmp("mygrid")
var objRow=grid.getSelectionModel().getSelections();
var id=objRow[0].get("rw")+"||"+objRow[0].get("chl");
if (objRow.length == 0) {
return;
}
else {

    var par = objRow[0].get("par");
    var Status = objRow[0].get("Status");
    //var EpisodeID = objRow[0].get("EpisodeID");

    //var Status = objRow[0].get("Status");
    //var EpisodeID = objRow[0].get("EpisodeID");

    //alert(EpisodeID)

  //alert(EpisodeID)
    var lnk= "DHCNurEmrComm.csp?"+"&EmrCode=DHCNURPGD_AYgxheddfx&EpisodeID="+EpisodeID+"&NurRecId="+par ;//"&DtId="+DtId+"&ExamId="+ExamId
    window.open(lnk,"htm",'toolbar=no,location=no,directories=no,resizable=yes,width=1000,height=800');

}

}
function inidata(cmbname,desc,quer,parr)
{
var cmb=Ext.getCmp(cmbname);
var querymth=document.getElementById('GetQueryCombox');
if (cmb!=null)

{
arrgrid=new Array();
var a = cspRunServerMethod(querymth.value, quer, parr , "AddRec",desc);
//alert(arrgrid)
// debugger;
cmb.store.loadData(arrgrid);
}

}
var logonht=1;
function newEvent()
{
// var CurrAdm=selections[rowIndex].get("Adm");
//if (DtId=="")return;
//var getcurExamId=document.getElementById('getcurExamId');
//var ExamId=cspRunServerMethod(getcurExamId.value,SpId);
// alert(ExamId);
//alert(logonht)
//alert(EpisodeID)

if (logonht==1)
{
    var lnk= "DHCNurEmrComm.csp?"+"&EmrCode=DHCNURPGD_AYgxheddfx&EpisodeID="+EpisodeID  ;//"&DtId="+DtId+"&ExamId="+ExamId
}

if (logonht==0)
{
    var lnk= "DHCNurEmrComm.csp?"+"&EmrCode=DHCNURPGD_AYgxheddfx&EpisodeID="+EpisodeID  ;//"&DtId="+DtId+"&ExamId="+ExamId
}
window.open(lnk,"htm",'toolbar=no,location=no,directories=no,resizable=yes,width=1000,height=800');

}

var REC=new Array();

function addtitCon(tobar,lab)
{
var but1=Ext.getCmp(lab+"but1");
but1.hide();
var but2=Ext.getCmp(lab+"but2");
but2.hide();

tobar.addItem(
    {
        xtype:'datefield',
        format: 'Y-m-d',
        id:lab+'stdate',
        value:(diffDate(new Date(),-1))
    },
    {
        xtype:'datefield',
        format: 'Y-m-d',
        id:lab+'enddate',
        value:new Date()
    }
);
tobar.addButton(
  {
    className: 'new-topic-button',
    text: "查询",
    //handler:find,
    id:lab+'Sch'
  }

);

}
function find()
{
//var StDate = Ext.getCmp("mygridstdate");
//var Enddate = Ext.getCmp("mygridenddate");
var GetQueryData = document.getElementById('GetQueryData');
var mygrid = Ext.getCmp("mygrid");
var parr ="DHCNURPF^"+EpisodeID;
arrgrid=new Array();
//alert(EpisodeID);

    arrgrid = new Array();
MeasureRel = new Hashtable();
//REC = new Array();
var adm = EpisodeID;
var ward=Ext.getCmp("patward");
var CCEV=Ext.getCmp("CCERR");

//var StDate = Ext.getCmp("mygridstdate");
//var Enddate = Ext.getCmp("mygridenddate");
var loc=session['LOGON.CTLOCID'];

var IfCncelRec=Ext.getCmp("IfCancelRec").getValue();

//alert(StDate.vlaue);
var parr = "DHCNURPGD_AYGXHEDDFX^"+adm+"^"+loc+"^"+"^"+"^"+IfCncelRec;
    //var parr = "DHCNURXHFFDD^"+adm+"^"+loc+"^"+StDate.value+"^"+Enddate.value+"^"+IfCncelRec;

//alert(parr);
//var a = cspRunServerMethod(GetQueryData.value, "web.DHCNurblsjflwh:MoudData2", "parr$" +parr,"AddRec");
//var a = cspRunServerMethod(GetQueryData.value, "web.DHCNurblsjflwh:MoudDatabyadm", "parr$" +parr,"AddRec");
//alert(a);

//mygrid.store.loadData(arrgrid);

var mygrid = Ext.getCmp("mygrid");
mygrid.store.on("beforeLoad",function(){

mygrid.store.baseParams.parr=parr; //传参数,根据原来的方式修改
});

//mygrid.getStore().addListener('load',handleGridLoadEvent); //护理记录表格需要:日期转换及出入量统计行加颜色
mygrid.store.load({
params:{
start:0,
limit:30
}

})

}

function AddRec(str)
{
//var a=new Object(eval(str));
//alert(str);
//var obj = eval('(' + str + ')');
//alert(str);
//obj.CareDate=getDate(obj.CareDate);
//obj.PregHPregDate=getDate(obj.PregHPregDate);
var obj = eval('(' + str + ')');
arrgrid.push(obj);
//debugger;
}

//Ext.util.Format.dateRenderer
//ext.util.format.date(ext.getcmp("控件id").getvalue(),y-m-d)Y-m-d H:m:s
function gettime()
{
var a=Ext.util.Format.dateRenderer('h:m');
return a;
}
function diffDate(val,addday){
var year=val.getFullYear();
var mon=val.getMonth();
var dat=val.getDate()+addday;
var datt=new Date(year,mon,dat);
return formatDate(datt);
}
function getDate(val)
{
var a=val.split('-');
var dt=new Date(a[0],a[1]-1,a[2]);
return dt;
}
function formatDate(value){
try
{
return value ? value.dateFormat('Y-m-d') : '';
}
catch(err)
{
return '';
}
};

function MultiFun()
{
var GetMulti=document.getElementById('GetMulti');
var getcheckform=document.getElementById('getcheckform');

var ret= cspRunServerMethod(GetMulti.value, "DHCNUR6");
var grid=Ext.getCmp('mygrid');
var tt=ret.split('^');
var ab="";
for (i=0;i<tt.length;i++)
{
if (tt[i]=="") continue;
//debugger;
var dd=grid.getSelectionModel().getSelections()[0].get(tt[i]);
if (dd==undefined)dd=""
if (dd!="") ab=ab+dd+"^"+tt[i]+"!";
else ab=ab+"^"+tt[i]+"!";
}
var tabstr=cspRunServerMethod(getcheckform.value, "DHCNUR6",ab);
var tabarr=tabstr.split('!');
var tbitm=new Array();
for (i = 0; i < tabarr.length; i++)
{
if (tabarr[i] == "")
continue;
var itmm = tabarr[i].split('^');
tbitm.push({
xtype: 'panel',
id: itmm[0],
title: itmm[1],
//height: 1000,
layout: 'absolute',
//frame:false,
//palin:false,
closable: false,
items: eval(itmm[2])

        })
            //alert(itmm[2]);
    }
var subttab=new Ext.TabPanel({
    activeTab : 0,//
    autoTabs: true,
    resizeTabs:true, 
    //height:200,
  //  width:300,
    enableTabScroll:true,
   items:tbitm
 });

var window = new Ext.Window({
    title: '多选',
    width: 450,
    height: 480,
    id:'mulForm',
    autoScroll: true,
    layout: 'fit',
    plain: true,
    frame:true,
    items: subttab ,  
    buttons:[{id:'mulselbut',text:'保存',handler:SaveMulCheck}]
});

window.show();

}
var checkret="";

function SaveMulCheck()
{
checkret="";
var gform=Ext.getCmp("mulForm");
gform.items.each(eachItem, this);

var aa=checkret.split('^');
var ht = new Hashtable();
//debugger;
for (i = 0; i < aa.length; i++) {
if (aa[i] == "")
continue;
var itm = aa[i].split('|');
var aitm = itm[0].split('_');
if (ht.contains(aitm[0])) {
var val=ht.items(aitm[0])
ht.remove(aitm[0]);
var dd=val+";"+itm[1];
ht.add(aitm[0],dd);
}
else {
ht.add(aitm[0], itm[1])
}

}
var mygrid=Ext.getCmp('mygrid');
for(var i in ht.keys())
{
var key =ht.keys()[i];
var restr = ht.items(key);
mygrid.getSelectionModel().getSelections()[0].set(key,restr);
}
alert(checkret);

}
function add(a1, a2){
attenitm.push({
xtype:'panel',
id: a1,
title: a2,
region:'center',
height:1000,
layout:'fit',
closable:true,
items:[]
})
}
function multiSel(ret)
{
var grid1=Ext.getCmp('multigrid');
var code=grid1.getSelectionModel().getSelections()[0].get("itm3");
var itname=grid1.getSelectionModel().getSelections()[0].get("itm4");
var getcheckform=document.getElementById('getcheckform');
alert(itname+"!!"+code)
var ret=cspRunServerMethod(getcheckform.value, "DHCNUR6",itname,code,"");

var CareDate=grid.getSelectionModel().getSelections()[0].get("CareDate");
var aa=new Array();
aa=eval(aa);
/*
debugger;
for(var i=0;i<items.length;i++){

        panl.remove(items[i]); 

      } 

   panl.doLayout();
    panl.add(new Ext.form.Checkbox({    
                id:"addboxModule",                
                name:"userModule",
                boxLabel : 'moduleName' 
               }));*/

    panl.doLayout();
    debugger;

}
function addMulitm(ret)
{
var grid1=Ext.getCmp('multigrid');
var Plant = Ext.data.Record.create([
{name:'itm1'},
{name:'itm2'},
{name:'itm3'},
{name:'itm4'}
]);
var itm=ret.split('^');
for (i = 0; i < itm.length; i++) {
if (itm[i]=="") continue;
var aa=itm[i].split('!');
var count = grid1.store.getCount();
var r = new Plant({
itm1: aa[0],
itm2: "",
itm3:aa[1],
itm4:aa[2]
});
grid1.store.commitChanges();
grid1.store.insert(count, r);
}
return;
}
function Measure1()
{
selections = grid.getSelectionModel().getSelections();
var arr = new Array();
var a = cspRunServerMethod(pdata1, "", "DHCNURMeasure", EpisodeID, "");
arr = eval(a);
var window = new Ext.Window({
title: '医嘱',
width: 550,
height: 450,
autoScroll: true,
layout: 'absolute',
plain: true,
frame:true,
//modal: true,
//bodyStyle: 'padding:5px;',
///buttonAlign: 'center',
items: arr
});
var mydate=new Date();
var butord=Ext.getCmp('_Button5');
butord.on=('click',OrdSch1);
window.show();
}
function InOutNod()
{ //小结

var SaveOutIn=document.getElementById('SaveOutIn');
var objRow=grid.getSelectionModel().getSelections();
if (objRow.length == 0) { Ext.Msg.alert('提示', "请先点'统计'按钮!"); return; }
else
{
  var countstr=""; //合计项
  var countcls=ICountCls+"&"+OCountCls;
  var tt=countcls.split('&');
  for (i=0;i<tt.length;i++)
  {
    if (tt[i]=="") continue;
    countstr=countstr+tt[i]+"|"+objRow[0].get(tt[i])+"^";
  }
  var CareDate=objRow[0].get("CareDate");
  var CareTime=objRow[0].get("CareTime");
  var inamount=objRow[0].get(DisplaySumInAmount);
  var OutQtAmount=objRow[0].get(DisplaySumOutAmount);
  var InPart=objRow[0].get(PartInAmount);
  var OutPart=objRow[0].get(PartOutAmount);
  //var StatTime=objRow[0].get("Item1");
  //var StatHours=objRow[0].get("Item2");
  var CaseMeasure=objRow[0].get("CaseMeasure");
  var CaseMeasureArr=CaseMeasure.split(" ");
  if (CaseMeasureArr.length>1)
  {
    var StatTime=CaseMeasureArr[0];
    var StatHours=CaseMeasureArr[1];
  }
  else
  {
    var StatTime="";
    var StatHours="";
  }
    var str=countstr+"^SumInAmount|"+inamount+"^SumOutAmount|"+OutQtAmount+"^CareDate|"+formatDate(CareDate)+"^CareTime|"+CareTime+"^Typ|Nod^"+"InPart|"+InPart+"^OutPart|"+OutPart+"^StatTime|"+StatTime+"^StatHours|"+StatHours;
    var diaggrid = Ext.getCmp('diaggrid');
    if (diaggrid) {
    var selModel=diaggrid.getSelectionModel();
    if (selModel.hasSelection()) {   
        var objDiagRow = selModel.getSelections();                  
            DiagnosDr=objDiagRow[0].get("rw");
        }
        else {
            DiagnosDr="";   
        }
    }
    else {
        DiagnosDr="";
    }
    str=str+"^DiagnosDr|"+DiagnosDr;
    //alert(str);
    var a=cspRunServerMethod(SaveOutIn.value,EpisodeID,str,session['LOGON.USERID'],"DHCNUR6");
    find();
}

}
function InOutSum()
{
var SaveOutIn=document.getElementById('SaveOutIn');
var objRow=grid.getSelectionModel().getSelections();
if (objRow.length == 0) { Ext.Msg.alert('提示', "请先点'统计'按钮!"); return; }
else
{
var countstr=""; //合计项
var countcls=ICountCls+"&"+OCountCls;
var tt=countcls.split('&');
for (i=0;i {
if (tt[i]=="") continue;
countstr=countstr+tt[i]+"|"+objRow[0].get(tt[i])+"^";
}
var CareDate=objRow[0].get("CareDate");
var CareTime=objRow[0].get("CareTime");
var inamount=objRow[0].get(DisplaySumInAmount);
var OutQtAmount=objRow[0].get(DisplaySumOutAmount);
var InPart=objRow[0].get(PartInAmount);
var OutPart=objRow[0].get(PartOutAmount);
//var StatTime=objRow[0].get("Item1");
//var StatHours=objRow[0].get("Item2");
var CaseMeasure=objRow[0].get("CaseMeasure");
var CaseMeasureArr=CaseMeasure.split(" ");
if (CaseMeasureArr.length>1)
{
var StatTime=CaseMeasureArr[0];
var StatHours=CaseMeasureArr[1];
}
else
{
var StatTime="";
var StatHours="";
}
var str=countstr+"^SumInAmount|"+inamount+"^SumOutAmount|"+OutQtAmount+"^CareDate|"+formatDate(CareDate)+"^CareTime|"+CareTime+"^Typ|Sum^"+"InPart|"+InPart+"^OutPart|"+OutPart+"^StatTime|"+StatTime+"^StatHours|"+StatHours;
//alert(str);
var diaggrid = Ext.getCmp('diaggrid');
if (diaggrid) {
var selModel=diaggrid.getSelectionModel();
if (selModel.hasSelection()) {

var objDiagRow = selModel.getSelections();

DiagnosDr=objDiagRow[0].get("rw");
}
else {
DiagnosDr="";

}
}
else {
DiagnosDr="";
}
str=str+"^DiagnosDr|"+DiagnosDr;
//alert(str);
var a=cspRunServerMethod(SaveOutIn.value,EpisodeID,str,session['LOGON.USERID'],"DHCNUR6");
find();
}
}
function OrdSch1(){
// var CurrAdm=selections[rowIndex].get("Adm");
selections = grid.getSelectionModel().getSelections();
var arr = new Array();
var a = cspRunServerMethod(pdata1, "", "DHCPatOrdList", EpisodeID, "");
arr = eval(a);
var window = new Ext.Window({
title: '医嘱',
width: 550,
height: 550,
autoScroll: true,
layout: 'absolute',
plain: true,
frame: true,
//modal: true,
//bodyStyle: 'padding:5px;',
///buttonAlign: 'center',
items: arr
});
var butin=Ext.getCmp('ordgridbut1');
butin.text="确定";
//debugger;
butin.on('click',SureIn);
window.show();

}
function OrdSch()
{

// var CurrAdm=selections[rowIndex].get("Adm");
selections = grid.getSelectionModel().getSelections();
var arr = new Array();
var a = cspRunServerMethod(pdata1, "", "DHCPatOrdList", EpisodeID, "");
arr = eval(a);
var window = new Ext.Window({
title: '医嘱',
width: 450,
height: 550,
autoScroll: true,
layout: 'absolute',
plain: true,
frame:true,
//modal: true,
//bodyStyle: 'padding:5px;',
///buttonAlign: 'center',
items: arr
});
var mydate=new Date();

var grid1=Ext.getCmp("ordgrid");
tobar=grid1.getTopToolbar();
tobar.addItem(
    {
        xtype:'datefield',
        format: 'Y-m-d',
        id:'ordgridstdate',
        value:(diffDate(new Date(),-1))
    },
    {
        xtype:'datefield',
        format: 'Y-m-d',
        id:'ordgridenddate',
        value:new Date()
    }
);
tobar.addButton(
  {
    className: 'new-topic-button',
    text: "查询",
    //handler:find,
    id:'ordgridSch'
  }

);

var butin=Ext.getCmp('ordgridbut2');
butin.hide();
var butin=Ext.getCmp('ordgridbut1');
butin.text="确定";
//debugger;
butin.on('click',SureIn);
var butschord=Ext.getCmp('ordgridSch');
butschord.on('click',SchOrd);
window.show();

}
var condata=new Array();
function add(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o)
{ //OrdDate,OrdTime,ARCIMDesc,PriorDes,Meth,PHFreq,Dose,PhQtyOrd,OrdStat,Doctor,Oew,OrdSub,Sel,SeqNo
condata.push({
OrdDate: a,
OrdTime: b,
ARCIMDesc: c,
PriorDes: d,
Meth: e,
PHFreq: f,
Dose: g,
DoseUnit: h,
PhQtyOrd: i,
OrdStat: j,
Doctor: k,
Oew: l,
OrdSub: m,
SeqNo: o
});
}

function printNurRec()
{
var GetPrnSet=document.getElementById('GetPrnSet');
var GetHead=document.getElementById('GetPatInfo');
var ret=cspRunServerMethod(GetHead.value,EpisodeID);
var hh=ret.split("^");
//alert("ddd");
//debugger;
var a=cspRunServerMethod(GetPrnSet.value,"DHCNUR6",EpisodeID); //page, caredattim, prnpos, adm,Typ,user
if (a=="") return;
var GetLableRec=document.getElementById('GetLableRec');
var LabHead=cspRunServerMethod(GetLableRec.value,"DHCNUR6^"+session['LOGON.CTLOCID']);
var tm=a.split("^");
var stdate="" //tm[2];
var stim="" //tm[3];
var edate="" //tm[4];
var etim="" //tm[5];
//PrintComm.RHeadCaption=hh[1];
//PrintComm.LHeadCaption=hh[0];
//PrintComm.RFootCaption="第";
//PrintComm.LFootCaption="页";
//PrintComm.LFootCaption=hh[2];
PrintComm.TitleStr=ret;
PrintComm.SetPreView("1");
PrintComm.PrnLoc=session['LOGON.CTLOCID'];
var aa=tm[1].split("&");
//PrintComm.stPage=aa[0];
//if (aa.length>1) PrintComm.stRow=aa[1];
PrintComm.stPage=0;
PrintComm.stRow=0;
PrintComm.previewPrint="1"; //是否弹出设置界面
//PrintComm.stprintpos=tm[0];
PrintComm.stprintpos=0;
//alert(PrintComm.Pages);
PrintComm.SetConnectStr(CacheDB);
PrintComm.ItmName = "DHCNurPrnMould6"; //338155!2010-07-13!0:00!!
//debugger;
var parr=EpisodeID+"!"+stdate+"!"+stim+"!"+edate+"!"+etim+"!DHCNUR6";
PrintComm.ID = "";
PrintComm.MultID = "";
//PrintComm.MthArr="web.DHCConsult:getConsultInfo&id:"+myid;
if(LabHead!="")PrintComm.LabHead=LabHead;
PrintComm.SetParrm(parr); // ="EpisodeId" ; //"p1:0^p2:"
PrintComm.PrintOut();
var SavePrnSet=document.getElementById('SavePrnSet');
//debugger;
var CareDateTim=PrintComm.CareDateTim;
if (CareDateTim=="") return ;
var pages=PrintComm.pages;
var stRow=PrintComm.stRow;
//debugger;
var stprintpos=PrintComm.stPrintPos;
//alert(pages+","+CareDateTim+","+stprintpos+","+EpisodeID+","+"DHCNUR6"+","+session['LOGON.USERID']+","+PrintComm.PrnFlag);
//PrnFlag==1说明是打印预览
if (PrintComm.PrnFlag==1) return;
//如果原记录保存打印到第8页则当打印第8页之前页时不保存打印记录
if (pages<aa[0]) return;
var a=cspRunServerMethod(SavePrnSet.value,pages,CareDateTim,stprintpos,EpisodeID,"DHCNUR6",session['LOGON.USERID']); //page, caredattim, prnpos, adm,Typ,user
//find();
}

function eachItem(item,index,length) {

if (item.xtype=="checkbox") {

//修改下拉框的请求地址

//debugger;
if (item.checked==true) checkret=checkret+item.id+"|"+item.boxLabel+"^";
}

if (item.items && item.items.getCount() > 0) {   
   item.items.each(eachItem, this);   
}   

}

function DBC2SBC(str)

{
var result = '';
if ((str)&&(str.length)) {
for (i = 0; i < str.length; i++) {
code = str.charCodeAt(i);
if (code >= 65281 && code <= 65373) {
result += String.fromCharCode(str.charCodeAt(i) - 65248);
}
else {
if (code == 12288) {
result += String.fromCharCode(str.charCodeAt(i) - 12288 + 32);
}
else {
result += str.charAt(i);
}
}
}
}
else{
result=str;
}

return result;

}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

0条回答

为你推荐

换一换