Min date control development
This commit is contained in:
parent
af685b6c17
commit
1a6ba034bd
@ -5,6 +5,8 @@
|
||||
{'readonly': readonly},
|
||||
{'disabled': disabled},
|
||||
{'hidden-year': hiddenYear},
|
||||
{'data-value-control': dataValueControl},
|
||||
{'data-value-min': dataValueMin},
|
||||
formClasses
|
||||
]"
|
||||
:footer-error="formError"
|
||||
@ -98,6 +100,12 @@ export default {
|
||||
},
|
||||
hiddenYear: {
|
||||
type: [Boolean, String]
|
||||
},
|
||||
dataValueControl: {
|
||||
type: [Boolean, String, Date]
|
||||
},
|
||||
dataValueMin: {
|
||||
type: [Boolean, String, Date]
|
||||
}
|
||||
},
|
||||
|
||||
@ -126,6 +134,18 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
dataControlEvent() {
|
||||
if(this.dataValueControl) {
|
||||
let date_control = document.querySelector('.data-value-control .datepicker');
|
||||
|
||||
if(this.dataValueMin) {
|
||||
debugger;
|
||||
this.dateConfig.minDate = date_control.value;
|
||||
// this.$set(this.dateConfig,'minDate', date_control.value);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
change() {
|
||||
this.$emit('interface', this.real_model);
|
||||
|
||||
@ -143,13 +163,18 @@ export default {
|
||||
wrapper.classList.remove('hidden-year-flatpickr');
|
||||
});
|
||||
}
|
||||
//this.dataControlEvent();
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
value: function(val) {
|
||||
this.real_model = val;
|
||||
}
|
||||
},
|
||||
|
||||
dataValueMin: function(val) {
|
||||
this.dateConfig.minDate = val;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
28
resources/assets/js/views/common/documents.js
vendored
28
resources/assets/js/views/common/documents.js
vendored
@ -4,22 +4,22 @@
|
||||
* 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 Error from './../../plugins/error';
|
||||
import BulkAction from './../../plugins/bulk-action';
|
||||
import Form from './../../plugins/form';
|
||||
import Error from './../../plugins/error';
|
||||
import BulkAction from './../../plugins/bulk-action';
|
||||
|
||||
// plugin setup
|
||||
Vue.use(DashboardPlugin);
|
||||
// plugin setup
|
||||
Vue.use(DashboardPlugin);
|
||||
|
||||
const app = new Vue({
|
||||
const app = new Vue({
|
||||
el: '#main-body',
|
||||
|
||||
mixins: [
|
||||
@ -54,6 +54,7 @@ const app = new Vue({
|
||||
taxes: [],
|
||||
page_loaded: false,
|
||||
currencies: [],
|
||||
min_due_date: false,
|
||||
}
|
||||
},
|
||||
|
||||
@ -544,6 +545,10 @@ const app = new Vue({
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
|
||||
setDueMinDate(date) {
|
||||
this.min_due_date = date;
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
@ -641,4 +646,5 @@ const app = new Vue({
|
||||
}, this);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -22,7 +22,7 @@
|
||||
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
|
||||
<div class="row">
|
||||
@if (!$hideIssuedAt)
|
||||
{{ Form::dateGroup('issued_at', trans($textIssuedAt), 'calendar', ['id' => 'issued_at', 'class' => 'form-control datepicker', 'required' => 'required', 'show-date-format' => company_date_format(), 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], $issuedAt) }}
|
||||
{{ Form::dateGroup('issued_at', trans($textIssuedAt), 'calendar', ['id' => 'issued_at', 'class' => 'form-control datepicker', 'required' => 'required', 'show-date-format' => company_date_format(), 'date-format' => 'Y-m-d', 'autocomplete' => 'off', 'data-value-control' => true, 'change' => 'setDueMinDate'], $issuedAt) }}
|
||||
@endif
|
||||
|
||||
@if (!$hideDocumentNumber)
|
||||
@ -30,7 +30,7 @@
|
||||
@endif
|
||||
|
||||
@if (!$hideDueAt)
|
||||
{{ Form::dateGroup('due_at', trans($textDueAt), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'show-date-format' => company_date_format(), 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], $dueAt) }}
|
||||
{{ Form::dateGroup('due_at', trans($textDueAt), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'show-date-format' => company_date_format(), 'date-format' => 'Y-m-d', 'autocomplete' => 'off', 'min-date' => 'form.issued_at', 'min-date-dynamic' => 'min_due_date', 'data-value-control' => true, 'data-value-min' => true], $dueAt) }}
|
||||
@else
|
||||
{{ Form::hidden('due_at', old('issued_at', $issuedAt), ['id' => 'due_at', 'v-model' => 'form.issued_at']) }}
|
||||
@endif
|
||||
|
@ -55,6 +55,14 @@
|
||||
hidden-year
|
||||
@endif
|
||||
|
||||
@if (!empty($attributes['data-value-control']))
|
||||
data-value-control
|
||||
@endif
|
||||
|
||||
@if (!empty($attributes['min-date-dynamic']))
|
||||
:data-value-min="{{ $attributes['min-date-dynamic'] }}"
|
||||
@endif
|
||||
|
||||
@if (!empty($attributes['change']))
|
||||
@change="{{ $attributes['change'] }}"
|
||||
@endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user