SMMNA01700.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /***********************************************************************************************************************************************
  2. * create date : 2007.12.29
  3. * author : dhkim
  4. * file name : SMMNA01700.js
  5. * desc : 혈액폐기물리스트를 조회한다.
  6. ***********************************************************************************************************************************************/
  7. var xCondPath = '/root/cond'; //조회 xPath
  8. var xSendPath = '/root/send/reqdata'; //request xPath
  9. var currentDate = getCurrentDate(); //현재일자
  10. /*
  11. * 혈액폐기물 내역을 조회한다.
  12. */
  13. function fSearch(){
  14. var sdate = model.getValue(xCondPath + '/fromdd');
  15. var edate = model.getValue(xCondPath + '/todd');
  16. if(sdate > edate){
  17. messageBox('조회시작일자를 조회종료일자보다 이전으로', 'C001');
  18. return false;
  19. }
  20. model.removeNodeset(xSendPath);
  21. model.makeValue(xSendPath+'/ddflag', model.getValue(xCondPath + '/ddflag'));
  22. model.makeValue(xSendPath+'/fromdd', model.getValue(xCondPath + '/fromdd'));
  23. model.makeValue(xSendPath+'/todd', model.getValue(xCondPath + '/todd'));
  24. submit('TRMNA01701');
  25. }
  26. /**
  27. * 조회조건 초기화
  28. */
  29. function fInit(){
  30. fChangeDDFlag('dd');
  31. model.refresh();
  32. fSearch();
  33. }
  34. /**
  35. * 년,월,일별 검색조건에 따라 조회시작, 종료 날짜 컴퍼넌트를 년,월,일 형식에 맞게 바꿔준다.
  36. *
  37. */
  38. function fChangeDDFlag(ddflag){
  39. model.removeNodeset(xCondPath);
  40. model.makeNode(xCondPath + '/ddflag');
  41. model.makeNode(xCondPath + '/fromdd');
  42. model.makeNode(xCondPath + '/todd');
  43. var condDate = currentDate;
  44. if(ddflag == 'dd'){
  45. cap_date.value = '기준일자 : ';
  46. ipt_fromdd.attribute("width") = "95";
  47. ipt_todd.attribute("width") = "95";
  48. ipt_fromdd.attribute('format') = 'yyyy-mm-dd';
  49. ipt_todd.attribute('format') = 'yyyy-mm-dd';
  50. }else if(ddflag == 'mm'){
  51. condDate = condDate.substring(0, 6);
  52. cap_date.value = '기준년월 : ';
  53. ipt_fromdd.attribute("width") = "80";
  54. ipt_todd.attribute("width") = "80";
  55. ipt_fromdd.attribute('format') = 'yyyy-mm';
  56. ipt_todd.attribute('format') = 'yyyy-mm';
  57. }else if(ddflag == 'yy'){
  58. condDate = condDate.substring(0, 4);
  59. cap_date.value = '기준년도 : ';
  60. ipt_fromdd.attribute("width") = "60";
  61. ipt_todd.attribute("width") = "60";
  62. ipt_fromdd.attribute('format') = 'yyyy';
  63. ipt_todd.attribute('format') = 'yyyy';
  64. }
  65. model.setValue(xCondPath + '/ddflag', ddflag);
  66. model.setValue(xCondPath + '/fromdd', condDate);
  67. model.setValue(xCondPath + '/todd', condDate);
  68. model.refresh();
  69. }