SMMNR03100.js 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012
  1. /*
  2. 간호 ITEM 관리(SMMNR03100.xrw - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var idx = 0;
  7. var treedepthcol = 14;
  8. var treetargetcol = 3;
  9. var xItemSrchPath = "/root/main/itemsrch/itemlist";
  10. var xAttrSrchPath = "/root/main/srchinfo/attrsrch/attrlist"; // 속성상세내역
  11. var xAttrListPath = "/root/main/recinfo/attrinfo/attrlist"; // 속성정보
  12. var xHiddenAttrListPath = "/root/temp/recinfo/attrlist"; // 속성정보
  13. var xRecItemAnptListPath = "/root/main/recinfo/recitemanptlist"; // 기록지연계정보
  14. var xHiddenRecItemAnptListPath = "/root/temp/recinfo/recitemanptlist";
  15. var xItemInfoPath = "/root/main/recinfo/iteminfo"; // Item 상세 정보
  16. var xHiddenItemInfoPath = "/root/temp/recinfo/iteminfo";
  17. var xICNPInfoPath = "/root/main/recinfo/icnpmngt/icnpinfo";
  18. var xCondPath = "/root/main/cond"; // 조건 정보
  19. var xPrcpInfoPath = "/root/main/recinfo/prcpinfo/prcplist"; // 처방조회
  20. var xRecFlagListPath = "/root/init/M0198list/M0198"; // 기록지구분
  21. var xPrcpSrchPath = "/root/main/srchinfo/prcpsrch/prcplist"; // 처방검색
  22. /**
  23. * @group :
  24. * @ver : 2007.03.12
  25. * @by : ??????
  26. * @---------------------------------------------------
  27. * @type : function
  28. * @access : public
  29. * @desc : 초기화 작업 및 기본 select
  30. * @param :
  31. * @return :
  32. * @---------------------------------------------------
  33. */
  34. function fInit(){
  35. var iItemRow = 0;
  36. zbcfGetCodeList(new Array("M0198"), new Array("/root/init/M0198list")); // 기록지구분(M0198)
  37. model.removenodeset("/root/main/itemsrch/itemlist");
  38. model.removenodeset(xRecItemAnptListPath);
  39. model.removenodeset(xPrcpSrchPath);
  40. grd_recitemanptinfo.rebuild();
  41. grd_prcpsrchinfo.rebuild();
  42. model.removenode("/root/send");
  43. fClearValue();
  44. for(var iRow = 1; iRow<=getNodesetCnt(model,xRecFlagListPath); iRow++){
  45. grd_recitemanptinfo.addRow(false);
  46. iItemRow = grd_recitemanptinfo.rows - grd_recitemanptinfo.fixedrows;
  47. model.setValue(xRecItemAnptListPath+"["+iItemRow+"]/status","I");
  48. model.setValue(xRecItemAnptListPath+"["+iItemRow+"]/recflag", model.getValue(xRecFlagListPath+"["+iRow+"]/cdid"));
  49. model.setValue(xRecItemAnptListPath+"["+iItemRow+"]/itemcd", model.getValue(xItemInfoPath+"]/itemcd"));
  50. }
  51. if (submit("TRMNR03101")){
  52. grd_srchitem.allStyle("data", "background-color") = "#FFFFFF";
  53. model.recalculate();
  54. setTree(grd_srchitem,treedepthcol,treetargetcol,true); // 트리구조 만들기
  55. model.copyNode("/root/temp/main/recinfo","/root/main/recinfo");
  56. }
  57. }
  58. /**
  59. * @group :
  60. * @ver : 2007.04.04
  61. * @by :
  62. * @---------------------------------------------------
  63. * @type : function
  64. * @access : public
  65. * @desc : 초기화 버튼 클릭시 값을 지움
  66. * @param : pFlag ( G : 분류명 입력여부 선택시, N : 신규버튼 클릭시)
  67. * @return :
  68. * @---------------------------------------------------
  69. */
  70. function fClearValue(pFlag){
  71. if(pFlag == null || pFlag == "" ){
  72. pFlag = "N";
  73. }
  74. switch(pFlag){
  75. case "ttl" :
  76. model.resetInstanceNode(xItemInfoPath);
  77. model.removenodeset(xICNPInfoPath);
  78. model.removenodeset(xAttrListPath);
  79. model.removenodeset(xAttrSrchPath);
  80. cmb_clscd.disabled = false;
  81. btn_saveprcpinfo.disabled = true;
  82. btn_delprcpinfo.disabled = true;
  83. rdo_cathflag.disabled = true;
  84. btn_srchprcp.disabled = true;
  85. ipt_prcpnm.disabled = true;
  86. btn_rgstprcp.disabled = true;
  87. break;
  88. case "N" :
  89. case "G" :
  90. var sClsYN = model.getValue(xCondPath+"/clsyn");
  91. var sClsCD = model.getValue(xCondPath+"/clscd");
  92. var sItemCD = model.getValue(xItemInfoPath+"/itemcd");
  93. var sSupCD = model.getValue(xItemInfoPath+"/supcd");
  94. model.resetInstanceNode(xItemInfoPath);
  95. model.removenodeset(xICNPInfoPath);
  96. model.removenodeset(xAttrListPath);
  97. model.removenodeset(xAttrSrchPath);
  98. for(var iRow = grd_recitemanptinfo.fixedrows;iRow <= grd_recitemanptinfo.rows - grd_recitemanptinfo.fixedrows; iRow++){
  99. model.setValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag","");
  100. model.setValue(xRecItemAnptListPath+"["+iRow+"]/prcpyn","");
  101. model.setValue(xRecItemAnptListPath+"["+iRow+"]/itemcd","");
  102. model.setValue(xRecItemAnptListPath+"["+iRow+"]/status","I");
  103. }
  104. model.resetInstanceNode(xCondPath);
  105. if(pFlag == "N"){
  106. if(sClsCD == "" && sSupCD == "*"){
  107. model.setValue(xCondPath+"/clscd",sItemCD);
  108. model.setValue(xItemInfoPath+"/supcd",sItemCD);
  109. }else{
  110. model.setValue(xCondPath+"/clscd",sClsCD);
  111. model.setValue(xItemInfoPath+"/supcd",sClsCD);
  112. }
  113. }else{
  114. if(pFlag == "G"){
  115. model.setValue(xCondPath+"/clsyn",sClsYN);
  116. }
  117. model.setValue(xItemInfoPath+"/supcd","*");
  118. }
  119. cmb_clscd.disabled = false;
  120. btn_saveprcpinfo.disabled = true;
  121. btn_delprcpinfo.disabled = true;
  122. rdo_cathflag.disabled = true;
  123. btn_srchprcp.disabled = true;
  124. ipt_prcpnm.disabled = true;
  125. btn_rgstprcp.disabled = true;
  126. fSrchPrcpInfo(); // 처방 매핑 부분
  127. model.setValue(xItemInfoPath+"/status","I");
  128. model.setValue(xItemInfoPath+"/refseq",0);
  129. // model.setValue(xItemInfoPath+"/timesetting","");
  130. model.setValue(xItemInfoPath+"/elmtdefineyn","Y");
  131. model.copyNode(xHiddenItemInfoPath, xItemInfoPath);
  132. model.copyNode("/root/temp/main/recinfo","/root/main/recinfo");
  133. break;
  134. case "prcp" :
  135. var iRow = grd_recitemanptinfo.row;
  136. if(model.getValue(xCondPath+"/recflag") == model.getValue(xRecItemAnptListPath+"["+iRow+"]/recflag")){
  137. return;
  138. }
  139. model.removenodeset(xPrcpInfoPath);
  140. model.removenodeset(xPrcpSrchPath);
  141. model.setValue(xCondPath+"/recflag","");
  142. grd_prcpinfo.rebuild();
  143. grd_prcpsrchinfo.rebuild();
  144. cmb_recflag.refresh();
  145. break;
  146. }
  147. }
  148. /**
  149. * @group :
  150. * @ver : 2007.05.04
  151. * @by : 이은영
  152. * @---------------------------------------------------
  153. * @type : function
  154. * @access : public
  155. * @desc : 저장
  156. * @param : pFlag ( item : 아이템 저장,)
  157. * @return :
  158. * @---------------------------------------------------
  159. */
  160. function fSave(pFlag){
  161. model.removenode("/root/send");
  162. var sSaveDataHeader = "supcd▦itemcd▦itemnm▦elmtdefineyn▦status▦refseq▦tmapntyn▦itemdescspec▦grupflag▦refseq▦lnkbizcd▦comnyn▩";
  163. var sSaveData = ""; // 저장 Data
  164. var iICNPRow = 1;
  165. var sClsYN = ""; // 분류 구분
  166. var sItemNM = ""; // 항목명
  167. var sMainRecCharFlagYN = "N"; // 주체 존재 여부
  168. var sMainRecCharFlagCnt = 0; // 주체 갯수
  169. var sRecItemAnptChk = "N"; // 기록지연계정보 수정여부
  170. var sAttrInfoChk = "N"; // 속성정보 수정여부
  171. var xSaveICNPInfoPath = "/root/temp/icnpinfo";
  172. var sICNPChk = false; // ICNP 존재 여부
  173. var sStatus = ""; // 상태
  174. var sSupCD = ""; // 상위코드
  175. var sItemCD = ""; // 항목코드
  176. var iRow = 0;
  177. switch(pFlag){
  178. case "item" : // 항목 저장
  179. sClsYN = model.getValue(xCondPath+"/clsyn");
  180. if(sClsYN == "Y"){
  181. sItemNM = model.getValue(xCondPath+"/clscd");
  182. if(sItemNM == ""){
  183. model.setValue(xItemInfoPath+"/status","-");
  184. }else{
  185. model.setValue(xItemInfoPath+"/itemnm",sItemNM);
  186. }
  187. for(var iRow = grd_recitemanptinfo.fixedrows; iRow<= grd_recitemanptinfo.rows - grd_recitemanptinfo.fixedrows; iRow++){
  188. model.setValue(xRecItemAnptListPath+"["+iRow+"]/status","-");
  189. }
  190. }else{
  191. sSupCD = model.getValue(xItemInfoPath+"/supcd");
  192. sItemNM = model.getValue(xItemInfoPath+"/itemnm");
  193. if(model.getValue(xItemInfoPath+"/itemnm") == ""){
  194. messageBox("항목명을 입력하지","E007");
  195. return;
  196. }
  197. // 분류에는 기록지 연계 내역이 없음.
  198. if(sSupCD != "*"){
  199. for(var iRow = grd_recitemanptinfo.fixedrows; iRow<= grd_recitemanptinfo.rows - grd_recitemanptinfo.fixedrows; iRow++){
  200. sStatus = model.getValue(xRecItemAnptListPath+"["+iRow+"]/status");
  201. if(model.getValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag") == "A"){
  202. sMainRecCharFlagYN = "Y";
  203. sMainRecCharFlagCnt++;
  204. }
  205. if(sStatus == "I" && model.getValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag") == ""){
  206. model.setValue(xRecItemAnptListPath+"["+iRow+"]/status","-");
  207. }else{
  208. if(sStatus == "I" || sStatus == "U" || sStatus == "D"){
  209. sRecItemAnptChk = "Y";
  210. }
  211. }
  212. }
  213. if(sMainRecCharFlagYN == "N"){
  214. messageBox("주체를 하나","C002");
  215. return;
  216. }
  217. if(sMainRecCharFlagCnt > 1){
  218. window.alert( "주체는 하나만 존재해야 합니다.", "오류", "16" );
  219. return;
  220. }
  221. for(var iRow = grd_attrinfo.fixedrows; iRow<=grd_attrinfo.rows-grd_attrinfo.fixedrows;iRow++){
  222. //if(model.getValue(xAttrListPath+"["+iRow+"]/check") == "true" && model.getValue(xAttrListPath+"["+iRow+"]/status") != "-"){
  223. if(model.getValue(xAttrListPath+"["+iRow+"]/status") != "-"){
  224. sAttrInfoChk = "Y";
  225. break;
  226. }
  227. }
  228. }else{
  229. for(var iRow = grd_recitemanptinfo.fixedrows; iRow<= grd_recitemanptinfo.rows - grd_recitemanptinfo.fixedrows; iRow++){
  230. model.setValue(xRecItemAnptListPath+"["+iRow+"]/status","-");
  231. }
  232. }
  233. // ICNP 정보
  234. for(var iRow=grd_icnpinfo.fixedrows; iRow<=grd_icnpinfo.rows-grd_icnpinfo.fixedrows; iRow++){
  235. if(model.getValue(xICNPInfoPath+"["+iRow+"]/check") == "true"){
  236. model.setValue(xICNPInfoPath+"["+iRow+"]/itemcd", model.getValue(xItemInfoPath+"/itemcd"));
  237. grd_icnpinfo.rowStatus(iRow) = 1;
  238. sICNPChk = true;
  239. }
  240. }
  241. if(instance1.selectSingleNode(xItemInfoPath).xml == instance1.selectSingleNode(xHiddenItemInfoPath).xml && sRecItemAnptChk == "N"
  242. && sICNPChk == false && sAttrInfoChk == "N"){ // 변경된 데이터가 있는 여부를 체크
  243. messageBox("변경된 데이터가","I004");
  244. return;
  245. }
  246. if(instance1.selectSingleNode(xItemInfoPath).xml == instance1.selectSingleNode(xHiddenItemInfoPath).xml){
  247. model.setValue(xItemInfoPath+"/status","-");
  248. }
  249. }
  250. // 트리 펼치기
  251. setTree(grd_srchitem,treedepthcol,treetargetcol,false);
  252. //tree 및 레벨설정
  253. /*for(var i = grd_srchitem.fixedRows; i < grd_srchitem.rows; i++)
  254. {
  255. grd_srchitem.outlinelevel(i)=grd_srchitem.valuematrix(i, 12); //인스턴스 levl 값임
  256. }
  257. // tree 대상 컬럼 및 형태 설정
  258. grd_srchitem.outlinecol=2; //연결선이 표현되는 컬럼
  259. grd_srchitem.outlinebar=2; //연결선 형태 설정 (+ , - , 사각형 안보이게 하려면 0 으로 세팅)
  260. grd_srchitem.treecolor="#948777"
  261. for(var i = grd_srchitem.fixedrows; i <grd_srchitem.rows; i++)
  262. {
  263. grd_srchitem.iscollapsed(i)=false; //자식 트리 접기
  264. }*/
  265. sSaveData += model.getValue(xItemInfoPath+"/supcd")+"▦"
  266. + model.getValue(xItemInfoPath+"/itemcd")+"▦"
  267. + model.getValue(xItemInfoPath+"/itemnm")+"▦"
  268. + model.getValue(xItemInfoPath+"/elmtdefineyn")+"▦"
  269. + model.getValue(xItemInfoPath+"/status")+"▦0▦"
  270. + model.getValue(xItemInfoPath+"/tmapntyn")+"▦"
  271. + model.getValue(xItemInfoPath+"/itemdescspec")+"▦"
  272. + model.getValue(xItemInfoPath+"/grupflag")+"▦"
  273. + ipt_refseq.value +"▦"
  274. + cmb_lnkbiz.value +"▦"
  275. + model.getValue(xItemInfoPath+"/comnyn")+"▩";
  276. model.makeValue("/root/send/iteminfo",sSaveDataHeader+sSaveData);
  277. model.makeValue("/root/send/attrinfo", grd_attrinfo.getUpdateDataAll("i"));
  278. model.makeValue("/root/send/recitemanptlist", grd_recitemanptinfo.getUpdateDataAll("i"));
  279. model.makeValue("/root/send/icnpinfo", grd_icnpinfo.getUpdateData());
  280. if(submit("TXMNR03101")){
  281. fClearValue();
  282. if(sClsYN != "Y"){
  283. iRow = grd_srchitem.findRow(sItemNM,1,3);
  284. sSupCD = model.getValue(xItemSrchPath+"["+iRow+"]/supcd");
  285. //tree 및 레벨설정
  286. for(var i = grd_srchitem.fixedRows; i < grd_srchitem.rows; i++)
  287. {
  288. //gridObj.issubtotal(i) = true;
  289. grd_srchitem.outlinelevel(i)=grd_srchitem.valuematrix(i, treedepthcol); //인스턴스 levl 값임
  290. }
  291. // tree 대상 컬럼 및 형태 설정
  292. grd_srchitem.outlinecol=3; //연결선이 표현되는 컬럼
  293. grd_srchitem.outlinebar=2; //연결선 형태 설정 (+ , - , 사각형 안보이게 하려면 0 으로 세팅)
  294. grd_srchitem.treecolor="#948777"
  295. for(var i = grd_srchitem.fixedrows; i <grd_srchitem.rows; i++)
  296. {
  297. if(model.getValue(xItemSrchPath+"["+i+"]/itemcd") == sSupCD || model.getValue(xItemSrchPath+"["+i+"]/supcd") == sSupCD){
  298. grd_srchitem.iscollapsed(i)=false; //자식 트리 접기
  299. }else{
  300. grd_srchitem.iscollapsed(i)=true; //자식 트리 접기
  301. }
  302. }
  303. iRow = grd_srchitem.findRow(sItemNM,1,3);
  304. grd_srchitem.row = iRow;
  305. fClickedGridRow("item");
  306. }else{
  307. setTree(grd_srchitem,treedepthcol,treetargetcol,true); // 트리구조 만들기
  308. }
  309. model.copyNode("/root/temp/main/recinfo","/root/main/recinfo");
  310. model.refresh();
  311. }
  312. break;
  313. case "prcp" :
  314. model.removenode("/root/send");
  315. model.makeValue("/root/send/prcpinfo", grd_prcpinfo.getUpdateDataAll("i"));
  316. if(submit("TXMNR03102")){
  317. iRow = grd_srchitem.findRow(model.getValue(xCondPath+"/itemcd"),1,2);
  318. grd_srchitem.row = iRow;
  319. fClickedGridRow("item");
  320. iRow = grd_recitemanptinfo.findRow(model.getValue(xCondPath+"/recflag"),1,1);
  321. grd_detlattrinfo.row = iRow;
  322. fDblClickedGrid("prcp",true);
  323. }
  324. break;
  325. }
  326. }
  327. /**
  328. * @group :
  329. * @ver : 2007.05.08
  330. * @by : 이은영
  331. * @---------------------------------------------------
  332. * @type : function
  333. * @access : public
  334. * @desc : Item 삭제
  335. * @param :
  336. * @return :
  337. * @---------------------------------------------------
  338. */
  339. function fDelItemInfo(){
  340. model.setValue(xItemInfoPath+"/elmtdefineyn","N");
  341. model.setValue(xItemInfoPath+"/status","D");
  342. fSave("item");
  343. }
  344. /**
  345. * @group :
  346. * @ver : 2007.03.22
  347. * @by : 신혁춘
  348. * @---------------------------------------------------
  349. * @type : function
  350. * @access : public
  351. * @desc : 그리드 클릭시..
  352. * @param : pFlag ( prcp : 처방조회), pReSrchYN : 저장 후 재조회여부
  353. * @return :
  354. * @---------------------------------------------------
  355. */
  356. function fDblClickedGrid(pFlag,pReSrchYN){
  357. var iRow = 0;
  358. var sItemCD = "";
  359. switch(pFlag){
  360. case "prcp" :
  361. iRow = grd_recitemanptinfo.row;
  362. var sStatus = model.getValue(xRecItemAnptListPath+"["+iRow+"]/status");
  363. var sRecFlag = model.getValue(xRecItemAnptListPath+"["+iRow+"]/recflag");
  364. var sRecCharFlag = model.getValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag");
  365. sItemCD = model.getValue(xRecItemAnptListPath+"["+iRow+"]/itemcd");
  366. if(pReSrchYN == null){
  367. fSrchPrcpInfo();
  368. btn_saveprcpinfo.disabled = true;
  369. btn_delprcpinfo.disabled = true;
  370. rdo_cathflag.disabled = true;
  371. btn_srchprcp.disabled = true;
  372. ipt_prcpnm.disabled = true;
  373. btn_rgstprcp.disabled = true;
  374. if(sRecCharFlag == ""){
  375. messageBox("현재 기록지 등록이 되어있지","E007");
  376. return;
  377. }
  378. if(sItemCD == "" && sRecCharFlag != ""){
  379. messageBox("항목 저장이 된 상태에서만 등록할 수 있습니다. 현재 저장하지","E007");
  380. return;
  381. }
  382. if(instance1.selectSingleNode("/root/main/recinfo").xml != instance1.selectSingleNode("/root/temp/main/recinfo").xml){
  383. sRtn = messageBox("변경된 데이터가 있습니다. 계속 진행시 저장이 되지 않습니다.","Q003");
  384. if(sRtn != 6){
  385. return;
  386. }
  387. }
  388. if(sRecFlag == "B" || sRecFlag == "C"){
  389. messageBox("Intake 와 Output은 처방 등록을 할 수","I004");
  390. return;
  391. }
  392. model.setValue(xCondPath+"/recflag",sRecFlag);
  393. btn_saveprcpinfo.disabled = false;
  394. btn_delprcpinfo.disabled = false;
  395. btn_srchprcp.disabled = false;
  396. ipt_prcpnm.disabled = false;
  397. btn_rgstprcp.disabled = false;
  398. if(sRecFlag == "D"){
  399. rdo_cathflag.disabled = false;
  400. model.setValue(xCondPath+"/cathflag","A");
  401. }else{
  402. rdo_cathflag.disabled = true;
  403. }
  404. model.toggle("prcpmapping");
  405. btn_prcpmapping.selected = true;
  406. }
  407. model.removenode("/root/send");
  408. model.makeValue("/root/send/itemcd",sItemCD);
  409. model.makeValue("/root/send/recflag",sRecFlag);
  410. if(submit("TRMNR03106")){
  411. model.copyNode("/root/temp/main/recinfo","/root/main/recinfo");
  412. model.removenodeset(xPrcpSrchPath);
  413. grd_prcpsrchinfo.rebuild();
  414. }
  415. model.refresh();
  416. break;
  417. case "detlattr":
  418. iRow = grd_attrinfo.row;
  419. if (iRow < 1 ){
  420. if(grd_attrinfo.rows < 1){
  421. return;
  422. }else{
  423. iRow = 1;
  424. }
  425. }
  426. if(model.getValue(xAttrListPath+"["+iRow+"]/attrcd") != ""){
  427. model.makeValue("/root/send/attrcd", model.getValue(xAttrListPath+"["+iRow+"]/attrcd"));
  428. submit("TRMNR03105");
  429. }
  430. break;
  431. }
  432. }
  433. /**
  434. * @group :
  435. * @ver : 2007.05.04
  436. * @by : 이은영
  437. * @---------------------------------------------------
  438. * @type : function
  439. * @access : public
  440. * @desc : 그리드 클릭시..
  441. * @param : pFlag ( item : 상세 항목 조회)
  442. * @return :
  443. * @---------------------------------------------------
  444. */
  445. function fClickedGridRow(pFlag){
  446. var iRow = 0;
  447. var sDepth = 0;
  448. var sItemCD = "";
  449. var sRecFlag = ""; // 기록구분
  450. var sBoolStatus = true; //
  451. var iDepth = 0;
  452. var sLnkbizcd = "";
  453. var sComnyn = "";
  454. switch(pFlag){
  455. case "item":
  456. iRow = grd_srchitem.row;
  457. if(iRow < 1 || !grd_srchitem.isCell(event.target)) return;
  458. fClearValue("ttl");
  459. sDepth = eval(model.getValue(xItemSrchPath+"["+iRow+"]/depth"));
  460. sItemCD = model.getValue(xItemSrchPath+"["+iRow+"]/itemcd");
  461. sLnkbizcd = model.getValue(xItemSrchPath+"["+iRow+"]/lnkbizcd");
  462. sComnyn = model.getValue(xItemSrchPath+"["+iRow+"]/comnyn");
  463. model.setValue(xCondPath+"/itemcd",sItemCD);
  464. model.removenode("/root/send");
  465. model.makeValue("/root/send/itemcd", sItemCD);
  466. if(submit("TRMNR03102")){
  467. model.copyNode(xItemInfoPath, xHiddenItemInfoPath);
  468. copyNodeset(xAttrListPath,"/root/temp/recinfo/attrlist");
  469. copyNodeset(xICNPInfoPath,"/root/temp/recinfo/icnpinfo");
  470. if(sDepth == 1){ // 분류
  471. model.setValue(xCondPath+"/clscd", "");
  472. cmb_clscd.disabled = true;
  473. }else{
  474. model.setValue(xCondPath+"/clscd", model.getValue(xItemInfoPath+"/supcd"));
  475. }
  476. model.refresh();
  477. for(var i = grd_recitemanptinfo.fixedrows; i <= grd_recitemanptinfo.rows - grd_recitemanptinfo.fixedrows; i++){
  478. sRecFlag = model.getValue(xRecItemAnptListPath+"["+i+"]/recflag");
  479. model.setValue(xRecItemAnptListPath+"["+i+"]/reccharflag",model.getValue(xHiddenRecItemAnptListPath+"[recflag = '"+sRecFlag+"']/reccharflag"));
  480. model.setValue(xRecItemAnptListPath+"["+i+"]/prcpyn",model.getValue(xHiddenRecItemAnptListPath+"[recflag = '"+sRecFlag+"']/prcpyn"));
  481. if(model.getValue(xHiddenRecItemAnptListPath+"[recflag = '"+sRecFlag+"']/reccharflag") != "") model.setValue(xRecItemAnptListPath+"["+i+"]/status","-");
  482. model.setValue(xRecItemAnptListPath+"["+i+"]/itemcd", sItemCD);
  483. }
  484. grd_recitemanptinfo.row = 0;
  485. model.recalculate();
  486. model.copyNode("/root/temp/main/recinfo","/root/main/recinfo");
  487. fSrchPrcpInfo(); // 처방 매핑 정보
  488. // 트리 변경
  489. if(grd_srchitem.iscollapsed(iRow) == true){
  490. sBoolStatus = false;
  491. }else{
  492. sBoolStatus = true;
  493. }
  494. for(var i=iRow; i<=grd_srchitem.rows - grd_srchitem.fixedrows; i++){
  495. iDepth = eval(model.getValue(xItemSrchPath+"["+i+"]/depth"));
  496. if(i==iRow){
  497. grd_srchitem.iscollapsed(i) = sBoolStatus;
  498. }else if(i != iRow && sDepth < iDepth){
  499. grd_srchitem.iscollapsed(i) = sBoolStatus;
  500. }else{
  501. break;
  502. }
  503. }
  504. }
  505. fDblClickedGrid("detlattr");
  506. break;
  507. }
  508. }
  509. /**
  510. * @group :
  511. * @ver : 2007.05.04
  512. * @by : 이은영
  513. * @---------------------------------------------------
  514. * @type : function
  515. * @access : public
  516. * @desc : 찾기
  517. * @param : pFlag ( term : 용어찾기, attr : 속성찾기, detlattr : 상세속성검색)
  518. * @return :
  519. * @---------------------------------------------------
  520. */
  521. function fSrchItemInfo(pFlag){
  522. model.removenode("/root/send");
  523. var sItemNM = ""; //항목명
  524. var sItemCD = ""; //항목코드
  525. var sSupCD = ""; //상위코드
  526. switch(pFlag){
  527. case "term":
  528. sItemNM = model.getValue(xItemInfoPath+"/itemnm");
  529. if(sItemNM == ""){
  530. messageBox("Item명을 먼저","C001");
  531. return;
  532. }
  533. model.makeValue("/root/send/itemnm", sItemNM);
  534. submit("TRMNR03103");
  535. break;
  536. case "attr":
  537. sItemNM = model.getValue(xItemInfoPath+"/itemnm");
  538. sItemCD = model.getValue(xItemInfoPath+"/itemcd");
  539. sSupCD = model.getValue(xItemInfoPath+"/supcd");
  540. if(sSupCD == "*"){
  541. messageBox("분류명은 속성을 등록할 수","I004");
  542. return;
  543. }
  544. if(sItemNM == ""){
  545. messageBox("Item명을 먼저","C001");
  546. return;
  547. }
  548. model.removenodeset(xAttrSrchPath);
  549. model.makeValue("/root/send/itemnm", sItemNM);
  550. model.makeValue("/root/send/itemcd", sItemCD);
  551. submit("TRMNR03104");
  552. break;
  553. }
  554. }
  555. /**
  556. * @group :
  557. * @ver : 2007.05.04
  558. * @by : 이은영
  559. * @---------------------------------------------------
  560. * @type : function
  561. * @access : public
  562. * @desc : 팝업창 호출
  563. * @param : pFlag ( attr : 속성등록, icnp: icnp 용어등록)
  564. * @return :
  565. * @---------------------------------------------------
  566. */
  567. function fCallPopUp(pFlag){
  568. var xpos = event.screenX-500;
  569. var ypos = event.screenY-300;
  570. switch(pFlag){
  571. case "attr":
  572. var sSupCD = model.getValue(xItemInfoPath+"/supcd");
  573. if(sSupCD == "*"){
  574. messageBox("분류명은 속성을 등록할 수","I004");
  575. return;
  576. }
  577. model.makeValue("/root/temp/refinfo/flag","p");
  578. //modal("SMMNR01700",1, xpos, ypos,"SMMNR01700","/root/temp/refinfo","/root/temp/refinfo");
  579. modal("SMMNR01700",1, xpos, ypos,"SMMNR01700","/root/temp/refinfo","/root/hidden/refinfo");
  580. var sAttrInfo = getParameter("SMMNR01700_Retrun").split("▩");
  581. setParameter("SMMNR01700_Retrun", "");
  582. if(sAttrInfo == "") return;
  583. var sValue = sAttrInfo[1].split("▦");
  584. if(model.getValue(xAttrListPath+"[attrcd = '"+sValue[0]+"']/attrcd") != "") return;
  585. grd_attrinfo.addItem();
  586. iRow = grd_attrinfo.rows - grd_attrinfo.fixedrows;
  587. model.setValue(xAttrListPath+"["+iRow+"]/status", "I");
  588. model.setValue(xAttrListPath+"["+iRow+"]/attrcd", sValue[0]);
  589. model.setValue(xAttrListPath+"["+iRow+"]/attrnm", sValue[1]);
  590. model.setValue(xAttrListPath+"["+iRow+"]/attrflag", sValue[2]);
  591. model.setValue(xAttrListPath+"["+iRow+"]/plnumchoiyn", sValue[3]);
  592. model.setValue(xAttrListPath+"["+iRow+"]/refseq", sValue[4]);
  593. model.setValue(xAttrListPath+"["+iRow+"]/check", "true");
  594. model.setValue(xAttrListPath+"["+iRow+"]/itemcd", model.getValue(xItemInfoPath+"/itemcd"));
  595. grd_attrinfo.rebuild();
  596. break;
  597. case "icnp":
  598. var iRow = grd_icnpinfo.row;
  599. if(iRow < 1){
  600. messageBox("ICNP 매핑할 용어가","I004");
  601. return;
  602. }
  603. model.makeValue("/root/temp/refinfo/flag","p");
  604. modal("SMMNR01200",1, xpos, ypos,"SMMNR01200","/root/temp/refinfo","/root/hidden/refinfo");
  605. var sTermInfo = getParameter("terminfo");
  606. var sValue = sTermInfo.split("▦");
  607. model.setValue(xICNPInfoPath+"["+iRow+"]/smnttypenm", sValue[0]);
  608. model.setValue(xICNPInfoPath+"["+iRow+"]/termcd", sValue[1]);
  609. model.setValue(xICNPInfoPath+"["+iRow+"]/icnphngterm", sValue[2]);
  610. model.setValue(xICNPInfoPath+"["+iRow+"]/icnpengterm", sValue[3]);
  611. grd_icnpinfo.rebuild();
  612. break;
  613. case "prcp" :
  614. if(model.getValue(xCondPath+"/prcpnm") == ""){
  615. messageBox("검색어를","C001");
  616. return;
  617. }
  618. var iRow = 0;
  619. setParameter("prcpsrchflag","nm");
  620. setParameter("srchtextval",model.getValue(xCondPath+"/prcpnm"));
  621. setParameter("scrnflag","rec");
  622. setParameter("srchParam","srchSET");
  623. setParameter("rtnpath","/root/main/srchinfo/prcpsrch");
  624. modal("SPMNW11100");
  625. grd_prcpsrchinfo.rebuild();
  626. iRow = grd_prcpsrchinfo.rows - grd_prcpsrchinfo.fixedrows;
  627. model.makeNode(xPrcpSrchPath+"["+iRow+"]/check");
  628. model.setValue(xCondPath+"/prcpnm","");
  629. grd_prcpsrchinfo.rebuild();
  630. model.refresh();
  631. break;
  632. }
  633. }
  634. /**
  635. * @group :
  636. * @ver : 2007.05.04
  637. * @by : 이은영
  638. * @---------------------------------------------------
  639. * @type : function
  640. * @access : public
  641. * @desc : 그리드 삭제
  642. * @param : pFlag ( attr : 속성찾기, rec: 기록지연계정보)
  643. * @return :
  644. * @---------------------------------------------------
  645. */
  646. function fDelGridRow(pFlag){
  647. var iRow = 0;
  648. var sStatus = "";
  649. switch(pFlag){
  650. case "attr": // 속성
  651. iRow = grd_attrinfo.row;
  652. if(iRow < 1) return;
  653. sStatus = model.getValue(xAttrListPath+"["+iRow+"]/status");
  654. if(sStatus == "I"){
  655. grd_attrinfo.deleteItem(iRow);
  656. model.removenodeset(xAttrSrchPath);
  657. grd_detlattrinfo.rebuild();
  658. }else if(sStatus == "D"){
  659. model.setValue(xAttrListPath+"["+iRow+"]/status","-");
  660. model.setValue(xAttrListPath+"["+iRow+"]/check","true");
  661. }else{
  662. model.setValue(xAttrListPath+"["+iRow+"]/status","D");
  663. model.setValue(xAttrListPath+"["+iRow+"]/check","false");
  664. }
  665. break;
  666. case "prcp":
  667. iRow = grd_prcpinfo.row;
  668. if(iRow < 1) return;
  669. sStatus = model.getValue(xPrcpInfoPath+"["+iRow+"]/status");
  670. if(sStatus == "I"){
  671. grd_prcpinfo.deleteItem(iRow);
  672. }else if(sStatus == "D"){
  673. model.setValue(xPrcpInfoPath+"["+iRow+"]/status","-");
  674. }else{
  675. model.setValue(xPrcpInfoPath+"["+iRow+"]/status","D");
  676. }
  677. grd_prcpinfo.rebuild();
  678. break;
  679. }
  680. }
  681. /**
  682. * @group :
  683. * @ver : 2007.05.04
  684. * @by : 이은영
  685. * @---------------------------------------------------
  686. * @type : function
  687. * @access : public
  688. * @desc : 그리드 추가
  689. * @param : pFlag ( item : 기록지 연계 정보, prcp : 처방정보)
  690. * @return :
  691. * @---------------------------------------------------
  692. */
  693. function fAddGridRow(pFlag){
  694. var iRow = 0;
  695. switch(pFlag){
  696. case "prcp":
  697. var sSetNo = "";
  698. var sSetTypeCd = "";
  699. var sSetCdNo = "";
  700. var sPrcpcd = "";
  701. var sPrcpPkSpec;
  702. var sItemCD = model.getValue(xCondPath+"/itemcd");
  703. var sRecFlag = model.getValue(xCondPath+"/recflag");
  704. var sCathFlag = model.getValue(xCondPath+"/cathflag");
  705. var sInsLastRow = 0;
  706. if(sRecFlag == ""){
  707. messageBox("기록지를 먼저", "C002");
  708. return;
  709. }
  710. if(sRecFlag == "D" && sCathFlag ==""){
  711. messageBox("Catheter 기록은 Catheter 구분은", "I003");
  712. return;
  713. }
  714. for(var iRow = grd_prcpsrchinfo.fixedrows; iRow<= (grd_prcpsrchinfo.rows-grd_prcpsrchinfo.fixedrows); iRow++){
  715. if(model.getValue(xPrcpSrchPath+"["+iRow+"]/check") == "true"){
  716. sPrcpPkSpec = model.getValue(xPrcpSrchPath+"["+iRow+"]/prcppkspec").split("|");
  717. sSetNo = sPrcpPkSpec[0];
  718. sSetTypeCd = sPrcpPkSpec[1];
  719. sSetCdNo = sPrcpPkSpec[2];
  720. sPrcpcd = model.getValue(xPrcpSrchPath+"["+iRow+"]/prcpcd");
  721. if(model.getValue(xPrcpInfoPath+"[prcpcd='"+sPrcpcd+"' and cateprcpflag='"+sCathFlag+"' and recflag='"+sRecFlag+"']/prcpcd") == ""){
  722. grd_prcpinfo.addItem();
  723. sRow = grd_prcpinfo.rows - grd_prcpinfo.fixedrows;
  724. model.setValue(xPrcpInfoPath+"["+sRow+"]/status","I");
  725. model.setValue(xPrcpInfoPath+"["+sRow+"]/itemcd",sItemCD); // 항목코드
  726. model.setValue(xPrcpInfoPath+"["+sRow+"]/recflag",sRecFlag); // 기록구분
  727. model.setValue(xPrcpInfoPath+"["+sRow+"]/prcpcd",model.getValue(xPrcpSrchPath+"["+iRow+"]/prcpcd")); // 처방코드
  728. model.setValue(xPrcpInfoPath+"["+sRow+"]/cateprcpflag",model.getValue(xCondPath+"/cathflag")); // catheter 구분
  729. model.setValue(xPrcpInfoPath+"["+sRow+"]/prcpnm",model.getValue(xPrcpSrchPath+"["+iRow+"]/prcpnm")); // 처방명
  730. model.setValue(xPrcpInfoPath+"["+sRow+"]/drugmthdspccd",model.getValue(xPrcpSrchPath+"["+iRow+"]/drugmthdspccd")); // 규격
  731. sInsLastRow = sRow;
  732. }
  733. }
  734. }
  735. grd_prcpinfo.rebuild();
  736. if(sInsLastRow > 0 ){
  737. grd_prcpinfo.topRow = sInsLastRow;
  738. }
  739. break;
  740. }
  741. }
  742. /**
  743. * @group :
  744. * @ver : 2007.05.04
  745. * @by : 이은영
  746. * @---------------------------------------------------
  747. * @type : function
  748. * @access : public
  749. * @desc : 그리드 값 변경시
  750. * @param :
  751. * @return :
  752. * @---------------------------------------------------
  753. */
  754. function fChangedGridRow(pFlag){
  755. var iRow = 0;
  756. var sCheck = "";
  757. var sStatus = "";
  758. var sSupCD = ""; // 상위코드
  759. switch(pFlag){
  760. case "attr" : // 속성
  761. iRow = grd_attrinfo.row;
  762. if(iRow < 1) return;
  763. var attrcd = model.getValue(xAttrListPath+"["+iRow+"]/attrcd");
  764. var sRefSeq = model.getValue(xAttrListPath+"["+iRow+"]/refseq");
  765. sCheck = model.getValue(xAttrListPath+"["+iRow+"]/check");
  766. sStatus = model.getValue(xAttrListPath+"["+iRow+"]/status");
  767. if(sCheck == "false" && (sStatus == "-" || sStatus == "U")){
  768. model.setValue(xAttrListPath+"["+iRow+"]/status","D");
  769. }else if(sCheck == "true" && sStatus == "D"){
  770. model.setValue(xAttrListPath+"["+iRow+"]/status","-");
  771. }
  772. if(sRefSeq != model.getValue(xHiddenAttrListPath+"[attrcd='"+attrcd+"']/refseq")){
  773. if(model.getValue(xAttrListPath+"["+iRow+"]/status") == "-"){
  774. model.setValue(xAttrListPath+"["+iRow+"]/status","U");
  775. model.setValue(xAttrListPath+"["+iRow+"]/check","true");
  776. }
  777. }
  778. grd_attrinfo.rebuild();
  779. break;
  780. case "rec" :
  781. iRow = grd_recitemanptinfo.row;
  782. if(iRow < 1) return;
  783. sSupCD = model.getValue(xItemInfoPath+"/supcd");
  784. if(sSupCD == "*"){
  785. messageBox("분류명은 기록지 연계 정보를 입력할 수","I004");
  786. model.setValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag","");
  787. grd_recitemanptinfo.rebuild();
  788. return;
  789. }
  790. sStatus = model.getValue(xRecItemAnptListPath+"["+iRow+"]/status");
  791. var sRecFlag = model.getValue(xRecItemAnptListPath+"["+iRow+"]/recflag");
  792. //수정 2008-05-28
  793. //var sRecCharFlag = grd_recitemanptinfo.combo.input.currentText;
  794. var sRecCharFlag = grd_recitemanptinfo.valueMatrix(iRow, 3);
  795. for(var iRecRow=grd_recitemanptinfo.fixedrows; iRecRow<= grd_recitemanptinfo.rows-grd_recitemanptinfo.fixedrows; iRecRow++){
  796. if(iRecRow == iRow) continue;
  797. if(sRecCharFlag == "A" && sRecCharFlag == model.getValue(xRecItemAnptListPath+"["+iRecRow+"]/reccharflag")){ // 주체는 한개만 존재
  798. messageBox("주체는 두개 이상을 입력","E001");
  799. model.setValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag", "");
  800. //2008-05-28 수정
  801. // if(sStatus == "I"){
  802. // model.setValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag", "");
  803. // }else{
  804. // model.setValue(xRecItemAnptListPath+"["+iRow+"]/reccharflag", model.getValue(xHiddenRecItemAnptListPath+"[recflag='"+sRecFlag+"']/reccharflag"));
  805. // }
  806. grd_recitemanptinfo.rebuild();
  807. return;
  808. }
  809. }
  810. if(sStatus == "I") return;
  811. if(sRecCharFlag == ""){
  812. model.setValue(xRecItemAnptListPath+"["+iRow+"]/status","D");
  813. }else{
  814. model.setValue(xRecItemAnptListPath+"["+iRow+"]/status","U");
  815. }
  816. model.setFocus("body");
  817. model.setFocus("grd_recitemanptinfo");
  818. break;
  819. }
  820. }
  821. /**
  822. * @group :
  823. * @ver : 2007.05.07
  824. * @by : 이은영
  825. * @---------------------------------------------------
  826. * @type : function
  827. * @access : public
  828. * @desc : 분류명 변경시
  829. * @param :
  830. * @return :
  831. * @---------------------------------------------------
  832. */
  833. function fChangedItem(){
  834. var sNewClsCD = model.getValue(xCondPath+"/clscd");
  835. var sClsCD = model.getValue(xItemSrchPath+"[itemcd ='"+sNewClsCD+"']/itemcd");
  836. var sClsYN = model.getValue(xCondPath+"/clsyn");
  837. if(sClsYN != "Y" && sClsCD == ""){
  838. messageBox("등록되어 있는 분류명을","C002" );
  839. model.setValue(xCondPath+"/clscd", model.getValue(xItemInfoPath+"/supcd"));
  840. cmb_clscd.refresh();
  841. }else if(sClsYN == "Y" && sNewClsCD == sClsCD){
  842. messageBox("이미 등록된 분류명","E008" );
  843. model.setValue(xCondPath+"/clscd", "");
  844. cmb_clscd.refresh();
  845. }
  846. if(sClsYN != "Y"){
  847. model.setValue(xItemInfoPath+"/supcd",sNewClsCD);
  848. }
  849. }
  850. /**
  851. * @group :
  852. * @ver : 2007.05.10
  853. * @by : 이은영
  854. * @---------------------------------------------------
  855. * @type : function
  856. * @access : public
  857. * @desc : 처방 매핑 정보
  858. * @param :
  859. * @return :
  860. * @---------------------------------------------------
  861. */
  862. function fSrchPrcpInfo(){
  863. var idx = swt_prcpinfo.selectedIndex;
  864. switch(idx){
  865. case 0: // 처방Mapping
  866. var iRow = grd_recitemanptinfo.row;
  867. if(iRow < 1){
  868. model.removeNodeset(xPrcpInfoPath);
  869. model.setValue(xCondPath+"/recflag","");
  870. model.setValue(xCondPath+"/cathflag","");
  871. model.setValue(xCondPath+"/prcpautogenr","");
  872. model.copyNode("/root/temp/main/recinfo/prcpinfo","/root/main/recinfo/prcpinfo");
  873. grd_prcpinfo.rebuild();
  874. model.refresh();
  875. }
  876. break;
  877. case 1: // Mapping내역조회
  878. var sItemcd = model.getValue(xCondPath+"/itemcd");
  879. if(sItemcd == ""){
  880. model.removenodeset("/root/main/srchinfo/prcpmappinfo");
  881. grd_prcpmappinfo.rebuild();
  882. return;
  883. }
  884. model.removenode("/root/send");
  885. model.makeValue("/root/send/itemcd",sItemcd);
  886. submit("TRMNR03107");
  887. break;
  888. }
  889. }
  890. /**
  891. * @group :
  892. * @ver : 2007.05.10
  893. * @by : 이은영
  894. * @---------------------------------------------------
  895. * @type : function
  896. * @access : public
  897. * @desc : 팝업 메뉴 SETTING
  898. * @param :
  899. * @return :
  900. * @---------------------------------------------------
  901. */
  902. function fSettingPopUpMenu(){
  903. if(event.button == 3){
  904. if(grd_srchitem.isCell(event.target) && grd_srchitem.mouseRow >= grd_srchitem.fixedrows){
  905. window.setPopupMenu(true, "/root/temp/popmenu/careitem/menu", "name", "func", false);
  906. }else{
  907. window.setPopupMenu(false);
  908. }
  909. }
  910. }
  911. /**
  912. * @group :
  913. * @ver : 2007.05.14
  914. * @by : 이은영
  915. * @---------------------------------------------------
  916. * @type : function
  917. * @access : public
  918. * @desc : 신규 항목 추가시
  919. * @param :
  920. * @return :
  921. * @---------------------------------------------------
  922. */
  923. function fAddItem(){
  924. var iRow = grd_srchitem.row;
  925. var sRtn = 0;
  926. var sItemCD = "";
  927. var sDepth = 0;
  928. var sSupCD = "";
  929. var sItemCD = "";
  930. var sRefSeq = 0;
  931. if(iRow < 1) return;
  932. if(instance1.selectSingleNode("/root/main/recinfo").xml != instance1.selectSingleNode("/root/temp/main/recinfo").xml){
  933. sRtn = messageBox("변경된 데이터가 있습니다.","Q003");
  934. if(sRtn != 6){
  935. sItemCD = model.getValue(xCondPath+"/itemcd");
  936. iRow = grd_srchitem.findRow(sItemCD,1,2);
  937. grd_srchitem.isSelected(iRow)=true;
  938. return;
  939. }
  940. }
  941. sDepth = eval(model.getValue(xItemSrchPath+"["+iRow+"]/depth"));
  942. sSupCD = model.getValue(xItemSrchPath+"["+iRow+"]/supcd");
  943. sItemCD = model.getValue(xItemSrchPath+"["+iRow+"]/itemcd");
  944. sRefSeq = parseInt(model.getValue(xItemSrchPath+"["+iRow+"]/refseq")) + 1;
  945. fClearValue();
  946. if(sDepth == 1){
  947. model.setValue(xItemInfoPath+"/supcd",sItemCD);
  948. model.setValue(xCondPath+"/clscd",sItemCD);
  949. model.setValue(xItemInfoPath+"/refseq", 0);
  950. }else{
  951. model.setValue(xItemInfoPath+"/supcd", sSupCD);
  952. model.setValue(xCondPath+"/clscd",sSupCD);
  953. model.setValue(xItemInfoPath+"/refseq",sRefSeq);
  954. }
  955. model.copyNode("/root/temp/main/recinfo","/root/main/recinfo");
  956. model.refresh();
  957. }