SMMNP02400.js 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258
  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/init/viewctrl/viewctrllist/viewctrlinfo/cdnm"));//CCR Main
  22. model.setValue("/root/main/cond/refdept", model.getValue("/root/init/viewctrl/viewctrllist/viewctrlinfo/cdnm"));//간호처방 화면
  23. //var dutplcecd = getUserInfo("dutplcecd");
  24. //if( dutplcecd == "3070000000" || dutplcecd == "1000000000" ){ // 수술실
  25. // model.setValue("/root/main/cond/refdept", "O");
  26. //}else if(dutplcecd == "3073100000"){ //마취부서
  27. // model.setValue("/root/main/cond/refdept", "A");
  28. //}else if(dutplcecd == "3073300000"){ //회복실부서
  29. // model.setValue("/root/main/cond/refdept", "R");
  30. //}else if(dutplcecd == "3072700000"){ //수술실 안과
  31. // model.setValue("/root/main/cond/refdept", "E");
  32. //}
  33. submit("TRMNP04414", false);//TREE 분류 조회
  34. submit("TRMNP04403", false);//물품구분 조회
  35. model.setValue("/root/main/goodinfo/gooddetlinfo/goodflag", "Y");
  36. model.makeValue("/root/send/reqdata/tabflag", "CCR");
  37. model.makeValue("/root/send/reqdata/goodflag", "Y");
  38. submit("TRMNP04408", false);//물품 상세정보 대분류 조회
  39. submit("TRMNP04404", false);
  40. var nodeCnt = getNodesetCount("/root/init/lrglist");
  41. if( nodeCnt > 0 ) {
  42. addComboItem("cmb_lrg", "전 체", "", "above" );
  43. }
  44. grd_goodlist.explorerbar = "sort";
  45. model.refresh();
  46. /* model.removeNodeset("/root/main/goodlist");
  47. model.setValue("/root/main/cond/tabflag", "CCR");
  48. model.toggle("ccrgood");
  49. model.copyNode("/root/send/reqdata", "/root/main/cond");
  50. submit("TRMNP04403", false);
  51. model.setValue("/root/main/cond/goodflag", "Y");
  52. model.copyNode("/root/send/reqdata", "/root/main/cond");
  53. //2008-12-29 오후 12:21:02 taebum add
  54. submit("TRMNP04408", false);//물품 상세정보 대분류 조회
  55. submit("TRMNP04404", false);
  56. var nodeCnt = getNodesetCount("/root/init/lrglist");
  57. if( nodeCnt > 0 ) {
  58. addComboItem("cmb_lrg", "전 체", "", "above" );
  59. }
  60. grd_goodlist.explorerbar = "sort";
  61. grd_goodlist2.explorerbar = "sort";
  62. grd_goodlist3.explorerbar = "sort";
  63. fChangeDept("1");
  64. btn_save.disabled = true;
  65. model.refresh();*/
  66. }
  67. /*--------------------------------------------------*/
  68. /*type : function */
  69. /*access : public */
  70. /*desc : 수술실 물품 마스터 조회 */
  71. /*param : */
  72. /*return : */
  73. /*--------------------------------------------------*/
  74. function fSearch(pFlag) {
  75. var indexcd, lrgcd, mdlcd, smlcd;
  76. var refdeptflag = model.getValue("/root/main/cond/refdeptflag");
  77. var refdept = model.getValue("/root/main/cond/refdept");
  78. var refflag = model.getValue("/root/main/cond/refflag");
  79. var refnm = model.getValue("/root/main/cond/refnm");
  80. var prodcmpynm = model.getValue("/root/main/cond/prodcmpynm");
  81. var custnm = model.getValue("/root/main/cond/custnm");
  82. if( pFlag == "1" ) {//트리 조회 일 경우만 실행
  83. var item = trv_goodindxcdlist.item(trv_goodindxcdlist.selectedIndex);
  84. if(item != null){
  85. indexcd = item.value;
  86. if( indexcd.length == 2 ) {
  87. lrgcd = indexcd;
  88. }else if( indexcd.length == 4 ) {
  89. lrgcd = indexcd.substr(0, 2);
  90. mdlcd = indexcd.substr(2, 2);
  91. }else if( indexcd.length == 6 ) {
  92. lrgcd = indexcd.substr(0, 2);
  93. mdlcd = indexcd.substr(2, 2);
  94. smlcd = indexcd.substr(4, 2);
  95. }
  96. }
  97. }
  98. if( refnm == "" && prodcmpynm == "" && custnm == "" && lrgcd == "" && mdlcd == "" && smlcd == "" ) {
  99. messageBox("검색조건을 입력하지 ", "E007");
  100. model.setFocus("ipt_goodcd");
  101. return;
  102. }
  103. model.removenode("/root/send");
  104. model.makeNode("/root/send/reqdata");
  105. model.copyNode("/root/send/reqdata", "/root/main/cond");
  106. model.makeValue("/root/send/reqdata/lrgcd", lrgcd);
  107. model.makeValue("/root/send/reqdata/mdlcd", mdlcd);
  108. model.makeValue("/root/send/reqdata/smlcd", smlcd);
  109. submit("TRMNP04401");
  110. }
  111. /*--------------------------------------------------*/
  112. /*type : function */
  113. /*access : public */
  114. /*desc : 수술실 물품 마스터 조회(일괄등록) */
  115. /*param : */
  116. /*return : */
  117. /*--------------------------------------------------*/
  118. function fBatchSearch() {
  119. var indexcd, lrgcd, mdlcd, smlcd;
  120. var refdeptflag = model.getValue("/root/main/cond/refdeptflag");
  121. var refdept = model.getValue("/root/main/cond/refdept");
  122. var refflag = model.getValue("/root/main/cond/refflag");
  123. var refnm = model.getValue("/root/main/cond/refnm");
  124. var prodcmpynm = model.getValue("/root/main/cond/prodcmpynm");
  125. var custnm = model.getValue("/root/main/cond/custnm");
  126. if( refnm == "" && prodcmpynm == "" && custnm == "" && lrgcd == "" && mdlcd == "" && smlcd == "" ) {
  127. messageBox("검색조건을 입력하지 ", "E007");
  128. model.setFocus("ipt_goodcd");
  129. return;
  130. }
  131. model.removenode("/root/send");
  132. model.makeNode("/root/send/reqdata");
  133. model.copyNode("/root/send/reqdata", "/root/main/cond");
  134. model.makeValue("/root/send/reqdata/lrgcd", lrgcd);
  135. model.makeValue("/root/send/reqdata/mdlcd", mdlcd);
  136. model.makeValue("/root/send/reqdata/smlcd", smlcd);
  137. submit("TRMNP04401");
  138. }
  139. /* --------------------------------------------------*/
  140. /* type : function */
  141. /* access : public */
  142. /* desc : 수술실 물품 부서별 부서 재고 화면 변경 */
  143. /* param : */
  144. /* return : */
  145. /* --------------------------------------------------*/
  146. function fChangeDept(flag) {
  147. /*
  148. var deptflag = model.getValue("/root/main/cond/refdeptflag");//부서구분
  149. var nodeCnt = parseInt(getNodesetCount("/root/init/oproomlist"))+1;
  150. if( deptflag != "R" ) {//수술, 마취
  151. var scrwidth = ( nodeCnt * 49 ) + 14;
  152. if( nodeCnt > 25 ) {//수술방이 25개 이상이면 스크롤 바로 인해 크기 조절
  153. grd_oproomstoclist.attribute("style") = "left:144px; top:50px; width:1050px; height:89px; text-align:right;";
  154. }else {
  155. grd_oproomstoclist.attribute("style") = "left:144px; top:65px; width:" + scrwidth + "px; height:72px; text-align:right;";
  156. }
  157. var captionlist = "";
  158. if( nodeCnt != 0 ) {
  159. if( flag == "2" ) {//부서를 변경했을 때
  160. for(var i = 0; i <= nodeCnt; i++ ) {
  161. grd_oproomstoclist.removeColumn(false);;
  162. }
  163. }
  164. for(var i = 0; i <= nodeCnt; i++ ) { //수술방 갯수 만큼 컴럼을 만들고 cation을 만들어 준다.(CCR제외)
  165. grd_oproomstoclist.addColumn("ref:oproomnostoc" + i + "; type:input;", false);
  166. if( i == 4 ) {
  167. grd_oproomstoclist.colWidth(i) = 60;
  168. }else {
  169. grd_oproomstoclist.colWidth(i) = 49;
  170. }
  171. grd_oproomstoclist.colAttribute(i, "format") = "#.###";
  172. if( i == 0 ) {
  173. captionlist = model.getValue("/root/init/oproomlist[" + i + "]/oproomnm");
  174. }else if( i == 4 ){
  175. captionlist = captionlist + "^OR총재고";
  176. }else if( i < 4 ) {
  177. captionlist = captionlist + "^" + model.getValue("/root/init/oproomlist[" + i + "]/oproomnm");
  178. }else if( i > 4 ) {
  179. j = i - 1;
  180. captionlist = captionlist + "^" + model.getValue("/root/init/oproomlist[" + j + "]/oproomnm");
  181. }
  182. }
  183. grd_oproomstoclist.caption = captionlist;
  184. grd_oproomstoclist.addRow(false);
  185. }
  186. grd_oproomstoclist.deleteColumn(0);
  187. if( deptflag == "O" ) {//수술
  188. grd_oproomstoclist.colDisabled(3) = "ture";
  189. }else {
  190. for( var j = 0; j < 4; j++ ) {
  191. grd_oproomstoclist.colDisabled(j) = "ture";
  192. }
  193. }
  194. }else {
  195. grd_oproomstoclist.attribute("style") = "left:144px; top:65px; width:242px; height:72px; text-align:right;";
  196. if( nodeCnt != 0 ) {
  197. for(var i = 0; i <= nodeCnt; i++ ) {
  198. grd_oproomstoclist.removeColumn(false);;
  199. }
  200. for(var i = 1; i <= 4; i++ ) {
  201. grd_oproomstoclist.addColumn("ref:oproomnostoc" + i + "; type:input;", false);
  202. grd_oproomstoclist.colWidth(i-1) = 60;
  203. grd_oproomstoclist.colAttribute(i-1, "format") = "#.###";
  204. }
  205. grd_oproomstoclist.caption = "CCR^C-C^C-O^회복실";
  206. grd_oproomstoclist.addRow(false);
  207. for( var j = 0; j < 3; j++ ) {
  208. grd_oproomstoclist.colDisabled(j) = "ture";
  209. }
  210. }
  211. }
  212. model.refresh();*/
  213. }
  214. /* --------------------------------------------------*/
  215. /* type : function */
  216. /* access : public */
  217. /* desc : 수술실 물품 정보 저장 */
  218. /* param : */
  219. /* return : */
  220. /* --------------------------------------------------*/
  221. function fSaveGoodInfo() {
  222. var lrgcd, mdlcd, smlcd, cureflag, delivepriod, deliveyn, useflag, appdd, enddd;
  223. lrgcd = model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd");
  224. mdlcd = model.getValue("/root/main/goodinfo/gooddetlinfo/mdlcd");
  225. smlcd = model.getValue("/root/main/goodinfo/gooddetlinfo/smlcd");
  226. prcpnm = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodnm");
  227. goodspec = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodspec");
  228. goodmodel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodmodel");
  229. custtel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel");
  230. cureflag = model.getValue("/root/main/goodinfo/gooddetlinfo/cureflag");
  231. delivepriod = model.getValue("/root/main/goodinfo/gooddetlinfo/delivepriod");
  232. deliveyn = model.getValue("/root/main/goodinfo/gooddetlinfo/deliveyn");
  233. useflag = model.getValue("/root/main/goodinfo/gooddetlinfo/useflag");
  234. appdd = model.getValue("/root/main/goodinfo/gooddetlinfo/appdd");
  235. enddd = model.getValue("/root/main/goodinfo/gooddetlinfo/enddd");
  236. rgstflag = model.getValue("/root/main/goodinfo/gooddetlinfo/rgstflag");
  237. if( lrgcd == "" ) {
  238. messageBox("대분류를 선택하지 ", "E007");
  239. model.setFocus("cmb_lrg");
  240. return;
  241. }else if( mdlcd == "" ) {
  242. messageBox("중분류를 선택하지 ", "E007");
  243. model.setFocus("cmb_mdl");
  244. return;
  245. }else if( prcpnm.length > 200 ) {
  246. messageBox("물품명은 200자 이하 ", "E008");
  247. model.setFocus("ipt_prcpnm");
  248. return;
  249. }else if( goodspec.length > 50 ) {
  250. messageBox("규격은 50자 이하 ", "E008");
  251. model.setFocus("ipt_goodspec");
  252. return;
  253. }else if( goodmodel.length > 50 ) {
  254. messageBox("모델은 50자 이하 ", "E008");
  255. model.setFocus("ipt_goodmodel");
  256. return;
  257. }else if( custtel.length > 13 ) {
  258. messageBox("업체전화번호는 13자 이하 ", "E008");
  259. model.setFocus("ipt_custtel");
  260. return;
  261. }else if( cureflag == "" ) {
  262. messageBox("처방구분를 선택하지 ", "E007");
  263. model.setFocus("rdo_cureflag");
  264. return;
  265. }else if( delivepriod == "" ) {
  266. messageBox("불출시기를 선택하지 ", "E007");
  267. model.setFocus("rdo_ccrdelivepriod");
  268. return;
  269. }else if( deliveyn == "" ) {
  270. messageBox("불출여부를 선택하지 ", "E007");
  271. model.setFocus("rdo_deliveyn");
  272. return;
  273. }else if( appdd == "" ) {
  274. messageBox("적용일자를 선택하지 ", "E007");
  275. model.setFocus("ipt_appdd");
  276. return;
  277. }else if( enddd == "" ) {
  278. messageBox("종료일자를 선택하지 ", "E007");
  279. model.setFocus("ipt_enddd");
  280. return;
  281. }
  282. model.removenode("/root/send");
  283. model.makeNode("/root/send/savedata");
  284. model.copyNode("/root/send/savedata", "/root/main/goodinfo/gooddetlinfo");
  285. model.makeValue("/root/send/savedata/refdept", model.getValue("/root/main/cond/refdept"));
  286. if( rgstflag == "E" ) {//단종이면 미사용으로 셋팅
  287. model.setValue("/root/send/savedata/rgstflag", "U");
  288. }
  289. if( submit("TXMNP04401") ) {
  290. model.removeNodeset("/root/main/goodinfo/gooddetlinfo");
  291. fSearch();
  292. }
  293. }
  294. /* --------------------------------------------------*/
  295. /* type : function */
  296. /* access : public */
  297. /* desc : 수술실 물품 정보 저장(일괄) */
  298. /* param : */
  299. /* return : */
  300. /* --------------------------------------------------*/
  301. function fSaveBatchGoodInfo() {
  302. var lrgcd, mdlcd, smlcd, cureflag, delivepriod, deliveyn, useflag, appdd, enddd, goodcd, allsizespecid, goodspec, goodmodel;
  303. 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";
  304. lrgcd = model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd");
  305. mdlcd = model.getValue("/root/main/goodinfo/gooddetlinfo/mdlcd");
  306. smlcd = model.getValue("/root/main/goodinfo/gooddetlinfo/smlcd");
  307. prcpnm = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodnm");
  308. goodspec = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodspec");
  309. goodmodel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodmodel");
  310. custtel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel");
  311. cureflag = model.getValue("/root/main/goodinfo/gooddetlinfo/cureflag");
  312. delivepriod = model.getValue("/root/main/goodinfo/gooddetlinfo/delivepriod");
  313. deliveyn = model.getValue("/root/main/goodinfo/gooddetlinfo/deliveyn");
  314. useflag = model.getValue("/root/main/goodinfo/gooddetlinfo/useflag");
  315. appdd = model.getValue("/root/main/goodinfo/gooddetlinfo/appdd");
  316. enddd = model.getValue("/root/main/goodinfo/gooddetlinfo/enddd");
  317. rgstflag = model.getValue("/root/main/goodinfo/gooddetlinfo/rgstflag");
  318. if( rgstflag == "E" ) {//단종이면 미사용으로 셋팅
  319. model.setValue("/root/send/savedata/rgstflag", "U");
  320. }
  321. if( lrgcd == "" ) {
  322. messageBox("대분류를 선택하지 ", "E007");
  323. model.setFocus("cmb_lrg");
  324. return;
  325. }else if( mdlcd == "" ) {
  326. messageBox("중분류를 선택하지 ", "E007");
  327. model.setFocus("cmb_mdl");
  328. return;
  329. }else if( prcpnm.length > 200 ) {
  330. messageBox("물품명은 200자 이하 ", "E008");
  331. model.setFocus("ipt_prcpnm");
  332. return;
  333. }else if( goodspec.length > 50 ) {
  334. messageBox("규격은 50자 이하 ", "E008");
  335. model.setFocus("ipt_goodspec");
  336. return;
  337. }else if( goodmodel.length > 50 ) {
  338. messageBox("모델은 50자 이하 ", "E008");
  339. model.setFocus("ipt_goodmodel");
  340. return;
  341. }else if( custtel.length > 13 ) {
  342. messageBox("업체전화번호는 13자 이하 ", "E008");
  343. model.setFocus("ipt_custtel");
  344. return;
  345. }else if( cureflag == "" ) {
  346. messageBox("처방구분를 선택하지 ", "E007");
  347. model.setFocus("rdo_cureflag");
  348. return;
  349. }else if( delivepriod == "" ) {
  350. messageBox("불출시기를 선택하지 ", "E007");
  351. model.setFocus("rdo_ccrdelivepriod");
  352. return;
  353. }else if( deliveyn == "" ) {
  354. messageBox("불출여부를 선택하지 ", "E007");
  355. model.setFocus("rdo_deliveyn");
  356. return;
  357. }else if( appdd == "" ) {
  358. messageBox("적용일자를 선택하지 ", "E007");
  359. model.setFocus("ipt_appdd");
  360. return;
  361. }else if( enddd == "" ) {
  362. messageBox("종료일자를 선택하지 ", "E007");
  363. model.setFocus("ipt_enddd");
  364. return;
  365. }
  366. model.removenode("/root/send");
  367. model.makeNode("/root/send/savedata");
  368. for( var i = 0; i < grd_goodlist.rows; i++ ) {
  369. if( model.getValue("/root/main/goodlist[" + i + "]/chkflag") == "true" ) {
  370. if( model.getValue("/root/main/goodlist[" + i + "]/rgstyn") == "N" ) {//등록안된것만 등록
  371. goodcd = model.getValue("/root/main/goodlist[" + i + "]/goodcd");
  372. allsizespecid = model.getValue("/root/main/goodlist[" + i + "]/allsizespecid");
  373. savelist = savelist + "▩" + goodcd
  374. + "▦" + allsizespecid
  375. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd")
  376. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/mdlcd")
  377. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/smlcd")
  378. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/rgstflag")
  379. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/ccrgoodnm")
  380. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/prcpunit")
  381. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/prcpqty")
  382. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel")
  383. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/deliveunit")
  384. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/deliveqty")
  385. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/goodmngt")
  386. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/implant")
  387. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/cureflag")
  388. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/delivepriod")
  389. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/deliveyn")
  390. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/useflag")
  391. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/acmlbaseqty")
  392. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/ccrdeliveunit")
  393. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/ccrdeliveqty")
  394. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/goodinfo")
  395. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/appdd")
  396. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/enddd")
  397. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/prcpinfo")
  398. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/indexlrg")
  399. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/indexmdl")
  400. + "▦" + model.getValue("/root/main/goodinfo/gooddetlinfo/indexsml")
  401. + "▦" + model.getValue("/root/main/cond/refdept");
  402. }
  403. }
  404. }
  405. alert(model.getValue("/root/main/cond/refdept"));
  406. model.setValue("/root/send/savedata", savelist);
  407. if( submit("TXMNP04402") ) {
  408. model.removeNodeset("/root/main/goodinfo/gooddetlinfo");
  409. fBatchSearch();
  410. }
  411. }
  412. /* function fSaveGoodInfo(){
  413. var deptflag = "";
  414. var opuseyn = "", anstuseyn = "", recovruseyn = "", opuseynstat = "", anstuseynstat = "", recovruseynstat = "";
  415. var oldopuseyn = "", oldanstuseyn = "", oldrecovruseyn = "";
  416. var endgood = model.getValue("/root/main/goodinfo/gooddetlinfo/useflag");
  417. var deptflag1 = model.getValue("/root/temp/deptflag1");
  418. var deptflagCnt = deptflag1.length;
  419. var refdeptflag = model.getValue("/root/main/cond/refdeptflag");
  420. oldopuseyn = model.getValue("/root/main/goodinfo/gooddetlinfo/opuseyn");
  421. oldanstuseyn = model.getValue("/root/main/goodinfo/gooddetlinfo/anstuseyn");
  422. oldrecovruseyn = model.getValue("/root/main/goodinfo/gooddetlinfo/recovruseyn");
  423. //1:수술, 2:마취, 3:회복, 4:수술/마취, 5:수술/회복, 6:마취/회복, 7:수술/마취/회복
  424. switch(deptflag1) {
  425. case "1"://수술
  426. if( refdeptflag == "O" ) {//수술
  427. deptflag = "1";
  428. opuseyn = "Y";
  429. anstuseyn = "N";
  430. recovruseyn = "N";
  431. }else if( refdeptflag == "A" ) {//수술/마취
  432. deptflag = "4";
  433. opuseyn = "Y";
  434. anstuseyn = "Y";
  435. recovruseyn = "N";
  436. }else if( refdeptflag == "R" ) {//수술/회복
  437. deptflag = "5";
  438. opuseyn = "Y";
  439. anstuseyn = "N";
  440. recovruseyn = "Y";
  441. }
  442. break;
  443. case "2"://마취
  444. if( refdeptflag == "O" ) {//수술/마취
  445. deptflag = "4";
  446. opuseyn = "Y";
  447. anstuseyn = "Y";
  448. recovruseyn = "N";
  449. }else if( refdeptflag == "A" ) {//마취
  450. deptflag = "2";
  451. opuseyn = "N";
  452. anstuseyn = "Y";
  453. recovruseyn = "N";
  454. }else if( refdeptflag == "R" ) {//마취/회복
  455. deptflag = "6";
  456. opuseyn = "N";
  457. anstuseyn = "Y";
  458. recovruseyn = "Y";
  459. }
  460. break;
  461. case "3"://회복
  462. if( refdeptflag == "O" ) {//수술/회복
  463. deptflag = "5";
  464. opuseyn = "Y";
  465. anstuseyn = "N";
  466. recovruseyn = "Y";
  467. }else if( refdeptflag == "A" ) {//마취/회복
  468. deptflag = "6";
  469. opuseyn = "N";
  470. anstuseyn = "Y";
  471. recovruseyn = "Y";
  472. }else if( refdeptflag == "R" ) {//회복
  473. deptflag = "3";
  474. opuseyn = "N";
  475. anstuseyn = "N";
  476. recovruseyn = "Y";
  477. }
  478. break;
  479. case "1 2"://수술, 마취
  480. if( refdeptflag == "O" ) {//수술/마취
  481. deptflag = "4";
  482. opuseyn = "Y";
  483. anstuseyn = "Y";
  484. recovruseyn = "N";
  485. }else if( refdeptflag == "A" ) {//수술/마취
  486. deptflag = "4";
  487. opuseyn = "Y";
  488. anstuseyn = "Y";
  489. recovruseyn = "N";
  490. }else if( refdeptflag == "R" ) {//회복
  491. deptflag = "7";
  492. opuseyn = "Y";
  493. anstuseyn = "Y";
  494. recovruseyn = "Y";
  495. }
  496. break;
  497. case "2 1"://마취, 수술
  498. if( refdeptflag == "O" ) {//수술/마취
  499. deptflag = "4";
  500. opuseyn = "Y";
  501. anstuseyn = "Y";
  502. recovruseyn = "N";
  503. }else if( refdeptflag == "A" ) {//수술/마취
  504. deptflag = "4";
  505. opuseyn = "Y";
  506. anstuseyn = "Y";
  507. recovruseyn = "N";
  508. }else if( refdeptflag == "R" ) {//전체
  509. deptflag = "7";
  510. opuseyn = "Y";
  511. anstuseyn = "Y";
  512. recovruseyn = "Y";
  513. }
  514. break;
  515. case "2 3"://마취, 회복
  516. if( refdeptflag == "O" ) {//전체
  517. deptflag = "7";
  518. opuseyn = "Y";
  519. anstuseyn = "Y";
  520. recovruseyn = "Y";
  521. }else if( refdeptflag == "A" ) {//마취/회복
  522. deptflag = "6";
  523. opuseyn = "N";
  524. anstuseyn = "Y";
  525. recovruseyn = "Y";
  526. }else if( refdeptflag == "R" ) {//마취/회복
  527. deptflag = "6";
  528. opuseyn = "N";
  529. anstuseyn = "Y";
  530. recovruseyn = "Y";
  531. }
  532. break;
  533. case "3 2"://회복, 마취
  534. if( refdeptflag == "O" ) {//전체
  535. deptflag = "7";
  536. opuseyn = "Y";
  537. anstuseyn = "Y";
  538. recovruseyn = "Y";
  539. }else if( refdeptflag == "A" ) {//마취/회복
  540. deptflag = "6";
  541. opuseyn = "N";
  542. anstuseyn = "Y";
  543. recovruseyn = "Y";
  544. }else if( refdeptflag == "R" ) {//마취/회복
  545. deptflag = "6";
  546. opuseyn = "N";
  547. anstuseyn = "Y";
  548. recovruseyn = "Y";
  549. }
  550. break;
  551. case "1 3"://수술, 회복
  552. if( refdeptflag == "O" ) {//수술, 회복
  553. deptflag = "5";
  554. opuseyn = "Y";
  555. anstuseyn = "N";
  556. recovruseyn = "Y";
  557. }else if( refdeptflag == "A" ) {//전체
  558. deptflag = "7";
  559. opuseyn = "Y";
  560. anstuseyn = "Y";
  561. recovruseyn = "Y";
  562. }else if( refdeptflag == "R" ) {//수술, 회복
  563. deptflag = "5";
  564. opuseyn = "Y";
  565. anstuseyn = "N";
  566. recovruseyn = "Y";
  567. }
  568. break;
  569. case "3 1"://회복, 수술
  570. if( refdeptflag == "O" ) {//수술, 회복
  571. deptflag = "5";
  572. opuseyn = "Y";
  573. anstuseyn = "N";
  574. recovruseyn = "Y";
  575. }else if( refdeptflag == "A" ) {//전체
  576. deptflag = "7";
  577. opuseyn = "Y";
  578. anstuseyn = "Y";
  579. recovruseyn = "Y";
  580. }else if( refdeptflag == "R" ) {//수술, 회복
  581. deptflag = "5";
  582. opuseyn = "Y";
  583. anstuseyn = "N";
  584. recovruseyn = "Y";
  585. }
  586. break;
  587. case "1 2 3"://전체
  588. deptflag = "7";
  589. opuseyn = "Y";
  590. anstuseyn = "Y";
  591. recovruseyn = "Y";
  592. break;
  593. case "1 3 2"://전체
  594. deptflag = "7";
  595. opuseyn = "Y";
  596. anstuseyn = "Y";
  597. recovruseyn = "Y";
  598. break;
  599. case "2 1 3"://전체
  600. deptflag = "7";
  601. opuseyn = "Y";
  602. anstuseyn = "Y";
  603. recovruseyn = "Y";
  604. break;
  605. case "2 3 1"://전체
  606. deptflag = "7";
  607. opuseyn = "Y";
  608. anstuseyn = "Y";
  609. recovruseyn = "Y";
  610. break;
  611. case "3 1 2"://전체
  612. deptflag = "7";
  613. opuseyn = "Y";
  614. anstuseyn = "Y";
  615. recovruseyn = "Y";
  616. break;
  617. case "3 2 1":
  618. deptflag = "7";
  619. opuseyn = "Y";
  620. anstuseyn = "Y";
  621. recovruseyn = "Y";
  622. break;
  623. default :
  624. if( refdeptflag == "O" ) {//수술, 회복
  625. deptflag = "1";
  626. opuseyn = "Y";
  627. anstuseyn = "N";
  628. recovruseyn = "N";
  629. }else if( refdeptflag == "A" ) {//전체
  630. deptflag = "2";
  631. opuseyn = "N";
  632. anstuseyn = "Y";
  633. recovruseyn = "N";
  634. }else if( refdeptflag == "R" ) {//수술, 회복
  635. deptflag = "3";
  636. opuseyn = "N";
  637. anstuseyn = "N";
  638. recovruseyn = "Y";
  639. }
  640. break;
  641. }
  642. //수술
  643. if( ( oldopuseyn == "N" )&&( opuseyn == "Y" ) ) {//생성
  644. opuseynstat = "C";
  645. }else if( ( oldopuseyn == "Y" )&&( opuseyn == "Y" ) ) {//변경
  646. opuseynstat = "S";
  647. }else if( ( oldopuseyn == "Y" )&&( opuseyn == "N" ) ) {//미사용으로 전환
  648. opuseynstat = "U";
  649. opuseyn = "U";
  650. }else if( ( oldopuseyn == "U" )&&( opuseyn == "Y" ) ) {//사용으로 전환
  651. opuseynstat = "Z";
  652. }else {//등록안됨
  653. opuseynstat = "F";
  654. }
  655. if( endgood == "U" ){//미사용
  656. if( refdeptflag == "O" ) {
  657. opuseyn = "U";
  658. }else if( refdeptflag == "A" ) {
  659. anstuseyn = "U";
  660. }else if( refdeptflag == "R" ) {
  661. recovruseyn = "U";
  662. }
  663. }
  664. if( refdeptflag != "O") {//수술이 아니면 변경없음
  665. opuseynstat = "P";
  666. }
  667. //마취
  668. if( ( oldanstuseyn == "N" )&&( anstuseyn == "Y" ) ) {//생성
  669. anstuseynstat = "C";
  670. }else if( ( oldanstuseyn == "Y" )&&( anstuseyn == "Y" ) ) {//변경
  671. anstuseynstat = "S";
  672. }else if( ( oldanstuseyn == "Y" )&&( anstuseyn == "N" ) ) {//미사용으로 전환
  673. anstuseynstat = "U";
  674. anstuseyn = "U";//미사용으로 등록
  675. }else if( ( oldanstuseyn == "U" )&&( anstuseyn == "Y" ) ) {//사용으로 전환
  676. anstuseynstat = "Z";
  677. }else {
  678. anstuseynstat = "F";
  679. }
  680. if( refdeptflag != "A") {//마취가 아니면 변경없음
  681. anstuseynstat = "P";
  682. }
  683. //회복
  684. if( ( oldrecovruseyn == "N" )&&( recovruseyn == "Y" ) ) {//생성
  685. recovruseynstat = "C";
  686. }else if( ( oldrecovruseyn == "Y" )&&( recovruseyn == "Y" ) ) {//변경
  687. recovruseynstat = "S";
  688. }else if( ( oldrecovruseyn == "Y" )&&( recovruseyn == "N" ) ) {//미사용으로 전환
  689. recovruseynstat = "U";
  690. recovruseyn = "U";
  691. }else if( ( oldrecovruseyn == "U" )&&( recovruseyn == "Y" ) ) {//사용으로 전환
  692. recovruseynstat = "Z";
  693. }else {
  694. recovruseynstat = "F";
  695. }
  696. if( refdeptflag != "R") {//회복가 아니면 변경없음
  697. recovruseynstat = "P";
  698. }
  699. model.makeValue("/root/main/goodinfo/gooddetlinfo/refdeptflag", refdeptflag);
  700. model.makeValue("/root/main/goodinfo/gooddetlinfo/deptflag", deptflag); //수술:1, 마취:2, 회복:3, 수술/마취:4, 마취/회복:5, 수술/회복:6, 수술/마취/회복:7
  701. model.makeValue("/root/main/goodinfo/gooddetlinfo/opuseynstat", opuseynstat);
  702. model.makeValue("/root/main/goodinfo/gooddetlinfo/anstuseynstat", anstuseynstat);
  703. model.makeValue("/root/main/goodinfo/gooddetlinfo/recovruseynstat", recovruseynstat);
  704. model.setValue("/root/main/goodinfo/gooddetlinfo/opuseyn", opuseyn);
  705. model.setValue("/root/main/goodinfo/gooddetlinfo/anstuseyn", anstuseyn);
  706. model.setValue("/root/main/goodinfo/gooddetlinfo/recovruseyn", recovruseyn);
  707. var iNode = "/root/main/goodinfo/gooddetlinfo/";
  708. var cureflag, ccrcusttel, winflag, goodmngt, reuseflag, prcpalias, ccrmdl, goodexist, ccrdeptflag;
  709. cureflag = model.getValue( iNode + "cureflag");
  710. winflag = model.getValue( iNode + "winflag");
  711. reuseflag = model.getValue( iNode + "reuseflag");
  712. prcpalias = model.getValue( iNode + "prcpalias");
  713. ccrlrgcd = model.getValue( iNode + "ccrlrgcd");
  714. ccrmdlcd = model.getValue( iNode + "ccrmdlcd");
  715. goodexist = model.getValue( iNode + "goodexist");
  716. if( model.getValue("/root/main/cond/tabflag") != "PRC" ) {
  717. if( prcpalias == "" ){
  718. messageBox("처방명을 ", "C001");
  719. model.setFocus("ipt_prcpnm");
  720. return;
  721. }else if( prcpalias.length > 200 ){
  722. messageBox("처방명은 200자 이하 ", "E008");
  723. model.setFocus("ipt_prcpnm");
  724. return;
  725. }else if( cureflag == "" ) {
  726. messageBox("처치구분을 ", "C002");
  727. model.setFocus("cmb_cureflag");
  728. return;
  729. }else if( winflag == "" ) {
  730. messageBox("입고구분을 ", "C002");
  731. model.setFocus("cmb_winflag");
  732. return;
  733. }else if( reuseflag == "" ) {
  734. messageBox("재사용구분을 ", "C002");
  735. return;
  736. }else if( ccrlrgcd == "" ) {
  737. messageBox("대분류를 ", "C002");
  738. return;
  739. }else if( ccrmdlcd == "" ) {
  740. messageBox("중분류를 ", "C002");
  741. return;
  742. }else if( ( goodexist == "N" )&&( deptflag == "" ) ) {//등록안된 물품인데 부서 체크안하면
  743. messageBox("저장할 부서를 ", "C002");
  744. return;
  745. }else if( ( goodexist == "N" )&&( deptflag != "" ) ) {//등록안된 물품인데 조회 부서 체크안하면
  746. if( refdeptflag == "O" ){
  747. if( !(( deptflag == "1" )||( deptflag == "4" )||( deptflag == "6" )||( deptflag == "7" )) ) {
  748. messageBox("수술실을 선택하지 ", "E007");
  749. return;
  750. }
  751. }else if( refdeptflag == "A" ){
  752. if( !(( deptflag == "2" )||( deptflag == "4" )||( deptflag == "5" )||( deptflag == "7" )) ) {
  753. messageBox("마취과를 선택하지 ", "E007");
  754. return;
  755. }
  756. }else if( refdeptflag == "R" ){
  757. if( !(( deptflag == "3" )||( deptflag == "5" )||( deptflag == "6" )||( deptflag == "7" )) ) {
  758. messageBox("회복실을 선택하지 ", "E007");
  759. return;
  760. }
  761. }
  762. }
  763. }else {
  764. var prcpclscd = model.getValue("/root/main/goodinfo/gooddetlinfo/prcpclscd");//처방 구분
  765. if( ( prcpclscd == "M2" )||( prcpclscd == "A2" )||( prcpclscd == "A4" )||( prcpclscd == "A6" )||( prcpclscd == "I4" ) ) {//재료, 경구, 외용, 주사, 마취약
  766. if( prcpalias == "" ){
  767. messageBox("처방명을 ", "C001");
  768. model.setFocus("ipt_prcpnm");
  769. return;
  770. }else if( prcpalias.length > 200 ){
  771. messageBox("처방명은 200자 이하 ", "E008");
  772. model.setFocus("ipt_prcpnm");
  773. return;
  774. }else if( cureflag == "" ) {
  775. messageBox("처치구분을 ", "C002");
  776. model.setFocus("cmb_cureflag");
  777. return;
  778. }else if( winflag == "" ) {
  779. messageBox("입고구분을 ", "C002");
  780. model.setFocus("cmb_winflag");
  781. return;
  782. }else if( reuseflag == "" ) {
  783. messageBox("재사용구분을 ", "C002");
  784. return;
  785. }else if( ccrlrgcd == "" ) {
  786. messageBox("대분류를 ", "C002");
  787. return;
  788. }else if( ccrmdlcd == "" ) {
  789. messageBox("중분류를 ", "C002");
  790. return;
  791. }else if( ( goodexist == "N" )&&( deptflag == "" ) ) {//등록안된 물품인데 부서 체크안하면
  792. messageBox("저장할 부서를 ", "C002");
  793. return;
  794. }else if( ( goodexist == "N" )&&( deptflag != "" ) ) {//등록안된 물품인데 조회 부서 체크안하면
  795. if( refdeptflag == "O" ){
  796. if( !(( deptflag == "1" )||( deptflag == "4" )||( deptflag == "6" )||( deptflag == "7" )) ) {
  797. messageBox("수술실을 선택하지 ", "E007");
  798. return;
  799. }
  800. }else if( refdeptflag == "A" ){
  801. if( !(( deptflag == "2" )||( deptflag == "4" )||( deptflag == "5" )||( deptflag == "7" )) ) {
  802. messageBox("마취과를 선택하지 ", "E007");
  803. return;
  804. }
  805. }else if( refdeptflag == "R" ){
  806. if( !(( deptflag == "3" )||( deptflag == "5" )||( deptflag == "6" )||( deptflag == "7" )) ) {
  807. messageBox("회복실을 선택하지 ", "E007");
  808. return;
  809. }else if( cureflag == "" ) {
  810. messageBox("처치구분을 ", "C002");
  811. model.setFocus("cmb_cureflag");
  812. return;
  813. }
  814. }
  815. }
  816. }else {//처방 탭에서 물품, 약이 아닌 물품들(처치 처방종류)
  817. if( prcpalias.length > 200 ){
  818. messageBox("처방명은 200자 이하 ", "E008");
  819. model.setFocus("ipt_prcpnm");
  820. return;
  821. }else if( cureflag == "" ) {
  822. messageBox("처치구분을 ", "C002");
  823. model.setFocus("cmb_cureflag");
  824. return;
  825. }else if( ccrlrgcd == "" ) {
  826. messageBox("대분류를 ", "C002");
  827. return;
  828. }else if( ccrmdlcd == "" ) {
  829. messageBox("중분류를 ", "C002");
  830. return;
  831. }else if( ( goodexist == "N" )&&( deptflag == "" ) ) {//등록안된 물품인데 부서 체크안하면
  832. messageBox("저장할 부서를 ", "C002");
  833. return;
  834. }else if( ( goodexist == "N" )&&( deptflag != "" ) ) {//등록안된 물품인데 조회 부서 체크안하면
  835. if( refdeptflag == "O" ){
  836. if( !(( deptflag == "1" )||( deptflag == "4" )||( deptflag == "6" )||( deptflag == "7" )) ) {
  837. messageBox("수술실을 선택하지 ", "E007");
  838. return;
  839. }
  840. }else if( refdeptflag == "A" ){
  841. if( !(( deptflag == "2" )||( deptflag == "4" )||( deptflag == "5" )||( deptflag == "7" )) ) {
  842. messageBox("마취과를 선택하지 ", "E007");
  843. return;
  844. }
  845. }else if( refdeptflag == "R" ){
  846. if( !(( deptflag == "3" )||( deptflag == "5" )||( deptflag == "6" )||( deptflag == "7" )) ) {
  847. messageBox("회복실을 선택하지 ", "E007");
  848. return;
  849. }else if( cureflag == "" ) {
  850. messageBox("처치구분을 ", "C002");
  851. model.setFocus("cmb_cureflag");
  852. return;
  853. }
  854. }
  855. }
  856. }
  857. }
  858. var oproomcd, safestocqty, stocqty, goodcd, allsizespecid, refdeptflag;
  859. var nodeCnt = parseInt(getNodesetCount("/root/init/oproomlist"))+1;
  860. var oproomstoclist = "oproomcd▦safestocqty▦stocqty▦goodcd▦allsizespecid▦refdeptflag";
  861. goodcd = model.getValue("/root/main/goodinfo/gooddetlinfo/goodcd");
  862. allsizespecid = model.getValue("/root/main/goodinfo/gooddetlinfo/allsizespecid");
  863. for( var j = 1; j < nodeCnt; j++) {
  864. oproomcd = model.getValue("/root/init/oproomlist["+j+"]/oproomcd");
  865. if( j < 4 ) {//OR총재고를 제외하기 위해
  866. if( refdeptflag == "O" ) {//수술이면 CCR, Clean-Zone, OR(창고) 포함
  867. safestocqty = model.getValue("/root/temp/oproomstoclist/oproomnostoc"+j);
  868. stocqty = model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j);
  869. refdeptflag = "O";//CCR, Clean-Zone, OR(창고)수술실에서만 관리
  870. oproomstoclist = oproomstoclist + "▩"
  871. + oproomcd + "▦"
  872. + safestocqty + "▦"
  873. + stocqty + "▦"
  874. + goodcd + "▦"
  875. + allsizespecid + "▦"
  876. + refdeptflag;
  877. }else if( refdeptflag == "A" ) {//마취면
  878. if( (oldopuseyn == "N")&&(oldrecovruseyn == "N")) {
  879. safestocqty = model.getValue("/root/temp/oproomstoclist/oproomnostoc"+j);
  880. stocqty = model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j);
  881. refdeptflag = "O";//CCR, Clean-Zone, OR(창고)수술실에서만 관리
  882. oproomstoclist = oproomstoclist + "▩"
  883. + oproomcd + "▦"
  884. + safestocqty + "▦"
  885. + stocqty + "▦"
  886. + goodcd + "▦"
  887. + allsizespecid + "▦"
  888. + refdeptflag;
  889. }
  890. }else if( refdeptflag == "R" ) {//회복이면
  891. if( (oldopuseyn == "N")&&(oldanstuseyn == "N")) {
  892. safestocqty = model.getValue("/root/temp/oproomstoclist/oproomnostoc"+j);
  893. stocqty = model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j);
  894. refdeptflag = "O";//CCR, Clean-Zone, OR(창고)수술실에서만 관리
  895. oproomstoclist = oproomstoclist + "▩"
  896. + oproomcd + "▦"
  897. + safestocqty + "▦"
  898. + stocqty + "▦"
  899. + goodcd + "▦"
  900. + allsizespecid + "▦"
  901. + refdeptflag;
  902. }
  903. }
  904. }else {
  905. safestocqty = model.getValue("/root/temp/oproomstoclist/oproomnostoc"+(j+1));
  906. stocqty = model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+(j+1));
  907. refdeptflag = model.getValue("/root/main/cond/refdeptflag");
  908. oproomstoclist = oproomstoclist + "▩"
  909. + oproomcd + "▦"
  910. + safestocqty + "▦"
  911. + stocqty + "▦"
  912. + goodcd + "▦"
  913. + allsizespecid + "▦"
  914. + refdeptflag;
  915. }
  916. model.setValue("/root/temp/oproomstoclist/oproomnostoc"+j, ""); //수술방 안전재고 instance 초기화
  917. model.setValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j, "");//수술방 재고 instance 초기화
  918. }
  919. var custtel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel");
  920. if( custtel != "" ) {
  921. if( custtel.length < 10 ) {
  922. messageBox("거래처 전화번호를 정확히 입력하세요!", "");
  923. model.setFocus("ipt_custtel");
  924. return;
  925. }
  926. var custteltemp = custtel.split("-");
  927. var tellen = custteltemp.length;
  928. if( tellen > 1 ) {//'-'입력시
  929. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custteltemp[0]+""+custteltemp[1]+""+custteltemp[2]);
  930. }else {
  931. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custteltemp[0]);
  932. }
  933. }
  934. model.copyNode("/root/send/reqdata", "/root/main/goodinfo/gooddetlinfo");
  935. model.setValue("/root/send/senddata", oproomstoclist);
  936. if( endgood == "N" ) {
  937. messageBox("단종된 물품은 저장할 수 ", "I004");
  938. }else {
  939. submit("TXMNP04401");
  940. }
  941. model.removenode("/root/main/goodinfo/goodstocinfo/refdeptflag");
  942. model.setValue("/root/main/cond/deptflag", "");
  943. model.setValue("/root/temp/deptflag1", "");
  944. model.setValue("/root/temp/deptflag1", "");
  945. model.resetInstanceNode("/root/main/goodinfo");
  946. model.setValue("/root/main/cond/ccrlrgcd", "");
  947. model.setValue("/root/main/cond/ccrmdlcd", "");
  948. model.copyNode("/root/send/reqdata", "/root/main/cond");
  949. submit("TRMNP04401");//저장 후 재조회
  950. btn_save.disabled = true;
  951. }*/
  952. /* --------------------------------------------------*/
  953. /* type : function */
  954. /* access : public */
  955. /* desc : 수술실 물품 상세 정보 조회 */
  956. /* param : */
  957. /* return : */
  958. /* --------------------------------------------------*/
  959. function fDblClick(){
  960. model.removenode("/root/send");
  961. model.makeValue("/root/send/reqdata/goodcd", model.getValue("/root/main/goodlist[" + grd_goodlist.row + "]/goodcd"));
  962. model.makeValue("/root/send/reqdata/allsizespecid", model.getValue("/root/main/goodlist[" + grd_goodlist.row + "]/allsizespecid"));
  963. model.makeValue("/root/send/reqdata/refdeptflag", model.getValue("/root/main/cond/refdeptflag"));
  964. model.makeValue("/root/send/reqdata/refdept", model.getValue("/root/main/cond/refdept"));
  965. submit("TRMNP04402", false);
  966. //대, 중분류에 따른 콤보 조회
  967. if( model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd") != "" ) {
  968. model.resetInstanceNode("/root/temp/mdllist");
  969. model.resetInstanceNode("/root/temp/smllist");
  970. model.removenode("/root/send");
  971. model.makeNode("/root/send/reqdata");
  972. model.copyNode("/root/send/reqdata", "/root/main/cond");
  973. model.makeValue("/root/send/reqdata/tabflag", "CCR");
  974. model.makeValue("/root/send/reqdata/ccrlrgcd", model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd"));
  975. submit("TRMNP04409");
  976. }
  977. if( model.getValue("/root/main/goodinfo/gooddetlinfo/mdlcd") != "" ) {
  978. model.resetInstanceNode("/root/temp/smllist");
  979. model.removenode("/root/send");
  980. model.makeNode("/root/send/reqdata");
  981. model.copyNode("/root/send/reqdata", "/root/main/cond");
  982. model.makeValue("/root/send/reqdata/tabflag", "CCR");
  983. model.makeValue("/root/send/reqdata/ccrlrgcd", model.getValue("/root/main/goodinfo/gooddetlinfo/lrgcd"));
  984. model.makeValue("/root/send/reqdata/ccrmdlcd", model.getValue("/root/main/goodinfo/gooddetlinfo/mdlcd"));
  985. submit("TRMNP04410");
  986. }
  987. model.refresh();
  988. /*
  989. var iRow = -1;
  990. if( idx == 1 ) {//구매 조회일때
  991. iRow = grd_goodlist.row;
  992. }else if( idx == 2 ) {//CCR 조회일때
  993. iRow = grd_goodlist2.row;
  994. }else if( idx == 3 ) {//처방 조회
  995. iRow = grd_goodlist3.row;
  996. }
  997. if(iRow < 1)
  998. {
  999. return;
  1000. }else {
  1001. model.makeValue("/root/send/reqdata/goodcd", model.getValue("/root/main/goodlist"+"["+iRow+"]/goodcd"));
  1002. model.makeValue("/root/send/reqdata/allsizespecid", model.getValue("/root/main/goodlist"+"["+iRow+"]/allsizespecid"));
  1003. model.makeValue("/root/send/reqdata/endgood", model.getValue("/root/main/goodlist"+"["+iRow+"]/endgood"));
  1004. submit("TRMNP04402", false);
  1005. var totalSafeCnt = 0;
  1006. var totaStocCnt = 0;
  1007. var custtel = model.getValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel");
  1008. var tellen = custtel.length;
  1009. var custteltemp = custtel.substring(0, 2);
  1010. //전화번호 '-'로 구분 표시
  1011. if( tellen != 0 ) {//번호가 있을때
  1012. if( custteltemp == "01" ) {//휴대폰
  1013. if( tellen == 11 ) {
  1014. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,4)+"-"+custtel.substr(7,4));
  1015. }else {
  1016. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,3)+"-"+custtel.substr(6,4));
  1017. }
  1018. }else {
  1019. if( custteltemp == "02" ) {//서울
  1020. if( tellen == 10 ) {
  1021. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,2)+"-"+custtel.substr(2,4)+"-"+custtel.substr(6,4));
  1022. }else {
  1023. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,2)+"-"+custtel.substr(2,3)+"-"+custtel.substr(5,4));
  1024. }
  1025. }else {//그 외
  1026. if( tellen == 10 ) {
  1027. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,3)+"-"+custtel.substr(6,4));
  1028. }else {
  1029. model.setValue("/root/main/goodinfo/gooddetlinfo/ccrcusttel", custtel.substr(0,3)+"-"+custtel.substr(3,4)+"-"+custtel.substr(7,4));
  1030. }
  1031. }
  1032. }
  1033. }
  1034. //수술:1, 마취:2, 회복:3, 수술/마취:4, 마취/회복:5, 수술/회복:6, 수술/마취/회복:7
  1035. var deptflag = model.getValue("/root/main/goodinfo/gooddetlinfo/deptflag") ;
  1036. switch( deptflag ) {
  1037. case "1":
  1038. model.setValue("/root/temp/deptflag1", "1");
  1039. break;
  1040. case "2":
  1041. model.setValue("/root/temp/deptflag1", "2");
  1042. break;
  1043. case "3":
  1044. model.setValue("/root/temp/deptflag1", "3");
  1045. break;
  1046. case "4":
  1047. model.setValue("/root/temp/deptflag1", "1 2");
  1048. break;
  1049. case "5":
  1050. model.setValue("/root/temp/deptflag1", "2 3");
  1051. break;
  1052. case "6":
  1053. model.setValue("/root/temp/deptflag1", "1 3");
  1054. break;
  1055. case "7":
  1056. model.setValue("/root/temp/deptflag1", "1 2 3");
  1057. break;
  1058. }
  1059. if( model.getValue("/root/main/goodinfo/gooddetlinfo/ccrdeliveyn") == "Y" ) {
  1060. ccrdelivepriod.disabled = "true";
  1061. }else {
  1062. ccrdelivepriod.disabled = "false";
  1063. }
  1064. if( model.getValue("/root/main/goodinfo/gooddetlinfo/ccrlrgcd") != "" ) {
  1065. //대분류 값이 있으면
  1066. //물품 분류를 보여주기 위해 대분류로 중분류 조회 후 중분류값 대입
  1067. model.setValue("/root/main/cond/ccrlrgcd", model.getValue("/root/main/goodinfo/gooddetlinfo/ccrlrgcd"));
  1068. model.resetInstanceNode("/root/temp/mdllist");
  1069. model.resetInstanceNode("/root/temp/smllist");
  1070. var oldtabflag = model.getValue("/root/main/cond/tabflag");
  1071. if( oldtabflag != "CCR" ) {
  1072. model.setValue("/root/main/cond/tabflag", "CCR");
  1073. model.copyNode("/root/send/reqdata", "/root/main/cond");
  1074. submit("TRMNP04409");
  1075. model.setValue("/root/main/cond/tabflag", oldtabflag);
  1076. }else {
  1077. model.copyNode("/root/send/reqdata", "/root/main/cond");
  1078. submit("TRMNP04409");
  1079. }
  1080. }
  1081. if( model.getValue("/root/main/goodinfo/gooddetlinfo/ccrmdlcd") != "" ) {
  1082. //중분류 값이 있으면
  1083. //물품 분류를 보여주기 위해 중분류로 소분류 조회 후 소분류값 대입
  1084. model.setValue("/root/main/cond/ccrlrgcd", model.getValue("/root/main/goodinfo/gooddetlinfo/ccrlrgcd"));
  1085. model.setValue("/root/main/cond/ccrmdlcd", model.getValue("/root/main/goodinfo/gooddetlinfo/ccrmdlcd"));
  1086. model.resetInstanceNode("/root/temp/smllist");
  1087. if( model.getValue("/root/main/cond/tabflag") != "CCR" ) {
  1088. model.setValue("/root/main/cond/tabflag", "CCR");
  1089. model.copyNode("/root/send/reqdata", "/root/main/cond");
  1090. submit("TRMNP04410");
  1091. model.setValue("/root/main/cond/tabflag", "MIS");
  1092. }else {
  1093. model.copyNode("/root/send/reqdata", "/root/main/cond");
  1094. submit("TRMNP04410");
  1095. }
  1096. var nodeCnt = getNodesetCount("/root/temp/smllist");
  1097. if( nodeCnt > 0 ) {
  1098. //addComboItem("cmb_ccrsml", "전 체", "", "above" );
  1099. }
  1100. }
  1101. var nodeCnt = getNodesetCount("/root/temp/mdllist");
  1102. if( nodeCnt > 0 ) {
  1103. //addComboItem("cmb_ccrmdl", "전 체", "", "above" );
  1104. }
  1105. //재고 그리드 값 맵핑
  1106. var nodeCnt = parseInt(getNodesetCount("/root/init/oproomlist"))+1;
  1107. for( var j = 1; j <= nodeCnt; j++) {
  1108. var safestocqty = model.getValue("/root/main/goodinfo/oproomstoclisthid["+j+"]/safestocqty");
  1109. var stocqty = model.getValue("/root/main/goodinfo/oproomstoclisthid["+j+"]/stocqty");
  1110. if( ( safestocqty == "" )||( stocqty == "" ) ) {
  1111. model.setValue("/root/temp/oproomstoclist/oproomnostoc"+j, 0);
  1112. model.setValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j, 0);
  1113. }else {
  1114. model.setValue("/root/temp/oproomstoclist/oproomnostoc"+j, model.getValue("/root/main/goodinfo/oproomstoclisthid["+j+"]/safestocqty"));
  1115. model.setValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j, model.getValue("/root/main/goodinfo/oproomstoclisthid["+j+"]/stocqty"));
  1116. }
  1117. if( j < 5 ) {//CCR, CLEANE-ZONE, 창고, 수술방 총합만 합계
  1118. totalSafeCnt += parseFloat(model.getValue("/root/temp/oproomstoclist/oproomnostoc"+j));
  1119. totaStocCnt += parseFloat(model.getValue("/root/temp/oproomstoclist[2]/oproomnostoc"+j));
  1120. }
  1121. }
  1122. //재고 총합계를 CSR총합계에 맵핑
  1123. if( ( isNaN(totalSafeCnt) )||( isNaN(totaStocCnt) ) ) {//숫자가 아니면 리턴
  1124. return;
  1125. }else {
  1126. //수술방에서 포장 단위로 계산하여 보여주기
  1127. //var exchqty = model.getValue("/root/main/goodinfo/gooddetlinfo/exchqty"); //환산수량
  1128. //var allpacksafeqty = parseFloat( totalSafeCnt / parseFloat(exchqty) );
  1129. //var allpackqty = parseFloat( totaStocCnt / parseFloat(exchqty) );
  1130. //model.makeValue("/root/main/goodinfo/ccrstocinfo/allpacksafeqty", totalSafeCnt);
  1131. //model.makeValue("/root/main/goodinfo/ccrstocinfo/allpackqty", totaStocCnt);
  1132. model.makeValue("/root/main/goodinfo/ccrstocinfo/allsafeqty", totalSafeCnt);
  1133. model.makeValue("/root/main/goodinfo/ccrstocinfo/allqty", totaStocCnt);
  1134. }
  1135. }
  1136. btn_save.disabled = false;
  1137. model.refresh();*/
  1138. }
  1139. /* --------------------------------------------------*/
  1140. /* type : function */
  1141. /* access : public */
  1142. /* desc : 엑셀저장 */
  1143. /* param : */
  1144. /* return : */
  1145. /* --------------------------------------------------*/
  1146. function fSaveExcel(){
  1147. var fileName = window.fileDialog("save", ",", false, "excel", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  1148. var tabflag = model.getValue("/root/main/cond/tabflag");
  1149. if (fileName != "")
  1150. {
  1151. if( tabflag == "MIS" ) {
  1152. grd_goodlist.saveExcel(fileName, "SheetName", false, false, "", "", true);
  1153. }else if( tabflag == "CCR" ) {
  1154. grd_goodlist2.saveExcel(fileName, "SheetName", false, false, "", "", true);
  1155. }
  1156. }
  1157. }