rpt-custom.blade.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <!--- uploaders --->
  2. <div class="modal fade" id="modal-rpt-custom" aria-hidden="true" data-backdrop="static" style="z-index: 1050; overflow: auto;">
  3. <div class="modal-dialog m-auto pt-4" style="max-width: 400px !important;">
  4. <div class="modal-content">
  5. <div class="modal-header bg-danger-10">
  6. <h4 class="modal-title text-white" id="myModalLabel">커스텀 보고서</h4>
  7. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fas fa-times"></i></button>
  8. </div>
  9. <div class="modal-body pb-2 px-2 pt-0" style="background-color: #f5f5f5;">
  10. <div class="text-right">
  11. <div class="btn-group my-1">
  12. <button type="button" class="btn btn-sm btn-primary rpt-custom-act save-button" data-value="">
  13. 미리보기
  14. </button>
  15. @include('front.dabory.erp.partial.select-btn-options', [
  16. 'selectBtns' => [
  17. [ 'Value' => 'PDF', 'Caption' => '아크로벳(pdf) 보기' ],
  18. [ 'Value' => 'EXCELWORKBOOK', 'Caption' => '엑셀(xlsx) 다운로드' ],
  19. [ 'Value' => 'EXCEL', 'Caption' => '엑셀(xls) 다운로드' ],
  20. [ 'Value' => 'WORD', 'Caption' => '워드(docx) 다운로드' ],
  21. [ 'Value' => 'EDITABLERTF', 'Caption' => '서식있는텍스트 (rtf) 다운로드' ],
  22. [ 'Value' => 'CSV', 'Caption' => '쉼표로구분(csv) 다운로드' ],
  23. [ 'Value' => 'RPT', 'Caption' => '크리스탈레포트(rpt) 다운로드' ],
  24. ],
  25. 'eventClassName' => 'rpt-custom-act',
  26. ])
  27. </div>
  28. </div>
  29. <div class="card p-2">
  30. <div class="d-flex flex-column mb-2">
  31. <label class="m-0">변형 서식 종류</label>
  32. <div class="d-flex align-items-center">
  33. <input autocomplete="off" name="is-custom" id="standard-radio" type="radio" value="0" checked>
  34. <label for="standard-radio" class="w-100 rounded overflow-hidden mr-0 text-nowrap">
  35. 표준
  36. </label>
  37. <input autocomplete="off" name="is-custom" id="custom-radio" type="radio" value="1">
  38. <label for="custom-radio" class="w-100 rounded overflow-hidden mr-0 text-nowrap">
  39. 커스텀
  40. </label>
  41. </div>
  42. </div>
  43. <div class="d-flex flex-column mb-2">
  44. <label class="m-0">서식선택</label>
  45. <select class="w-100 rounded" id="format-select"></select>
  46. </div>
  47. </div>
  48. {{-- <div class="position-absolute" style="top: 2px; right: 10px;">--}}
  49. {{-- <button type="button" class="font-weight-bold btn btn-danger btn-sm">--}}
  50. {{-- 인쇄--}}
  51. {{-- </button>--}}
  52. {{-- </div>--}}
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. @once
  58. <script>
  59. $('#modal-rpt-custom').find('.rpt-custom-act').on('click', function () {
  60. // console.log($(this).data('value'))
  61. ModalRptCustom.rpt_print($(this).data('value'))
  62. })
  63. $('input[name=is-custom]').change(function () {
  64. ModalRptCustom.create_format_select_box_options()
  65. });
  66. (function( ModalRptCustom, $, undefined ) {
  67. ModalRptCustom.data = []
  68. ModalRptCustom.info = []
  69. ModalRptCustom.rpt_print = function (export_fmt) {
  70. let print_vars = ModalRptCustom.data.filter(rpt_custom => rpt_custom['Id'] === Number($('#modal-rpt-custom').find('#format-select').val()))[0]
  71. print_vars['ExportFmt'] = export_fmt
  72. show_recrystallize_server(print_vars, ModalRptCustom.info['type'], ModalRptCustom.info['vars'])
  73. }
  74. ModalRptCustom.show_popup_callback = async function (custom_code, type, vars) {
  75. ModalRptCustom.info['type'] = type
  76. ModalRptCustom.info['vars'] = vars
  77. ModalRptCustom.btn_act_new()
  78. const response = await get_api_data('rpt-custom-page', {
  79. PageVars: {
  80. Query: `custom_code = '${custom_code}'`,
  81. Asc: 'seq_no',
  82. Limit: 9999999
  83. }
  84. })
  85. ModalRptCustom.data = response.data['Page']
  86. ModalRptCustom.create_format_select_box_options()
  87. }
  88. ModalRptCustom.btn_act_new = function () {
  89. $('#modal-rpt-custom .modal-body button').addClass('bg-danger-10 border-danger-10 bg-danger-10-hover')
  90. }
  91. ModalRptCustom.create_format_select_box_options = function() {
  92. const is_custom = $('input[name=is-custom]:checked').val()
  93. const data = ModalRptCustom.data.filter(rpt_custom => rpt_custom['IsCustom'] === is_custom)
  94. const options = custom_create_options('Id', 'RptName', data)
  95. $('#modal-rpt-custom').find('#format-select').html(options);
  96. }
  97. }( window.ModalRptCustom = window.ModalRptCustom || {}, jQuery ));
  98. </script>
  99. @endonce