hokky 1 mese fa
parent
commit
8dc14c33af

+ 24 - 0
dabory/para/erp/ko_KR/popup/popup-setup/form-a/header-footer-html.json

@@ -0,0 +1,24 @@
+{
+    "General": {
+        "PickApi": "setup-pick",
+        "ActApi": "setup-act"
+    },
+    "SelectButtonOptions": [
+    ],
+
+    "//FormVars": "ListVars[0]-Caption, ListVars[1]-hidden",
+    "FormVars": [
+        {
+            "SaveButton": "저장",
+            "Header": "Header",
+            "Body": "Body",
+            "Footer": "Footer"
+        },
+        {
+            "SaveButton": "center",
+            "Header": "center",
+            "Body": "center",
+            "Footer": "center"
+        }
+    ]
+}

+ 14 - 6
resources/views/front/dabory/erp/basic-settings/monthly-settle.blade.php

@@ -120,16 +120,24 @@
         }
 
         MonthlySettleForm.btn_re_cal = async function () {
+            if ($('#yyyy-txt').val() == '') {
+                return iziToast.error({ title: 'Error', message: '정산년도를 입력해주세요. ex)2024' });
+            }
+
             const parameters = MonthlySettleForm.parameter();
-            let data;
-            const yymmdd =parameters[''];
-            console.log('yymmdd : ', yymmdd);
+
             for (const parameter of parameters) {
-                data = parameter;
-                const response = await get_api_data('monthly-settle', data);
+                const response = await get_api_data('monthly-settle', parameter);
+
+                if (response && response.data.apiStatus) {
+                    console.log(response);
+                    return iziToast.error({ title: 'Error', message: 'API Error' });
+                }
+
+                iziToast.success({ title: 'Success', message: '재정산 완료' });
                 console.log(response);
             }
-        }
+        };
 
     }( window.MonthlySettleForm = window.MonthlySettleForm || {}, jQuery ));
 

+ 134 - 0
resources/views/front/dabory/erp/popup-setup/form-a/header-footer-html-form.blade.php

