SMAVT00130.xjs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Script type="xscript4.0"><![CDATA[/*
  3. 적출물리스트관리(SMMNP00310.xfm - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. */
  7. var xExtListPath = "/root/main/extinfo/extlist";
  8. var sFlag = "c";
  9. /**
  10. * @group :
  11. * @ver : 2008.07.01
  12. * @by : dhkim
  13. * @---------------------------------------------------
  14. * @type : function
  15. * @access : public
  16. * @desc : 화면초기화
  17. * @param :
  18. * @param :
  19. * @return :
  20. * @---------------------------------------------------
  21. */
  22. function fInit(){
  23. //인스턴스초기화
  24. ds_send_reqdata.clearData();
  25. ds_hidden_confpsninfo_confpsnlist.clearData();
  26. ds_main_extinfo_extlist.clearData();
  27. ds_cond.clearData();
  28. ds_send_reqdata.addRow();
  29. ds_cond.addRow();
  30. //조회조건 초기화
  31. ds_cond.setColumn(0, "fromdd", utlf_getCurrentDate());
  32. ds_cond.setColumn(0, "todd", utlf_getCurrentDate());
  33. ds_cond.setColumn(0, "rdocond", sFlag);
  34. ds_main_ipt_extinfo.setColumn(0, "remvdd", utlf_getCurrentDate());
  35. ds_main_ipt_extinfo.setColumn(0, "checknurid", sysf_getUserInfo("userid"));
  36. //**공통코드 가져오기**//
  37. //콤보리스트 셋팅(감염성 질환)
  38. var arrParam = [{dsNm: "ds_init_M0194list_M0194", cdGrpId: "M0194"}
  39. ,{dsNm: "ds_init_DisplayData_S02", cdGrpId: "S02"}
  40. ,{dsNm: "ds_init_DisplayData_S03", cdGrpId: "S03"}]
  41. appf_getCodeList(arrParam);
  42. // tbGetBscdList( new Array("S02", "S03"), //yjh : 사용안하는듯...
  43. // new Array("/root/init/DisplayData", // S02 간호사
  44. // "/root/init/DisplayData" // S03 수술방
  45. // )
  46. // );
  47. //수술실간호사리스트 조회(확인자콤보)
  48. fGetOpNrList();
  49. //화면 버튼 설정
  50. fValueChangedInfectRdo(sFlag);
  51. for( var i=0 ; i<ds_main_extinfo_extlist.rowcount ; i++ ){
  52. ds_main_extinfo_extlist.setColumn(i, "chk", "1");
  53. }
  54. //속도개선
  55. this.setTimer(0, 100);
  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. ds_send_reqdata.clearData();
  73. ds_send_reqdata.addRow();
  74. ds_send_reqdata.setColumn(0, "deptflag", "015");
  75. ds_send_reqdata.setColumn(0, "searchdd", utlf_getCurrentDate());
  76. var oParam = {};
  77. oParam.id = "TRAVT00132";
  78. oParam.service = "tissuebankapp.TissueBankProcess";
  79. oParam.method = "reqGetNrList";
  80. oParam.inds = "reqdata=ds_send_reqdata";
  81. oParam.outds = "ds_hidden_confpsninfo_confpsnlist=confPsnList";
  82. oParam.async = false;
  83. oParam.callback = "cf_TRAVT00132";
  84. tranf_submit(oParam);
  85. }
  86. function cf_TRAVT00132(sSvcId, nErrorCode, sErrorMsg) {
  87. if(nErrorCode < 0){
  88. sysf_messageBox('초기화를', 'E009');
  89. return;
  90. }
  91. ds_hidden_confpsninfo_confpsnlist.updateColID("userid", "cd");
  92. ds_hidden_confpsninfo_confpsnlist.updateColID("usernm", "nm");
  93. }
  94. /**
  95. * @group :
  96. * @ver : 2008.07.01
  97. * @by : dhkim
  98. * @---------------------------------------------------
  99. * @type : function
  100. * @access : public
  101. * @desc : 회복환자조회
  102. * @param :
  103. * @param :
  104. * @return :
  105. * @---------------------------------------------------
  106. */
  107. function fSearch(){
  108. var fromdd = ds_cond.getColumn(0, "fromdd");
  109. var todd = ds_cond.getColumn(0, "todd");
  110. var rdocond = ds_cond.getColumn(0, "rdocond");
  111. if(utlf_isNull(fromdd)){
  112. fromdd = utlf_getCurrentDate();
  113. }
  114. if(utlf_isNull(todd)){
  115. todd = utlf_getCurrentDate();
  116. }
  117. ds_cond.setColumn(0, "fromdd", fromdd);
  118. ds_cond.setColumn(0, "todd", todd);
  119. ds_main_extinfo_extlist.clearData();
  120. ds_main_totextinfo.setColumn(0, "totextcrcnt", "");
  121. ds_main_totextinfo.setColumn(0, "totextcrweig", "");
  122. ds_main_ipt_extinfo.setColumn(0, "remvdd", utlf_getCurrentDate());
  123. ds_main_ipt_extinfo.setColumn(0, "checknurid", sysf_getUserInfo("userid"));
  124. ds_send_reqdata.clearData();
  125. ds_send_reqdata.addRow();
  126. ds_send_reqdata.setColumn(0, "fromdd", fromdd);
  127. ds_send_reqdata.setColumn(0, "todd", todd);
  128. ds_send_reqdata.setColumn(0, "rdocond", rdocond);
  129. var oParam = {};
  130. oParam.id = "TRAVT00131";
  131. oParam.service = "tissuebankapp.TissueBankProcess";
  132. oParam.method = "reqGetAvtTbeoInfoList";
  133. oParam.inds = "reqdata=ds_send_reqdata";
  134. oParam.outds = "ds_main_extinfo_extlist=extlist";
  135. oParam.async = false;
  136. oParam.callback = "cf_TRAVT00131";
  137. tranf_submit(oParam);
  138. }
  139. function cf_TRAVT00131(sSvcId, nErrorCode, sErrorMsg) {
  140. if(nErrorCode < 0){
  141. sysf_messageBox('적출물리스트조회를', 'E009');
  142. return;
  143. }
  144. if(ds_main_extinfo_extlist.rowcount < 1){
  145. group3.btn_print.enable = false;
  146. group3.btn_saveexcel.enable = false;
  147. group3.btn_save.enable = false;
  148. group3.btn_cncl.enable = false;
  149. group3.ipt_remvdd.enable = false;
  150. group3.ipt_remvnm.enable = false;
  151. group3.cmb_checknurid.enable = false;
  152. ds_main_totextinfo.setColumn(0, "totextcrcnt", "0");
  153. ds_main_totextinfo.setColumn(0, "totextcrweig", "0");
  154. }else{
  155. group3.btn_print.enable = true;
  156. group3.btn_saveexcel.enable = true;
  157. group3.btn_save.enable = true;
  158. group3.btn_cncl.enable = true;
  159. group3.ipt_remvdd.enable = true;
  160. group3.ipt_remvnm.enable = true;
  161. group3.cmb_checknurid.enable = true;
  162. var totalCnt = 0;
  163. var totalWeig = 0;
  164. for( var i=0 ; i<ds_main_extinfo_extlist.rowcount ; i++ ){
  165. infectInfo = "";
  166. var infectArray;
  167. if( !utlf_isNull(ds_main_extinfo_extlist.getColumn(i, "infectflag")) ){
  168. infectArray = ds_main_extinfo_extlist.getColumn(i, "infectflag").split(" ");
  169. }else{
  170. infectArray = new Array();
  171. }
  172. for( var j=0 ; j<ds_init_M0194list_M0194.rowcount ; j++ ){
  173. for( var k=0 ; k<=infectArray[k] ; k++ ){
  174. if(infectArray[k] == ds_init_M0194list_M0194.getColumn(j, "cdid")){
  175. if(infectInfo == ""){
  176. infectInfo = ds_init_M0194list_M0194.getColumn(j, "cdnm");
  177. }else{
  178. infectInfo += ", " + ds_init_M0194list_M0194.getColumn(j, "cdnm");
  179. }
  180. }
  181. }
  182. }
  183. //감염정보 입력
  184. ds_main_extinfo_extlist.setColumn(i, "infectflag", infectInfo);
  185. //총 개수, 총 중량 합계
  186. if(ds_main_extinfo_extlist.getColumn(i, "extcrcnt").isNumber()== true){
  187. totalCnt += eval(ds_main_extinfo_extlist.getColumn(i, "extcrcnt"));
  188. }
  189. if(ds_main_extinfo_extlist.getColumn(i, "extcrweig").isNumber() == true ){
  190. totalWeig += eval(ds_main_extinfo_extlist.getColumn(i, "extcrweig"));
  191. }
  192. }
  193. //총 개수, 총 중량 입력
  194. ds_main_totextinfo.setColumn(0, "totextcrcnt", totalCnt);
  195. ds_main_totextinfo.setColumn(0, "totextcrweig", totalWeig);
  196. }
  197. }
  198. /**
  199. * @group :
  200. * @ver : 2008.07.01
  201. * @by : dhkim
  202. * @---------------------------------------------------
  203. * @type : function
  204. * @access : public
  205. * @desc : 적출물리스트 수거일자, 수거자, 확인자 수정
  206. * @param :
  207. * @param :
  208. * @return :
  209. * @---------------------------------------------------
  210. */
  211. function fSave(){
  212. if(fIsValid()){
  213. ds_send_reqdata.clearData();
  214. ds_send_reqdata.enableevent = false;
  215. ds_send_reqdata.updatecontrol = false;
  216. for( var i=0 ; i<ds_main_extinfo_extlist.rowcount ; i++ ){
  217. var nRow = ds_send_reqdata.addRow();
  218. ds_send_reqdata.copyRow(nRow, ds_main_extinfo_extlist, i);
  219. ds_send_reqdata.setRowType(nRow, "i");
  220. if( ds_send_reqdata.getColumn(nRow, "chk") == "1" ){
  221. ds_send_reqdata.setColumn(nRow, "chk", "Y");
  222. }
  223. }
  224. ds_send_reqdata.updatecontrol = true;
  225. ds_send_reqdata.enableevent = true;
  226. grdf_setStatusColumn(ds_send_reqdata, "status");
  227. var oParam = {};
  228. oParam.id = "TXAVT00131";
  229. oParam.service = "tissuebankapp.TissueBankProcess";
  230. oParam.method = "reqSetAvtTbeoInfoList";
  231. oParam.inds = "reqdata=ds_send_reqdata";
  232. //oParam.outds = "ds_=item";
  233. oParam.async = false;
  234. oParam.callback = "cf_TXAVT00131";
  235. tranf_submit(oParam);
  236. }
  237. }
  238. function cf_TXAVT00131(sSvcId, nErrorCode, sErrorMsg) {
  239. if(nErrorCode < 0){
  240. sysf_messageBox('적출물정보 수정을', 'E009');
  241. return;
  242. }
  243. fSearch();
  244. }
  245. /**
  246. * @group :
  247. * @ver : 2008.07.01
  248. * @by : dhkim
  249. * @---------------------------------------------------
  250. * @type : function
  251. * @access : public
  252. * @desc : 적출물정보 수정하기전 유효성체크
  253. * @param :
  254. * @param :
  255. * @return :
  256. * @---------------------------------------------------
  257. */
  258. function fIsValid(){
  259. if(ds_main_extinfo_extlist.findRow("chk", "1") < 1){
  260. sysf_messageBox("수정 또는 저장할 내역을 선택하십시요","I");
  261. return;
  262. }
  263. //체크한 환자의 적출물은 입력된 내역으로 한꺼번에 반영하도록 한다.
  264. //입력받는 내역 : 수거일자, 수거자, 확인자
  265. var chk;
  266. var remvdd = ds_main_ipt_extinfo.getColumn(0, "remvdd"); //입력받은 수거일자
  267. var remvnm = ds_main_ipt_extinfo.getColumn(0, "remvnm"); //입력받은 수거자
  268. var checknurid = ds_main_ipt_extinfo.getColumn(0, "checknurid"); //입력받은 확인자
  269. if(utlf_isNull(remvdd)){
  270. sysf_messageBox('수거일자를', 'C001');
  271. return false;
  272. }
  273. if(utlf_isNull(remvnm)){
  274. sysf_messageBox('수거자를', 'C001');
  275. return false;
  276. }
  277. if(utlf_isNull(checknurid)){
  278. sysf_messageBox('확인자를', 'C002');
  279. return;
  280. }
  281. for( var i=0 ; i<ds_main_extinfo_extlist.rowcount ; i++ ){
  282. chk = ds_main_extinfo_extlist.getColumn(i, "chk");
  283. if(chk == '1'){
  284. //체크된 환자에게 입력한 적출물 수거 정보를 세팅한다.
  285. ds_main_extinfo_extlist.setColumn(i, "remvdd", remvdd);
  286. ds_main_extinfo_extlist.setColumn(i, "remvnm", remvnm);
  287. ds_main_extinfo_extlist.setColumn(i, "checknurid", checknurid);
  288. }
  289. }
  290. return true;
  291. }
  292. /**
  293. * @group :
  294. * @ver : 2008.07.02
  295. * @by : dhkim
  296. * @---------------------------------------------------
  297. * @type : function
  298. * @access : public
  299. * @desc : Excel파일로 저장
  300. * @param :
  301. * @param :
  302. * @return :
  303. * @---------------------------------------------------
  304. */
  305. function fSaveExcel(){
  306. var exceldd = utlf_getCurrentDate();
  307. if(group3.grp_sea.rdo_rdocond.value == "b"){
  308. exceldd = group3.grp_sea.ipt_fromdd.value;
  309. }
  310. if( ds_main_extinfo_extlist.rowcount > 0 ){
  311. grdf_exportExcel(group3.grd_extlist, "적출물리스트", "적출물리스트_"+exceldd, false, "", "user", false);
  312. } else {
  313. sysf_messageBox("조회된 데이터가 ", "I004");
  314. }
  315. }
  316. /**
  317. * @group :
  318. * @ver : 2008.07.02
  319. * @by : dhkim
  320. * @---------------------------------------------------
  321. * @type : function
  322. * @access : public
  323. * @desc : 미수거리스트 출력물 미리보기 실행
  324. * @param :
  325. * @param :
  326. * @return :
  327. * @---------------------------------------------------
  328. */
  329. function fPrint(){
  330. if(ds_main_extinfo_extlist.findRow("chk", "1") < 1){
  331. sysf_messageBox("출력할 내역을 선택하십시요","I");
  332. return;
  333. }
  334. dsf_createDs("ds_prnt_extinfo_extlist");
  335. totalCnt = 0;
  336. totalWeig = 0;
  337. prntyy = "";
  338. prntmm = "";
  339. prntdd = "";
  340. ds_prnt_extinfo_extlist.assign(ds_main_extinfo_extlist);
  341. ds_prnt_extinfo_extlist.clearData();
  342. for( var i=0 ; i<ds_main_extinfo_extlist.rowcount ; i++ ){
  343. chk = ds_main_extinfo_extlist.getColumn(i, "chk");
  344. if(chk == '1'){
  345. //체크된 정보 copy
  346. noderow = eval(ds_prnt_extinfo_extlist.rowcount) + 1;
  347. var nRow = ds_prnt_extinfo_extlist.addRow();
  348. ds_prnt_extinfo_extlist.copyRow(nRow, ds_main_extinfo_extlist, i);
  349. //총 개수, 총 중량 합계
  350. if(ds_main_extinfo_extlist.getColumn(i, "extcrcnt").isNumber()== true){
  351. totalCnt += eval(ds_main_extinfo_extlist.getColumn(i, "extcrcnt"));
  352. }
  353. if(ds_main_extinfo_extlist.getColumn(i, "extcrweig").isNumber() == true ){
  354. totalWeig += eval(ds_main_extinfo_extlist.getColumn(i, "extcrweig"));
  355. }
  356. }
  357. }
  358. if(group3.grp_sea.rdo_rdocond.value == "a"){
  359. prntdd = ds_cond.getColumn(0, "fromdd").substr(0,4) + "-" + ds_cond.getColumn(0, "fromdd").substr(4,2) + "-" + ds_cond.getColumn(0, "fromdd").substr(6,2) + " ~ "
  360. + ds_cond.getColumn(0, "todd").substr(0,4) + "-" + ds_cond.getColumn(0, "todd").substr(4,2) + "-" + ds_cond.getColumn(0, "todd").substr(6,2);
  361. }else if(group3.grp_sea.rdo_rdocond.value == "b"){
  362. prntyy = ds_cond.getColumn(0, "fromdd").substr(0,4) + "년";
  363. prntmm = ds_cond.getColumn(0, "fromdd").substr(4,2) + "월";
  364. prntdd = ds_cond.getColumn(0, "fromdd").substr(6,2) + "일";
  365. }else if(group3.grp_sea.rdo_rdocond.value == "c"){
  366. prntyy = ds_main_ipt_extinfo.getColumn(0, "remvdd").substr(0,4) + "년";
  367. prntmm = ds_main_ipt_extinfo.getColumn(0, "remvdd").substr(4,2) + "월";
  368. prntdd = ds_main_ipt_extinfo.getColumn(0, "remvdd").substr(6,2) + "일";
  369. }
  370. var objDOM = rptf_createDOM(); // DOM 객체 설정
  371. rptf_setNodeListToDOM(objDOM, "/root/prnt/extinfo/extlist", ds_prnt_extinfo_extlist); // 데이터셋 1
  372. rptf_setValueToDOM(objDOM, "/root/prnt/totextinfo/prntflag", group3.grp_sea.rdo_rdocond.value); // 데이터셋 2
  373. rptf_setValueToDOM(objDOM, "/root/prnt/totextinfo/prntyy", prntyy); // 데이터셋 2
  374. rptf_setValueToDOM(objDOM, "/root/prnt/totextinfo/prntmm", prntmm); // 데이터셋 2
  375. rptf_setValueToDOM(objDOM, "/root/prnt/totextinfo/prntdd", prntdd); // 데이터셋 2
  376. rptf_setValueToDOM(objDOM, "/root/prnt/totextinfo/totextcrcnt", totalCnt); // 데이터셋 2
  377. rptf_setValueToDOM(objDOM, "/root/prnt/totextinfo/totextcrweig", totalWeig); // 데이터셋 2
  378. rptf_setValueToDOM(objDOM, "/root/cond/fromdd", ds_cond.getColumn(0, "fromdd")); // 데이터셋 2
  379. rptf_setValueToDOM(objDOM, "/root/cond/todd", ds_cond.getColumn(0, "todd")); // 데이터셋 2
  380. rptf_setValueToDOM(objDOM, "/root/cond/rdocond", ds_cond.getColumn(0, "rdocond")); // 데이터셋 2
  381. var objParam = new Object();
  382. objParam.xml_data_XML1 = objDOM.documentElement.source; // 최상의노드 XML 스트링 추출
  383. var option = "open=1;save=1;directprint=0;print=1;zoom=0;";
  384. rptf_exeReportPreview30(["RPAVT00130"],[objParam], option);
  385. dsf_deleteDs("ds_prnt_extinfo_extlist");
  386. }
  387. /**
  388. * @group :
  389. * @ver : 2008.07.02
  390. * @by : dhkim
  391. * @---------------------------------------------------
  392. * @type : function
  393. * @access : public
  394. * @desc : 수거구분 조회 정보 변경 시 이벤트
  395. * @param :
  396. * @param :
  397. * @return :
  398. * @---------------------------------------------------
  399. */
  400. function fValueChangedInfectRdo(pParam){
  401. switch(pParam){
  402. case "a":
  403. group3.grp_sea.caption2.visible = true; //조회일자 caption
  404. group3.grp_sea.ipt_fromdd.visible = true; //from 일자
  405. group3.grp_sea.caption7.visible = true; //~ caption
  406. group3.grp_sea.ipt_todd.visible = true; //to 일자
  407. group3.btn_print.visible = false; //출력버튼
  408. group3.btn_cncl.visible = false; //수거취소버튼
  409. break;
  410. case "b":
  411. group3.grp_sea.caption2.visible = true; //조회일자 caption
  412. group3.grp_sea.ipt_fromdd.visible = true; //from 일자
  413. group3.grp_sea.caption7.visible = false; //~ caption
  414. group3.grp_sea.ipt_todd.visible = false; //to 일자
  415. group3.btn_print.visible = true; //출력버튼
  416. group3.btn_cncl.visible = true; //수거취소버튼
  417. break;
  418. case "c":
  419. group3.grp_sea.caption2.visible = false; //조회일자 caption
  420. group3.grp_sea.ipt_fromdd.visible = false; //from 일자
  421. group3.grp_sea.caption7.visible = false; //~ caption
  422. group3.grp_sea.ipt_todd.visible = false; //to 일자
  423. group3.btn_print.visible = true; //출력버튼
  424. group3.btn_cncl.visible = false; //수거취소버튼
  425. break;
  426. }
  427. }
  428. /**
  429. * @group :
  430. * @ver : 2009.01.29
  431. * @by : dhkim
  432. * @---------------------------------------------------
  433. * @type : function
  434. * @access : public
  435. * @desc : 수거취소 버튼 이벤트
  436. * @param :
  437. * @param :
  438. * @return :
  439. * @---------------------------------------------------
  440. */
  441. function fCncl(){
  442. if(ds_main_extinfo_extlist.findRow("chk", "1") < 1){
  443. sysf_messageBox("수거 취소할 내역을 선택하십시요.","I");
  444. return;
  445. }
  446. ds_send_reqdata.clearData();
  447. ds_send_reqdata.enableevent = false;
  448. ds_send_reqdata.updatecontrol = false;
  449. for( var i=0 ; i<ds_main_extinfo_extlist.rowcount ; i++ ){
  450. var nRow = ds_send_reqdata.addRow();
  451. ds_send_reqdata.copyRow(nRow, ds_main_extinfo_extlist, i);
  452. ds_send_reqdata.setRowType(nRow, "u");
  453. if( ds_send_reqdata.getColumn(nRow, "chk") == "1" ){
  454. ds_send_reqdata.setColumn(nRow, "chk", "Y");
  455. }
  456. }
  457. ds_send_reqdata.updatecontrol = true;
  458. ds_send_reqdata.enableevent = true;
  459. grdf_setStatusColumn(ds_send_reqdata, "status");
  460. var oParam = {};
  461. oParam.id = "TXAVT00131";
  462. oParam.service = "tissuebankapp.TissueBankProcess";
  463. oParam.method = "reqSetAvtTbeoInfoList";
  464. oParam.inds = "reqdata=ds_send_reqdata";
  465. //oParam.outds = "ds_=item";
  466. oParam.async = false;
  467. oParam.callback = "cf_TXAVT00131";
  468. tranf_submit(oParam);
  469. }
  470. function cf_TXAVT00131(sSvcId, nErrorCode, sErrorMsg) {
  471. if(nErrorCode < 0){
  472. sysf_messageBox('적출물정보 수정을', 'E009');
  473. return;
  474. }
  475. fSearch();
  476. }]]></Script>