SMMNP00310.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. /*
  2. 적출물리스트관리(SMMNP00310.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var xExtListPath = "/root/main/extinfo/extlist";
  7. var sFlag = "c";
  8. /**
  9. * @group :
  10. * @ver : 2008.07.01
  11. * @by : dhkim
  12. * @---------------------------------------------------
  13. * @type : function
  14. * @access : public
  15. * @desc : 화면초기화
  16. * @param :
  17. * @param :
  18. * @return :
  19. * @---------------------------------------------------
  20. */
  21. function fInit(){
  22. //인스턴스초기화
  23. model.removenode('/root/send');
  24. model.removenode('/root/hidden');
  25. model.removenode('/root/main/extinfo');
  26. model.removenode('/root/cond');
  27. model.makenode('/root/send');
  28. model.makenode('/root/hidden');
  29. model.makenode('/root/main/extinfo');
  30. model.makenode('/root/cond/fromdd');
  31. model.makenode('/root/cond/todd');
  32. model.makenode('/root/cond/rdocond');
  33. model.makenode('/root/cond/flag');
  34. //조회조건 초기화
  35. model.setValue('/root/cond/fromdd', getCurrentDate());
  36. model.setValue('/root/cond/todd', getCurrentDate());
  37. model.setValue('/root/main/ipt_extinfo/remvdd', getCurrentDate());
  38. model.setValue('/root/main/ipt_extinfo/checknurid', getUserInfo("userid"));
  39. model.setValue('/root/cond/rdocond', sFlag);
  40. //**공통코드 가져오기**//
  41. zbcfGetCodeList( new Array ( "M0194" // 감염성 질환
  42. )
  43. , new Array ( "/root/init/M0194list" // 감염성 질환
  44. )
  45. );
  46. //화면 버튼 설정
  47. fValueChangedInfectRdo(sFlag);
  48. //수술실간호사리스트 조회(확인자콤보)
  49. fGetOpNrList();
  50. grd_extlist.fixedcellcheckbox(0, grd_extlist.colRef("chk")) = true;
  51. grd_extlist.fixedcellischeck(0, grd_extlist.colRef("chk")) = true;
  52. fSearch();
  53. //model.refresh();
  54. }
  55. /**
  56. * @group :
  57. * @ver : 2008.07.02
  58. * @by : dhkim
  59. * @---------------------------------------------------
  60. * @type : function
  61. * @access : public
  62. * @desc : 수술실간호사리스트조회
  63. * @param :
  64. * @param :
  65. * @return :
  66. * @---------------------------------------------------
  67. */
  68. function fGetOpNrList(){
  69. model.removenode('/root/send');
  70. model.makeValue('/root/send/reqdata/deptflag', '015');
  71. model.makeValue('/root/send/reqdata/searchdd', getCurrentDate());
  72. if(!submit('TRMNP00312')){
  73. messageBox('초기화를', 'E009');
  74. return;
  75. }
  76. }
  77. /**
  78. * @group :
  79. * @ver : 2008.07.01
  80. * @by : dhkim
  81. * @---------------------------------------------------
  82. * @type : function
  83. * @access : public
  84. * @desc : 회복환자조회
  85. * @param :
  86. * @param :
  87. * @return :
  88. * @---------------------------------------------------
  89. */
  90. function fSearch(){
  91. var fromdd = model.getValue('/root/cond/fromdd');
  92. var todd = model.getValue('/root/cond/todd');
  93. var rdocond = model.getValue('/root/cond/rdocond');
  94. var flag = model.getValue('/root/cond/flag');
  95. if(fromdd == null || fromdd == ''){
  96. fromdd = getCurrentDate();
  97. }
  98. if(todd == null || todd == ''){
  99. todd = getCurrentDate();
  100. }
  101. model.setValue('/root/cond/fromdd', fromdd);
  102. model.setValue('/root/cond/todd', todd);
  103. model.removenode('/root/main/extinfo');
  104. //model.removenode('/root/main/totextinfo');
  105. model.setValue("/root/main/totextinfo/totextcrcnt", "");
  106. model.setValue("/root/main/totextinfo/totextcrweig", "");
  107. model.reset('/root/main/ipt_extinfo');
  108. model.removenode('/root/send/reqdata');
  109. model.makeValue('/root/send/reqdata/fromdd', fromdd);
  110. model.makeValue('/root/send/reqdata/todd', todd);
  111. model.makeValue('/root/send/reqdata/rdocond', rdocond);
  112. model.makeValue('/root/send/reqdata/flag', flag);
  113. if(!submit('TRMNP00311', false)){
  114. messageBox('적출물리스트조회를', 'E009');
  115. return;
  116. }
  117. // if(!submit('TRMNP00313', false)){
  118. // messageBox('적출물리스트조회를', 'E009');
  119. // return;
  120. // }
  121. if(getNodesetCount("/root/main/extinfo/extlist") < 1){
  122. btn_print.disabled = true;
  123. btn_saveexcel.disabled = true;
  124. btn_save.disabled = true;
  125. btn_cncl.disabled = true;
  126. ipt_remvdd.disabled = true;
  127. ipt_remvnm.disabled = true;
  128. cmb_checknurid.disabled = true;
  129. model.setValue("/root/main/totextinfo/totextcrcnt", 0);
  130. model.setValue("/root/main/totextinfo/totextcrweig", 0);
  131. }else{
  132. btn_print.disabled = false;
  133. btn_saveexcel.disabled = false;
  134. btn_save.disabled = false;
  135. btn_cncl.disabled = false;
  136. ipt_remvdd.disabled = false;
  137. ipt_remvnm.disabled = false;
  138. cmb_checknurid.disabled = false;
  139. totalCnt = 0;
  140. totalWeig = 0;
  141. for(var i = 1 ; i <= getNodesetCount("/root/main/extinfo/extlist") ; i++){
  142. infectInfo = "";
  143. infectArray = model.getValue("/root/main/extinfo/extlist["+i+"]/infectflag").split(" ");
  144. for(var j = 1 ; j <= getNodesetCount("/root/init/M0194list/M0194") ; j++){
  145. for(var k = 0 ; k <= infectArray[k] ; k++){
  146. if(infectArray[k] == model.getValue("/root/init/M0194list/M0194["+j+"]/cdid")){
  147. if(infectInfo == ""){
  148. infectInfo = model.getValue("/root/init/M0194list/M0194["+j+"]/cdnm");
  149. }else{
  150. infectInfo += ", " + model.getValue("/root/init/M0194list/M0194["+j+"]/cdnm");
  151. }
  152. }
  153. }
  154. }
  155. //감염정보 입력
  156. model.setValue("/root/main/extinfo/extlist["+i+"]/infectflag", infectInfo);
  157. //총 개수, 총 중량 합계
  158. if(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrcnt").isNumber()== true){
  159. totalCnt += eval(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrcnt"));
  160. }
  161. if(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrweig").isNumber() == true ){
  162. totalWeig += eval(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrweig"));
  163. }
  164. }
  165. //총 개수, 총 중량 입력
  166. model.setValue("/root/main/totextinfo/totextcrcnt", totalCnt);
  167. model.setValue("/root/main/totextinfo/totextcrweig", totalWeig);
  168. }
  169. model.refresh();
  170. }
  171. /**
  172. * @group :
  173. * @ver : 2008.07.01
  174. * @by : dhkim
  175. * @---------------------------------------------------
  176. * @type : function
  177. * @access : public
  178. * @desc : 적출물리스트 수거일자, 수거자, 확인자 수정
  179. * @param :
  180. * @param :
  181. * @return :
  182. * @---------------------------------------------------
  183. */
  184. function fSave(){
  185. if(fIsValid()){
  186. model.removenode('/root/send');
  187. model.makeValue('/root/send/reqdata', grd_extlist.getUpdateDataAll('i'));
  188. if(!submit('TXMNP00311')){
  189. messageBox('적출물정보 수정을', 'E009');
  190. return;
  191. }else{
  192. fSearch();
  193. }
  194. }
  195. }
  196. /**
  197. * @group :
  198. * @ver : 2008.07.01
  199. * @by : dhkim
  200. * @---------------------------------------------------
  201. * @type : function
  202. * @access : public
  203. * @desc : 적출물정보 수정하기전 유효성체크
  204. * @param :
  205. * @param :
  206. * @return :
  207. * @---------------------------------------------------
  208. */
  209. function fIsValid(){
  210. if(grd_extlist.findRow("Y", 0, grd_extlist.colRef("chk")) < 1){
  211. messageBox("수정 또는 저장할 내역을 선택하십시요","I");
  212. return;
  213. }
  214. //체크한 환자의 적출물은 입력된 내역으로 한꺼번에 반영하도록 한다.
  215. //입력받는 내역 : 수거일자, 수거자, 확인자
  216. var chk;
  217. var remvdd = model.getValue('/root/main/ipt_extinfo/remvdd'); //입력받은 수거일자
  218. var remvnm = model.getValue('/root/main/ipt_extinfo/remvnm'); //입력받은 수거자
  219. var checknurid = model.getValue('/root/main/ipt_extinfo/checknurid'); //입력받은 확인자
  220. if(remvdd == null || remvdd == ''){
  221. messageBox('수거일자를', 'C001');
  222. return false;
  223. }
  224. if(remvnm == null || remvnm == ''){
  225. messageBox('수거자를', 'C001');
  226. return false;
  227. }
  228. if(checknurid == null || checknurid == ''){
  229. messageBox('확인자를', 'C002');
  230. return;
  231. }
  232. for(var i = 1; i <= getNodesetCount("/root/main/extinfo/extlist"); i++){
  233. chk = model.getValue('/root/main/extinfo/extlist[' + i +']/chk');
  234. if(chk == 'Y'){
  235. //체크된 환자에게 입력한 적출물 수거 정보를 세팅한다.
  236. model.setValue('/root/main/extinfo/extlist[' + i + ']/remvdd', remvdd);
  237. model.setValue('/root/main/extinfo/extlist[' + i + ']/remvnm', remvnm);
  238. model.setValue('/root/main/extinfo/extlist[' + i + ']/checknurid', checknurid);
  239. }
  240. }
  241. //model.refresh();
  242. return true;
  243. }
  244. /**
  245. * @group :
  246. * @ver : 2008.07.02
  247. * @by : dhkim
  248. * @---------------------------------------------------
  249. * @type : function
  250. * @access : public
  251. * @desc : Excel파일로 저장
  252. * @param :
  253. * @param :
  254. * @return :
  255. * @---------------------------------------------------
  256. */
  257. function fSaveExcel(){
  258. var exceldd = getCurrentDate();
  259. if(rdo_rdocond.value == "b"){
  260. exceldd = ipt_fromdd.value;
  261. }
  262. var fileName = window.fileDialog("save", ",", false, "적출물리스트_"+exceldd, "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  263. if (fileName != "") {
  264. grd_extlist.saveExcel(fileName, "SheetName", true, true, "", "", false);
  265. }
  266. }
  267. /**
  268. * @group :
  269. * @ver : 2008.07.02
  270. * @by : dhkim
  271. * @---------------------------------------------------
  272. * @type : function
  273. * @access : public
  274. * @desc : 미수거리스트 출력물 미리보기 실행
  275. * @param :
  276. * @param :
  277. * @return :
  278. * @---------------------------------------------------
  279. */
  280. function fPrint(){
  281. if(grd_extlist.findRow("Y", 0, grd_extlist.colRef("chk")) < 1){
  282. messageBox("출력할 내역을 선택하십시요","I");
  283. return;
  284. }
  285. model.makenode("/root/prnt/extinfo");
  286. model.makenode("/root/prnt/totextinfo");
  287. totalCnt = 0;
  288. totalWeig = 0;
  289. prntyy = "";
  290. prntmm = "";
  291. prntdd = "";
  292. for(var i = 1; i <= getNodesetCount("/root/main/extinfo/extlist"); i++){
  293. chk = model.getValue('/root/main/extinfo/extlist[' + i +']/chk');
  294. if(chk == 'Y'){
  295. //체크된 정보 copy
  296. noderow = eval(getNodesetCount("/root/prnt/extinfo/extlist")) + 1;
  297. model.makenode("/root/prnt/extinfo/extlist["+noderow+"]");
  298. model.copyNode("/root/prnt/extinfo/extlist["+noderow+"]", "/root/main/extinfo/extlist["+ i +"]");
  299. //총 개수, 총 중량 합계
  300. if(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrcnt").isNumber()== true){
  301. totalCnt += eval(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrcnt"));
  302. }
  303. if(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrweig").isNumber() == true ){
  304. totalWeig += eval(model.getValue("/root/main/extinfo/extlist["+i+"]/extcrweig"));
  305. }
  306. }
  307. }
  308. if(rdo_rdocond.value == "a"){
  309. prntdd = ipt_fromdd.value.substr(0,4) + "-" + ipt_fromdd.value.substr(4,2) + "-" + ipt_fromdd.value.substr(6,2) + " ~ "
  310. + ipt_todd.value.substr(0,4) + "-" + ipt_todd.value.substr(4,2) + "-" + ipt_todd.value.substr(6,2)
  311. }else if(rdo_rdocond.value == "b"){
  312. prntyy = ipt_fromdd.value.substr(0,4) + "년";
  313. prntmm = ipt_fromdd.value.substr(4,2) + "월";
  314. prntdd = ipt_fromdd.value.substr(6,2) + "일";
  315. }else if(rdo_rdocond.value == "c"){
  316. prntyy = ipt_remvdd.value.substr(0,4) + "년";
  317. prntmm = ipt_remvdd.value.substr(4,2) + "월";
  318. prntdd = ipt_remvdd.value.substr(6,2) + "일";
  319. }
  320. model.makeValue("/root/prnt/totextinfo/prntflag", rdo_rdocond.value);
  321. model.makeValue("/root/prnt/totextinfo/prntyy", prntyy);
  322. model.makeValue("/root/prnt/totextinfo/prntmm", prntmm);
  323. model.makeValue("/root/prnt/totextinfo/prntdd", prntdd);
  324. model.makeValue("/root/prnt/totextinfo/totextcrcnt", totalCnt);
  325. model.makeValue("/root/prnt/totextinfo/totextcrweig", totalWeig);
  326. exeReportPreview("RPMNP00310", "XMLSTR"); //미리보기
  327. model.removeNode("/root/prnt");
  328. }
  329. /**
  330. * @group :
  331. * @ver : 2008.07.02
  332. * @by : dhkim
  333. * @---------------------------------------------------
  334. * @type : function
  335. * @access : public
  336. * @desc : 수거구분 조회 정보 변경 시 이벤트
  337. * @param :
  338. * @param :
  339. * @return :
  340. * @---------------------------------------------------
  341. */
  342. function fValueChangedInfectRdo(pParam){
  343. switch(pParam){
  344. case "a":
  345. caption2.visible = true; //조회일자 caption
  346. ipt_fromdd.visible = true; //from 일자
  347. caption7.visible = true; //~ caption
  348. ipt_todd.visible = true; //to 일자
  349. btn_print.visible = false; //출력버튼
  350. btn_cncl.visible = false; //수거취소버튼
  351. break;
  352. case "b":
  353. caption2.visible = true; //조회일자 caption
  354. ipt_fromdd.visible = true; //from 일자
  355. caption7.visible = false; //~ caption
  356. ipt_todd.visible = false; //to 일자
  357. btn_print.visible = true; //출력버튼
  358. btn_cncl.visible = true; //수거취소버튼
  359. break;
  360. case "c":
  361. caption2.visible = false; //조회일자 caption
  362. ipt_fromdd.visible = false; //from 일자
  363. caption7.visible = false; //~ caption
  364. ipt_todd.visible = false; //to 일자
  365. btn_print.visible = true; //출력버튼
  366. btn_cncl.visible = false; //수거취소버튼
  367. break;
  368. }
  369. }
  370. /**
  371. * @group :
  372. * @ver : 2009.01.29
  373. * @by : dhkim
  374. * @---------------------------------------------------
  375. * @type : function
  376. * @access : public
  377. * @desc : 수거취소 버튼 이벤트
  378. * @param :
  379. * @param :
  380. * @return :
  381. * @---------------------------------------------------
  382. */
  383. function fCncl(){
  384. if(grd_extlist.findRow("Y", 0, grd_extlist.colRef("chk")) < 1){
  385. messageBox("수거 취소할 내역을 선택하십시요.","I");
  386. return;
  387. }
  388. model.removenode('/root/send');
  389. model.makeValue('/root/send/reqdata', grd_extlist.getUpdateDataAll('u'));
  390. if(!submit('TXMNP00311')){
  391. messageBox('적출물정보 수정을', 'E009');
  392. return;
  393. }else{
  394. fSearch();
  395. }
  396. }