SMMNP04400.js 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615
  1. /*---------------------------------------------------------------------
  2. 수술실 물품 마스터 (SMMNP04400.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By 김 진 명
  6. : 2007.09.08
  7. ----------------------------------------------------------------------*/
  8. /* --------------------------------------------------*/
  9. /* type : function */
  10. /* access : public */
  11. /* desc : 수술실 물품 마스터 초기화 */
  12. /* param : */
  13. /* return : */
  14. /* --------------------------------------------------*/
  15. function fInit() {
  16. model.removenode("/root/send");
  17. model.removeNodeset("/root/main/goodlist");
  18. //2009.04.08 하드코딩 소스 변경
  19. model.makeValue("/root/send/cdgrupid", "038");
  20. submit("TRMNP00323", false);
  21. model.setValue("/root/main/cond/refdept", model.getValue("/root/viewctrl/viewctrllist/viewctrlinfo/cdnm"));//CCR Main
  22. model.setValue("/root/main/cond/refdept", model.getValue("/root/viewctrl/viewctrllist/viewctrlinfo/cdnm"));//간호처방 화면
  23. if(model.getValue("/root/main/cond/refdept") == "A") {
  24. cmb_lrg.visible = false;
  25. cmb_mdl.visible = false;
  26. cmb_sml.visible = false;
  27. cmb_anstlrgcd.visible = true;
  28. cmb_anstmdlcd.visible = true;
  29. cmb_anstsmlcd.visible = true;
  30. } else {
  31. cmb_lrg.visible = true;
  32. cmb_mdl.visible = true;
  33. cmb_sml.visible = true;
  34. cmb_anstlrgcd.visible = false;
  35. cmb_anstmdlcd.visible = false;
  36. cmb_anstsmlcd.visible = false;
  37. }
  38. //var dutplcecd = getUserInfo("dutplcecd");
  39. //if( dutplcecd == "3070000000" || dutplcecd == "1000000000" ){ // 수술실
  40. // model.setValue("/root/main/cond/refdept", "O");
  41. //}else if(dutplcecd == "3073100000"){ //마취부서
  42. // model.setValue("/root/main/cond/refdept", "A");
  43. //}else if(dutplcecd == "3073300000"){ //회복실부서
  44. // model.setValue("/root/main/cond/refdept", "R");
  45. //}else if(dutplcecd == "3072700000"){ //수술실 안과
  46. // model.setValue("/root/main/cond/refdept", "E");
  47. //}
  48. //---------(20101204) 경북대
  49. //추가
  50. var sjobposcd = getUserInfo("jobposcd"); // 직위
  51. var ssflag = "";
  52. if(getUserInfo("dutplceinstcd") != '032' && getUserInfo("dutplceinstcd") != '031') {
  53. //경북대가 아니면
  54. if( jobrespcd == "1901"){
  55. ssflag = "Y";
  56. }else{
  57. ssflag = "N";
  58. }
  59. } else if(getUserInfo("dutplceinstcd") == '032' || getUserInfo("dutplceinstcd") == '031') {
  60. //경북대이면
  61. if( sjobposcd == "75" || getUserInfo("ENR")){ //수간호사
  62. ssflag = "Y";
  63. }else{
  64. ssflag = "N";
  65. }
  66. }
  67. //---------(20101204) 경북대
  68. //---------(20101204) 경북대
  69. //if( getUserInfo("jobrespcd") == "1901" ) {//UM 선생님만 저장가능
  70. // if( ssflag == "Y" || getUserInfo("ENR") ) {//UM 선생님만 저장가능
  71. // //---------(20101204) 경북대
  72. // button4.disabled = "false";//저장
  73. // btn_save.disabled = "false";//선택일괄저장
  74. // }else {
  75. // button4.disabled = "true";//저장
  76. // btn_save.disabled = "true";//선택일괄저장
  77. // }
  78. //---------------(20101012) 경북대 s1
  79. cap_srchflag.visible = false;
  80. cmb_srchflag.visible= false;
  81. submit("TRMNP04497");//마스터구분이 구매인 경우 물품구분을 사용한다.
  82. cmb_srchflag.select(0);
  83. //---------------(20101012) 경북대 e1
  84. model.setValue("/root/main/goodinfo/gooddetlinfo/goodflag", "Y");
  85. model.makeValue("/root/send/reqdata/refdeptflag", model.getValue("/root/main/cond/refdeptflag"));//TREE 분류 조회를 위한 조건
  86. model.makeValue("/root/send/reqdata/tabflag", "CCR");//수술실 물품 분류 조회를 위한 조건
  87. model.makeValue("/root/send/reqdata/goodflag", "Y");
  88. submit("TRMNP04414", false);//TREE 분류 조회
  89. submit("TRMNP04403", false);//물품구분 조회
  90. submit("TRMNP04408", false);//물품 상세정보 대분류 조회
  91. submit("TRMNP04404", false);
  92. var nodeCnt = getNodesetCount("/root/init/lrglist");
  93. if( nodeCnt > 0 ) {
  94. addComboItem("cmb_lrg", "전 체", "", "above" );
  95. }
  96. //2009-06-22 K.J.M 병원별 Display 여부
  97. model.removenode("/root/send");
  98. model.makeValue("/root/send/reqdata/cdgrupid", "106");//병원별 Display 여부
  99. model.makeValue("/root/send/reqdata/supcdid", "");//서브구분
  100. model.makeValue("/root/send/reqdata/cdid", "");//서브구분
  101. submit("TRMNP04903", false);
  102. if( model.getValue("/root/init/hardcodeinfo/cdid").substr(8, 1) == "Y" ) {//수술실 관리 Display 여부
  103. cap_opmn.visible = true;
  104. chk_opmn.visible = true;
  105. }else {
  106. cap_opmn.visible = false;
  107. chk_opmn.visible = false;
  108. }
  109. grd_goodlist.explorerbar = "sort";
  110. model.refresh();
  111. /* model.removeNodeset("/root/main/goodlist");
  112. model.setValue("/root/main/cond/tabflag", "CCR");
  113. model.toggle("ccrgood");
  114. model.copyNode("/root/send/reqdata", "/root/main/cond");
  115. submit("TRMNP04403", false);
  116. model.setValue("/root/main/cond/goodflag", "Y");
  117. model.copyNode("/root/send/reqdata", "/root/main/cond");
  118. //2008-12-29 오후 12:21:02 taebum add
  119. submit("TRMNP04408", false);//물품 상세정보 대분류 조회
  120. submit("TRMNP04404", false);
  121. var nodeCnt = getNodesetCount("/root/init/lrglist");
  122. if( nodeCnt > 0 ) {
  123. addComboItem("cmb_lrg", "전 체", "", "above" );
  124. }
  125. grd_goodlist.explorerbar = "sort";
  126. grd_goodlist2.explorerbar = "sort";
  127. grd_goodlist3.explorerbar = "sort";
  128. fChangeDept("1");
  129. btn_save.disabled = true;
  130. model.refresh();*/
  131. }
  132. /*--------------------------------------------------*/
  133. /*type : function */
  134. /*access : public */
  135. /*desc : 수술실 물품 마스터 조회 */
  136. /*param : */
  137. /*return : */
  138. /*--------------------------------------------------*/
  139. function fSearch(pFlag) {
  140. var indexcd, lrgcd, mdlcd, smlcd;
  141. var refdeptflag = model.getValue("/root/main/cond/refdeptflag");
  142. var refdept = model.getValue("/root/main/cond/refdept");
  143. var refflag = model.getValue("/root/main/cond/refflag");
  144. var refnm = model.getValue("/root/main/cond/refnm");
  145. var prodcmpynm = model.getValue("/root/main/cond/prodcmpynm");
  146. var custnm = model.getValue("/root/main/cond/custnm");
  147. //------------(20101011) 경북대----------
  148. //구처방조회기능 추가
  149. if (refdeptflag == "PRCOLD") {
  150. var prcpclasscd = trv_goodindxcdlist2.item(trv_goodindxcdlist2.selectedIndex);
  151. model.removenode("/root/send");
  152. model.makeNode("/root/send/reqdata");
  153. model.copyNode("/root/send/reqdata", "/root/main/cond");
  154. model.makeValue("/root/send/reqdata/prcpclasscd", prcpclasscd.value);
  155. submit("TRMNP04499");
  156. return;
  157. }
  158. //------------(20101011) 경북대----------
  159. if( pFlag == "1" ) {//트리 조회 일 경우만 실행
  160. var item = trv_goodindxcdlist.item(trv_goodindxcdlist.selectedIndex);
  161. if(item != null){
  162. indexcd = item.value;
  163. //------------(20101012) 경북대----------
  164. if (refdeptflag != "MIS") {
  165. if( indexcd.length < 4 ) {
  166. return;
  167. }
  168. if( indexcd.length == 2 ) {
  169. lrgcd = indexcd;
  170. }else if( indexcd.length == 4 ) {
  171. lrgcd = indexcd.substr(0, 2);
  172. mdlcd = indexcd.substr(2, 2);
  173. }else if( indexcd.length == 6 ) {
  174. lrgcd = indexcd.substr(0, 2);
  175. mdlcd = indexcd.substr(2, 2);
  176. smlcd = indexcd.substr(4, 2);
  177. }
  178. } else {
  179. var stemp = indexcd.split("/");
  180. lrgcd = stemp[0];
  181. mdlcd = stemp[1];
  182. smlcd = stemp[2];
  183. }
  184. //------------(20101012) 경북대----------
  185. }
  186. }else {
  187. var item = trv_goodindxcdlist.item(trv_goodindxcdlist.selectedIndex);
  188. if(item != null){
  189. indexcd = item.value;
  190. //------------(20101012) 경북대----------
  191. if (refdeptflag != "MIS") {
  192. if( indexcd.length == 2 ) {
  193. lrgcd = indexcd;
  194. }else if( indexcd.length == 4 ) {
  195. lrgcd = indexcd.substr(0, 2);
  196. mdlcd = indexcd.substr(2, 2);
  197. }else if( indexcd.length == 6 ) {
  198. lrgcd = indexcd.substr(0, 2);
  199. mdlcd = indexcd.substr(2, 2);
  200. smlcd = indexcd.substr(4, 2);
  201. }
  202. } else {
  203. var stemp = indexcd.split("/");
  204. lrgcd = stemp[0];
  205. mdlcd = stemp[1];
  206. smlcd = stemp[2];
  207. }
  208. //------------(20101012) 경북대----------
  209. }
  210. }
  211. if( refnm == "" && prodcmpynm == "" && custnm == "" && lrgcd == "" && mdlcd == "" && smlcd == "" ) {
  212. messageBox("검색조건을 입력하지 ", "E007");
  213. model.setFocus("ipt_goodcd");
  214. return;
  215. }
  216. model.removenode("/root/send");
  217. model.makeNode("/root/send/reqdata");
  218. model.copyNode("/root/send/reqdata", "/root/main/cond");
  219. model.makeValue("/root/send/reqdata/lrgcd", lrgcd);
  220. model.makeValue("/root/send/reqdata/mdlcd", mdlcd);
  221. model.makeValue("/root/send/reqdata/smlcd", smlcd);
  222. //------(20101012) 경북대
  223. if ( model.getValue("/root/main/cond/refdeptflag") == "MIS" ) {
  224. model.makeValue("/root/send/reqdata/srchflag", model.getValue("/root/main/srchinfo/srchflag"));
  225. }
  226. //------(20101012) 경북대
  227. submit("TRMNP04401");
  228. /*for(var i = 1; i <= grd_goodlist.rows; i++ ){
  229. if(grd_goodlist.valueMatrix(i,0) == "★"){
  230. grd_goodlist.cellstyle("color", i, 0, i, 0) = "#FF0000";
  231. }else if(grd_goodlist.valueMatrix(i,0) == "☆"){
  232. grd_goodlist.cellstyle("color", i, 0, i, 0) = "#000000";
  233. }else if(grd_goodlist.valueMatrix(i,0) == "●"){
  234. grd_goodlist.cellstyle("color", i, 0, i, 0) = "#0000FF";
  235. }else{
  236. grd_goodlist.cellstyle("color", i, 0, i, 0) = "#000000";
  237. }
  238. }
  239. model.refresh();*/
  240. }
  241. /*--------------------------------------------------*/
  242. /*type : function */
  243. /*access : public */
  244. /*desc : 수술실 물품 마스터 조회(일괄등록) */
  245. /*param : */
  246. /*return : */
  247. /*--------------------------------------------------*/
  248. function fBatchSearch() {
  249. var indexcd, lrgcd, mdlcd, smlcd;
  250. var refdeptflag = model.getValue("/root/main/cond/refdeptflag");
  251. var refdept = model.getValue("/root/main/cond/refdept");
  252. var refflag = model.getValue("/root/main/cond/refflag");
  253. var refnm = model.getValue("/root/main/cond/refnm");
  254. var prodcmpynm = model.getValue("/root/main/cond/prodcmpynm");
  255. var custnm = model.getValue("/root/main/cond/custnm");
  256. if( refnm == "" && prodcmpynm == "" && custnm == "" && lrgcd == "" && mdlcd == "" && smlcd == "" ) {
  257. messageBox("검색조건을 입력하지 ", "E007");
  258. model.setFocus("ipt_goodcd");
  259. return;
  260. }
  261. model.removenode("/root/send");
  262. model.makeNode("/root/send/reqdata");
  263. model.copyNode("/root/send/reqdata", "/root/main/cond");
  264. model.makeValue("/root/send/reqdata/lrgcd", lrgcd);
  265. model.makeValue("/root/send/reqdata/mdlcd", mdlcd);
  266. model.makeValue("/root/send/reqdata/smlcd", smlcd);
  267. submit("TRMNP04401");
  268. /*for(var i = 1; i <= grd_goodlist.rows; i++ ){
  269. if(grd_goodlist.valueMatrix(i,0) == "★"){
  270. grd_goodlist.cellstyle("color", i, 0, i, 0) = "#FF0000";
  271. }else if(grd_goodlist.valueMatrix(i,0) == "☆"){
  272. grd_goodlist.cellstyle("color", i, 0, i, 0) = "#000000";
  273. }else if(grd_goodlist.valueMatrix(i,0) == "●"){
  274. grd_goodlist.cellstyle("color", i, 0, i, 0) = "#0000FF";
  275. }else{
  276. grd_goodlist.cellstyle("color", i, 0, i, 0) = "#000000";
  277. }
  278. }
  279. model.refresh();*/
  280. }
  281. /* --------------------------------------------------*/
  282. /* type : function */
  283. /* access : public */
  284. /* desc : 수술실 물품 부서별 부서 재고 화면 변경 */
  285. /* param : */
  286. /* return : */
  287. /* --------------------------------------------------*/
  288. function fChangeDept(flag) {
  289. /*
  290. var deptflag = model.getValue("/root/main/cond/refdeptflag");//부서구분
  291. var nodeCnt = parseInt(getNodesetCount("/root/init/oproomlist"))+1;
  292. if( deptflag != "R" ) {//수술, 마취
  293. var scrwidth = ( nodeCnt * 49 ) + 14;
  294. if( nodeCnt > 25 ) {//수술방이 25개 이상이면 스크롤 바로 인해 크기 조절
  295. grd_oproomstoclist.attribute("style") = "left:144px; top:50px; width:1050px; height:89px; text-align:right;";
  296. }else {
  297. grd_oproomstoclist.attribute("style") = "left:144px; top:65px; width:" + scrwidth + "px; height:72px; text-align:right;";
  298. }
  299. var captionlist = "";
  300. if( nodeCnt != 0 ) {
  301. if( flag == "2" ) {//부서를 변경했을 때
  302. for(var i = 0; i <= nodeCnt; i++ ) {
  303. grd_oproomstoclist.removeColumn(false);;
  304. }
  305. }
  306. for(var i = 0; i <= nodeCnt; i++ ) { //수술방 갯수 만큼 컴럼을 만들고 cation을 만들어 준다.(CCR제외)
  307. grd_oproomstoclist.addColumn("ref:oproomnostoc" + i + "; type:input;", false);
  308. if( i == 4 ) {
  309. grd_oproomstoclist.colWidth(i) = 60;
  310. }else {
  311. grd_oproomstoclist.colWidth(i) = 49;
  312. }
  313. grd_oproomstoclist.colAttribute(i, "format") = "#.###";
  314. if( i == 0 ) {
  315. captionlist = model.getValue("/root/init/oproomlist[" + i + "]/oproomnm");
  316. }else if( i == 4 ){
  317. captionlist = captionlist + "^OR총재고";
  318. }else if( i < 4 ) {
  319. captionlist = captionlist + "^" + model.getValue("/root/init/oproomlist[" + i + "]/oproomnm");
  320. }else if( i > 4 ) {
  321. j = i - 1;
  322. captionlist = captionlist + "^" + model.getValue("/root/init/oproomlist[" + j + "]/oproomnm");
  323. }
  324. }
  325. grd_oproomstoclist.caption = captionlist;
  326. grd_oproomstoclist.addRow(false);
  327. }
  328. grd_oproomstoclist.deleteColumn(0);
  329. if( deptflag == "O" ) {//수술
  330. grd_oproomstoclist.colDisabled(3) = "ture";
  331. }else {
  332. for( var j = 0; j < 4; j++ ) {
  333. grd_oproomstoclist.colDisabled(j) = "ture";
  334. }
  335. }
  336. }else {
  337. grd_oproomstoclist.attribute("style") = "left:144px; top:65px; width:242px; height:72px; text-align:right;";
  338. if( nodeCnt != 0 ) {
  339. for(var i = 0; i <= nodeCnt; i++ ) {
  340. grd_oproomstoclist.removeColumn(false);;
  341. }
  342. for(var i = 1; i <= 4; i++ ) {
  343. grd_oproomstoclist.addColumn("ref:oproomnostoc" + i + "; type:input;", false);
  344. grd_oproomstoclist.colWidth(i-1) = 60;
  345. grd_oproomstoclist.colAttribute(i-1, "format") = "#.###";
  346. }
  347. grd_oproomstoclist.caption = "CCR^C-C^C-O^회복실";
  348. grd_oproomstoclist.addRow(false);
  349. for( var j = 0; j < 3; j++ ) {
  350. grd_oproomstoclist.colDisabled(j) = "ture";
  351. }
  352. }
  353. }
  354. model.refresh();*/
  355. }
  356. /* --------------------------------------------------*/
  357. /* type : function */
  358. /* access : public */
  359. /* desc : 수술실 물품 정보 저장 */
  360. /* param : */
  361. /* return : */
  362. /* --------------------------------------------------*/
  363. function fSaveGoodInfo() {
  364. var lrgcd, mdlcd, smlcd, cureflag, delivepriod, deliveyn, useflag, appdd, enddd;
  365. var anstlrgcd, anstmdlcd, anstsmlcd;
  366. lrgcd = model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd");
  367. mdlcd = model.getValue("/root/main/goodinfo/gooddetlinfo/mdlcd");
  368. smlcd = model.getValue("/root/main/goodinfo/gooddetlinfo/smlcd");
  369. anstlrgcd = model.getValue("/root/main/goodinfo/gooddetlinfo/anstlrgcd");
  370. anstmdlcd = model.getValue("/root/main/goodinfo/gooddetlinfo/anstmdlcd");
  371. anstsmlcd = model.getValue("/root/main/goodinfo/gooddetlinfo/anstsmlcd");
  372. prcpnm = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodnm");
  373. goodspec = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodspec");
  374. goodmodel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodmodel");
  375. custtel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel");
  376. cureflag = model.getValue("/root/main/goodinfo/gooddetlinfo/cureflag");
  377. delivepriod = model.getValue("/root/main/goodinfo/gooddetlinfo/delivepriod");
  378. deliveyn = model.getValue("/root/main/goodinfo/gooddetlinfo/deliveyn");
  379. useflag = model.getValue("/root/main/goodinfo/gooddetlinfo/useflag");
  380. appdd = model.getValue("/root/main/goodinfo/gooddetlinfo/appdd");
  381. enddd = model.getValue("/root/main/goodinfo/gooddetlinfo/enddd");
  382. rgstflag = model.getValue("/root/main/goodinfo/gooddetlinfo/rgstflag");
  383. var calcscorcd = model.getValue("/root/main/goodinfo/gooddetlinfo/calcscorcd");
  384. var insuyn = model.getValue("/root/main/goodinfo/gooddetlinfo/insuyn");
  385. if( insuyn == "Y"&&calcscorcd == "" ) {
  386. if( messageBox("수가등록 대상 물품이나 등록이 안된 물품입니다. 계속 진행하시겠습니까?", "Q000") != 6 ) { return; }
  387. }
  388. if( lrgcd == "" && anstlrgcd == "" ) {
  389. messageBox("대분류를 선택하지 ", "E007");
  390. model.setFocus("cmb_lrg");
  391. return;
  392. }else if( mdlcd == "" && anstmdlcd == "" ) {
  393. messageBox("중분류를 선택하지 ", "E007");
  394. model.setFocus("cmb_mdl");
  395. return;
  396. }else if( prcpnm.length > 400 ) {
  397. messageBox("물품명은 400자 이하 ", "E008");
  398. model.setFocus("ipt_prcpnm");
  399. return;
  400. }else if( goodspec.length > 150 ) {
  401. messageBox("규격은 150자 이하 ", "E008");
  402. model.setFocus("ipt_goodspec");
  403. return;
  404. }else if( goodmodel.length > 150 ) {
  405. messageBox("모델은 150자 이하 ", "E008");
  406. model.setFocus("ipt_goodmodel");
  407. return;
  408. }else if( custtel.length > 13 ) {
  409. messageBox("업체전화번호는 13자 이하 ", "E008");
  410. model.setFocus("ipt_custtel");
  411. return;
  412. }else if( cureflag == "" ) {
  413. messageBox("처방구분를 선택하지 ", "E007");
  414. model.setFocus("rdo_cureflag");
  415. return;
  416. }else if( delivepriod == "" ) {
  417. messageBox("불출시기를 선택하지 ", "E007");
  418. model.setFocus("rdo_ccrdelivepriod");
  419. return;
  420. }else if( deliveyn == "" ) {
  421. messageBox("불출여부를 선택하지 ", "E007");
  422. model.setFocus("rdo_deliveyn");
  423. return;
  424. }else if( appdd == "" ) {
  425. messageBox("적용일자를 선택하지 ", "E007");
  426. model.setFocus("ipt_appdd");
  427. return;
  428. }else if( enddd == "" ) {
  429. messageBox("종료일자를 선택하지 ", "E007");
  430. model.setFocus("ipt_enddd");
  431. return;
  432. }
  433. model.removenode("/root/send");
  434. model.makeNode("/root/send/savedata");
  435. model.copyNode("/root/send/savedata", "/root/main/goodinfo/gooddetlinfo");
  436. model.makeValue("/root/send/savedata/refdept", model.getValue("/root/main/cond/refdept"));
  437. if( rgstflag == "E" ) {//단종이면 미사용으로 셋팅
  438. model.setValue("/root/send/savedata/rgstflag", "U");
  439. }
  440. if( submit("TXMNP04401") ) {
  441. model.removeNodeset("/root/main/goodinfo/gooddetlinfo");
  442. var pFlag = "2";//트리 조회로 트리 조회가 아니더라도 검색명이 있음.2009.04.07
  443. fSearch(pFlag);
  444. }
  445. }
  446. /* --------------------------------------------------*/
  447. /* type : function */
  448. /* access : public */
  449. /* desc : 수술실 물품 정보 저장(일괄) */
  450. /* param : */
  451. /* return : */
  452. /* --------------------------------------------------*/
  453. function fSaveBatchGoodInfo() {
  454. var lrgcd, mdlcd, smlcd, cureflag, delivepriod, deliveyn, useflag, appdd, enddd, goodcd, allsizespecid, goodspec, goodmodel, stat;
  455. var savelist = "goodcd▦allsizespecid▦lrgcd▦mdlcd▦smlcd▦rgstflag▦ccrgoodnm▦prcpunit▦prcpqty▦ccrcusttel▦deliveunit▦deliveqty▦goodmngt▦implant▦cureflag▦delivepriod▦deliveyn▦useflag▦acmlbaseqty▦ccrdeliveunit▦ccrdeliveqty▦goodinfo▦appdd▦enddd▦prcpinfo▦indexlrg▦indexmdl▦indexsml▦refdept▦stat▦opmn";
  456. lrgcd = model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd");
  457. mdlcd = model.getValue("/root/main/goodinfo/gooddetlinfo/mdlcd");
  458. smlcd = model.getValue("/root/main/goodinfo/gooddetlinfo/smlcd");
  459. prcpnm = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodnm");
  460. goodspec = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodspec");
  461. goodmodel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodmodel");
  462. custtel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel");
  463. cureflag = model.getValue("/root/main/goodinfo/gooddetlinfo/cureflag");
  464. delivepriod = model.getValue("/root/main/goodinfo/gooddetlinfo/delivepriod");
  465. deliveyn = model.getValue("/root/main/goodinfo/gooddetlinfo/deliveyn");
  466. useflag = model.getValue("/root/main/goodinfo/gooddetlinfo/useflag");
  467. appdd = model.getValue("/root/main/goodinfo/gooddetlinfo/appdd");
  468. enddd = model.getValue("/root/main/goodinfo/gooddetlinfo/enddd");
  469. var calcscorcd = model.getValue("/root/main/goodinfo/gooddetlinfo/calcscorcd");
  470. var insuyn = model.getValue("/root/main/goodinfo/gooddetlinfo/insuyn");
  471. if( insuyn == "Y"&&calcscorcd == "" ) {
  472. if( messageBox("수가등록 대상 물품이나 등록이 안된 물품입니다. 계속 진행하시겠습니까?", "Q000") != 6 ) { return; }
  473. }
  474. rgstflag = model.getValue("/root/main/goodinfo/gooddetlinfo/rgstflag");
  475. if( rgstflag == "E" ) {//단종이면 미사용으로 셋팅
  476. model.setValue("/root/send/savedata/rgstflag", "U");
  477. }
  478. if( lrgcd == "" ) {
  479. messageBox("대분류를 선택하지 ", "E007");
  480. model.setFocus("cmb_lrg");
  481. return;
  482. }else if( mdlcd == "" ) {
  483. messageBox("중분류를 선택하지 ", "E007");
  484. model.setFocus("cmb_mdl");
  485. return;
  486. }else if( prcpnm.length > 400 ) {
  487. messageBox("물품명은 400자 이하 ", "E008");
  488. model.setFocus("ipt_prcpnm");
  489. return;
  490. }else if( goodspec.length > 150 ) {
  491. messageBox("규격은 150자 이하 ", "E008");
  492. model.setFocus("ipt_goodspec");
  493. return;
  494. }else if( goodmodel.length > 150 ) {
  495. messageBox("모델은 150자 이하 ", "E008");
  496. model.setFocus("ipt_goodmodel");
  497. return;
  498. }else if( custtel.length > 13 ) {
  499. messageBox("업체전화번호는 13자 이하 ", "E008");
  500. model.setFocus("ipt_custtel");
  501. return;
  502. }else if( cureflag == "" ) {
  503. messageBox("처방구분를 선택하지 ", "E007");
  504. model.setFocus("rdo_cureflag");
  505. return;
  506. }else if( delivepriod == "" ) {
  507. messageBox("불출시기를 선택하지 ", "E007");
  508. model.setFocus("rdo_ccrdelivepriod");
  509. return;
  510. }else if( deliveyn == "" ) {
  511. messageBox("불출여부를 선택하지 ", "E007");
  512. model.setFocus("rdo_deliveyn");
  513. return;
  514. }else if( appdd == "" ) {
  515. messageBox("적용일자를 선택하지 ", "E007");
  516. model.setFocus("ipt_appdd");
  517. return;
  518. }else if( enddd == "" ) {
  519. messageBox("종료일자를 선택하지 ", "E007");
  520. model.setFocus("ipt_enddd");
  521. return;
  522. }
  523. model.removenode("/root/send");
  524. model.makeNode("/root/send/savedata");
  525. for( var i = 0; i < grd_goodlist.rows; i++ ) {
  526. if( model.getValue("/root/main/goodlist[" + i + "]/chkflag") == "true" ) {
  527. //if( model.getValue("/root/main/goodlist[" + i + "]/rgstyn") == "N" ) {//등록안된것만 등록
  528. goodcd = model.getValue("/root/main/goodlist[" + i + "]/goodcd");
  529. allsizespecid = model.getValue("/root/main/goodlist[" + i + "]/allsizespecid");
  530. if( model.getValue("/root/main/goodlist[" + i + "]/rgstyn") == "N" ) {
  531. stat = "I";
  532. }else {
  533. stat = "U";
  534. }
  535. savelist = savelist + "▩" + goodcd
  536. + "▦" + allsizespecid
  537. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd")
  538. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/mdlcd")
  539. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/smlcd")
  540. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/rgstflag")
  541. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodnm")
  542. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/prcpunit")
  543. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/prcpqty")
  544. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel")
  545. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/deliveunit")
  546. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/deliveqty")
  547. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/goodmngt")
  548. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/implant")
  549. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/cureflag")
  550. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/delivepriod")
  551. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/deliveyn")
  552. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/useflag")
  553. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/acmlbaseqty")
  554. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/ccrdeliveunit")
  555. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/ccrdeliveqty")
  556. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/goodinfo")
  557. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/appdd")
  558. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/enddd")
  559. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/prcpinfo")
  560. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/indexlrg")
  561. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/indexmdl")
  562. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/indexsml")
  563. + "▦" + model.getValue("/root/main/cond/refdept")
  564. + "▦" + stat
  565. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/opmn");
  566. }
  567. //}
  568. }
  569. model.setValue("/root/send/savedata", savelist);
  570. if( submit("TXMNP04402") ) {
  571. model.removeNodeset("/root/main/goodinfo/gooddetlinfo");
  572. fBatchSearch();
  573. }
  574. }
  575. /* function fSaveGoodInfo(){
  576. var deptflag = "";
  577. var opuseyn = "", anstuseyn = "", recovruseyn = "", opuseynstat = "", anstuseynstat = "", recovruseynstat = "";
  578. var oldopuseyn = "", oldanstuseyn = "", oldrecovruseyn = "";
  579. var endgood = model.getValue("/root/main/goodinfo/gooddetlinfo/useflag");
  580. var deptflag1 = model.getValue("/root/temp/deptflag1");
  581. var deptflagCnt = deptflag1.length;
  582. var refdeptflag = model.getValue("/root/main/cond/refdeptflag");
  583. oldopuseyn = model.getValue("/root/main/goodinfo/gooddetlinfo/opuseyn");
  584. oldanstuseyn = model.getValue("/root/main/goodinfo/gooddetlinfo/anstuseyn");
  585. oldrecovruseyn = model.getValue("/root/main/goodinfo/gooddetlinfo/recovruseyn");
  586. //1:수술, 2:마취, 3:회복, 4:수술/마취, 5:수술/회복, 6:마취/회복, 7:수술/마취/회복
  587. switch(deptflag1) {
  588. case "1"://수술
  589. if( refdeptflag == "O" ) {//수술
  590. deptflag = "1";
  591. opuseyn = "Y";
  592. anstuseyn = "N";
  593. recovruseyn = "N";
  594. }else if( refdeptflag == "A" ) {//수술/마취
  595. deptflag = "4";
  596. opuseyn = "Y";
  597. anstuseyn = "Y";
  598. recovruseyn = "N";
  599. }else if( refdeptflag == "R" ) {//수술/회복
  600. deptflag = "5";
  601. opuseyn = "Y";
  602. anstuseyn = "N";
  603. recovruseyn = "Y";
  604. }
  605. break;
  606. case "2"://마취
  607. if( refdeptflag == "O" ) {//수술/마취
  608. deptflag = "4";
  609. opuseyn = "Y";
  610. anstuseyn = "Y";
  611. recovruseyn = "N";
  612. }else if( refdeptflag == "A" ) {//마취
  613. deptflag = "2";
  614. opuseyn = "N";
  615. anstuseyn = "Y";
  616. recovruseyn = "N";
  617. }else if( refdeptflag == "R" ) {//마취/회복
  618. deptflag = "6";
  619. opuseyn = "N";
  620. anstuseyn = "Y";
  621. recovruseyn = "Y";
  622. }
  623. break;
  624. case "3"://회복
  625. if( refdeptflag == "O" ) {//수술/회복
  626. deptflag = "5";
  627. opuseyn = "Y";
  628. anstuseyn = "N";
  629. recovruseyn = "Y";
  630. }else if( refdeptflag == "A" ) {//마취/회복
  631. deptflag = "6";
  632. opuseyn = "N";
  633. anstuseyn = "Y";
  634. recovruseyn = "Y";
  635. }else if( refdeptflag == "R" ) {//회복
  636. deptflag = "3";
  637. opuseyn = "N";
  638. anstuseyn = "N";
  639. recovruseyn = "Y";
  640. }
  641. break;
  642. case "1 2"://수술, 마취
  643. if( refdeptflag == "O" ) {//수술/마취
  644. deptflag = "4";
  645. opuseyn = "Y";
  646. anstuseyn = "Y";
  647. recovruseyn = "N";
  648. }else if( refdeptflag == "A" ) {//수술/마취
  649. deptflag = "4";
  650. opuseyn = "Y";
  651. anstuseyn = "Y";
  652. recovruseyn = "N";
  653. }else if( refdeptflag == "R" ) {//회복
  654. deptflag = "7";
  655. opuseyn = "Y";
  656. anstuseyn = "Y";
  657. recovruseyn = "Y";
  658. }
  659. break;
  660. case "2 1"://마취, 수술
  661. if( refdeptflag == "O" ) {//수술/마취
  662. deptflag = "4";
  663. opuseyn = "Y";
  664. anstuseyn = "Y";
  665. recovruseyn = "N";
  666. }else if( refdeptflag == "A" ) {//수술/마취
  667. deptflag = "4";
  668. opuseyn = "Y";
  669. anstuseyn = "Y";
  670. recovruseyn = "N";
  671. }else if( refdeptflag == "R" ) {//전체
  672. deptflag = "7";
  673. opuseyn = "Y";
  674. anstuseyn = "Y";
  675. recovruseyn = "Y";
  676. }
  677. break;
  678. case "2 3"://마취, 회복
  679. if( refdeptflag == "O" ) {//전체
  680. deptflag = "7";
  681. opuseyn = "Y";
  682. anstuseyn = "Y";
  683. recovruseyn = "Y";
  684. }else if( refdeptflag == "A" ) {//마취/회복
  685. deptflag = "6";
  686. opuseyn = "N";
  687. anstuseyn = "Y";
  688. recovruseyn = "Y";
  689. }else if( refdeptflag == "R" ) {//마취/회복
  690. deptflag = "6";
  691. opuseyn = "N";
  692. anstuseyn = "Y";
  693. recovruseyn = "Y";
  694. }
  695. break;
  696. case "3 2"://회복, 마취
  697. if( refdeptflag == "O" ) {//전체
  698. deptflag = "7";
  699. opuseyn = "Y";
  700. anstuseyn = "Y";
  701. recovruseyn = "Y";
  702. }else if( refdeptflag == "A" ) {//마취/회복
  703. deptflag = "6";
  704. opuseyn = "N";
  705. anstuseyn = "Y";
  706. recovruseyn = "Y";
  707. }else if( refdeptflag == "R" ) {//마취/회복
  708. deptflag = "6";
  709. opuseyn = "N";
  710. anstuseyn = "Y";
  711. recovruseyn = "Y";
  712. }
  713. break;
  714. case "1 3"://수술, 회복
  715. if( refdeptflag == "O" ) {//수술, 회복
  716. deptflag = "5";
  717. opuseyn = "Y";
  718. anstuseyn = "N";
  719. recovruseyn = "Y";
  720. }else if( refdeptflag == "A" ) {//전체
  721. deptflag = "7";
  722. opuseyn = "Y";
  723. anstuseyn = "Y";
  724. recovruseyn = "Y";
  725. }else if( refdeptflag == "R" ) {//수술, 회복
  726. deptflag = "5";
  727. opuseyn = "Y";
  728. anstuseyn = "N";
  729. recovruseyn = "Y";
  730. }
  731. break;
  732. case "3 1"://회복, 수술
  733. if( refdeptflag == "O" ) {//수술, 회복
  734. deptflag = "5";
  735. opuseyn = "Y";
  736. anstuseyn = "N";
  737. recovruseyn = "Y";
  738. }else if( refdeptflag == "A" ) {//전체
  739. deptflag = "7";
  740. opuseyn = "Y";
  741. anstuseyn = "Y";
  742. recovruseyn = "Y";
  743. }else if( refdeptflag == "R" ) {//수술, 회복
  744. deptflag = "5";
  745. opuseyn = "Y";
  746. anstuseyn = "N";
  747. recovruseyn = "Y";
  748. }
  749. break;
  750. case "1 2 3"://전체
  751. deptflag = "7";
  752. opuseyn = "Y";
  753. anstuseyn = "Y";
  754. recovruseyn = "Y";
  755. break;
  756. case "1 3 2"://전체
  757. deptflag = "7";
  758. opuseyn = "Y";
  759. anstuseyn = "Y";
  760. recovruseyn = "Y";
  761. break;
  762. case "2 1 3"://전체
  763. deptflag = "7";
  764. opuseyn = "Y";
  765. anstuseyn = "Y";
  766. recovruseyn = "Y";
  767. break;
  768. case "2 3 1"://전체
  769. deptflag = "7";
  770. opuseyn = "Y";
  771. anstuseyn = "Y";
  772. recovruseyn = "Y";
  773. break;
  774. case "3 1 2"://전체
  775. deptflag = "7";
  776. opuseyn = "Y";
  777. anstuseyn = "Y";
  778. recovruseyn = "Y";
  779. break;
  780. case "3 2 1":
  781. deptflag = "7";
  782. opuseyn = "Y";
  783. anstuseyn = "Y";
  784. recovruseyn = "Y";
  785. break;
  786. default :
  787. if( refdeptflag == "O" ) {//수술, 회복
  788. deptflag = "1";
  789. opuseyn = "Y";
  790. anstuseyn = "N";
  791. recovruseyn = "N";
  792. }else if( refdeptflag == "A" ) {//전체
  793. deptflag = "2";
  794. opuseyn = "N";
  795. anstuseyn = "Y";
  796. recovruseyn = "N";
  797. }else if( refdeptflag == "R" ) {//수술, 회복
  798. deptflag = "3";
  799. opuseyn = "N";
  800. anstuseyn = "N";
  801. recovruseyn = "Y";
  802. }
  803. break;
  804. }
  805. //수술
  806. if( ( oldopuseyn == "N" )&&( opuseyn == "Y" ) ) {//생성
  807. opuseynstat = "C";
  808. }else if( ( oldopuseyn == "Y" )&&( opuseyn == "Y" ) ) {//변경
  809. opuseynstat = "S";
  810. }else if( ( oldopuseyn == "Y" )&&( opuseyn == "N" ) ) {//미사용으로 전환
  811. opuseynstat = "U";
  812. opuseyn = "U";
  813. }else if( ( oldopuseyn == "U" )&&( opuseyn == "Y" ) ) {//사용으로 전환
  814. opuseynstat = "Z";
  815. }else {//등록안됨
  816. opuseynstat = "F";
  817. }
  818. if( endgood == "U" ){//미사용
  819. if( refdeptflag == "O" ) {
  820. opuseyn = "U";
  821. }else if( refdeptflag == "A" ) {
  822. anstuseyn = "U";
  823. }else if( refdeptflag == "R" ) {
  824. recovruseyn = "U";
  825. }
  826. }
  827. if( refdeptflag != "O") {//수술이 아니면 변경없음
  828. opuseynstat = "P";
  829. }
  830. //마취
  831. if( ( oldanstuseyn == "N" )&&( anstuseyn == "Y" ) ) {//생성
  832. anstuseynstat = "C";
  833. }else if( ( oldanstuseyn == "Y" )&&( anstuseyn == "Y" ) ) {//변경
  834. anstuseynstat = "S";
  835. }else if( ( oldanstuseyn == "Y" )&&( anstuseyn == "N" ) ) {//미사용으로 전환
  836. anstuseynstat = "U";
  837. anstuseyn = "U";//미사용으로 등록
  838. }else if( ( oldanstuseyn == "U" )&&( anstuseyn == "Y" ) ) {//사용으로 전환
  839. anstuseynstat = "Z";
  840. }else {
  841. anstuseynstat = "F";
  842. }
  843. if( refdeptflag != "A") {//마취가 아니면 변경없음
  844. anstuseynstat = "P";
  845. }
  846. //회복
  847. if( ( oldrecovruseyn == "N" )&&( recovruseyn == "Y" ) ) {//생성
  848. recovruseynstat = "C";
  849. }else if( ( oldrecovruseyn == "Y" )&&( recovruseyn == "Y" ) ) {//변경
  850. recovruseynstat = "S";
  851. }else if( ( oldrecovruseyn == "Y" )&&( recovruseyn == "N" ) ) {//미사용으로 전환
  852. recovruseynstat = "U";
  853. recovruseyn = "U";
  854. }else if( ( oldrecovruseyn == "U" )&&( recovruseyn == "Y" ) ) {//사용으로 전환
  855. recovruseynstat = "Z";
  856. }else {
  857. recovruseynstat = "F";
  858. }
  859. if( refdeptflag != "R") {//회복가 아니면 변경없음
  860. recovruseynstat = "P";
  861. }
  862. model.makeValue("/root/main/goodinfo/gooddetlinfo/refdeptflag", refdeptflag);
  863. model.makeValue("/root/main/goodinfo/gooddetlinfo/deptflag", deptflag); //수술:1, 마취:2, 회복:3, 수술/마취:4, 마취/회복:5, 수술/회복:6, 수술/마취/회복:7
  864. model.makeValue("/root/main/goodinfo/gooddetlinfo/opuseynstat", opuseynstat);
  865. model.makeValue("/root/main/goodinfo/gooddetlinfo/anstuseynstat", anstuseynstat);
  866. model.makeValue("/root/main/goodinfo/gooddetlinfo/recovruseynstat", recovruseynstat);
  867. model.setValue("/root/main/goodinfo/gooddetlinfo/opuseyn", opuseyn);
  868. model.setValue("/root/main/goodinfo/gooddetlinfo/anstuseyn", anstuseyn);
  869. model.setValue("/root/main/goodinfo/gooddetlinfo/recovruseyn", recovruseyn);
  870. var iNode = "/root/main/goodinfo/gooddetlinfo/";
  871. var cureflag, ccrcusttel, winflag, goodmngt, reuseflag, prcpalias, ccrmdl, goodexist, ccrdeptflag;
  872. cureflag = model.getValue( iNode + "cureflag");
  873. winflag = model.getValue( iNode + "winflag");
  874. reuseflag = model.getValue( iNode + "reuseflag");
  875. prcpalias = model.getValue( iNode + "prcpalias");
  876. ccrlrgcd = model.getValue( iNode + "ccrlrgcd");
  877. ccrmdlcd = model.getValue( iNode + "ccrmdlcd");
  878. goodexist = model.getValue( iNode + "goodexist");
  879. if( model.getValue("/root/main/cond/tabflag") != "PRC" ) {
  880. if( prcpalias == "" ){
  881. messageBox("처방명을 ", "C001");
  882. model.setFocus("ipt_prcpnm");
  883. return;
  884. }else if( prcpalias.length > 200 ){
  885. messageBox("처방명은 200자 이하 ", "E008");
  886. model.setFocus("ipt_prcpnm");
  887. return;
  888. }else if( cureflag == "" ) {
  889. messageBox("처치구분을 ", "C002");
  890. model.setFocus("cmb_cureflag");
  891. return;
  892. }else if( winflag == "" ) {
  893. messageBox("입고구분을 ", "C002");
  894. model.setFocus("cmb_winflag");
  895. return;
  896. }else if( reuseflag == "" ) {
  897. messageBox("재사용구분을 ", "C002");
  898. return;
  899. }else if( ccrlrgcd == "" ) {
  900. messageBox("대분류를 ", "C002");
  901. return;
  902. }else if( ccrmdlcd == "" ) {
  903. messageBox("중분류를 ", "C002");
  904. return;
  905. }else if( ( goodexist == "N" )&&( deptflag == "" ) ) {//등록안된 물품인데 부서 체크안하면
  906. messageBox("저장할 부서를 ", "C002");
  907. return;
  908. }else if( ( goodexist == "N" )&&( deptflag != "" ) ) {//등록안된 물품인데 조회 부서 체크안하면
  909. if( refdeptflag == "O" ){
  910. if( !(( deptflag == "1" )||( deptflag == "4" )||( deptflag == "6" )||( deptflag == "7" )) ) {
  911. messageBox("수술실을 선택하지 ", "E007");
  912. return;
  913. }
  914. }else if( refdeptflag == "A" ){
  915. if( !(( deptflag == "2" )||( deptflag == "4" )||( deptflag == "5" )||( deptflag == "7" )) ) {
  916. messageBox("마취과를 선택하지 ", "E007");
  917. return;
  918. }
  919. }else if( refdeptflag == "R" ){
  920. if( !(( deptflag == "3" )||( deptflag == "5" )||( deptflag == "6" )||( deptflag == "7" )) ) {
  921. messageBox("회복실을 선택하지 ", "E007");
  922. return;
  923. }
  924. }
  925. }
  926. }else {
  927. var prcpclscd = model.getValue("/root/main/goodinfo/gooddetlinfo/prcpclscd");//처방 구분
  928. if( ( prcpclscd == "M2" )||( prcpclscd == "A2" )||( prcpclscd == "A4" )||( prcpclscd == "A6" )||( prcpclscd == "I4" ) ) {//재료, 경구, 외용, 주사, 마취약
  929. if( prcpalias == "" ){
  930. messageBox("처방명을 ", "C001");
  931. model.setFocus("ipt_prcpnm");
  932. return;
  933. }else if( prcpalias.length > 200 ){
  934. messageBox("처방명은 200자 이하 ", "E008");
  935. model.setFocus("ipt_prcpnm");
  936. return;
  937. }else if( cureflag == "" ) {
  938. messageBox("처치구분을 ", "C002");
  939. model.setFocus("cmb_cureflag");
  940. return;
  941. }else if( winflag == "" ) {
  942. messageBox("입고구분을 ", "C002");
  943. model.setFocus("cmb_winflag");
  944. return;
  945. }else if( reuseflag == "" ) {
  946. messageBox("재사용구분을 ", "C002");
  947. return;
  948. }else if( ccrlrgcd == "" ) {
  949. messageBox("대분류를 ", "C002");
  950. return;
  951. }else if( ccrmdlcd == "" ) {
  952. messageBox("중분류를 ", "C002");
  953. return;
  954. }else if( ( goodexist == "N" )&&( deptflag == "" ) ) {//등록안된 물품인데 부서 체크안하면
  955. messageBox("저장할 부서를 ", "C002");
  956. return;
  957. }else if( ( goodexist == "N" )&&( deptflag != "" ) ) {//등록안된 물품인데 조회 부서 체크안하면
  958. if( refdeptflag == "O" ){
  959. if( !(( deptflag == "1" )||( deptflag == "4" )||( deptflag == "6" )||( deptflag == "7" )) ) {
  960. messageBox("수술실을 선택하지 ", "E007");
  961. return;
  962. }
  963. }else if( refdeptflag == "A" ){
  964. if( !(( deptflag == "2" )||( deptflag == "4" )||( deptflag == "5" )||( deptflag == "7" )) ) {
  965. messageBox("마취과를 선택하지 ", "E007");
  966. return;
  967. }
  968. }else if( refdeptflag == "R" ){
  969. if( !(( deptflag == "3" )||( deptflag == "5" )||( deptflag == "6" )||( deptflag == "7" )) ) {
  970. messageBox("회복실을 선택하지 ", "E007");
  971. return;
  972. }else if( cureflag == "" ) {
  973. messageBox("처치구분을 ", "C002");
  974. model.setFocus("cmb_cureflag");
  975. return;
  976. }
  977. }
  978. }
  979. }else {//처방 탭에서 물품, 약이 아닌 물품들(처치 처방종류)
  980. if( prcpalias.length > 200 ){
  981. messageBox("처방명은 200자 이하 ", "E008");
  982. model.setFocus("ipt_prcpnm");
  983. return;
  984. }else if( cureflag == "" ) {
  985. messageBox("처치구분을 ", "C002");
  986. model.setFocus("cmb_cureflag");
  987. return;
  988. }else if( ccrlrgcd == "" ) {
  989. messageBox("대분류를 ", "C002");
  990. return;
  991. }else if( ccrmdlcd == "" ) {
  992. messageBox("중분류를 ", "C002");
  993. return;
  994. }else if( ( goodexist == "N" )&&( deptflag == "" ) ) {//등록안된 물품인데 부서 체크안하면
  995. messageBox("저장할 부서를 ", "C002");
  996. return;
  997. }else if( ( goodexist == "N" )&&( deptflag != "" ) ) {//등록안된 물품인데 조회 부서 체크안하면
  998. if( refdeptflag == "O" ){
  999. if( !(( deptflag == "1" )||( deptflag == "4" )||( deptflag == "6" )||( deptflag == "7" )) ) {
  1000. messageBox("수술실을 선택하지 ", "E007");
  1001. return;
  1002. }
  1003. }else if( refdeptflag == "A" ){
  1004. if( !(( deptflag == "2" )||( deptflag == "4" )||( deptflag == "5" )||( deptflag == "7" )) ) {
  1005. messageBox("마취과를 선택하지 ", "E007");
  1006. return;
  1007. }
  1008. }else if( refdeptflag == "R" ){
  1009. if( !(( deptflag == "3" )||( deptflag == "5" )||( deptflag == "6" )||( deptflag == "7" )) ) {
  1010. messageBox("회복실을 선택하지 ", "E007");
  1011. return;
  1012. }else if( cureflag == "" ) {
  1013. messageBox("처치구분을 ", "C002");
  1014. model.setFocus("cmb_cureflag");
  1015. return;
  1016. }
  1017. }
  1018. }
  1019. }
  1020. }
  1021. var oproomcd, safestocqty, stocqty, goodcd, allsizespecid, refdeptflag;
  1022. var nodeCnt = parseInt(getNodesetCount("/root/init/oproomlist"))+1;
  1023. var oproomstoclist = "oproomcd▦safestocqty▦stocqty▦goodcd▦allsizespecid▦refdeptflag";
  1024. goodcd = model.getValue("/root/main/goodinfo/gooddetlinfo/goodcd");
  1025. allsizespecid = model.getValue("/root/main/goodinfo/gooddetlinfo/allsizespecid");
  1026. for( var j = 1; j < nodeCnt; j++) {
  1027. oproomcd = model.getValue("/root/init/oproomlist["+j+"]/oproomcd");
  1028. if( j < 4 ) {//OR총재고를 제외하기 위해
  1029. if( refdeptflag == "O" ) {//수술이면 CCR, Clean-Zone, OR(창고) 포함
  1030. safestocqty = model.getValue("/root/temp/oproomstoclist/oproomnostoc"+j);
  1031. stocqty = model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j);
  1032. refdeptflag = "O";//CCR, Clean-Zone, OR(창고)수술실에서만 관리
  1033. oproomstoclist = oproomstoclist + "▩"
  1034. + oproomcd + "▦"
  1035. + safestocqty + "▦"
  1036. + stocqty + "▦"
  1037. + goodcd + "▦"
  1038. + allsizespecid + "▦"
  1039. + refdeptflag;
  1040. }else if( refdeptflag == "A" ) {//마취면
  1041. if( (oldopuseyn == "N")&&(oldrecovruseyn == "N")) {
  1042. safestocqty = model.getValue("/root/temp/oproomstoclist/oproomnostoc"+j);
  1043. stocqty = model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j);
  1044. refdeptflag = "O";//CCR, Clean-Zone, OR(창고)수술실에서만 관리
  1045. oproomstoclist = oproomstoclist + "▩"
  1046. + oproomcd + "▦"
  1047. + safestocqty + "▦"
  1048. + stocqty + "▦"
  1049. + goodcd + "▦"
  1050. + allsizespecid + "▦"
  1051. + refdeptflag;
  1052. }
  1053. }else if( refdeptflag == "R" ) {//회복이면
  1054. if( (oldopuseyn == "N")&&(oldanstuseyn == "N")) {
  1055. safestocqty = model.getValue("/root/temp/oproomstoclist/oproomnostoc"+j);
  1056. stocqty = model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j);
  1057. refdeptflag = "O";//CCR, Clean-Zone, OR(창고)수술실에서만 관리
  1058. oproomstoclist = oproomstoclist + "▩"
  1059. + oproomcd + "▦"
  1060. + safestocqty + "▦"
  1061. + stocqty + "▦"
  1062. + goodcd + "▦"
  1063. + allsizespecid + "▦"
  1064. + refdeptflag;
  1065. }
  1066. }
  1067. }else {
  1068. safestocqty = model.getValue("/root/temp/oproomstoclist/oproomnostoc"+(j+1));
  1069. stocqty = model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+(j+1));
  1070. refdeptflag = model.getValue("/root/main/cond/refdeptflag");
  1071. oproomstoclist = oproomstoclist + "▩"
  1072. + oproomcd + "▦"
  1073. + safestocqty + "▦"
  1074. + stocqty + "▦"
  1075. + goodcd + "▦"
  1076. + allsizespecid + "▦"
  1077. + refdeptflag;
  1078. }
  1079. model.setValue("/root/temp/oproomstoclist/oproomnostoc"+j, ""); //수술방 안전재고 instance 초기화
  1080. model.setValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j, "");//수술방 재고 instance 초기화
  1081. }
  1082. var custtel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel");
  1083. if( custtel != "" ) {
  1084. if( custtel.length < 10 ) {
  1085. messageBox("거래처 전화번호를 정확히 입력하세요!", "");
  1086. model.setFocus("ipt_custtel");
  1087. return;
  1088. }
  1089. var custteltemp = custtel.split("-");
  1090. var tellen = custteltemp.length;
  1091. if( tellen > 1 ) {//'-'입력시
  1092. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custteltemp[0]+""+custteltemp[1]+""+custteltemp[2]);
  1093. }else {
  1094. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custteltemp[0]);
  1095. }
  1096. }
  1097. model.copyNode("/root/send/reqdata", "/root/main/goodinfo/gooddetlinfo");
  1098. model.setValue("/root/send/senddata", oproomstoclist);
  1099. if( endgood == "N" ) {
  1100. messageBox("단종된 물품은 저장할 수 ", "I004");
  1101. }else {
  1102. submit("TXMNP04401");
  1103. }
  1104. model.removenode("/root/main/goodinfo/goodstocinfo/refdeptflag");
  1105. model.setValue("/root/main/cond/deptflag", "");
  1106. model.setValue("/root/temp/deptflag1", "");
  1107. model.setValue("/root/temp/deptflag1", "");
  1108. model.resetInstanceNode("/root/main/goodinfo");
  1109. model.setValue("/root/main/cond/ccrlrgcd", "");
  1110. model.setValue("/root/main/cond/ccrmdlcd", "");
  1111. model.copyNode("/root/send/reqdata", "/root/main/cond");
  1112. submit("TRMNP04401");//저장 후 재조회
  1113. btn_save.disabled = true;
  1114. }*/
  1115. /* --------------------------------------------------*/
  1116. /* type : function */
  1117. /* access : public */
  1118. /* desc : 수술실 물품 상세 정보 조회 */
  1119. /* param : */
  1120. /* return : */
  1121. /* --------------------------------------------------*/
  1122. function fBatchDblClick(){
  1123. model.removenode("/root/send");
  1124. model.makeValue("/root/send/reqdata/goodcd", opener.javascript.getParameter("goodcd"));
  1125. model.makeValue("/root/send/reqdata/allsizespecid", opener.javascript.getParameter("allsizespecid"));
  1126. model.makeValue("/root/send/reqdata/refdeptflag", opener.javascript.getParameter("refdeptflag"));
  1127. model.makeValue("/root/send/reqdata/refdept", opener.javascript.getParameter("refdept"));
  1128. submit("TRMNP04402", false);
  1129. //대, 중분류에 따른 콤보 조회
  1130. if( model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd") != "" ) {
  1131. model.resetInstanceNode("/root/temp/mdllist");
  1132. model.resetInstanceNode("/root/temp/smllist");
  1133. //model.setValue("/root/main/goodinfo/gooddetlinfo/mdlcd", "");
  1134. //model.setValue("/root/main/goodinfo/gooddetlinfo/smlcd", "");
  1135. model.removenode("/root/send");
  1136. model.makeNode("/root/send/reqdata");
  1137. model.copyNode("/root/send/reqdata", "/root/main/cond");
  1138. model.makeValue("/root/send/reqdata/tabflag", "CCR");
  1139. model.makeValue("/root/send/reqdata/ccrlrgcd", model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd"));
  1140. submit("TRMNP04409");
  1141. }
  1142. if( model.getValue("/root/main/goodinfo/gooddetlinfo/mdlcd") != "" ) {
  1143. model.resetInstanceNode("/root/temp/smllist");
  1144. model.removenode("/root/send");
  1145. model.makeNode("/root/send/reqdata");
  1146. model.copyNode("/root/send/reqdata", "/root/main/cond");
  1147. model.makeValue("/root/send/reqdata/tabflag", "CCR");
  1148. model.makeValue("/root/send/reqdata/ccrlrgcd", model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd"));
  1149. model.makeValue("/root/send/reqdata/ccrmdlcd", model.getValue("/root/main/goodinfo/gooddetlinfo/mdlcd"));
  1150. submit("TRMNP04410");
  1151. }
  1152. model.refresh();
  1153. }
  1154. /* --------------------------------------------------*/
  1155. /* type : function */
  1156. /* access : public */
  1157. /* desc : 수술실 물품 상세 정보 조회 */
  1158. /* param : */
  1159. /* return : */
  1160. /* --------------------------------------------------*/
  1161. function fDblClick(){
  1162. model.removenode("/root/send");
  1163. model.makeValue("/root/send/reqdata/goodcd", model.getValue("/root/main/goodlist[" + grd_goodlist.row + "]/goodcd"));
  1164. model.makeValue("/root/send/reqdata/allsizespecid", model.getValue("/root/main/goodlist[" + grd_goodlist.row + "]/allsizespecid"));
  1165. model.makeValue("/root/send/reqdata/refdeptflag", model.getValue("/root/main/cond/refdeptflag"));
  1166. model.makeValue("/root/send/reqdata/refdept", model.getValue("/root/main/cond/refdept"));
  1167. // 20100913_laboru_경북대병원_부서구분을 선택해야만 물품 기본정보 등록 부분에 조회가 되도록.
  1168. var tmprefdept = model.getValue("/root/main/cond/refdept");
  1169. if(tmprefdept == "W") {
  1170. messageBox("부서구분을 선택하세요..!", "E000");
  1171. } else {
  1172. if(tmprefdept == "A") {
  1173. cmb_lrg.visible = false;
  1174. cmb_mdl.visible = false;
  1175. cmb_sml.visible = false;
  1176. cmb_anstlrgcd.visible = true;
  1177. cmb_anstmdlcd.visible = true;
  1178. cmb_anstsmlcd.visible = true;
  1179. } else {
  1180. cmb_lrg.visible = true;
  1181. cmb_mdl.visible = true;
  1182. cmb_sml.visible = true;
  1183. cmb_anstlrgcd.visible = false;
  1184. cmb_anstmdlcd.visible = false;
  1185. cmb_anstsmlcd.visible = false;
  1186. }
  1187. submit("TRMNP04402", false);
  1188. var calcscorcd = model.getValue("/root/main/goodinfo/gooddetlinfo/calcscorcd");
  1189. //var edicd = model.getValue("/root/main/goodinfo/gooddetlinfo/edicd");
  1190. var insuyn = model.getValue("/root/main/goodinfo/gooddetlinfo/insuyn");
  1191. if( insuyn == "Y"&&calcscorcd == "" ) {
  1192. messageBox("수가등록 대상 물품이나 등록이 안된 물품입니다. 수가팀에 확인하세요.!", "E000");
  1193. }
  1194. var mngtflag = model.getValue("/root/main/goodinfo/gooddetlinfo/mngtflag");//SET구분
  1195. if( mngtflag == "S" ) {
  1196. rdo_chargeflag.disabled = "false";
  1197. }else {
  1198. rdo_chargeflag.disabled = "true";
  1199. }
  1200. //대, 중분류에 따른 콤보 조회
  1201. var lrgcd;
  1202. var mdlcd;
  1203. if(tmprefdept == "A") {
  1204. lrgcd = model.getValue("/root/main/goodinfo/gooddetlinfo/anstlrgcd");
  1205. mdlcd = model.getValue("/root/main/goodinfo/gooddetlinfo/anstmdlcd");
  1206. } else {
  1207. lrgcd = model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd");
  1208. mdlcd = model.getValue("/root/main/goodinfo/gooddetlinfo/mdlcd");
  1209. }
  1210. if( lrgcd != "" ) {
  1211. model.resetInstanceNode("/root/temp/mdllist");
  1212. model.resetInstanceNode("/root/temp/smllist");
  1213. model.removenode("/root/send");
  1214. model.makeNode("/root/send/reqdata");
  1215. model.copyNode("/root/send/reqdata", "/root/main/cond");
  1216. model.makeValue("/root/send/reqdata/tabflag", "CCR");
  1217. model.makeValue("/root/send/reqdata/ccrlrgcd", lrgcd);
  1218. submit("TRMNP04409");
  1219. }
  1220. if( mdlcd != "" ) {
  1221. model.resetInstanceNode("/root/temp/smllist");
  1222. model.removenode("/root/send");
  1223. model.makeNode("/root/send/reqdata");
  1224. model.copyNode("/root/send/reqdata", "/root/main/cond");
  1225. model.makeValue("/root/send/reqdata/tabflag", "CCR");
  1226. model.makeValue("/root/send/reqdata/ccrlrgcd", lrgcd);
  1227. model.makeValue("/root/send/reqdata/ccrmdlcd", mdlcd);
  1228. submit("TRMNP04410");
  1229. }
  1230. if( model.getValue("/root/main/goodinfo/gooddetlinfo/deliveyn") == "Y" ) {
  1231. rdo_ccrdelivepriod.disabled = "true";
  1232. }else {
  1233. rdo_ccrdelivepriod.disabled = "false";
  1234. }
  1235. var custtel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel");
  1236. var tellen = custtel.length;
  1237. var custteltemp = custtel.substring(0, 2);
  1238. //전화번호 '-'로 구분 표시
  1239. if( tellen != 0 ) {//번호가 있을때
  1240. if( custteltemp == "01" ) {//휴대폰
  1241. if( tellen == 11 ) {
  1242. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,4)+"-"+custtel.substr(7,4));
  1243. }else {
  1244. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,3)+"-"+custtel.substr(6,4));
  1245. }
  1246. }else {
  1247. if( custteltemp == "02" ) {//서울
  1248. if( tellen == 10 ) {
  1249. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,2)+"-"+custtel.substr(2,4)+"-"+custtel.substr(6,4));
  1250. }else {
  1251. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,2)+"-"+custtel.substr(2,3)+"-"+custtel.substr(5,4));
  1252. }
  1253. }else {//그 외
  1254. if( tellen == 10 ) {
  1255. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,3)+"-"+custtel.substr(6,4));
  1256. }else {
  1257. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,4)+"-"+custtel.substr(7,4));
  1258. }
  1259. }
  1260. }
  1261. }
  1262. model.refresh();
  1263. }
  1264. /*
  1265. var iRow = -1;
  1266. if( idx == 1 ) {//구매 조회일때
  1267. iRow = grd_goodlist.row;
  1268. }else if( idx == 2 ) {//CCR 조회일때
  1269. iRow = grd_goodlist2.row;
  1270. }else if( idx == 3 ) {//처방 조회
  1271. iRow = grd_goodlist3.row;
  1272. }
  1273. if(iRow < 1)
  1274. {
  1275. return;
  1276. }else {
  1277. model.makeValue("/root/send/reqdata/goodcd", model.getValue("/root/main/goodlist"+"["+iRow+"]/goodcd"));
  1278. model.makeValue("/root/send/reqdata/allsizespecid", model.getValue("/root/main/goodlist"+"["+iRow+"]/allsizespecid"));
  1279. model.makeValue("/root/send/reqdata/endgood", model.getValue("/root/main/goodlist"+"["+iRow+"]/endgood"));
  1280. submit("TRMNP04402", false);
  1281. var totalSafeCnt = 0;
  1282. var totaStocCnt = 0;
  1283. var custtel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel");
  1284. var tellen = custtel.length;
  1285. var custteltemp = custtel.substring(0, 2);
  1286. //전화번호 '-'로 구분 표시
  1287. if( tellen != 0 ) {//번호가 있을때
  1288. if( custteltemp == "01" ) {//휴대폰
  1289. if( tellen == 11 ) {
  1290. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,4)+"-"+custtel.substr(7,4));
  1291. }else {
  1292. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,3)+"-"+custtel.substr(6,4));
  1293. }
  1294. }else {
  1295. if( custteltemp == "02" ) {//서울
  1296. if( tellen == 10 ) {
  1297. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,2)+"-"+custtel.substr(2,4)+"-"+custtel.substr(6,4));
  1298. }else {
  1299. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,2)+"-"+custtel.substr(2,3)+"-"+custtel.substr(5,4));
  1300. }
  1301. }else {//그 외
  1302. if( tellen == 10 ) {
  1303. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,3)+"-"+custtel.substr(6,4));
  1304. }else {
  1305. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,4)+"-"+custtel.substr(7,4));
  1306. }
  1307. }
  1308. }
  1309. }
  1310. //수술:1, 마취:2, 회복:3, 수술/마취:4, 마취/회복:5, 수술/회복:6, 수술/마취/회복:7
  1311. var deptflag = model.getValue("/root/main/goodinfo/gooddetlinfo/deptflag") ;
  1312. switch( deptflag ) {
  1313. case "1":
  1314. model.setValue("/root/temp/deptflag1", "1");
  1315. break;
  1316. case "2":
  1317. model.setValue("/root/temp/deptflag1", "2");
  1318. break;
  1319. case "3":
  1320. model.setValue("/root/temp/deptflag1", "3");
  1321. break;
  1322. case "4":
  1323. model.setValue("/root/temp/deptflag1", "1 2");
  1324. break;
  1325. case "5":
  1326. model.setValue("/root/temp/deptflag1", "2 3");
  1327. break;
  1328. case "6":
  1329. model.setValue("/root/temp/deptflag1", "1 3");
  1330. break;
  1331. case "7":
  1332. model.setValue("/root/temp/deptflag1", "1 2 3");
  1333. break;
  1334. }
  1335. if( model.getValue("/root/main/goodinfo/gooddetlinfo/ccrdeliveyn") == "Y" ) {
  1336. ccrdelivepriod.disabled = "true";
  1337. }else {
  1338. ccrdelivepriod.disabled = "false";
  1339. }
  1340. if( model.getValue("/root/main/goodinfo/gooddetlinfo/ccrlrgcd") != "" ) {
  1341. //대분류 값이 있으면
  1342. //물품 분류를 보여주기 위해 대분류로 중분류 조회 후 중분류값 대입
  1343. model.setValue("/root/main/cond/ccrlrgcd", model.getValue("/root/main/goodinfo/gooddetlinfo/ccrlrgcd"));
  1344. model.resetInstanceNode("/root/temp/mdllist");
  1345. model.resetInstanceNode("/root/temp/smllist");
  1346. var oldtabflag = model.getValue("/root/main/cond/tabflag");
  1347. if( oldtabflag != "CCR" ) {
  1348. model.setValue("/root/main/cond/tabflag", "CCR");
  1349. model.copyNode("/root/send/reqdata", "/root/main/cond");
  1350. submit("TRMNP04409");
  1351. model.setValue("/root/main/cond/tabflag", oldtabflag);
  1352. }else {
  1353. model.copyNode("/root/send/reqdata", "/root/main/cond");
  1354. submit("TRMNP04409");
  1355. }
  1356. }
  1357. if( model.getValue("/root/main/goodinfo/gooddetlinfo/ccrmdlcd") != "" ) {
  1358. //중분류 값이 있으면
  1359. //물품 분류를 보여주기 위해 중분류로 소분류 조회 후 소분류값 대입
  1360. model.setValue("/root/main/cond/ccrlrgcd", model.getValue("/root/main/goodinfo/gooddetlinfo/ccrlrgcd"));
  1361. model.setValue("/root/main/cond/ccrmdlcd", model.getValue("/root/main/goodinfo/gooddetlinfo/ccrmdlcd"));
  1362. model.resetInstanceNode("/root/temp/smllist");
  1363. if( model.getValue("/root/main/cond/tabflag") != "CCR" ) {
  1364. model.setValue("/root/main/cond/tabflag", "CCR");
  1365. model.copyNode("/root/send/reqdata", "/root/main/cond");
  1366. submit("TRMNP04410");
  1367. model.setValue("/root/main/cond/tabflag", "MIS");
  1368. }else {
  1369. model.copyNode("/root/send/reqdata", "/root/main/cond");
  1370. submit("TRMNP04410");
  1371. }
  1372. var nodeCnt = getNodesetCount("/root/temp/smllist");
  1373. if( nodeCnt > 0 ) {
  1374. //addComboItem("cmb_ccrsml", "전 체", "", "above" );
  1375. }
  1376. }
  1377. var nodeCnt = getNodesetCount("/root/temp/mdllist");
  1378. if( nodeCnt > 0 ) {
  1379. //addComboItem("cmb_ccrmdl", "전 체", "", "above" );
  1380. }
  1381. //재고 그리드 값 맵핑
  1382. var nodeCnt = parseInt(getNodesetCount("/root/init/oproomlist"))+1;
  1383. for( var j = 1; j <= nodeCnt; j++) {
  1384. var safestocqty = model.getValue("/root/main/goodinfo/oproomstoclisthid["+j+"]/safestocqty");
  1385. var stocqty = model.getValue("/root/main/goodinfo/oproomstoclisthid["+j+"]/stocqty");
  1386. if( ( safestocqty == "" )||( stocqty == "" ) ) {
  1387. model.setValue("/root/temp/oproomstoclist/oproomnostoc"+j, 0);
  1388. model.setValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j, 0);
  1389. }else {
  1390. model.setValue("/root/temp/oproomstoclist/oproomnostoc"+j, model.getValue("/root/main/goodinfo/oproomstoclisthid["+j+"]/safestocqty"));
  1391. model.setValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j, model.getValue("/root/main/goodinfo/oproomstoclisthid["+j+"]/stocqty"));
  1392. }
  1393. if( j < 5 ) {//CCR, CLEANE-ZONE, 창고, 수술방 총합만 합계
  1394. totalSafeCnt += parseFloat(model.getValue("/root/temp/oproomstoclist/oproomnostoc"+j));
  1395. totaStocCnt += parseFloat(model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j));
  1396. }
  1397. }
  1398. //재고 총합계를 CSR총합계에 맵핑
  1399. if( ( isNaN(totalSafeCnt) )||( isNaN(totaStocCnt) ) ) {//숫자가 아니면 리턴
  1400. return;
  1401. }else {
  1402. //수술방에서 포장 단위로 계산하여 보여주기
  1403. //var exchqty = model.getValue("/root/main/goodinfo/gooddetlinfo/exchqty"); //환산수량
  1404. //var allpacksafeqty = parseFloat( totalSafeCnt / parseFloat(exchqty) );
  1405. //var allpackqty = parseFloat( totaStocCnt / parseFloat(exchqty) );
  1406. //model.makeValue("/root/main/goodinfo/ccrstocinfo/allpacksafeqty", totalSafeCnt);
  1407. //model.makeValue("/root/main/goodinfo/ccrstocinfo/allpackqty", totaStocCnt);
  1408. model.makeValue("/root/main/goodinfo/ccrstocinfo/allsafeqty", totalSafeCnt);
  1409. model.makeValue("/root/main/goodinfo/ccrstocinfo/allqty", totaStocCnt);
  1410. }
  1411. }
  1412. btn_save.disabled = false;
  1413. model.refresh();*/
  1414. }
  1415. /* --------------------------------------------------*/
  1416. /* type : function */
  1417. /* access : public */
  1418. /* desc : 엑셀저장 */
  1419. /* param : */
  1420. /* return : */
  1421. /* --------------------------------------------------*/
  1422. function fSaveExcel(){
  1423. var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  1424. var tabflag = model.getValue("/root/main/cond/tabflag");
  1425. if (fileName != "")
  1426. {
  1427. if( tabflag == "MIS" ) {
  1428. grd_goodlist.saveExcel(fileName, "SheetName", false, false, "", "", true);
  1429. }else if( tabflag == "CCR" ) {
  1430. grd_goodlist2.saveExcel(fileName, "SheetName", false, false, "", "", true);
  1431. }
  1432. }
  1433. }
  1434. //------------(20101012) 경북대
  1435. // radio6 의 xforms-value-changed 이벤트를 함수를 빼냄
  1436. function fntreequery() {
  1437. //---(20101012) 경북대 S1
  1438. // 처방OLD인경우는 물품구분을 수정할수 있도록 한다.
  1439. if ( model.getValue("/root/main/cond/refdeptflag") == "PRCOLD" ) {
  1440. combo5.disabled = false;
  1441. } else {
  1442. combo5.disabled = true;
  1443. }
  1444. //---(20101012) 경북대 e1
  1445. //---(20101012) 경북대 S1
  1446. if ( model.getValue("/root/main/cond/refdeptflag") == "MIS" ) {
  1447. cap_srchflag.visible = true;
  1448. cmb_srchflag.visible= true;
  1449. } else {
  1450. cap_srchflag.visible = false;
  1451. cmb_srchflag.visible= false;
  1452. }
  1453. //---(20101012) 경북대 e1
  1454. //-- (20101011) 경북대 s
  1455. // 구매/처방/부서구분으로 조회하기
  1456. if ( model.getValue("/root/main/cond/refdeptflag") != "PRCOLD" ) {
  1457. trv_goodindxcdlist.visible = true
  1458. trv_goodindxcdlist2.visible = false
  1459. //원본
  1460. model.makeValue("/root/send/reqdata/refdeptflag", model.getValue("/root/main/cond/refdeptflag"));//TREE 분류 조회를 위한 조건
  1461. model.makeValue("/root/send/reqdata/goodflag", model.getValue("/root/main/goodinfo/gooddetlinfo/goodflag"));
  1462. model.makeValue("/root/send/reqdata/srchflag", model.getValue("/root/main/srchinfo/srchflag"));
  1463. submit("TRMNP04414");//TREE 분류 조회
  1464. } else { //처방old 로 조회하기
  1465. trv_goodindxcdlist2.visible = true
  1466. trv_goodindxcdlist.visible = false
  1467. //추가
  1468. model.makeValue("/root/send/reqdata/refdeptflag", model.getValue("/root/main/cond/refdeptflag"));//TREE 분류 조회를 위한 조건
  1469. model.makeValue("/root/send/reqdata/goodflag", model.getValue("/root/main/goodinfo/gooddetlinfo/goodflag"));
  1470. submit("TRMNP04498");//TREE 분류 조회
  1471. }
  1472. //-- (20101011) 경북대 e
  1473. }