greuge ya crea
This commit is contained in:
parent
4667b39b1a
commit
1416cab07a
|
@ -1,17 +1,30 @@
|
||||||
<vn-card pad-medium>
|
<mg-ajax path="/client/api/greuges" options="vnPost"></mg-ajax>
|
||||||
<vn-vertical pad-medium>
|
<vn-watcher
|
||||||
<vn-title vn-one margin-large-bottom>Add Greuge</vn-title>
|
vn-id="watcher"
|
||||||
<vn-horizontal>
|
data="$ctrl.greuge"
|
||||||
<vn-textfield vn-one margin-small-right label="Importe" field="$ctrl.greuge.amount" type="number" vn-focus></vn-textfield>
|
form="form"
|
||||||
<vn-date-picker vn-one label="Date" model="$ctrl.greuge.date"></vn-date-picker>
|
save="post">
|
||||||
</vn-horizontal>
|
</vn-watcher>
|
||||||
<vn-horizontal>
|
<form pad-medium ng-submit="$ctrl.onSubmit()">
|
||||||
<vn-textfield vn-one margin-small-right label="Comment" field="$ctrl.greuge.description"></vn-textfield>
|
<vn-card>
|
||||||
|
<vn-vertical pad-medium>
|
||||||
|
<vn-title vn-one margin-large-bottom>Add Greuge</vn-title>
|
||||||
|
<vn-horizontal>
|
||||||
|
<vn-textfield vn-one margin-medium-right label="Importe" field="$ctrl.greuge.amount" type="number" vn-focus></vn-textfield>
|
||||||
|
<vn-date-picker vn-one label="Date" model="$ctrl.greuge.shipped"></vn-date-picker>
|
||||||
|
</vn-horizontal>
|
||||||
|
<vn-horizontal>
|
||||||
|
<vn-textfield vn-one margin-medium-right label="Comment" field="$ctrl.greuge.description"></vn-textfield>
|
||||||
<vn-autocomplete vn-one
|
<vn-autocomplete vn-one
|
||||||
field="$ctrl.greuge.greugeTypeFk"
|
field="$ctrl.greuge.greugeTypeFk"
|
||||||
url="/client/api/greugeTypes"
|
url="/client/api/greugeTypes"
|
||||||
label="Type">
|
label="Type"
|
||||||
</vn-autocomplete>
|
>
|
||||||
</vn-horizontal>
|
</vn-autocomplete>
|
||||||
</vn-vertical>
|
</vn-horizontal>
|
||||||
</vn-card>
|
</vn-vertical>
|
||||||
|
</vn-card>
|
||||||
|
<vn-button-bar>
|
||||||
|
<vn-submit label="Save"></vn-submit>
|
||||||
|
</vn-button-bar>
|
||||||
|
</form>
|
|
@ -1,8 +1,25 @@
|
||||||
import ngModule from '../module';
|
import ngModule from '../module';
|
||||||
|
|
||||||
|
class ClientGreugeCreate {
|
||||||
|
constructor($scope, $state) {
|
||||||
|
this.$ = $scope;
|
||||||
|
this.$state = $state;
|
||||||
|
this.greuge = {};
|
||||||
|
}
|
||||||
|
onSubmit() {
|
||||||
|
let created = new Date();
|
||||||
|
this.greuge.created = created.toISOString();
|
||||||
|
this.greuge.clientFk = this.$state.params.id;
|
||||||
|
this.$.watcher.submit().then(
|
||||||
|
() => {
|
||||||
|
this.$state.go('clientCard.greuge.list');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ClientGreugeCreate.$inject = ['$scope', '$state'];
|
||||||
|
|
||||||
ngModule.component('vnClientGreugeCreate', {
|
ngModule.component('vnClientGreugeCreate', {
|
||||||
template: require('./greuge-create.html'),
|
template: require('./greuge-create.html'),
|
||||||
bindings: {
|
controller: ClientGreugeCreate
|
||||||
client: '<'
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue