#997 worker.summary, bugs fixed
This commit is contained in:
parent
97f28e2ef6
commit
84737a0bb9
|
@ -13,15 +13,18 @@ import UserError from '../../lib/user-error';
|
||||||
* properties are provided.
|
* properties are provided.
|
||||||
*/
|
*/
|
||||||
export default class Watcher extends Component {
|
export default class Watcher extends Component {
|
||||||
constructor($element, $scope, $state, $transitions, $http, vnApp, $translate, $attrs, $q) {
|
constructor($element, $, $state, $stateParams, $transitions, $http, vnApp, $translate, $attrs, $q) {
|
||||||
super($element);
|
super($element);
|
||||||
this.$ = $scope;
|
Object.assign(this, {
|
||||||
this.$state = $state;
|
$,
|
||||||
this.$http = $http;
|
$state,
|
||||||
this._ = $translate;
|
$stateParams,
|
||||||
this.$attrs = $attrs;
|
$http,
|
||||||
this.vnApp = vnApp;
|
_: $translate,
|
||||||
this.$q = $q;
|
$attrs,
|
||||||
|
vnApp,
|
||||||
|
$q
|
||||||
|
});
|
||||||
|
|
||||||
this.state = null;
|
this.state = null;
|
||||||
this.deregisterCallback = $transitions.onStart({},
|
this.deregisterCallback = $transitions.onStart({},
|
||||||
|
@ -240,7 +243,7 @@ export default class Watcher extends Component {
|
||||||
return newCopy;
|
return newCopy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Watcher.$inject = ['$element', '$scope', '$state', '$transitions', '$http', 'vnApp', '$translate', '$attrs', '$q'];
|
Watcher.$inject = ['$element', '$scope', '$state', '$stateParams', '$transitions', '$http', 'vnApp', '$translate', '$attrs', '$q'];
|
||||||
|
|
||||||
ngModule.component('vnWatcher', {
|
ngModule.component('vnWatcher', {
|
||||||
template: require('./watcher.html'),
|
template: require('./watcher.html'),
|
||||||
|
|
|
@ -8,25 +8,40 @@
|
||||||
<form name="form" ng-submit="watcher.submit()" compact>
|
<form name="form" ng-submit="watcher.submit()" compact>
|
||||||
<vn-card pad-large>
|
<vn-card pad-large>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-textfield vn-one
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
label="Comercial Name"
|
label="Comercial Name"
|
||||||
field="$ctrl.client.name" vn-focus>
|
field="$ctrl.client.name" vn-focus>
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-textfield vn-one label="Contact" field="$ctrl.client.contact"></vn-textfield>
|
<vn-textfield
|
||||||
<vn-textfield vn-one
|
vn-one
|
||||||
|
label="Contact"
|
||||||
|
field="$ctrl.client.contact">
|
||||||
|
</vn-textfield>
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
label="Email"
|
label="Email"
|
||||||
field="$ctrl.client.email"
|
field="$ctrl.client.email"
|
||||||
info="You can save multiple emails">
|
info="You can save multiple emails">
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-textfield vn-one label="Phone" field="$ctrl.client.phone"></vn-textfield>
|
<vn-textfield
|
||||||
<vn-textfield vn-one label="Mobile" field="$ctrl.client.mobile"></vn-textfield>
|
vn-one
|
||||||
|
label="Phone"
|
||||||
|
field="$ctrl.client.phone">
|
||||||
|
</vn-textfield>
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
label="Mobile"
|
||||||
|
field="$ctrl.client.mobile">
|
||||||
|
</vn-textfield>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete vn-one
|
<vn-autocomplete
|
||||||
|
vn-one
|
||||||
initial-data="$ctrl.client.salesPerson"
|
initial-data="$ctrl.client.salesPerson"
|
||||||
field="$ctrl.client.salesPersonFk"
|
field="$ctrl.client.salesPersonFk"
|
||||||
url="/client/api/Clients/activeWorkersWithRole"
|
url="/client/api/Clients/activeWorkersWithRole"
|
||||||
|
@ -38,7 +53,8 @@
|
||||||
vn-acl="salesAssistant">
|
vn-acl="salesAssistant">
|
||||||
<tpl-item>{{firstName}} {{name}}</tpl-item>
|
<tpl-item>{{firstName}} {{name}}</tpl-item>
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<vn-autocomplete vn-one
|
<vn-autocomplete
|
||||||
|
vn-one
|
||||||
initial-data="$ctrl.client.contactChannel"
|
initial-data="$ctrl.client.contactChannel"
|
||||||
field="$ctrl.client.contactChannelFk"
|
field="$ctrl.client.contactChannelFk"
|
||||||
url="/client/api/ContactChannels"
|
url="/client/api/ContactChannels"
|
||||||
|
|
|
@ -236,6 +236,7 @@
|
||||||
"state": "client.card.creditInsurance.index",
|
"state": "client.card.creditInsurance.index",
|
||||||
"component": "vn-client-credit-insurance-index",
|
"component": "vn-client-credit-insurance-index",
|
||||||
"description": "Credit contracts",
|
"description": "Credit contracts",
|
||||||
|
"acl": ["creditInsurance"],
|
||||||
"params": {
|
"params": {
|
||||||
"client": "$ctrl.client"
|
"client": "$ctrl.client"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +1,34 @@
|
||||||
<mg-ajax path="api/Workers/{{patch.params.id}}" options="vnPatch"></mg-ajax>
|
|
||||||
<vn-watcher
|
<vn-watcher
|
||||||
vn-id="watcher"
|
vn-id="watcher"
|
||||||
data="$ctrl.worker"
|
data="$ctrl.worker"
|
||||||
form="form"
|
form="form"
|
||||||
save="patch">
|
id-field="id"
|
||||||
|
url="api/Workers"
|
||||||
|
save="post">
|
||||||
</vn-watcher>
|
</vn-watcher>
|
||||||
<form name="form" ng-submit="$ctrl.onSubmit()">
|
<form name="form" ng-submit="$ctrl.onSubmit()">
|
||||||
<vn-card pad-large>
|
<vn-card pad-large>
|
||||||
|
<vn-vertical>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete
|
<vn-textfield
|
||||||
vn-one
|
vn-one
|
||||||
field="$ctrl.zone.warehouseFk"
|
label="Name"
|
||||||
url="api/Warehouses"
|
field="$ctrl.worker.firstName">
|
||||||
show-field="name"
|
</vn-textfield>
|
||||||
value-field="id"
|
<vn-textfield
|
||||||
label="Id">
|
|
||||||
</vn-autocomplete>
|
|
||||||
<vn-autocomplete
|
|
||||||
vn-one
|
vn-one
|
||||||
field="$ctrl.zone.agencyModeFk"
|
label="Last name"
|
||||||
url="api/AgencyModes"
|
field="$ctrl.worker.name">
|
||||||
show-field="name"
|
</vn-textfield>
|
||||||
value-field="id"
|
|
||||||
label="Name">
|
|
||||||
</vn-autocomplete>
|
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
|
<vn-horizontal>
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
label="Phone"
|
||||||
|
field="$ctrl.worker.phone">
|
||||||
|
</vn-textfield>
|
||||||
|
</vn-horizontal>
|
||||||
|
</vn-vertical>
|
||||||
</vn-card>
|
</vn-card>
|
||||||
<vn-button-bar>
|
<vn-button-bar>
|
||||||
<vn-submit label="Save"></vn-submit>
|
<vn-submit label="Save"></vn-submit>
|
||||||
|
|
|
@ -1,21 +1,16 @@
|
||||||
import ngModule from '../module';
|
import ngModule from '../module';
|
||||||
|
|
||||||
class Controller {
|
class Controller {
|
||||||
constructor($, $state) {
|
constructor($) {
|
||||||
Object.assign(this, {
|
Object.assign(this, {$});
|
||||||
$,
|
|
||||||
$state
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
this.$.watcher.submit().then(() => {
|
this.$.watcher.submit()
|
||||||
this.card.reload();
|
.then(() => this.card.reload());
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Controller.$inject = ['$scope'];
|
||||||
Controller.$inject = ['$scope', '$state'];
|
|
||||||
|
|
||||||
ngModule.component('vnWorkerBasicData', {
|
ngModule.component('vnWorkerBasicData', {
|
||||||
template: require('./index.html'),
|
template: require('./index.html'),
|
||||||
|
|
|
@ -10,27 +10,27 @@
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<div class="attributes">
|
<div class="attributes">
|
||||||
<h5>{{::$ctrl.worker.firstName}} {{::$ctrl.worker.name}}</h5>
|
<h5>{{$ctrl.worker.firstName}} {{$ctrl.worker.name}}</h5>
|
||||||
<vn-label-value label="Id"
|
<vn-label-value label="Id"
|
||||||
value="{{::$ctrl.worker.id}}">
|
value="{{$ctrl.worker.id}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value label="User"
|
<vn-label-value label="User"
|
||||||
value="{{::$ctrl.worker.user.name}}">
|
value="{{$ctrl.worker.user.name}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value label="Email"
|
<vn-label-value label="Email"
|
||||||
value="{{::$ctrl.worker.user.email}}">
|
value="{{$ctrl.worker.user.email}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value label="Fiscal identifier"
|
<vn-label-value label="Fiscal identifier"
|
||||||
value="{{::$ctrl.worker.client.fi}}">
|
value="{{$ctrl.worker.client.fi}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value label="Department"
|
<vn-label-value label="Department"
|
||||||
value="{{::$ctrl.worker.department.department}}">
|
value="{{$ctrl.worker.department.department}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value label="Phone"
|
<vn-label-value label="Phone"
|
||||||
value="{{::$ctrl.worker.phone}}">
|
value="{{$ctrl.worker.phone}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value label="Extension"
|
<vn-label-value label="Extension"
|
||||||
value="{{::$ctrl.worker.sip.phone}}">
|
value="{{$ctrl.worker.sip.phone}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
</div>
|
</div>
|
||||||
<div class="quicklinks">
|
<div class="quicklinks">
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
url="/agency/api/Workers"
|
url="/agency/api/Workers"
|
||||||
include="::$ctrl.include"
|
include="::$ctrl.include"
|
||||||
limit="20"
|
limit="20"
|
||||||
data="workers"
|
data="workers">
|
||||||
auto-load="false">
|
|
||||||
</vn-crud-model>
|
</vn-crud-model>
|
||||||
<div class="index-block">
|
<div class="index-block">
|
||||||
<div class="vn-list">
|
<div class="vn-list">
|
||||||
|
@ -21,7 +20,7 @@
|
||||||
ui-sref="worker.card.summary({id: worker.id})"
|
ui-sref="worker.card.summary({id: worker.id})"
|
||||||
translate-attr="{title: 'View worker'}"
|
translate-attr="{title: 'View worker'}"
|
||||||
class="vn-list-item">
|
class="vn-list-item">
|
||||||
<vn-horizontal ng-click="$ctrl.onClick($event)">
|
<vn-horizontal>
|
||||||
<vn-one>
|
<vn-one>
|
||||||
<h6>{{::worker.firstName}} {{::worker.name}}</h6>
|
<h6>{{::worker.firstName}} {{::worker.name}}</h6>
|
||||||
<vn-label-value label="Id"
|
<vn-label-value label="Id"
|
||||||
|
|
Loading…
Reference in New Issue