SMMNO04500.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /**
  2. * @desc : 임산부보고서 화면 초기화
  3. * @
  4. * @param :
  5. * @return :
  6. * @author : 엄영만
  7. * @---------------------------------------------------
  8. */
  9. function fInitialize(){
  10. model.removeNodeset("/root/main/preglist");
  11. //조회날짜 받아옴
  12. var fromdd = ((getCurrentDate().toDate()).getAddDate(-30)).getDateFormat();
  13. var todd = getCurrentDate();
  14. //지난달을 보여줌
  15. model.makeValue("/root/main/cond/fromdd",fromdd);
  16. model.makeValue("/root/main/cond/todd",todd);
  17. fSearch();
  18. }
  19. /**
  20. * @desc : 임산부보고서 조회
  21. * @
  22. * @param :
  23. * @return :
  24. * @author : 엄영만
  25. * @---------------------------------------------------
  26. */
  27. function fSearch() {
  28. model.removeNodeset("/root/main/preglist");
  29. // 조회 조건을 셋팅 한다.
  30. var fromdd = model.getValue("/root/main/cond/fromdd");
  31. var todd = model.getValue("/root/main/cond/todd");
  32. model.setValue("/root/send/fromdd", fromdd);
  33. model.setValue("/root/send/todd", todd);
  34. submit("TRMNO04501");
  35. model.refresh();
  36. }
  37. /**
  38. * @desc : 임산부보고서 생성
  39. * @
  40. * @param :
  41. * @return :
  42. * @author : 엄영만
  43. * @---------------------------------------------------
  44. */
  45. function fCreate() {
  46. model.removeNodeset("/root/main/preglist");
  47. // 조회 조건을 셋팅 한다.
  48. var fromdd = model.getValue("/root/main/cond/fromdd");
  49. var todd = model.getValue("/root/main/cond/todd");
  50. model.setValue("/root/send/fromdd", fromdd);
  51. model.setValue("/root/send/todd", todd);
  52. submit("TRMNO04502");
  53. for(var i = grd_preg.fixedRows; i < grd_preg.rows; i++) {
  54. grd_preg.rowStatus(i) = 1;
  55. }
  56. model.refresh();
  57. }
  58. /**
  59. * @desc : 임산부보고서 저장
  60. * @
  61. * @param :
  62. * @return :
  63. * @author : 엄영만
  64. * @---------------------------------------------------
  65. */
  66. function fSave() {
  67. for(var iRow = grd_preg.fixedrows; iRow <= grd_preg.rows - grd_preg.fixedrows; iRow++){
  68. if(model.getValue("/root/main/preginfo/preglist["+iRow+"]/indd") == ""){
  69. messageBox("진료일자를","C001");
  70. return;
  71. }
  72. else{
  73. if(model.getValue("/root/main/preginfo/preglist["+iRow+"]/indd").length != 8){
  74. messageBox("8자리 진료일자를","C001");
  75. return;
  76. }
  77. }
  78. if(model.getValue("/root/main/preginfo/preglist["+iRow+"]/pid") == ""){
  79. messageBox("환자번호를","C001");
  80. return;
  81. }
  82. if(model.getValue("/root/main/preginfo/preglist["+iRow+"]/pname") == ""){
  83. messageBox("임산부명를","C001");
  84. return;
  85. }
  86. if(model.getValue("/root/main/preginfo/preglist["+iRow+"]/rrgstno") == ""){
  87. messageBox("주민번호를","C001");
  88. return;
  89. }
  90. else{
  91. if(model.getValue("/root/main/preginfo/preglist["+iRow+"]/rrgstno").length != 13){
  92. messageBox("13자리 주민번호를","C001");
  93. return;
  94. }
  95. }
  96. if(model.getValue("/root/main/preginfo/preglist["+iRow+"]/zipcd") != "" &&
  97. model.getValue("/root/main/preginfo/preglist["+iRow+"]/zipcd").length != 6){
  98. messageBox("6자리 우편번호를","C001");
  99. return;
  100. }
  101. }
  102. var updateData = grd_preg.getUpdateData();
  103. if(getArrayData(updateData,1,0) == ""){
  104. messageBox("저장할 데이터를 입력하지 ","E007");
  105. return;
  106. }
  107. if(messageBox("저장 " , "S001") == '6'){
  108. model.makeValue("/root/send/preglist",updateData);
  109. if(submit("TXMNO04501")){
  110. fSearch();
  111. }
  112. }
  113. }