SMAVT00130.js 13 KB

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