Delete modal and permission control edited
This commit is contained in:
parent
697ac984d9
commit
5ea50925e4
40
resources/assets/js/views/purchases/vendors.js
vendored
40
resources/assets/js/views/purchases/vendors.js
vendored
@ -4,31 +4,31 @@
|
|||||||
* building robust, powerful web applications using Vue and Laravel.
|
* building robust, powerful web applications using Vue and Laravel.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require('./../../bootstrap');
|
require('./../../bootstrap');
|
||||||
|
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
|
||||||
import DashboardPlugin from './../../plugins/dashboard-plugin';
|
import DashboardPlugin from './../../plugins/dashboard-plugin';
|
||||||
|
|
||||||
import Global from './../../mixins/global';
|
import Global from './../../mixins/global';
|
||||||
|
|
||||||
import Form from './../../plugins/form';
|
import Form from './../../plugins/form';
|
||||||
import BulkAction from './../../plugins/bulk-action';
|
import BulkAction from './../../plugins/bulk-action';
|
||||||
|
|
||||||
// plugin setup
|
// plugin setup
|
||||||
Vue.use(DashboardPlugin);
|
Vue.use(DashboardPlugin);
|
||||||
|
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
el: '#app',
|
el: '#main-body',
|
||||||
|
|
||||||
mixins: [
|
mixins: [
|
||||||
Global
|
Global
|
||||||
],
|
],
|
||||||
|
data: function () {
|
||||||
|
return {
|
||||||
|
form: new Form('vendor'),
|
||||||
|
bulk_action: new BulkAction('vendors')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
data: function () {
|
|
||||||
return {
|
|
||||||
form: new Form('vendor'),
|
|
||||||
bulk_action: new BulkAction('vendors')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
149
resources/assets/js/views/sales/customers.js
vendored
149
resources/assets/js/views/sales/customers.js
vendored
@ -4,94 +4,95 @@
|
|||||||
* building robust, powerful web applications using Vue and Laravel.
|
* building robust, powerful web applications using Vue and Laravel.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require('./../../bootstrap');
|
require('./../../bootstrap');
|
||||||
|
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
|
||||||
import DashboardPlugin from './../../plugins/dashboard-plugin';
|
import DashboardPlugin from './../../plugins/dashboard-plugin';
|
||||||
|
|
||||||
import Global from './../../mixins/global';
|
import Global from './../../mixins/global';
|
||||||
|
|
||||||
import Form from './../../plugins/form';
|
import Form from './../../plugins/form';
|
||||||
import BulkAction from './../../plugins/bulk-action';
|
import BulkAction from './../../plugins/bulk-action';
|
||||||
|
|
||||||
// plugin setup
|
// plugin setup
|
||||||
Vue.use(DashboardPlugin);
|
Vue.use(DashboardPlugin);
|
||||||
|
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
el: '#app',
|
el: '#main-body',
|
||||||
|
|
||||||
mixins: [
|
mixins: [
|
||||||
Global
|
Global
|
||||||
],
|
],
|
||||||
|
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
form: new Form('customer'),
|
form: new Form('customer'),
|
||||||
bulk_action: new BulkAction('customers'),
|
bulk_action: new BulkAction('customers'),
|
||||||
can_login : false
|
can_login : false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.form.create_user = false;
|
this.form.create_user = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
methods:{
|
methods:{
|
||||||
onCanLogin(event) {
|
onCanLogin(event) {
|
||||||
if (event.target.checked) {
|
if (event.target.checked) {
|
||||||
if (this.form.email) {
|
if (this.form.email) {
|
||||||
axios.get(url + '/auth/users/autocomplete', {
|
axios.get(url + '/auth/users/autocomplete', {
|
||||||
params: {
|
params: {
|
||||||
column: 'email',
|
column: 'email',
|
||||||
value : this.form.email
|
value : this.form.email
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (response.data.errors) {
|
if (response.data.errors) {
|
||||||
if (response.data.data) {
|
if (response.data.data) {
|
||||||
this.form.errors.set('email', {
|
this.form.errors.set('email', {
|
||||||
0: response.data.data
|
0: response.data.data
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.can_login = true;
|
this.can_login = true;
|
||||||
this.form.create_user = true;
|
this.form.create_user = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.data.success) {
|
if (response.data.success) {
|
||||||
this.form.errors.set('email', {
|
this.form.errors.set('email', {
|
||||||
0: can_login_errors.email
|
0: can_login_errors.email
|
||||||
});
|
});
|
||||||
|
|
||||||
this.can_login = false;
|
this.can_login = false;
|
||||||
this.form.create_user = false;
|
this.form.create_user = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.form.errors.set('email', {
|
this.form.errors.set('email', {
|
||||||
0: can_login_errors.valid
|
0: can_login_errors.valid
|
||||||
});
|
});
|
||||||
|
|
||||||
this.can_login = false;
|
this.can_login = false;
|
||||||
this.form.create_user = false;
|
this.form.create_user = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
this.form.errors.clear('email');
|
this.form.errors.clear('email');
|
||||||
|
|
||||||
|
this.can_login = false;
|
||||||
|
this.form.create_user = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.can_login = false;
|
|
||||||
this.form.create_user = false;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
{{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount']) }}
|
{{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount']) }}
|
||||||
|
|
||||||
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, null, ['path' => route('modals.vendors.create'), 'remote_action' => route('vendors.index')]) }}
|
{{ Form::selectRemoteAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, old('contact.id', old('contact_id', null)), ['path' => route('modals.vendors.create'), 'remote_action' => route('vendors.index')]) }}
|
||||||
|
|
||||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||||
|
|
||||||
|
12
resources/views/purchases/vendors/show.blade.php
vendored
12
resources/views/purchases/vendors/show.blade.php
vendored
@ -12,7 +12,7 @@
|
|||||||
@stack('button_dropdown_start')
|
@stack('button_dropdown_start')
|
||||||
|
|
||||||
@stack('duplicate_button_start')
|
@stack('duplicate_button_start')
|
||||||
@can('create-purchases-bills')
|
@can('create-purchases-vendors')
|
||||||
<a class="dropdown-item" href="{{ route('vendors.duplicate', $vendor->id) }}">
|
<a class="dropdown-item" href="{{ route('vendors.duplicate', $vendor->id) }}">
|
||||||
{{ trans('general.duplicate') }}
|
{{ trans('general.duplicate') }}
|
||||||
</a>
|
</a>
|
||||||
@ -21,21 +21,21 @@
|
|||||||
|
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
|
|
||||||
@stack('invoice_button_start')
|
@stack('bill_button_start')
|
||||||
@can('create-purchases-bills')
|
@can('create-purchases-bills')
|
||||||
<a class="dropdown-item" href="{{ route('vendors.create-bill', $vendor->id) }}">
|
<a class="dropdown-item" href="{{ route('vendors.create-bill', $vendor->id) }}">
|
||||||
{{ trans('bills.create_bill') }}
|
{{ trans('bills.create_bill') }}
|
||||||
</a>
|
</a>
|
||||||
@endcan
|
@endcan
|
||||||
@stack('invoice_button_end')
|
@stack('bill_button_end')
|
||||||
|
|
||||||
@stack('revenue_button_start')
|
@stack('payment_button_start')
|
||||||
@can('create-purchases-payments')
|
@can('create-purchases-vendors')
|
||||||
<a class="dropdown-item" href="{{ route('vendors.create-payment', $vendor->id) }}">
|
<a class="dropdown-item" href="{{ route('vendors.create-payment', $vendor->id) }}">
|
||||||
{{ trans('payments.create_payment') }}
|
{{ trans('payments.create_payment') }}
|
||||||
</a>
|
</a>
|
||||||
@endcan
|
@endcan
|
||||||
@stack('revenue_button_end')
|
@stack('payment_button_end')
|
||||||
|
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user