copy-to-another.blade.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!--- copy-to-anther --->
  2. @php $modalClassName = $modalClassName ?? '';
  3. //var_dump($moealSetFile['General']['Title']);
  4. @endphp
  5. <div class="modal fade {{ $modalClassName }}" id="modal-copy-to-another" aria-hidden="true" data-backdrop="static" style="display: none; z-index: 1050; overflow: auto;">
  6. <div class="modal-dialog m-auto pt-4" style="width: 480px;">
  7. <button type="button" hidden
  8. class="btn btn-success btn-open-modal modal-btn">
  9. </button>
  10. <div class="modal-content">
  11. <div class="modal-header" style="background-color: #45748a;">
  12. <h4 class="modal-title text-white" id="myModalLabel">{{ $moealSetFile['General']['Title'] }}</h4>
  13. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fas fa-times"></i></button>
  14. </div>
  15. <div class="modal-body pb-2">
  16. <div class="d-flex flex-row justify-content-center">
  17. <div class="mr-2">
  18. <button type="button" class="w-100 btn-sm mb-1 border-0 source-btn"
  19. onclick="copy_to_another_show_modal('{{ $modalClassName }}', 'Source')">
  20. {{ $moealSetFile['FormVars']['Title']['SourceButton'] }}
  21. </button>
  22. <input type="text" class="text-center rounded w-100 source-slip-no-txt" autocomplete="off" required>
  23. </div>
  24. <div>
  25. <button class="w-100 btn-sm mb-1 target-slip-no-btn border-0"
  26. onclick="get_target_last_slip_no(this)">
  27. {{ $moealSetFile['FormVars']['Title']['TargetButton'] }}
  28. </button>
  29. <input type="text" class="text-center rounded w-100 target-slip-no-txt" autocomplete="off" required>
  30. </div>
  31. <button class="btn_copy btn btn-sm btn-secondary rounded btn-sm icon-copy3 ml-2" onclick="copy_to_another()"></button>
  32. </div>
  33. </div>
  34. <div class="d-flex pb-3 flex-column row02">
  35. <div class="mb-1">
  36. <input type="checkbox" value="1" name="EqualLabel" id="{{ $modalClassName }}-EqualLabel" onchange="change_target_text(this)">
  37. <label class="m-0 font-weight-bold"
  38. for="{{ $modalClassName }}-EqualLabel">{{ $moealSetFile['FormVars']['Title']['EqualLabel'] }}</label>
  39. <input type="hidden" name="EqualLabel" value='0' id="EqualLabel_hidden">
  40. </div>
  41. <div class="d-flex px-2 border border-light">
  42. <label class="m-0 font-weight-bold">{{ $moealSetFile['FormVars']['Title']['ItemCopyLabel'] }}</label>
  43. <input name="{{ $modalClassName }}-CopyItemCheckRadio" type="radio" value="true" id="{{ $modalClassName }}-CopyItemRadio">
  44. <label class="m-0" for="{{ $modalClassName }}-CopyItemRadio">
  45. {{ $moealSetFile['FormVars']['Title']['CopyItemRadio'] }}
  46. </label>
  47. <input name="{{ $modalClassName }}-CopyItemCheckRadio" type="radio" value="false" id="{{ $modalClassName }}-DontCopyRadio">
  48. <label class="m-0" for="{{ $modalClassName }}-DontCopyRadio">
  49. {{ $moealSetFile['FormVars']['Title']['DontCopyRadio'] }}
  50. </label>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <script>
  57. $(document).ready(function() {
  58. let class_name = {!! json_encode($modalClassName) !!};
  59. copyToAnother[class_name] = {!! json_encode($moealSetFile) !!};
  60. });
  61. </script>
  62. @php
  63. //var_dump($moealSetFile['CopyToAnotherPopupVars']['Display']);
  64. @endphp
  65. @foreach ($moealSetFile['CopyToAnotherPopupVars']['Display'] as $key => $i)
  66. @if ($moealSetFile['CopyToAnotherPopupVars']['Display'][$key] != 'd-none')
  67. @push('modal')
  68. @include($moealSetFile['CopyToAnotherPopupVars']['BladeRoute'][$key], [
  69. 'moealSetFile' => $moealSetFile['CopyToAnotherPopupVars']['Parameter'][$key],
  70. 'modalClassName' => 'copy-to-another-'.$modalClassName
  71. ])
  72. @endpush
  73. @endif
  74. @endforeach
  75. @once
  76. <script src="{{ csset('/js/modals-controller/b-type/copy-to-another.js') }}"></script>
  77. <script>
  78. function copy_to_another_show_modal(class_name, key) {
  79. let modal_class_name = 'copy-to-another-' + class_name;
  80. let func_name = `get_source_${copyToAnother[class_name]['CopyToAnotherPopupVars']['Filter'][key]}`;
  81. // 첫 번째 show 했을 때만 호출
  82. if (! $(`#modal-copy-to-another.${class_name}`).find('.modal-btn').data('first')) {
  83. first_slip_date_rang(`#${modal_class_name}slip-date-navi-div`)
  84. }
  85. $(`#modal-copy-to-another.${class_name}`).find('.modal-btn').data('first', true)
  86. $(`#modal-copy-to-another.${class_name}`).find('.modal-btn').data('filter', copyToAnother[class_name]['CopyToAnotherPopupVars']['Filter'][key])
  87. $(`#modal-copy-to-another.${class_name}`).find('.modal-btn').data('target', copyToAnother[class_name]['CopyToAnotherPopupVars']['Component'][key])
  88. $(`#modal-copy-to-another.${class_name}`).find('.modal-btn').data('variable', copyToAnother[class_name]['CopyToAnotherPopupVars']['Parameter'][key])
  89. $(`#modal-copy-to-another.${class_name}`).find('.modal-btn').data('class', modal_class_name)
  90. $(`#modal-copy-to-another.${class_name}`).find('.modal-btn').data('clicked', snakeCase(func_name))
  91. $(`#modal-copy-to-another.${class_name}`).find('.modal-btn').trigger('click')
  92. }
  93. var copyToAnother = {}
  94. </script>
  95. @endonce