copy-to-another.blade.php 5.5 KB

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