#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)"
vn-tooltip="Imports ticket lines">
</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-horizontal>
<vn-table model="model">

View File

@ -145,6 +145,14 @@ class Controller {
this.$.descriptor.parent = event.target;
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'];

View File

@ -52,15 +52,6 @@
field="$ctrl.claim.isChargedToMana"
vn-acl="salesAssistant">
</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 pad-small-v>

View File

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

View File

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