SMLBD01600.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. /***********************************************************************************************************************************************
  2. * create date : 2007.12.26
  3. * author : dhkim
  4. * file name : SMLBD01600.js
  5. * desc : 혈액불출 리스트를 조회한다.
  6. ***********************************************************************************************************************************************/
  7. var xApuPath = '/root/main/apuinfo';
  8. var xCondPath = '/root/cond';
  9. var xUserInfoPath = '/root/main/userpopupinfo'; //불출,확인자팝업결과 xPath
  10. var currentDate = getCurrentDate();
  11. /*
  12. * 전체병동정보를 가져온다.
  13. */
  14. function fGetWard(){
  15. submit('TRLBD01602');
  16. }
  17. /*
  18. * 초기화
  19. */
  20. function fInit(){
  21. model.removeNodeset(xApuPath);
  22. //model.removeNodeset(xCondPath);
  23. //model.makeValue(xCondPath + '/fromdd', currentDate);
  24. //model.makeValue(xCondPath + '/todd', currentDate);
  25. //model.makeNode(xCondPath + '/wardcd');
  26. //model.makeNode(xCondPath + '/iogbn');
  27. model.setValue(xCondPath + '/fromdd', currentDate);
  28. model.setValue(xCondPath + '/todd', currentDate);
  29. fGetWard();//병동코드load
  30. addComboItem("cmb_wardcd", "전체", "ALL", "above");//콤보에 전체추가
  31. cmb_wardcd.select(0); //첫번째값 세팅
  32. rdo_iogbn.select(0);
  33. rdo_outflag.select(2);
  34. model.refresh();
  35. fSearch();
  36. }
  37. /*
  38. * 혈액불출 리스트를 조회한다.
  39. */
  40. function fSearch(){
  41. var iogbn = model.getValue(xCondPath+'/iogbn');
  42. var wardcd = model.getValue(xCondPath+'/wardcd');
  43. var fromdd = model.getValue(xCondPath+'/fromdd');
  44. var todd = model.getValue(xCondPath+'/todd');
  45. var outflag = model.getValue(xCondPath+'/outflag');
  46. if(iogbn == 'I' && wardcd == ''){
  47. model.setValue(xCondPath+'/wardcd', 'ALL');
  48. }
  49. if(fromdd == '')
  50. fromdd = currentDate;
  51. if(todd == '')
  52. todd = currentDate;
  53. model.removeNodeset(xApuPath + "/apulist");
  54. model.removeNodeset(xCondPath);
  55. model.makeValue(xCondPath + '/wardcd', wardcd);
  56. model.makeValue(xCondPath + '/fromdd', fromdd);
  57. model.makeValue(xCondPath + '/todd', todd);
  58. model.makeValue(xCondPath + '/iogbn', iogbn);
  59. model.makeValue(xCondPath + '/outflag', outflag);
  60. if(!submit('TRLBD01601')){
  61. messageBox('조회를', 'E009');
  62. }
  63. //------------(20080124)
  64. // 불출된것은 선택하지 못하게 한다.
  65. var pGrd = grd_apulist;
  66. var outflag = "";
  67. var confdd = "";
  68. if (pGrd.rows <= 1 ) return;
  69. pGrd.isReadOnly(1,1,pGrd.rows-1,pGrd.cols-1)= true;
  70. var sApuoutdd = getCurrentDate();
  71. var sApuouttm = getCurrentTime().substring(0,4);
  72. var sApuoutid = getUserId();
  73. var sApuoutnm = getUserName();
  74. for (var row=1;row<pGrd.rows;row++) {
  75. //확인일자가 있기전까지는 불출일자를 입력할수 있도록 한다.
  76. confdd = model.getValue("/root/main/apuinfo/apulist[" + row + "]/confdd");
  77. if (confdd == "") {
  78. pGrd.isReadOnly(row,pGrd.colRef("chk"), row,pGrd.colRef("chk")) = false;
  79. pGrd.isReadOnly(row,pGrd.colRef("apuoutdd"),row,pGrd.colRef("apuoutdd"))= false;
  80. pGrd.isReadOnly(row,pGrd.colRef("apuouttm"),row,pGrd.colRef("apuouttm"))= false;
  81. pGrd.isReadOnly(row,pGrd.colRef("apuoutnm"),row,pGrd.colRef("apuoutnm"))= false;
  82. }
  83. outflag = model.getValue("/root/main/apuinfo/apulist[" + row + "]/outflag");
  84. if (outflag == "N") {
  85. model.setValue("/root/main/apuinfo/apulist[" + row + "]/apuoutdd" , sApuoutdd);
  86. model.setValue("/root/main/apuinfo/apulist[" + row + "]/apuouttm" , sApuouttm);
  87. model.setValue("/root/main/apuinfo/apulist[" + row + "]/apuoutid" , sApuoutid);
  88. model.setValue("/root/main/apuinfo/apulist[" + row + "]/apuoutnm" , sApuoutnm);
  89. }
  90. }
  91. //--------------------------------------------------
  92. }
  93. /*
  94. * date : 2007.12.31
  95. * desc : 조회조건의 외래입원구분에 따른 병동선택 사용을 컨트롤한다.
  96. * 외래일때는 병동콤보를 사용불가상태로 만들고
  97. * 입원일때는 병동콤보를 사용가능상태로 만든다.
  98. * rdo_iogbn : 외래입원구분 (외래 : O, 입원 : I)
  99. * cmb_wardcd : 병동
  100. **/
  101. function fDisabledCondWardCd(ioGbn){
  102. if(ioGbn == 'I' || ioGbn == 'A'){
  103. model.setValue(xCondPath + '/wardcd', 'ALL');
  104. cmb_wardcd.disabled = false;
  105. }else if(ioGbn == 'O'){
  106. model.setValue(xCondPath + '/wardcd', '');
  107. cmb_wardcd.disabled = true;
  108. }
  109. model.refresh();
  110. }
  111. /*
  112. * 2007.12.30
  113. * 혈액불출내역정보가 유효한 데이터인지 검증한다.
  114. **/
  115. function fIsValid(){
  116. var apuoutdd; //불출일자
  117. var apuouttm; //불출시간
  118. var apuoutid; //불출자
  119. var confdd; //확인일자
  120. var conftm; //확인시간
  121. var confid; //확인자
  122. for(var row = 1; row <= grd_apulist.rows; row++){
  123. if ( model.getValue(xApuPath + '/apulist[" + row + "]/chk') == "ture") {
  124. apuoutdd = model.getValue(xApuPath + '/apulist[" + row + "]/apuoutdd');
  125. apuouttm = model.getValue(xApuPath + '/apulist[" + row + "]/apuouttm');
  126. apuoutid = model.getValue(xApuPath + '/apulist[" + row + "]/apuoutid');
  127. confdd = model.getValue(xApuPath + '/apulist[" + row + "]/confdd');
  128. conftm = model.getValue(xApuPath + '/apulist[" + row + "]/conftm');
  129. confid = model.getValue(xApuPath + '/apulist[" + row + "]/confid');
  130. if(apuoutdd == '' || !isValidDateTime(apuoutdd, 'YYYYMMDD')){
  131. messageBox(i + '번째의 불출일자를 날짜형식(예(2008-01-01))에 맞게', 'C001');
  132. return false;
  133. }
  134. if(apuouttm == '' || !isValidDateTime(apuouttm, 'hhmmss')){
  135. messageBox(i + '번째의 불출시간을 시간형식(예(23:01:30))에 맞게', 'C001');
  136. return false;
  137. }
  138. if(apuoutid == ''){
  139. alert(i + '번째의 불출자를 선택하세요.');
  140. return false;
  141. }
  142. if(confdd == '' || !isValidDateTime(confdd, 'YYYYMMDD')){
  143. messageBox(i + '번째의 확인일자를 날짜형식(예(2008-01-01))에 맞게', 'C001');
  144. return false;
  145. }
  146. if(conftm == '' || !isValidDateTime(conftm, 'hhmmss')){
  147. messageBox(i + '번째의 확인시간을 시간형식(예(23:01:30))에 맞게', 'C001');
  148. return false;
  149. }
  150. if(confid == ''){
  151. messageBox(i + '번째의 확인자를', 'C002');
  152. return false;
  153. }
  154. } else {
  155. }
  156. }
  157. return true;
  158. }
  159. /*
  160. * 2007.12.30
  161. * 혈액불출내역정보를 수정한다.
  162. **/
  163. function fSave(){
  164. var msgNo = messageBox('혈액불출내역을', 'Q002');
  165. //수정된 자료는 전부 가져가고, api에서 chk=ture인것만 저장함
  166. if(fIsValid()&& msgNo == 6){
  167. model.removeNodeset('/root/send');
  168. model.makeValue('/root/send/savedata', grd_apulist.getUpdateDataAll('u'));
  169. if(submit('TXLBD01601')){
  170. fSearch();
  171. }
  172. }else{
  173. return false;
  174. }
  175. }
  176. /*
  177. * 2007.12.31
  178. * 변경된 그리드의 row상태를 update 상태로 바꾼다.
  179. **/
  180. function fSetUpdateState(isPop){
  181. //isPop -- popup으로 변경된 노드는 true값으로 받아옴..그리드는 상태값이 setValue로 들어오는 값은 변경되지 않는다....-_ -;
  182. var curRow = grd_apulist.row;
  183. if(grd_apulist.rowStatus(grd_apulist.row) == 2 || isPop){
  184. model.setValue(xApuPath + '/apulist[' + curRow + ']' + '/status', 'u');
  185. }
  186. }
  187. /**
  188. * 2007-12-30
  189. * 불출및 확인자를 선택하기 위한 팝업화면을 호출한다.
  190. * 불출내역등록그리드의 클릭이벤트 발생시 호출된다.
  191. */
  192. function fGetWorkerId(outConfGbn){
  193. var curRow = grd_apulist.row;
  194. if (curRow <= 0) return;
  195. if (model.getValue("/root/main/apuinfo/apulist[" + curRow + "]/confdd") != "" ) {
  196. messageBox('불출되어 확인된 자료 ', 'E008');
  197. return;
  198. }
  199. model.removenodeset(xUserInfoPath);
  200. model.makeValue(xUserInfoPath + '/param', '_OneS');
  201. modal("../../userdeptinfoweb/xrw/SPZSU10103_사용자부서선택조회", "", "200", "200", "SPZSU10103","/root/main/userpopupinfo","/root/main/temp");
  202. var iParam = getParameter('SPZSU10103_');
  203. if(iParam != ''){
  204. setCSVToNode(xUserInfoPath, iParam);
  205. if(getNodesetCount(xUserInfoPath) == 1){
  206. if(outConfGbn == 'out'){
  207. model.setValue(xApuPath + '/apulist[' + curRow + ']/apuoutid', model.getValue(xUserInfoPath + '/list/userid'));
  208. model.setValue(xApuPath + '/apulist[' + curRow + ']/apuoutnm', model.getValue(xUserInfoPath + '/list/usernm'));
  209. }else if(outConfGbn == 'conf'){
  210. model.setValue(xApuPath + '/apulist[' + curRow + ']/confid', model.getValue(xUserInfoPath + '/list/userid'));
  211. model.setValue(xApuPath + '/apulist[' + curRow + ']/confnm', model.getValue(xUserInfoPath + '/list/usernm'));
  212. }
  213. fSetUpdateState(true);//current row staus 변경
  214. }
  215. }
  216. clearParameter("SPZSU10103_");
  217. }