@@ -0,0 +1,134 @@
+{{-- @extends('layouts.master')
+@section('content') --}}
+
+<div id="popup-setup-form-a-header-footer-html-form">
+    <div class="mb-1 pt-2 text-right btn-groups">
+        <button type="button" class="btn btn-sm btn-primary save-spinner-btn">
+            <span class="save-spinner spinner-border spinner-border-sm text-center" role="status" aria-hidden="true"></span>
+                Loading...
+        </button>
+        <div class="btn-group" hidden>
+            <button type="button" class="btn btn-sm btn-primary header-footer-html-act save-button" data-value="save" {{ $formA['FormVars']['Hidden']['SaveButton'] }}>
+                {{ $formA['FormVars']['Title']['SaveButton'] }}
+            </button>
+            @isset($formA['SelectButtonOptions'])
+                @include('front.dabory.erp.partial.select-btn-options', [
+                    'selectBtns' => $formA['SelectButtonOptions'],
+                    'eventClassName' => 'header-footer-html-act',
+                ])
+            @endisset
+        </div>
+    </div>
+    <div class="card mb-2" id="header-footer-html-form">
+        <div class="card-header" id="frm">
+            <input type="hidden" id="Id" name="Id" value="0">
+            <input type="hidden" id="view-source-url">
+            <div class="row">
+                <div class="col-12 col-lg card-header-item">
+                    <div class="card card card-primary mb-3 mb-md-2 mb-lg-0 border-light">
+                        <div class="card-header p-0 mb-2">
+                        </div>
+                        <div class="card-body">
+                            <div class="d-flex flex-column mb-3">
+                                <label class="m-0">{{ $formA['FormVars']['Title']['Header'] }}</label>
+                                <textarea id="header-textarea"></textarea>
+                            </div>
+                            <div class="d-flex flex-column mb-3">
+                                <label class="m-0">{{ $formA['FormVars']['Title']['Body'] }}</label>
+                                <textarea id="body-textarea"></textarea>
+                            </div><div class="d-flex flex-column mb-3">
+                                <label class="m-0">{{ $formA['FormVars']['Title']['Footer'] }}</label>
+                                <textarea id="footer-textarea"></textarea>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+{{-- @endsection --}}
+
+@once
+    <script>
+        $(document).ready(async function() {
+            $('#header-footer-html-form').find('#upload-file').fileselect()
+
+            $('.header-footer-html-act').on('click', function () {
+                // console.log($(this).data('value'))
+                switch( $(this).data('value') ) {
+                    case 'save': PopupSetupFormAHeaderFooterHtmlForm.btn_act_save(); break;
+                }
+            });
+
+            activate_button_group()
+        });
+
+        (function( PopupSetupFormAHeaderFooterHtmlForm, $, undefined ) {
+            PopupSetupFormAHeaderFooterHtmlForm.formA = {!! json_encode($formA) !!};
+            PopupSetupFormAHeaderFooterHtmlForm.brand_code
+
+
+            PopupSetupFormAHeaderFooterHtmlForm.btn_act_new_callback = function () {
+                Atype.btn_act_new('#header-footer-html-form #frm')
+            }
+
+            PopupSetupFormAHeaderFooterHtmlForm.btn_act_save = function () {
+                Atype.set_parameter_callback(PopupSetupFormAHeaderFooterHtmlForm.parameter);
+
+                Atype.btn_act_save('#header-footer-html-form #frm', function () {
+                    $('#modal-select-popup.show').trigger('list.requery')
+                    $('#modal-select-popup.show').modal('hide');
+                }, 'PopupSetupFormAHeaderFooterHtmlForm');
+            }
+
+            PopupSetupFormAHeaderFooterHtmlForm.parameter = function () {
+                const form = $('#header-footer-html-form')
+
+                let setup = {
+                    Header: $(form).find('#header-textarea').val(),
+                    Body: $(form).find('#body-textarea').val(),
+                    Footer: $(form).find('#footer-textarea').val(),
+                }
+                let id = Number($(form).find('#Id').val())
+                let parameter = {
+                    Id: id,
+                    SetupJson: JSON.stringify(setup),
+                }
+                if (id < 0) {
+                    parameter = { Id: id }
+                } else if (id > 0) {
+                    delete parameter.CreatedOn;
+                } else {
+                    delete parameter.UpdatedOn;
+                }
+
+                return parameter;
+            }
+
+            PopupSetupFormAHeaderFooterHtmlForm.btn_act_new = async function () {
+                Atype.btn_act_new('#header-footer-html-form #frm')
+            }
+
+            PopupSetupFormAHeaderFooterHtmlForm.show_popup_callback = async function (id, setup, brand_code) {
+                $('#modal-select-popup.popup-setup-form-a-header-footer-html-form .modal-dialog').css('maxWidth', '600px');
+                PopupSetupFormAHeaderFooterHtmlForm.btn_act_new()
+                $('#header-footer-html-form').find('#Id').val(id)
+                PopupSetupFormAHeaderFooterHtmlForm.brand_code = brand_code
+                PopupSetupFormAHeaderFooterHtmlForm.set_ui(setup)
+            }
+
+            PopupSetupFormAHeaderFooterHtmlForm.set_ui = function (setup) {
+                if (_.isEmpty(setup)) return;
+
+                const form = $('#header-footer-html-form')
+
+                $(form).find('#header-textarea').val(setup['Header'])
+                $(form).find('#body-textarea').val(setup['Body'])
+                $(form).find('#footer-textarea').val(setup['Footer'])
+            }
+
+        }( window.PopupSetupFormAHeaderFooterHtmlForm = window.PopupSetupFormAHeaderFooterHtmlForm || {}, jQuery ));
+    </script>
+@endonce

+ 1 - 4
resources/views/front/dabory/erp/popup-setup/form-a/seo-html-form.blade.php

@@ -29,10 +29,7 @@
                         <div class="card-header p-0 mb-2">
                         </div>
                         <div class="card-body">
-                            <div class="d-flex flex-column mb-3">
-                                <label class="m-0">{{ $formA['FormVars']['Title']['PageHtml'] }}</label>
-                                <textarea id="page-html-textarea"></textarea>
-                            </div>
+
                             <div class="d-flex flex-column mb-3 common-seo-html">
                                 <label class="m-0">site-verification HTML & robots.txt (.xml, .txt .html ONLY)</label>
                                 <input type="file" id="upload-file" class="cursor-pointer rounded w-100 form-control-uniform-custom" style="text-indent: 0;"