Tarea #446 claim.development

This commit is contained in:
gerard 2018-09-05 11:48:38 +02:00
parent 0333ba96b0
commit b5448aaa5a
5 changed files with 152 additions and 1 deletions

View File

@ -0,0 +1,114 @@
<vn-crud-model
vn-id="model"
url="claim/api/ClaimDevelopments"
fields="['id', 'claimFk', 'claimReasonFk', 'claimResultFk', 'claimResponsibleFk', 'workerFk', 'claimRedeliveryFk']"
link="{claimFk: $ctrl.$state.params.id}"
filter="$ctrl.filter"
data="claimDevelopments" on-data-change="$ctrl.onDataChange()">
</vn-crud-model>
<vn-crud-model
url="claim/api/ClaimReasons"
data="claimReasons"
order="description">
</vn-crud-model>
<vn-crud-model
url="claim/api/ClaimResults"
data="claimResults"
order="description">
</vn-crud-model>
<vn-crud-model
url="claim/api/ClaimResponsibles"
data="claimResponsibles"
order="description">
</vn-crud-model>
<vn-crud-model
url="/client/api/Clients/activeSalesPerson"
data="activeSalesPersons"
order="firstName">
</vn-crud-model>
<vn-crud-model
url="claim/api/ClaimRedeliveries"
data="claimRedeliveries"
order="description">
</vn-crud-model>
<vn-watcher
vn-id="watcher"
data="claimDevelopments"
form="form">
</vn-watcher>
<vn-vertical>
<vn-card pad-large>
<vn-vertical>
<form name="form" ng-submit="$ctrl.onSubmit()">
<vn-title vn-two>Development</vn-title>
<vn-horizontal ng-repeat="claimDevelopment in claimDevelopments">
<vn-autocomplete
vn-one
vn-focus
label="Reason"
id="claimReason"
field="claimDevelopment.claimReasonFk"
data="claimReasons"
select-fields="['id','description']"
show-field="description">
</vn-autocomplete>
<vn-autocomplete
vn-one
label="Result"
id="claimResult"
field="claimDevelopment.claimResultFk"
data="claimResults"
select-fields="['id','description']"
show-field="description">
</vn-autocomplete>
<vn-autocomplete
vn-one
label="Responsible"
id="Responsible"
field="claimDevelopment.claimResponsibleFk"
data="claimResponsibles"
select-fields="['id','description']"
show-field="description">
</vn-autocomplete>
<vn-autocomplete
vn-one
label="Worker"
field="claimDevelopment.workerFk"
data="activeSalesPersons"
show-field="firstName"
vn-acl="salesAssistant">
<tpl-item>{{firstName}} {{name}}</tpl-item>
</vn-autocomplete>
<vn-autocomplete
vn-one
label="Redelivery"
id="redelivery"
field="claimDevelopment.claimRedeliveryFk"
data="claimResponsibles"
select-fields="['id','description']"
show-field="description">
</vn-autocomplete>
<vn-icon-button
medium-grey
margin-medium-v
vn-tooltip="Remove tag"
icon="remove_circle_outline"
ng-click="model.remove($index)"
tabindex="-1">
</vn-icon-button>
</vn-horizontal>
</form>
<vn-one pad-medium-top>
<vn-icon-button
vn-bind="+"
vn-tooltip="Add tag"
icon="add_circle"
ng-click="model.insert()">
</vn-icon-button>
</vn-one>
</vn-vertical>
</vn-card>
<vn-button-bar>
<vn-submit label="Save" ng-click="$ctrl.onSubmit()"></vn-submit>
</vn-button-bar>
</vn-vertical>

View File

@ -0,0 +1,30 @@
import ngModule from '../module';
import './style.scss';
class Controller {
constructor($state, $scope, $http, $translate, vnApp) {
this.$state = $state;
this.$ = $scope;
this.$http = $http;
this.$translate = $translate;
this.vnApp = vnApp;
}
onSubmit() {
this.$.watcher.check();
this.$.model.save().then(() => {
this.$.watcher.notifySaved();
this.$.model.refresh();
});
}
}
Controller.$inject = ['$state', '$scope', '$http', '$translate', 'vnApp'];
ngModule.component('vnClaimDevelopment', {
template: require('./index.html'),
controller: Controller,
bindings: {
claim: '<'
}
});

View File

@ -0,0 +1,7 @@
Destination: Destino
Development: Trazabilidad
Reason: Motivo
Result: Consecuencia
Responsible: Responsable
Worker: Trabajador
Redelivery: Devolución

View File

View File

@ -5,7 +5,7 @@ import './basic-data';
import './card';
import './detail';
import './descriptor';
// import './development';
import './development';
import './index/';
import './search-panel';
// import './summary';