123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077 |
- /*---------------------------------------------------------------------
- 수술실 물품 마스터 일괄등록(SPMNP04400.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- : Create By 김 진 명
- : 2009.02.05
- ----------------------------------------------------------------------*/
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 수술실 물품 마스터 초기화 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fInit() {
- model.removenode("/root/send");
- model.removeNodeset("/root/main/goodlist");
- model.setValue("/root/main/cond/refdept", "X");
- model.setValue("/root/main/cond/refdeptflag", "MIS");
- submit("TRMNP04403", false);//물품구분 조회
- model.setValue("/root/main/goodinfo/gooddetlinfo/goodflag", "Y");
- model.makeValue("/root/send/reqdata/tabflag", "CCR");
- model.makeValue("/root/send/reqdata/goodflag", "Y");
- submit("TRMNP04408", false);//물품 상세정보 대분류 조회
- submit("TRMNP04404", false);
- var nodeCnt = getNodesetCount("/root/init/lrglist");
- if( nodeCnt > 0 ) {
- addComboItem("cmb_lrg", "전 체", "", "above" );
- }
- grd_goodlist.explorerbar = "sort";
- model.refresh();
- /* model.removeNodeset("/root/main/goodlist");
- model.setValue("/root/main/cond/tabflag", "CCR");
- model.toggle("ccrgood");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMNP04403", false);
- model.setValue("/root/main/cond/goodflag", "Y");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- //2008-12-29 오후 12:21:02 taebum add
- submit("TRMNP04408", false);//물품 상세정보 대분류 조회
- submit("TRMNP04404", false);
- var nodeCnt = getNodesetCount("/root/init/lrglist");
- if( nodeCnt > 0 ) {
- addComboItem("cmb_lrg", "전 체", "", "above" );
- }
- grd_goodlist.explorerbar = "sort";
- grd_goodlist2.explorerbar = "sort";
- grd_goodlist3.explorerbar = "sort";
- fChangeDept("1");
- btn_save.disabled = true;
- model.refresh();*/
- }
- /*--------------------------------------------------*/
- /*type : function */
- /*access : public */
- /*desc : 수술실 물품 마스터 조회 */
- /*param : */
- /*return : */
- /*--------------------------------------------------*/
- function fSearch() {
- var indexcd, lrgcd, mdlcd, smlcd;
- var refdeptflag = model.getValue("/root/main/cond/refdeptflag");
- var refdept = model.getValue("/root/main/cond/refdept");
- var refflag = model.getValue("/root/main/cond/refflag");
- var refnm = model.getValue("/root/main/cond/refnm");
- var prodcmpynm = model.getValue("/root/main/cond/prodcmpynm");
- var custnm = model.getValue("/root/main/cond/custnm");
- var item = trv_goodindxcdlist.item(trv_goodindxcdlist.selectedIndex);
- if(item != null){
- indexcd = item.value;
- if( indexcd.length == 2 ) {
- lrgcd = indexcd;
- }else if( indexcd.length == 4 ) {
- lrgcd = indexcd.substr(0, 2);
- mdlcd = indexcd.substr(2, 2);
- }else if( indexcd.length == 6 ) {
- lrgcd = indexcd.substr(0, 2);
- mdlcd = indexcd.substr(2, 2);
- smlcd = indexcd.substr(4, 2);
- }
- }
- if( refnm == "" && prodcmpynm == "" && custnm == "" && lrgcd == "" && mdlcd == "" && smlcd == "" ) {
- messageBox("검색조건을 입력하지 ", "E007");
- model.setFocus("ipt_goodcd");
- return;
- }
- model.removenode("/root/send");
- model.makeNode("/root/send/reqdata");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- model.makeValue("/root/send/reqdata/lrgcd", lrgcd);
- model.makeValue("/root/send/reqdata/mdlcd", mdlcd);
- model.makeValue("/root/send/reqdata/smlcd", smlcd);
- submit("TRMNP04401");
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 수술실 물품 부서별 부서 재고 화면 변경 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fChangeDept(flag) {
- /*
- var deptflag = model.getValue("/root/main/cond/refdeptflag");//부서구분
- var nodeCnt = parseInt(getNodesetCount("/root/init/oproomlist"))+1;
- if( deptflag != "R" ) {//수술, 마취
- var scrwidth = ( nodeCnt * 49 ) + 14;
- if( nodeCnt > 25 ) {//수술방이 25개 이상이면 스크롤 바로 인해 크기 조절
- grd_oproomstoclist.attribute("style") = "left:144px; top:50px; width:1050px; height:89px; text-align:right;";
- }else {
- grd_oproomstoclist.attribute("style") = "left:144px; top:65px; width:" + scrwidth + "px; height:72px; text-align:right;";
- }
- var captionlist = "";
- if( nodeCnt != 0 ) {
- if( flag == "2" ) {//부서를 변경했을 때
- for(var i = 0; i <= nodeCnt; i++ ) {
- grd_oproomstoclist.removeColumn(false);;
- }
- }
- for(var i = 0; i <= nodeCnt; i++ ) { //수술방 갯수 만큼 컴럼을 만들고 cation을 만들어 준다.(CCR제외)
- grd_oproomstoclist.addColumn("ref:oproomnostoc" + i + "; type:input;", false);
- if( i == 4 ) {
- grd_oproomstoclist.colWidth(i) = 60;
- }else {
- grd_oproomstoclist.colWidth(i) = 49;
- }
- grd_oproomstoclist.colAttribute(i, "format") = "#.###";
- if( i == 0 ) {
- captionlist = model.getValue("/root/init/oproomlist[" + i + "]/oproomnm");
- }else if( i == 4 ){
- captionlist = captionlist + "^OR총재고";
- }else if( i < 4 ) {
- captionlist = captionlist + "^" + model.getValue("/root/init/oproomlist[" + i + "]/oproomnm");
- }else if( i > 4 ) {
- j = i - 1;
- captionlist = captionlist + "^" + model.getValue("/root/init/oproomlist[" + j + "]/oproomnm");
- }
- }
- grd_oproomstoclist.caption = captionlist;
- grd_oproomstoclist.addRow(false);
- }
- grd_oproomstoclist.deleteColumn(0);
- if( deptflag == "O" ) {//수술
- grd_oproomstoclist.colDisabled(3) = "ture";
- }else {
- for( var j = 0; j < 4; j++ ) {
- grd_oproomstoclist.colDisabled(j) = "ture";
- }
- }
- }else {
- grd_oproomstoclist.attribute("style") = "left:144px; top:65px; width:242px; height:72px; text-align:right;";
- if( nodeCnt != 0 ) {
- for(var i = 0; i <= nodeCnt; i++ ) {
- grd_oproomstoclist.removeColumn(false);;
- }
- for(var i = 1; i <= 4; i++ ) {
- grd_oproomstoclist.addColumn("ref:oproomnostoc" + i + "; type:input;", false);
- grd_oproomstoclist.colWidth(i-1) = 60;
- grd_oproomstoclist.colAttribute(i-1, "format") = "#.###";
- }
- grd_oproomstoclist.caption = "CCR^C-C^C-O^회복실";
- grd_oproomstoclist.addRow(false);
- for( var j = 0; j < 3; j++ ) {
- grd_oproomstoclist.colDisabled(j) = "ture";
- }
- }
- }
- model.refresh();*/
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 수술실 물품 정보 저장 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fSaveGoodInfo() {
- var lrgcd, mdlcd, smlcd, cureflag, delivepriod, deliveyn, useflag, appdd, enddd;
- lrgcd = model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd");
- mdlcd = model.getValue("/root/main/goodinfo/gooddetlinfo/mdlcd");
- smlcd = model.getValue("/root/main/goodinfo/gooddetlinfo/smlcd");
- prcpnm = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodnm");
- goodspec = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodspec");
- goodmodel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodmodel");
- custtel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel");
- cureflag = model.getValue("/root/main/goodinfo/gooddetlinfo/cureflag");
- delivepriod = model.getValue("/root/main/goodinfo/gooddetlinfo/delivepriod");
- deliveyn = model.getValue("/root/main/goodinfo/gooddetlinfo/deliveyn");
- useflag = model.getValue("/root/main/goodinfo/gooddetlinfo/useflag");
- appdd = model.getValue("/root/main/goodinfo/gooddetlinfo/appdd");
- enddd = model.getValue("/root/main/goodinfo/gooddetlinfo/enddd");
- rgstflag = model.getValue("/root/main/goodinfo/gooddetlinfo/rgstflag");
- if( lrgcd == "" ) {
- messageBox("대분류를 선택하지 ", "E007");
- model.setFocus("cmb_lrg");
- return;
- }else if( mdlcd == "" ) {
- messageBox("중분류를 선택하지 ", "E007");
- model.setFocus("cmb_mdl");
- return;
- }else if( prcpnm.length > 200 ) {
- messageBox("물품명은 200자 이하 ", "E008");
- model.setFocus("ipt_prcpnm");
- return;
- }else if( goodspec.length > 50 ) {
- messageBox("규격은 50자 이하 ", "E008");
- model.setFocus("ipt_goodspec");
- return;
- }else if( goodmodel.length > 50 ) {
- messageBox("모델은 50자 이하 ", "E008");
- model.setFocus("ipt_goodmodel");
- return;
- }else if( custtel.length > 13 ) {
- messageBox("업체전화번호는 13자 이하 ", "E008");
- model.setFocus("ipt_custtel");
- return;
- }else if( cureflag == "" ) {
- messageBox("처방구분를 선택하지 ", "E007");
- model.setFocus("rdo_cureflag");
- return;
- }else if( delivepriod == "" ) {
- messageBox("불출시기를 선택하지 ", "E007");
- model.setFocus("rdo_ccrdelivepriod");
- return;
- }else if( deliveyn == "" ) {
- messageBox("불출여부를 선택하지 ", "E007");
- model.setFocus("rdo_deliveyn");
- return;
- }else if( appdd == "" ) {
- messageBox("적용일자를 선택하지 ", "E007");
- model.setFocus("ipt_appdd");
- return;
- }else if( enddd == "" ) {
- messageBox("종료일자를 선택하지 ", "E007");
- model.setFocus("ipt_enddd");
- return;
- }
- model.removenode("/root/send");
- model.makeNode("/root/send/savedata");
- model.copyNode("/root/send/savedata", "/root/main/goodinfo/gooddetlinfo");
- model.makeValue("/root/send/savedata/refdept", model.getValue("/root/main/cond/refdept"));
- if( rgstflag == "E" ) {//단종이면 미사용으로 셋팅
- model.setValue("/root/send/savedata/rgstflag", "U");
- }
- submit("TXMNP04401");
- }
- /* function fSaveGoodInfo(){
- var deptflag = "";
- var opuseyn = "", anstuseyn = "", recovruseyn = "", opuseynstat = "", anstuseynstat = "", recovruseynstat = "";
- var oldopuseyn = "", oldanstuseyn = "", oldrecovruseyn = "";
- var endgood = model.getValue("/root/main/goodinfo/gooddetlinfo/useflag");
- var deptflag1 = model.getValue("/root/temp/deptflag1");
- var deptflagCnt = deptflag1.length;
- var refdeptflag = model.getValue("/root/main/cond/refdeptflag");
- oldopuseyn = model.getValue("/root/main/goodinfo/gooddetlinfo/opuseyn");
- oldanstuseyn = model.getValue("/root/main/goodinfo/gooddetlinfo/anstuseyn");
- oldrecovruseyn = model.getValue("/root/main/goodinfo/gooddetlinfo/recovruseyn");
- //1:수술, 2:마취, 3:회복, 4:수술/마취, 5:수술/회복, 6:마취/회복, 7:수술/마취/회복
- switch(deptflag1) {
- case "1"://수술
- if( refdeptflag == "O" ) {//수술
- deptflag = "1";
- opuseyn = "Y";
- anstuseyn = "N";
- recovruseyn = "N";
- }else if( refdeptflag == "A" ) {//수술/마취
- deptflag = "4";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "N";
- }else if( refdeptflag == "R" ) {//수술/회복
- deptflag = "5";
- opuseyn = "Y";
- anstuseyn = "N";
- recovruseyn = "Y";
- }
- break;
- case "2"://마취
- if( refdeptflag == "O" ) {//수술/마취
- deptflag = "4";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "N";
- }else if( refdeptflag == "A" ) {//마취
- deptflag = "2";
- opuseyn = "N";
- anstuseyn = "Y";
- recovruseyn = "N";
- }else if( refdeptflag == "R" ) {//마취/회복
- deptflag = "6";
- opuseyn = "N";
- anstuseyn = "Y";
- recovruseyn = "Y";
- }
- break;
- case "3"://회복
- if( refdeptflag == "O" ) {//수술/회복
- deptflag = "5";
- opuseyn = "Y";
- anstuseyn = "N";
- recovruseyn = "Y";
- }else if( refdeptflag == "A" ) {//마취/회복
- deptflag = "6";
- opuseyn = "N";
- anstuseyn = "Y";
- recovruseyn = "Y";
- }else if( refdeptflag == "R" ) {//회복
- deptflag = "3";
- opuseyn = "N";
- anstuseyn = "N";
- recovruseyn = "Y";
- }
- break;
- case "1 2"://수술, 마취
- if( refdeptflag == "O" ) {//수술/마취
- deptflag = "4";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "N";
- }else if( refdeptflag == "A" ) {//수술/마취
- deptflag = "4";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "N";
- }else if( refdeptflag == "R" ) {//회복
- deptflag = "7";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "Y";
- }
- break;
- case "2 1"://마취, 수술
- if( refdeptflag == "O" ) {//수술/마취
- deptflag = "4";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "N";
- }else if( refdeptflag == "A" ) {//수술/마취
- deptflag = "4";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "N";
- }else if( refdeptflag == "R" ) {//전체
- deptflag = "7";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "Y";
- }
- break;
- case "2 3"://마취, 회복
- if( refdeptflag == "O" ) {//전체
- deptflag = "7";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "Y";
- }else if( refdeptflag == "A" ) {//마취/회복
- deptflag = "6";
- opuseyn = "N";
- anstuseyn = "Y";
- recovruseyn = "Y";
- }else if( refdeptflag == "R" ) {//마취/회복
- deptflag = "6";
- opuseyn = "N";
- anstuseyn = "Y";
- recovruseyn = "Y";
- }
- break;
- case "3 2"://회복, 마취
- if( refdeptflag == "O" ) {//전체
- deptflag = "7";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "Y";
- }else if( refdeptflag == "A" ) {//마취/회복
- deptflag = "6";
- opuseyn = "N";
- anstuseyn = "Y";
- recovruseyn = "Y";
- }else if( refdeptflag == "R" ) {//마취/회복
- deptflag = "6";
- opuseyn = "N";
- anstuseyn = "Y";
- recovruseyn = "Y";
- }
- break;
- case "1 3"://수술, 회복
- if( refdeptflag == "O" ) {//수술, 회복
- deptflag = "5";
- opuseyn = "Y";
- anstuseyn = "N";
- recovruseyn = "Y";
- }else if( refdeptflag == "A" ) {//전체
- deptflag = "7";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "Y";
- }else if( refdeptflag == "R" ) {//수술, 회복
- deptflag = "5";
- opuseyn = "Y";
- anstuseyn = "N";
- recovruseyn = "Y";
- }
- break;
- case "3 1"://회복, 수술
- if( refdeptflag == "O" ) {//수술, 회복
- deptflag = "5";
- opuseyn = "Y";
- anstuseyn = "N";
- recovruseyn = "Y";
- }else if( refdeptflag == "A" ) {//전체
- deptflag = "7";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "Y";
- }else if( refdeptflag == "R" ) {//수술, 회복
- deptflag = "5";
- opuseyn = "Y";
- anstuseyn = "N";
- recovruseyn = "Y";
- }
- break;
- case "1 2 3"://전체
- deptflag = "7";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "Y";
- break;
- case "1 3 2"://전체
- deptflag = "7";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "Y";
- break;
- case "2 1 3"://전체
- deptflag = "7";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "Y";
- break;
- case "2 3 1"://전체
- deptflag = "7";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "Y";
- break;
- case "3 1 2"://전체
- deptflag = "7";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "Y";
- break;
- case "3 2 1":
- deptflag = "7";
- opuseyn = "Y";
- anstuseyn = "Y";
- recovruseyn = "Y";
- break;
- default :
- if( refdeptflag == "O" ) {//수술, 회복
- deptflag = "1";
- opuseyn = "Y";
- anstuseyn = "N";
- recovruseyn = "N";
- }else if( refdeptflag == "A" ) {//전체
- deptflag = "2";
- opuseyn = "N";
- anstuseyn = "Y";
- recovruseyn = "N";
- }else if( refdeptflag == "R" ) {//수술, 회복
- deptflag = "3";
- opuseyn = "N";
- anstuseyn = "N";
- recovruseyn = "Y";
- }
- break;
- }
- //수술
- if( ( oldopuseyn == "N" )&&( opuseyn == "Y" ) ) {//생성
- opuseynstat = "C";
- }else if( ( oldopuseyn == "Y" )&&( opuseyn == "Y" ) ) {//변경
- opuseynstat = "S";
- }else if( ( oldopuseyn == "Y" )&&( opuseyn == "N" ) ) {//미사용으로 전환
- opuseynstat = "U";
- opuseyn = "U";
- }else if( ( oldopuseyn == "U" )&&( opuseyn == "Y" ) ) {//사용으로 전환
- opuseynstat = "Z";
- }else {//등록안됨
- opuseynstat = "F";
- }
- if( endgood == "U" ){//미사용
- if( refdeptflag == "O" ) {
- opuseyn = "U";
- }else if( refdeptflag == "A" ) {
- anstuseyn = "U";
- }else if( refdeptflag == "R" ) {
- recovruseyn = "U";
- }
- }
- if( refdeptflag != "O") {//수술이 아니면 변경없음
- opuseynstat = "P";
- }
- //마취
- if( ( oldanstuseyn == "N" )&&( anstuseyn == "Y" ) ) {//생성
- anstuseynstat = "C";
- }else if( ( oldanstuseyn == "Y" )&&( anstuseyn == "Y" ) ) {//변경
- anstuseynstat = "S";
- }else if( ( oldanstuseyn == "Y" )&&( anstuseyn == "N" ) ) {//미사용으로 전환
- anstuseynstat = "U";
- anstuseyn = "U";//미사용으로 등록
- }else if( ( oldanstuseyn == "U" )&&( anstuseyn == "Y" ) ) {//사용으로 전환
- anstuseynstat = "Z";
- }else {
- anstuseynstat = "F";
- }
- if( refdeptflag != "A") {//마취가 아니면 변경없음
- anstuseynstat = "P";
- }
- //회복
- if( ( oldrecovruseyn == "N" )&&( recovruseyn == "Y" ) ) {//생성
- recovruseynstat = "C";
- }else if( ( oldrecovruseyn == "Y" )&&( recovruseyn == "Y" ) ) {//변경
- recovruseynstat = "S";
- }else if( ( oldrecovruseyn == "Y" )&&( recovruseyn == "N" ) ) {//미사용으로 전환
- recovruseynstat = "U";
- recovruseyn = "U";
- }else if( ( oldrecovruseyn == "U" )&&( recovruseyn == "Y" ) ) {//사용으로 전환
- recovruseynstat = "Z";
- }else {
- recovruseynstat = "F";
- }
- if( refdeptflag != "R") {//회복가 아니면 변경없음
- recovruseynstat = "P";
- }
- model.makeValue("/root/main/goodinfo/gooddetlinfo/refdeptflag", refdeptflag);
- model.makeValue("/root/main/goodinfo/gooddetlinfo/deptflag", deptflag); //수술:1, 마취:2, 회복:3, 수술/마취:4, 마취/회복:5, 수술/회복:6, 수술/마취/회복:7
- model.makeValue("/root/main/goodinfo/gooddetlinfo/opuseynstat", opuseynstat);
- model.makeValue("/root/main/goodinfo/gooddetlinfo/anstuseynstat", anstuseynstat);
- model.makeValue("/root/main/goodinfo/gooddetlinfo/recovruseynstat", recovruseynstat);
- model.setValue("/root/main/goodinfo/gooddetlinfo/opuseyn", opuseyn);
- model.setValue("/root/main/goodinfo/gooddetlinfo/anstuseyn", anstuseyn);
- model.setValue("/root/main/goodinfo/gooddetlinfo/recovruseyn", recovruseyn);
- var iNode = "/root/main/goodinfo/gooddetlinfo/";
- var cureflag, ccrcusttel, winflag, goodmngt, reuseflag, prcpalias, ccrmdl, goodexist, ccrdeptflag;
- cureflag = model.getValue( iNode + "cureflag");
- winflag = model.getValue( iNode + "winflag");
- reuseflag = model.getValue( iNode + "reuseflag");
- prcpalias = model.getValue( iNode + "prcpalias");
- ccrlrgcd = model.getValue( iNode + "ccrlrgcd");
- ccrmdlcd = model.getValue( iNode + "ccrmdlcd");
- goodexist = model.getValue( iNode + "goodexist");
- if( model.getValue("/root/main/cond/tabflag") != "PRC" ) {
- if( prcpalias == "" ){
- messageBox("처방명을 ", "C001");
- model.setFocus("ipt_prcpnm");
- return;
- }else if( prcpalias.length > 200 ){
- messageBox("처방명은 200자 이하 ", "E008");
- model.setFocus("ipt_prcpnm");
- return;
- }else if( cureflag == "" ) {
- messageBox("처치구분을 ", "C002");
- model.setFocus("cmb_cureflag");
- return;
- }else if( winflag == "" ) {
- messageBox("입고구분을 ", "C002");
- model.setFocus("cmb_winflag");
- return;
- }else if( reuseflag == "" ) {
- messageBox("재사용구분을 ", "C002");
- return;
- }else if( ccrlrgcd == "" ) {
- messageBox("대분류를 ", "C002");
- return;
- }else if( ccrmdlcd == "" ) {
- messageBox("중분류를 ", "C002");
- return;
- }else if( ( goodexist == "N" )&&( deptflag == "" ) ) {//등록안된 물품인데 부서 체크안하면
- messageBox("저장할 부서를 ", "C002");
- return;
- }else if( ( goodexist == "N" )&&( deptflag != "" ) ) {//등록안된 물품인데 조회 부서 체크안하면
- if( refdeptflag == "O" ){
- if( !(( deptflag == "1" )||( deptflag == "4" )||( deptflag == "6" )||( deptflag == "7" )) ) {
- messageBox("수술실을 선택하지 ", "E007");
- return;
- }
- }else if( refdeptflag == "A" ){
- if( !(( deptflag == "2" )||( deptflag == "4" )||( deptflag == "5" )||( deptflag == "7" )) ) {
- messageBox("마취과를 선택하지 ", "E007");
- return;
- }
- }else if( refdeptflag == "R" ){
- if( !(( deptflag == "3" )||( deptflag == "5" )||( deptflag == "6" )||( deptflag == "7" )) ) {
- messageBox("회복실을 선택하지 ", "E007");
- return;
- }
- }
- }
- }else {
- var prcpclscd = model.getValue("/root/main/goodinfo/gooddetlinfo/prcpclscd");//처방 구분
- if( ( prcpclscd == "M2" )||( prcpclscd == "A2" )||( prcpclscd == "A4" )||( prcpclscd == "A6" )||( prcpclscd == "I4" ) ) {//재료, 경구, 외용, 주사, 마취약
- if( prcpalias == "" ){
- messageBox("처방명을 ", "C001");
- model.setFocus("ipt_prcpnm");
- return;
- }else if( prcpalias.length > 200 ){
- messageBox("처방명은 200자 이하 ", "E008");
- model.setFocus("ipt_prcpnm");
- return;
- }else if( cureflag == "" ) {
- messageBox("처치구분을 ", "C002");
- model.setFocus("cmb_cureflag");
- return;
- }else if( winflag == "" ) {
- messageBox("입고구분을 ", "C002");
- model.setFocus("cmb_winflag");
- return;
- }else if( reuseflag == "" ) {
- messageBox("재사용구분을 ", "C002");
- return;
- }else if( ccrlrgcd == "" ) {
- messageBox("대분류를 ", "C002");
- return;
- }else if( ccrmdlcd == "" ) {
- messageBox("중분류를 ", "C002");
- return;
- }else if( ( goodexist == "N" )&&( deptflag == "" ) ) {//등록안된 물품인데 부서 체크안하면
- messageBox("저장할 부서를 ", "C002");
- return;
- }else if( ( goodexist == "N" )&&( deptflag != "" ) ) {//등록안된 물품인데 조회 부서 체크안하면
- if( refdeptflag == "O" ){
- if( !(( deptflag == "1" )||( deptflag == "4" )||( deptflag == "6" )||( deptflag == "7" )) ) {
- messageBox("수술실을 선택하지 ", "E007");
- return;
- }
- }else if( refdeptflag == "A" ){
- if( !(( deptflag == "2" )||( deptflag == "4" )||( deptflag == "5" )||( deptflag == "7" )) ) {
- messageBox("마취과를 선택하지 ", "E007");
- return;
- }
- }else if( refdeptflag == "R" ){
- if( !(( deptflag == "3" )||( deptflag == "5" )||( deptflag == "6" )||( deptflag == "7" )) ) {
- messageBox("회복실을 선택하지 ", "E007");
- return;
- }else if( cureflag == "" ) {
- messageBox("처치구분을 ", "C002");
- model.setFocus("cmb_cureflag");
- return;
- }
- }
- }
- }else {//처방 탭에서 물품, 약이 아닌 물품들(처치 처방종류)
- if( prcpalias.length > 200 ){
- messageBox("처방명은 200자 이하 ", "E008");
- model.setFocus("ipt_prcpnm");
- return;
- }else if( cureflag == "" ) {
- messageBox("처치구분을 ", "C002");
- model.setFocus("cmb_cureflag");
- return;
- }else if( ccrlrgcd == "" ) {
- messageBox("대분류를 ", "C002");
- return;
- }else if( ccrmdlcd == "" ) {
- messageBox("중분류를 ", "C002");
- return;
- }else if( ( goodexist == "N" )&&( deptflag == "" ) ) {//등록안된 물품인데 부서 체크안하면
- messageBox("저장할 부서를 ", "C002");
- return;
- }else if( ( goodexist == "N" )&&( deptflag != "" ) ) {//등록안된 물품인데 조회 부서 체크안하면
- if( refdeptflag == "O" ){
- if( !(( deptflag == "1" )||( deptflag == "4" )||( deptflag == "6" )||( deptflag == "7" )) ) {
- messageBox("수술실을 선택하지 ", "E007");
- return;
- }
- }else if( refdeptflag == "A" ){
- if( !(( deptflag == "2" )||( deptflag == "4" )||( deptflag == "5" )||( deptflag == "7" )) ) {
- messageBox("마취과를 선택하지 ", "E007");
- return;
- }
- }else if( refdeptflag == "R" ){
- if( !(( deptflag == "3" )||( deptflag == "5" )||( deptflag == "6" )||( deptflag == "7" )) ) {
- messageBox("회복실을 선택하지 ", "E007");
- return;
- }else if( cureflag == "" ) {
- messageBox("처치구분을 ", "C002");
- model.setFocus("cmb_cureflag");
- return;
- }
- }
- }
- }
- }
- var oproomcd, safestocqty, stocqty, goodcd, allsizespecid, refdeptflag;
- var nodeCnt = parseInt(getNodesetCount("/root/init/oproomlist"))+1;
- var oproomstoclist = "oproomcd▦safestocqty▦stocqty▦goodcd▦allsizespecid▦refdeptflag";
- goodcd = model.getValue("/root/main/goodinfo/gooddetlinfo/goodcd");
- allsizespecid = model.getValue("/root/main/goodinfo/gooddetlinfo/allsizespecid");
- for( var j = 1; j < nodeCnt; j++) {
- oproomcd = model.getValue("/root/init/oproomlist["+j+"]/oproomcd");
- if( j < 4 ) {//OR총재고를 제외하기 위해
- if( refdeptflag == "O" ) {//수술이면 CCR, Clean-Zone, OR(창고) 포함
- safestocqty = model.getValue("/root/temp/oproomstoclist/oproomnostoc"+j);
- stocqty = model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j);
- refdeptflag = "O";//CCR, Clean-Zone, OR(창고)수술실에서만 관리
- oproomstoclist = oproomstoclist + "▩"
- + oproomcd + "▦"
- + safestocqty + "▦"
- + stocqty + "▦"
- + goodcd + "▦"
- + allsizespecid + "▦"
- + refdeptflag;
- }else if( refdeptflag == "A" ) {//마취면
- if( (oldopuseyn == "N")&&(oldrecovruseyn == "N")) {
- safestocqty = model.getValue("/root/temp/oproomstoclist/oproomnostoc"+j);
- stocqty = model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j);
- refdeptflag = "O";//CCR, Clean-Zone, OR(창고)수술실에서만 관리
- oproomstoclist = oproomstoclist + "▩"
- + oproomcd + "▦"
- + safestocqty + "▦"
- + stocqty + "▦"
- + goodcd + "▦"
- + allsizespecid + "▦"
- + refdeptflag;
- }
- }else if( refdeptflag == "R" ) {//회복이면
- if( (oldopuseyn == "N")&&(oldanstuseyn == "N")) {
- safestocqty = model.getValue("/root/temp/oproomstoclist/oproomnostoc"+j);
- stocqty = model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j);
- refdeptflag = "O";//CCR, Clean-Zone, OR(창고)수술실에서만 관리
- oproomstoclist = oproomstoclist + "▩"
- + oproomcd + "▦"
- + safestocqty + "▦"
- + stocqty + "▦"
- + goodcd + "▦"
- + allsizespecid + "▦"
- + refdeptflag;
- }
- }
- }else {
- safestocqty = model.getValue("/root/temp/oproomstoclist/oproomnostoc"+(j+1));
- stocqty = model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+(j+1));
- refdeptflag = model.getValue("/root/main/cond/refdeptflag");
- oproomstoclist = oproomstoclist + "▩"
- + oproomcd + "▦"
- + safestocqty + "▦"
- + stocqty + "▦"
- + goodcd + "▦"
- + allsizespecid + "▦"
- + refdeptflag;
- }
- model.setValue("/root/temp/oproomstoclist/oproomnostoc"+j, ""); //수술방 안전재고 instance 초기화
- model.setValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j, "");//수술방 재고 instance 초기화
- }
- var custtel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel");
- if( custtel != "" ) {
- if( custtel.length < 10 ) {
- messageBox("거래처 전화번호를 정확히 입력하세요!", "");
- model.setFocus("ipt_custtel");
- return;
- }
- var custteltemp = custtel.split("-");
- var tellen = custteltemp.length;
- if( tellen > 1 ) {//'-'입력시
- model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custteltemp[0]+""+custteltemp[1]+""+custteltemp[2]);
- }else {
- model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custteltemp[0]);
- }
- }
- model.copyNode("/root/send/reqdata", "/root/main/goodinfo/gooddetlinfo");
- model.setValue("/root/send/senddata", oproomstoclist);
- if( endgood == "N" ) {
- messageBox("단종된 물품은 저장할 수 ", "I004");
- }else {
- submit("TXMNP04401");
- }
- model.removenode("/root/main/goodinfo/goodstocinfo/refdeptflag");
- model.setValue("/root/main/cond/deptflag", "");
- model.setValue("/root/temp/deptflag1", "");
- model.setValue("/root/temp/deptflag1", "");
- model.resetInstanceNode("/root/main/goodinfo");
- model.setValue("/root/main/cond/ccrlrgcd", "");
- model.setValue("/root/main/cond/ccrmdlcd", "");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMNP04401");//저장 후 재조회
- btn_save.disabled = true;
- }*/
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 수술실 물품 상세 정보 조회 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fDblClick(){
- model.removenode("/root/send");
- model.makeValue("/root/send/reqdata/goodcd", model.getValue("/root/main/goodlist[" + grd_goodlist.row + "]/goodcd"));
- model.makeValue("/root/send/reqdata/allsizespecid", model.getValue("/root/main/goodlist[" + grd_goodlist.row + "]/allsizespecid"));
- model.makeValue("/root/send/reqdata/refdeptflag", model.getValue("/root/main/cond/refdeptflag"));
- model.makeValue("/root/send/reqdata/refdept", model.getValue("/root/main/cond/refdept"));
- submit("TRMNP04402", false);
- //대, 중분류에 따른 콤보 조회
- if( model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd") != "" ) {
- model.resetInstanceNode("/root/temp/mdllist");
- model.resetInstanceNode("/root/temp/smllist");
- model.removenode("/root/send");
- model.makeNode("/root/send/reqdata");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- model.makeValue("/root/send/reqdata/tabflag", "CCR");
- model.makeValue("/root/send/reqdata/ccrlrgcd", model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd"));
- submit("TRMNP04409");
- }
- if( model.getValue("/root/main/goodinfo/gooddetlinfo/mdlcd") != "" ) {
- model.resetInstanceNode("/root/temp/smllist");
- model.removenode("/root/send");
- model.makeNode("/root/send/reqdata");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- model.makeValue("/root/send/reqdata/tabflag", "CCR");
- model.makeValue("/root/send/reqdata/ccrlrgcd", model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd"));
- model.makeValue("/root/send/reqdata/ccrmdlcd", model.getValue("/root/main/goodinfo/gooddetlinfo/mdlcd"));
- submit("TRMNP04410");
- }
- model.refresh();
- /*
- var iRow = -1;
- if( idx == 1 ) {//구매 조회일때
- iRow = grd_goodlist.row;
- }else if( idx == 2 ) {//CCR 조회일때
- iRow = grd_goodlist2.row;
- }else if( idx == 3 ) {//처방 조회
- iRow = grd_goodlist3.row;
- }
- if(iRow < 1)
- {
- return;
- }else {
- model.makeValue("/root/send/reqdata/goodcd", model.getValue("/root/main/goodlist"+"["+iRow+"]/goodcd"));
- model.makeValue("/root/send/reqdata/allsizespecid", model.getValue("/root/main/goodlist"+"["+iRow+"]/allsizespecid"));
- model.makeValue("/root/send/reqdata/endgood", model.getValue("/root/main/goodlist"+"["+iRow+"]/endgood"));
- submit("TRMNP04402", false);
- var totalSafeCnt = 0;
- var totaStocCnt = 0;
- var custtel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel");
- var tellen = custtel.length;
- var custteltemp = custtel.substring(0, 2);
- //전화번호 '-'로 구분 표시
- if( tellen != 0 ) {//번호가 있을때
- if( custteltemp == "01" ) {//휴대폰
- if( tellen == 11 ) {
- model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,4)+"-"+custtel.substr(7,4));
- }else {
- model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,3)+"-"+custtel.substr(6,4));
- }
- }else {
- if( custteltemp == "02" ) {//서울
- if( tellen == 10 ) {
- model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,2)+"-"+custtel.substr(2,4)+"-"+custtel.substr(6,4));
- }else {
- model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,2)+"-"+custtel.substr(2,3)+"-"+custtel.substr(5,4));
- }
- }else {//그 외
- if( tellen == 10 ) {
- model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,3)+"-"+custtel.substr(6,4));
- }else {
- model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,4)+"-"+custtel.substr(7,4));
- }
- }
- }
- }
- //수술:1, 마취:2, 회복:3, 수술/마취:4, 마취/회복:5, 수술/회복:6, 수술/마취/회복:7
- var deptflag = model.getValue("/root/main/goodinfo/gooddetlinfo/deptflag") ;
- switch( deptflag ) {
- case "1":
- model.setValue("/root/temp/deptflag1", "1");
- break;
- case "2":
- model.setValue("/root/temp/deptflag1", "2");
- break;
- case "3":
- model.setValue("/root/temp/deptflag1", "3");
- break;
- case "4":
- model.setValue("/root/temp/deptflag1", "1 2");
- break;
- case "5":
- model.setValue("/root/temp/deptflag1", "2 3");
- break;
- case "6":
- model.setValue("/root/temp/deptflag1", "1 3");
- break;
- case "7":
- model.setValue("/root/temp/deptflag1", "1 2 3");
- break;
- }
- if( model.getValue("/root/main/goodinfo/gooddetlinfo/ccrdeliveyn") == "Y" ) {
- ccrdelivepriod.disabled = "true";
- }else {
- ccrdelivepriod.disabled = "false";
- }
- if( model.getValue("/root/main/goodinfo/gooddetlinfo/ccrlrgcd") != "" ) {
- //대분류 값이 있으면
- //물품 분류를 보여주기 위해 대분류로 중분류 조회 후 중분류값 대입
- model.setValue("/root/main/cond/ccrlrgcd", model.getValue("/root/main/goodinfo/gooddetlinfo/ccrlrgcd"));
- model.resetInstanceNode("/root/temp/mdllist");
- model.resetInstanceNode("/root/temp/smllist");
- var oldtabflag = model.getValue("/root/main/cond/tabflag");
- if( oldtabflag != "CCR" ) {
- model.setValue("/root/main/cond/tabflag", "CCR");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMNP04409");
- model.setValue("/root/main/cond/tabflag", oldtabflag);
- }else {
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMNP04409");
- }
- }
- if( model.getValue("/root/main/goodinfo/gooddetlinfo/ccrmdlcd") != "" ) {
- //중분류 값이 있으면
- //물품 분류를 보여주기 위해 중분류로 소분류 조회 후 소분류값 대입
- model.setValue("/root/main/cond/ccrlrgcd", model.getValue("/root/main/goodinfo/gooddetlinfo/ccrlrgcd"));
- model.setValue("/root/main/cond/ccrmdlcd", model.getValue("/root/main/goodinfo/gooddetlinfo/ccrmdlcd"));
- model.resetInstanceNode("/root/temp/smllist");
- if( model.getValue("/root/main/cond/tabflag") != "CCR" ) {
- model.setValue("/root/main/cond/tabflag", "CCR");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMNP04410");
- model.setValue("/root/main/cond/tabflag", "MIS");
- }else {
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMNP04410");
- }
- var nodeCnt = getNodesetCount("/root/temp/smllist");
- if( nodeCnt > 0 ) {
- //addComboItem("cmb_ccrsml", "전 체", "", "above" );
- }
- }
- var nodeCnt = getNodesetCount("/root/temp/mdllist");
- if( nodeCnt > 0 ) {
- //addComboItem("cmb_ccrmdl", "전 체", "", "above" );
- }
- //재고 그리드 값 맵핑
- var nodeCnt = parseInt(getNodesetCount("/root/init/oproomlist"))+1;
- for( var j = 1; j <= nodeCnt; j++) {
- var safestocqty = model.getValue("/root/main/goodinfo/oproomstoclisthid["+j+"]/safestocqty");
- var stocqty = model.getValue("/root/main/goodinfo/oproomstoclisthid["+j+"]/stocqty");
- if( ( safestocqty == "" )||( stocqty == "" ) ) {
- model.setValue("/root/temp/oproomstoclist/oproomnostoc"+j, 0);
- model.setValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j, 0);
- }else {
- model.setValue("/root/temp/oproomstoclist/oproomnostoc"+j, model.getValue("/root/main/goodinfo/oproomstoclisthid["+j+"]/safestocqty"));
- model.setValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j, model.getValue("/root/main/goodinfo/oproomstoclisthid["+j+"]/stocqty"));
- }
- if( j < 5 ) {//CCR, CLEANE-ZONE, 창고, 수술방 총합만 합계
- totalSafeCnt += parseFloat(model.getValue("/root/temp/oproomstoclist/oproomnostoc"+j));
- totaStocCnt += parseFloat(model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j));
- }
- }
- //재고 총합계를 CSR총합계에 맵핑
- if( ( isNaN(totalSafeCnt) )||( isNaN(totaStocCnt) ) ) {//숫자가 아니면 리턴
- return;
- }else {
- //수술방에서 포장 단위로 계산하여 보여주기
- //var exchqty = model.getValue("/root/main/goodinfo/gooddetlinfo/exchqty"); //환산수량
- //var allpacksafeqty = parseFloat( totalSafeCnt / parseFloat(exchqty) );
- //var allpackqty = parseFloat( totaStocCnt / parseFloat(exchqty) );
- //model.makeValue("/root/main/goodinfo/ccrstocinfo/allpacksafeqty", totalSafeCnt);
- //model.makeValue("/root/main/goodinfo/ccrstocinfo/allpackqty", totaStocCnt);
- model.makeValue("/root/main/goodinfo/ccrstocinfo/allsafeqty", totalSafeCnt);
- model.makeValue("/root/main/goodinfo/ccrstocinfo/allqty", totaStocCnt);
- }
- }
- btn_save.disabled = false;
- model.refresh();*/
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 엑셀저장 */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fSaveExcel(){
- var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
- var tabflag = model.getValue("/root/main/cond/tabflag");
- if (fileName != "")
- {
- if( tabflag == "MIS" ) {
- grd_goodlist.saveExcel(fileName, "SheetName", false, false, "", "", true);
- }else if( tabflag == "CCR" ) {
- grd_goodlist2.saveExcel(fileName, "SheetName", false, false, "", "", true);
- }
- }
- }
|