SPMNP04400.js 39 KB

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