123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- @extends ('layouts.patient')
- @section('inner-content')
- <div id="company-client-{{ $patient->uid }}">
- @yield('company-client-content')
- </div>
- <script>
- (function () {
- function init() {
- initStagSuggest();
- let parentSegment = $('body');
- parentSegment.find('input[stag-suggest][target-key][target-field]')
- .off('stag-suggest-selected')
- .on('stag-suggest-selected', (_e, _input, _data) => {
- _input = $(_input);
- _input.closest('form').find('input[name="' + _input.attr('target-field') + '"]').val(_data[_input.attr('target-key')]);
- });
- parentSegment.find('.copy-target')
- .off('click.copy-target')
- .on('click.copy-target', function() {
- copyTextToClipboard($(this).attr('data-target'));
- return false;
- });
- parentSegment.find('.generate-and-visit-ic-portal')
- .off('click.generate-and-visit-ic-portal')
- .on('click.generate-and-visit-ic-portal', function() {
- $.post('/api/session/proLogInAsCustomer', {
- customerUid: $(this).attr('data-uid')
- }, _data => {
- if(!hasResponseError(_data)) {
- window.location.href = '/ic/home/' + _data.data;
- return false;
- }
- });
- return false;
- });
- parentSegment.find('.generate-and-copy-ic-portal-url')
- .off('click.generate-and-copy-ic-portal-url')
- .on('click.generate-and-copy-ic-portal-url', function() {
- $.post('/api/session/proLogInAsCustomer', {
- customerUid: $(this).attr('data-uid')
- }, _data => {
- if(!hasResponseError(_data)) {
- copyTextToClipboard('{{config('app.url')}}/ic/home/' + _data.data);
- return false;
- }
- });
- return false;
- });
- parentSegment.find('.generate-and-visit-ic-pay')
- .off('click.generate-and-visit-ic-pay')
- .on('click.generate-and-visit-ic-pay', function() {
- $.post('/api/session/proLogInAsCustomer', {
- customerUid: $(this).attr('data-uid')
- }, _data => {
- if(!hasResponseError(_data)) {
- window.location.href = '/ic/pay/' + $(this).attr('data-invoice-uid') + '/' + _data.data;
- return false;
- }
- });
- return false;
- });
- parentSegment.find('.generate-and-copy-ic-pay-url')
- .off('click.generate-and-copy-ic-pay-url')
- .on('click.generate-and-copy-ic-pay-url', function() {
- $.post('/api/session/proLogInAsCustomer', {
- customerUid: $(this).attr('data-uid')
- }, _data => {
- if(!hasResponseError(_data)) {
- copyTextToClipboard('{{config('app.url')}}/ic/pay/' + $(this).attr('data-invoice-uid') + '/' + _data.data);
- return false;
- }
- });
- return false;
- });
- parentSegment.find('.generate-and-copy-ic-payment-method-url')
- .off('click.generate-and-copy-ic-payment-method-url')
- .on('click.generate-and-copy-ic-payment-method-url', function() {
- $.post('/api/session/proLogInAsCustomer', {
- customerUid: $(this).attr('data-uid')
- }, _data => {
- if (!hasResponseError(_data)) {
- copyTextToClipboard('{{ config('app.url') }}/ic/payment-methods/' + _data.data);
- return false;
- }
- });
- return false;
- });
- }
- addMCInitializer('company-client-{{$patient->uid}}', init, '#company-client-{{$patient->uid}}')
- }).call(window);
- </script>
- @endsection
|