#881 mover input range de claim.basic-data a claim.action

This commit is contained in:
Gerard 2018-12-21 14:52:26 +01:00
parent f5f543136e
commit 5d82c6786c
5 changed files with 26 additions and 14 deletions

View File

@ -27,6 +27,16 @@
ng-click="$ctrl.showLastTickets($event)" ng-click="$ctrl.showLastTickets($event)"
vn-tooltip="Imports ticket lines"> vn-tooltip="Imports ticket lines">
</vn-button> </vn-button>
<vn-input-range
vn-one
label="Responsability"
value="$ctrl.claim.responsibility"
max="5"
min="1"
step="1"
vn-acl="salesAssistant"
on-change="$ctrl.saveResponsibility()">
</vn-input-range>
</vn-tool-bar> </vn-tool-bar>
</vn-horizontal> </vn-horizontal>
<vn-table model="model"> <vn-table model="model">

View File

@ -145,6 +145,14 @@ class Controller {
this.$.descriptor.parent = event.target; this.$.descriptor.parent = event.target;
this.$.descriptor.show(); this.$.descriptor.show();
} }
saveResponsibility() {
let query = `/claim/api/Claims/updateClaim`;
this.$http.post(query, {responsibility: this.claim.responsibility}).then(res => {
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
});
}
} }
Controller.$inject = ['$stateParams', '$scope', '$http', '$translate', 'vnApp']; Controller.$inject = ['$stateParams', '$scope', '$http', '$translate', 'vnApp'];

View File

@ -52,15 +52,6 @@
field="$ctrl.claim.isChargedToMana" field="$ctrl.claim.isChargedToMana"
vn-acl="salesAssistant"> vn-acl="salesAssistant">
</vn-check> </vn-check>
<vn-input-range
vn-one
label="Responsability"
value="$ctrl.claim.responsibility"
max="5"
min="1"
step="1"
vn-acl="salesAssistant">
</vn-input-range>
</vn-horizontal> </vn-horizontal>
</vn-horizontal> </vn-horizontal>
<vn-horizontal pad-small-v> <vn-horizontal pad-small-v>

View File

@ -30,12 +30,12 @@
<vn-one> <vn-one>
<vn-input-range <vn-input-range
vn-one vn-one
disabled="true"
label="Responsability" label="Responsability"
value="$ctrl.summary.claim.responsibility" value="$ctrl.summary.claim.responsibility"
max="4" max="5"
min="0" min="1"
step="1"> step="1"
vn-acl="salesAssistant">
</vn-input-range> </vn-input-range>
</vn-one> </vn-one>
</vn-horizontal> </vn-horizontal>

View File

@ -10,6 +10,8 @@ export default class inputRange extends Input {
this.mdlElement.addEventListener('change', () => { this.mdlElement.addEventListener('change', () => {
this._value = this.input.value; this._value = this.input.value;
this.$.$applyAsync(); this.$.$applyAsync();
if (this._value && this.onChange)
this.onChange();
}); });
} }
@ -71,6 +73,7 @@ ngModule.component('vnInputRange', {
max: '<?', max: '<?',
step: '<?', step: '<?',
value: '=', value: '=',
model: '=' model: '=',
onChange: '&'
} }
}); });