5918-worker.time-control_resend #1685
|
@ -0,0 +1,3 @@
|
||||||
|
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
|
||||||
|
VALUES
|
||||||
|
('Worker', 'search', 'READ', 'ALLOW', 'ROLE', 'employee');
|
|
@ -0,0 +1,3 @@
|
||||||
|
UPDATE `vn`.`department`
|
||||||
|
SET code='VN'
|
||||||
|
WHERE name='VERDNATURA';
|
|
@ -632,6 +632,7 @@ let actions = {
|
||||||
await this.write(selector, value.toString());
|
await this.write(selector, value.toString());
|
||||||
break;
|
break;
|
||||||
case 'vn-autocomplete':
|
case 'vn-autocomplete':
|
||||||
|
case 'vn-worker-autocomplete':
|
||||||
if (value)
|
if (value)
|
||||||
await this.autocompleteSearch(selector, value.toString());
|
await this.autocompleteSearch(selector, value.toString());
|
||||||
else
|
else
|
||||||
|
@ -667,6 +668,7 @@ let actions = {
|
||||||
switch (tagName) {
|
switch (tagName) {
|
||||||
case 'vn-textfield':
|
case 'vn-textfield':
|
||||||
case 'vn-autocomplete':
|
case 'vn-autocomplete':
|
||||||
|
case 'vn-worker-autocomplete':
|
||||||
case 'vn-input-time':
|
case 'vn-input-time':
|
||||||
case 'vn-datalist':
|
case 'vn-datalist':
|
||||||
el = await input.$('input');
|
el = await input.$('input');
|
||||||
|
|
|
@ -187,7 +187,7 @@ export default {
|
||||||
country: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.countryFk"]',
|
country: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.countryFk"]',
|
||||||
userName: 'vn-client-create vn-textfield[ng-model="$ctrl.client.userName"]',
|
userName: 'vn-client-create vn-textfield[ng-model="$ctrl.client.userName"]',
|
||||||
email: 'vn-client-create vn-textfield[ng-model="$ctrl.client.email"]',
|
email: 'vn-client-create vn-textfield[ng-model="$ctrl.client.email"]',
|
||||||
salesPerson: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
|
salesPerson: 'vn-client-create vn-worker-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
|
||||||
saveNewProvicenButton: '#saveProvince',
|
saveNewProvicenButton: '#saveProvince',
|
||||||
saveNewCityButton: '#saveCity',
|
saveNewCityButton: '#saveCity',
|
||||||
saveNewPoscode: '#savePostcode',
|
saveNewPoscode: '#savePostcode',
|
||||||
|
@ -199,7 +199,7 @@ export default {
|
||||||
email: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.email"]',
|
email: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.email"]',
|
||||||
phone: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.phone"]',
|
phone: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.phone"]',
|
||||||
mobile: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.mobile"]',
|
mobile: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.mobile"]',
|
||||||
salesPerson: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
|
salesPerson: 'vn-client-basic-data vn-worker-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
|
||||||
channel: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.contactChannelFk"]',
|
channel: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.contactChannelFk"]',
|
||||||
transferor: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.transferorFk"]',
|
transferor: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.transferorFk"]',
|
||||||
businessType: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.businessTypeFk"]',
|
businessType: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.businessTypeFk"]',
|
||||||
|
@ -735,7 +735,7 @@ export default {
|
||||||
},
|
},
|
||||||
createStateView: {
|
createStateView: {
|
||||||
state: 'vn-autocomplete[ng-model="$ctrl.stateFk"]',
|
state: 'vn-autocomplete[ng-model="$ctrl.stateFk"]',
|
||||||
worker: 'vn-autocomplete[ng-model="$ctrl.workerFk"]',
|
worker: 'vn-worker-autocomplete[ng-model="$ctrl.workerFk"]',
|
||||||
saveStateButton: `button[type=submit]`
|
saveStateButton: `button[type=submit]`
|
||||||
},
|
},
|
||||||
claimsIndex: {
|
claimsIndex: {
|
||||||
|
@ -781,12 +781,12 @@ export default {
|
||||||
firstClaimReason: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
|
firstClaimReason: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
|
||||||
firstClaimResult: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
|
firstClaimResult: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
|
||||||
firstClaimResponsible: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
|
firstClaimResponsible: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
|
||||||
firstClaimWorker: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
|
firstClaimWorker: 'vn-claim-development vn-horizontal:nth-child(1) vn-worker-autocomplete[ng-model="claimDevelopment.workerFk"]',
|
||||||
firstClaimRedelivery: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
|
firstClaimRedelivery: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
|
||||||
secondClaimReason: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
|
secondClaimReason: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
|
||||||
secondClaimResult: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
|
secondClaimResult: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
|
||||||
secondClaimResponsible: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
|
secondClaimResponsible: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
|
||||||
secondClaimWorker: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
|
secondClaimWorker: 'vn-claim-development vn-horizontal:nth-child(2) vn-worker-autocomplete[ng-model="claimDevelopment.workerFk"]',
|
||||||
secondClaimRedelivery: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
|
secondClaimRedelivery: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
|
||||||
saveDevelopmentButton: 'button[type=submit]'
|
saveDevelopmentButton: 'button[type=submit]'
|
||||||
},
|
},
|
||||||
|
@ -854,7 +854,7 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
createRouteView: {
|
createRouteView: {
|
||||||
worker: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.workerFk"]',
|
worker: 'vn-route-create vn-worker-autocomplete[ng-model="$ctrl.route.workerFk"]',
|
||||||
createdDatePicker: 'vn-route-create vn-date-picker[ng-model="$ctrl.route.created"]',
|
createdDatePicker: 'vn-route-create vn-date-picker[ng-model="$ctrl.route.created"]',
|
||||||
vehicleAuto: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
|
vehicleAuto: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
|
||||||
agency: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]',
|
agency: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]',
|
||||||
|
@ -976,7 +976,7 @@ export default {
|
||||||
street: 'vn-worker-create vn-textfield[ng-model="$ctrl.worker.street"]',
|
street: 'vn-worker-create vn-textfield[ng-model="$ctrl.worker.street"]',
|
||||||
user: 'vn-worker-create vn-textfield[ng-model="$ctrl.worker.name"]',
|
user: 'vn-worker-create vn-textfield[ng-model="$ctrl.worker.name"]',
|
||||||
email: 'vn-worker-create vn-textfield[ng-model="$ctrl.worker.email"]',
|
email: 'vn-worker-create vn-textfield[ng-model="$ctrl.worker.email"]',
|
||||||
boss: 'vn-worker-create vn-autocomplete[ng-model="$ctrl.worker.bossFk"]',
|
boss: 'vn-worker-create vn-worker-autocomplete[ng-model="$ctrl.worker.bossFk"]',
|
||||||
role: 'vn-worker-create vn-autocomplete[ng-model="$ctrl.worker.roleFk"]',
|
role: 'vn-worker-create vn-autocomplete[ng-model="$ctrl.worker.roleFk"]',
|
||||||
iban: 'vn-worker-create vn-textfield[ng-model="$ctrl.worker.iban"]',
|
iban: 'vn-worker-create vn-textfield[ng-model="$ctrl.worker.iban"]',
|
||||||
createButton: 'vn-worker-create vn-submit[label="Create"]',
|
createButton: 'vn-worker-create vn-submit[label="Create"]',
|
||||||
|
|
|
@ -59,7 +59,7 @@ describe('Ticket Create new tracking state path', () => {
|
||||||
const result = await page
|
const result = await page
|
||||||
.waitToGetProperty(selectors.createStateView.worker, 'value');
|
.waitToGetProperty(selectors.createStateView.worker, 'value');
|
||||||
|
|
||||||
expect(result).toEqual('salesPersonNick');
|
expect(result).toEqual('salesPerson');
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should succesfully create a valid state`, async() => {
|
it(`should succesfully create a valid state`, async() => {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<label>
|
<label>
|
||||||
<span translate>{{$ctrl.label}}</span>
|
<span translate>{{$ctrl.label}}</span>
|
||||||
<span class="required">*</span>
|
<span class="required">*</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="icons pre">
|
<div class="icons pre">
|
||||||
<vn-icon
|
<vn-icon
|
||||||
|
@ -50,4 +50,4 @@
|
||||||
on-select="$ctrl.onDropDownSelect(item)"
|
on-select="$ctrl.onDropDownSelect(item)"
|
||||||
on-data-ready="$ctrl.onDataReady()"
|
on-data-ready="$ctrl.onDataReady()"
|
||||||
on-close-start="$ctrl.onDropDownClose()">
|
on-close-start="$ctrl.onDropDownClose()">
|
||||||
</vn-drop-down>
|
</vn-drop-down>
|
||||||
|
|
|
@ -17,10 +17,9 @@ import './style.scss';
|
||||||
* @event change Thrown when value is changed
|
* @event change Thrown when value is changed
|
||||||
*/
|
*/
|
||||||
export default class Autocomplete extends Field {
|
export default class Autocomplete extends Field {
|
||||||
constructor($element, $, $compile, $transclude) {
|
constructor($element, $, $transclude) {
|
||||||
super($element, $, $compile);
|
super($element, $, $transclude);
|
||||||
this.$transclude = $transclude;
|
this.$transclude = $transclude;
|
||||||
this.$compile = $compile;
|
|
||||||
this._selection = null;
|
this._selection = null;
|
||||||
this.input = this.element.querySelector('input');
|
this.input = this.element.querySelector('input');
|
||||||
}
|
}
|
||||||
|
@ -153,7 +152,14 @@ export default class Autocomplete extends Field {
|
||||||
filter.include = this.include;
|
filter.include = this.include;
|
||||||
|
|
||||||
let json = encodeURIComponent(JSON.stringify(filter));
|
let json = encodeURIComponent(JSON.stringify(filter));
|
||||||
this.$http.get(`${this.url}?filter=${json}`).then(
|
|
||||||
|
let url;
|
||||||
|
if (this.url.includes('?'))
|
||||||
|
url = `${this.url}&filter=${json}`;
|
||||||
|
else
|
||||||
|
url = `${this.url}?filter=${json}`;
|
||||||
|
|
||||||
|
this.$http.get(url).then(
|
||||||
json => this.onSelectionRequest(json.data),
|
json => this.onSelectionRequest(json.data),
|
||||||
() => this.onSelectionRequest()
|
() => this.onSelectionRequest()
|
||||||
);
|
);
|
||||||
|
@ -282,7 +288,7 @@ export default class Autocomplete extends Field {
|
||||||
this.refreshSelection();
|
this.refreshSelection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Autocomplete.$inject = ['$element', '$scope', '$compile', '$transclude'];
|
Autocomplete.$inject = ['$element', '$scope', '$transclude'];
|
||||||
|
|
||||||
ngModule.vnComponent('vnAutocomplete', {
|
ngModule.vnComponent('vnAutocomplete', {
|
||||||
template: require('./index.html'),
|
template: require('./index.html'),
|
||||||
|
|
|
@ -13,12 +13,12 @@
|
||||||
class="dropdown"
|
class="dropdown"
|
||||||
ng-click="$ctrl.onContainerClick($event)">
|
ng-click="$ctrl.onContainerClick($event)">
|
||||||
</ul>
|
</ul>
|
||||||
<div
|
<div
|
||||||
ng-if="$ctrl.statusText"
|
ng-if="$ctrl.statusText"
|
||||||
ng-click="$ctrl.onLoadMoreClick($event)"
|
ng-click="$ctrl.onLoadMoreClick($event)"
|
||||||
class="status"
|
class="status"
|
||||||
translate>
|
translate>
|
||||||
{{$ctrl.statusText}}
|
{{$ctrl.statusText}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</default>
|
</default>
|
||||||
|
|
|
@ -3,8 +3,8 @@ import FormInput from '../form-input';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
export default class Field extends FormInput {
|
export default class Field extends FormInput {
|
||||||
constructor($element, $scope) {
|
constructor($element, $scope, $transclude) {
|
||||||
super($element, $scope);
|
super($element, $scope, $transclude);
|
||||||
|
|
||||||
this.prefix = null;
|
this.prefix = null;
|
||||||
this.suffix = null;
|
this.suffix = null;
|
||||||
|
@ -197,7 +197,7 @@ export default class Field extends FormInput {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Field.$inject = ['$element', '$scope'];
|
Field.$inject = ['$element', '$scope', '$transclude'];
|
||||||
|
|
||||||
ngModule.vnComponent('vnField', {
|
ngModule.vnComponent('vnField', {
|
||||||
template: require('./index.html'),
|
template: require('./index.html'),
|
||||||
|
|
|
@ -51,6 +51,7 @@ import './textarea';
|
||||||
import './th';
|
import './th';
|
||||||
import './treeview';
|
import './treeview';
|
||||||
import './wday-picker';
|
import './wday-picker';
|
||||||
|
import './worker-autocomplete';
|
||||||
import './datalist';
|
import './datalist';
|
||||||
import './contextmenu';
|
import './contextmenu';
|
||||||
import './rating';
|
import './rating';
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<tpl-item>
|
||||||
|
<div>
|
||||||
|
{{name}}
|
||||||
|
</div>
|
||||||
|
<div class="text-caption text-secondary">
|
||||||
|
{{nickname}}, {{code}}
|
||||||
|
</div>
|
||||||
|
</tpl-item>
|
|
@ -0,0 +1,40 @@
|
||||||
|
import ngModule from '../../module';
|
||||||
|
import Autocomplete from '../autocomplete';
|
||||||
|
|
||||||
|
export default class WorkerAutocomplete extends Autocomplete {
|
||||||
|
constructor(...args) {
|
||||||
|
super(...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
$onInit() {
|
||||||
|
super.$onInit();
|
||||||
|
|
||||||
|
let url = 'Workers/search';
|
||||||
|
if (this.departments) {
|
||||||
|
const parameter = encodeURIComponent(JSON.stringify(this.departments));
|
||||||
|
url = `Workers/search?departmentCodes=${parameter}`;
|
||||||
|
}
|
||||||
|
Object.assign(this, {
|
||||||
|
label: 'Worker',
|
||||||
|
url,
|
||||||
|
searchFunction: function({$search}) {
|
||||||
|
return {and: [
|
||||||
|
{'active': {neq: false}},
|
||||||
|
{or: [
|
||||||
|
{'name': $search},
|
||||||
|
{'nickname': {like: '%' + $search + '%'}},
|
||||||
|
{'code': {like: $search + '%'}}
|
||||||
|
]}
|
||||||
|
]};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ngModule.vnComponent('vnWorkerAutocomplete', {
|
||||||
|
slotTemplate: require('./index.html'),
|
||||||
|
controller: WorkerAutocomplete,
|
||||||
|
bindings: {
|
||||||
|
departments: '<?'
|
||||||
|
},
|
||||||
|
});
|
|
@ -25,15 +25,13 @@
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
disabled="false"
|
disabled="false"
|
||||||
ng-model="$ctrl.claim.workerFk"
|
|
||||||
url="Workers/activeWithRole"
|
|
||||||
show-field="nickname"
|
show-field="nickname"
|
||||||
search-function="{firstName: $search}"
|
ng-model="$ctrl.claim.workerFk"
|
||||||
where="{role: 'salesPerson'}"
|
departments="['VT']"
|
||||||
label="Attended by">
|
label="Attended by">
|
||||||
</vn-autocomplete>
|
</vn-worker-autocomplete>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
ng-model="$ctrl.claim.claimStateFk"
|
ng-model="$ctrl.claim.claimStateFk"
|
||||||
data="claimStates"
|
data="claimStates"
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
data="claimDevelopments"
|
data="claimDevelopments"
|
||||||
form="form">
|
form="form">
|
||||||
</vn-watcher>
|
</vn-watcher>
|
||||||
<vn-vertical class="vn-w-md">
|
<vn-vertical class="vn-w-lg">
|
||||||
<vn-card class="vn-pa-lg">
|
<vn-card class="vn-pa-lg">
|
||||||
<vn-vertical>
|
<vn-vertical>
|
||||||
<form name="form">
|
<form name="form">
|
||||||
|
@ -66,16 +66,11 @@
|
||||||
show-field="description"
|
show-field="description"
|
||||||
rule>
|
rule>
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
ng-model="claimDevelopment.workerFk"
|
ng-model="claimDevelopment.workerFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
|
||||||
show-field="nickname"
|
show-field="nickname"
|
||||||
search-function="{firstName: $search}"
|
|
||||||
value-field="id"
|
|
||||||
where="{role: 'employee'}"
|
|
||||||
label="Worker"
|
|
||||||
rule>
|
rule>
|
||||||
</vn-autocomplete>
|
</vn-worker-autocomplete>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
label="Redelivery"
|
label="Redelivery"
|
||||||
ng-model="claimDevelopment.claimRedeliveryFk"
|
ng-model="claimDevelopment.claimRedeliveryFk"
|
||||||
|
@ -118,4 +113,4 @@
|
||||||
ng-click="watcher.loadOriginalData()">
|
ng-click="watcher.loadOriginalData()">
|
||||||
</vn-button> -->
|
</vn-button> -->
|
||||||
</vn-button-bar>
|
</vn-button-bar>
|
||||||
</vn-vertical>
|
</vn-vertical>
|
||||||
|
|
|
@ -22,26 +22,18 @@
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="filter.salesPersonFk"
|
ng-model="filter.salesPersonFk"
|
||||||
url="Workers/activeWithRole"
|
departments="['VT']"
|
||||||
search-function="{firstName: $search}"
|
|
||||||
value-field="id"
|
|
||||||
where="{role: {inq: ['salesTeamBoss', 'salesPerson', 'officeBoss']}}"
|
|
||||||
label="Salesperson">
|
label="Salesperson">
|
||||||
<tpl-item>{{firstName}} {{name}}</tpl-item>
|
</vn-worker-autocomplete>
|
||||||
</vn-autocomplete>
|
<vn-worker-autocomplete
|
||||||
<vn-autocomplete
|
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="filter.attenderFk"
|
ng-model="filter.attenderFk"
|
||||||
url="Workers/activeWithRole"
|
departments="['VT']"
|
||||||
search-function="{firstName: $search}"
|
|
||||||
value-field="id"
|
|
||||||
where="{role: {inq: ['salesTeamBoss', 'salesPerson']}}"
|
|
||||||
label="Attended by">
|
label="Attended by">
|
||||||
<tpl-item>{{firstName}} {{name}}</tpl-item>
|
</vn-worker-autocomplete>
|
||||||
</vn-autocomplete>
|
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete vn-one
|
<vn-autocomplete vn-one
|
||||||
|
|
|
@ -14,13 +14,13 @@
|
||||||
<vn-card class="vn-pa-lg">
|
<vn-card class="vn-pa-lg">
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-textfield
|
<vn-textfield
|
||||||
vn-one
|
vn-one
|
||||||
label="Comercial Name"
|
label="Comercial Name"
|
||||||
ng-model="$ctrl.client.name"
|
ng-model="$ctrl.client.name"
|
||||||
rule
|
rule
|
||||||
vn-focus>
|
vn-focus>
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="$ctrl.client.businessTypeFk"
|
ng-model="$ctrl.client.businessTypeFk"
|
||||||
url="BusinessTypes"
|
url="BusinessTypes"
|
||||||
|
@ -37,8 +37,8 @@
|
||||||
rule>
|
rule>
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
<vn-textfield
|
<vn-textfield
|
||||||
vn-one
|
vn-one
|
||||||
label="Email"
|
label="Email"
|
||||||
ng-model="$ctrl.client.email"
|
ng-model="$ctrl.client.email"
|
||||||
rule
|
rule
|
||||||
info="You can save multiple emails">
|
info="You can save multiple emails">
|
||||||
|
@ -59,18 +59,15 @@
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="$ctrl.client.salesPersonFk"
|
ng-model="$ctrl.client.salesPersonFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
departments="['VT']"
|
||||||
show-field="nickname"
|
show-field="nickname"
|
||||||
search-function="{firstName: $search}"
|
|
||||||
value-field="id"
|
|
||||||
where="{role: 'salesPerson'}"
|
|
||||||
label="Salesperson"
|
label="Salesperson"
|
||||||
vn-acl="salesAssistant">
|
vn-acl="salesAssistant">
|
||||||
</vn-autocomplete>
|
</vn-worker-autocomplete>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="$ctrl.client.contactChannelFk"
|
ng-model="$ctrl.client.contactChannelFk"
|
||||||
data="contactChannels"
|
data="contactChannels"
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="filter.buyerId"
|
ng-model="filter.buyerId"
|
||||||
url="Workers/activeWithRole"
|
url="TicketRequests/getItemTypeWorker"
|
||||||
search-function="{firstName: $search}"
|
search-function="{firstName: $search}"
|
||||||
|
show-field="nickname"
|
||||||
value-field="id"
|
value-field="id"
|
||||||
where="{role: {inq: ['logistic', 'buyer']}}"
|
|
||||||
label="Buyer">
|
label="Buyer">
|
||||||
<tpl-item>{{nickname}}</tpl-item>
|
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
|
|
|
@ -15,18 +15,15 @@
|
||||||
rule
|
rule
|
||||||
vn-focus>
|
vn-focus>
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
label="Salesperson"
|
label="Salesperson"
|
||||||
ng-model="$ctrl.client.salesPersonFk"
|
ng-model="$ctrl.client.salesPersonFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
departments="['VT']"
|
||||||
search-function="{firstName: $search}"
|
show-field="nickname">
|
||||||
show-field="firstName"
|
</vn-worker-autocomplete>
|
||||||
where="{role: 'salesPerson'}">
|
|
||||||
<tpl-item>{{firstName}} {{lastName}}</tpl-item>
|
|
||||||
</vn-autocomplete>
|
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
vn-id="businessTypeFk"
|
vn-id="businessTypeFk"
|
||||||
ng-model="$ctrl.client.businessTypeFk"
|
ng-model="$ctrl.client.businessTypeFk"
|
||||||
url="BusinessTypes"
|
url="BusinessTypes"
|
||||||
|
@ -68,7 +65,7 @@
|
||||||
show-field="code"
|
show-field="code"
|
||||||
rule>
|
rule>
|
||||||
<tpl-item>
|
<tpl-item>
|
||||||
{{code}} - {{town.name}} ({{town.province.name}},
|
{{code}} - {{town.name}} ({{town.province.name}},
|
||||||
{{town.province.country.country}})
|
{{town.province.country.country}})
|
||||||
</tpl-item>
|
</tpl-item>
|
||||||
<append>
|
<append>
|
||||||
|
@ -82,7 +79,7 @@
|
||||||
</append>
|
</append>
|
||||||
</vn-datalist>
|
</vn-datalist>
|
||||||
<vn-datalist
|
<vn-datalist
|
||||||
vn-id="town"
|
vn-id="town"
|
||||||
label="City"
|
label="City"
|
||||||
ng-model="$ctrl.client.city"
|
ng-model="$ctrl.client.city"
|
||||||
selection="$ctrl.town"
|
selection="$ctrl.town"
|
||||||
|
@ -90,7 +87,7 @@
|
||||||
fields="['id', 'name', 'provinceFk']"
|
fields="['id', 'name', 'provinceFk']"
|
||||||
value-field="name">
|
value-field="name">
|
||||||
<tpl-item>
|
<tpl-item>
|
||||||
{{name}}, {{province.name}}
|
{{name}}, {{province.name}}
|
||||||
({{province.country.country}})
|
({{province.country.country}})
|
||||||
</tpl-item>
|
</tpl-item>
|
||||||
</vn-datalist>
|
</vn-datalist>
|
||||||
|
@ -150,4 +147,4 @@
|
||||||
<vn-geo-postcode
|
<vn-geo-postcode
|
||||||
vn-id="postcode"
|
vn-id="postcode"
|
||||||
on-response="$ctrl.onResponse($response)">
|
on-response="$ctrl.onResponse($response)">
|
||||||
</vn-geo-postcode>
|
</vn-geo-postcode>
|
||||||
|
|
|
@ -14,17 +14,12 @@
|
||||||
vn-one label="Name"
|
vn-one label="Name"
|
||||||
ng-model="filter.name">
|
ng-model="filter.name">
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="filter.salesPersonFk"
|
ng-model="filter.salesPersonFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
departments="['VT']"
|
||||||
search-function="{firstName: $search}"
|
|
||||||
show-field="firstName"
|
|
||||||
value-field="id"
|
|
||||||
where="{role: 'salesPerson'}"
|
|
||||||
label="Salesperson">
|
label="Salesperson">
|
||||||
<tpl-item>{{firstName}} {{name}}</tpl-item>
|
</vn-worker-autocomplete>
|
||||||
</vn-autocomplete>
|
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-textfield
|
<vn-textfield
|
||||||
|
|
|
@ -54,11 +54,10 @@
|
||||||
vn-id="salesPerson"
|
vn-id="salesPerson"
|
||||||
disabled="false"
|
disabled="false"
|
||||||
ng-model="$ctrl.filter.salesPersonFk"
|
ng-model="$ctrl.filter.salesPersonFk"
|
||||||
url="Workers/activeWithRole"
|
url="TicketRequests/getItemTypeWorker"
|
||||||
show-field="nickname"
|
show-field="nickname"
|
||||||
search-function="{firstName: $search}"
|
search-function="{firstName: $search}"
|
||||||
value-field="id"
|
value-field="id"
|
||||||
where="{role: {inq: ['logistic', 'buyer']}}"
|
|
||||||
label="Buyer"
|
label="Buyer"
|
||||||
on-change="$ctrl.addFilters()">
|
on-change="$ctrl.addFilters()">
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
|
|
|
@ -54,11 +54,10 @@
|
||||||
vn-id="buyer"
|
vn-id="buyer"
|
||||||
disabled="false"
|
disabled="false"
|
||||||
ng-model="$ctrl.filter.buyerFk"
|
ng-model="$ctrl.filter.buyerFk"
|
||||||
url="Workers/activeWithRole"
|
url="TicketRequests/getItemTypeWorker"
|
||||||
show-field="nickname"
|
show-field="nickname"
|
||||||
search-function="{firstName: $search}"
|
search-function="{firstName: $search}"
|
||||||
value-field="id"
|
value-field="id"
|
||||||
where="{role: {inq: ['logistic', 'buyer']}}"
|
|
||||||
label="Buyer"
|
label="Buyer"
|
||||||
on-change="$ctrl.addFilters()">
|
on-change="$ctrl.addFilters()">
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
|
|
|
@ -44,8 +44,7 @@ class Controller extends Section {
|
||||||
{
|
{
|
||||||
field: 'buyerFk',
|
field: 'buyerFk',
|
||||||
autocomplete: {
|
autocomplete: {
|
||||||
url: 'Workers/activeWithRole',
|
url: 'TicketRequests/getItemTypeWorker',
|
||||||
where: `{role: {inq: ['logistic', 'buyer']}}`,
|
|
||||||
searchFunction: '{firstName: $search}',
|
searchFunction: '{firstName: $search}',
|
||||||
showField: 'nickname',
|
showField: 'nickname',
|
||||||
valueField: 'id',
|
valueField: 'id',
|
||||||
|
|
|
@ -22,12 +22,11 @@
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="filter.attenderFk"
|
ng-model="filter.attenderFk"
|
||||||
url="Workers/activeWithRole"
|
url="TicketRequests/getItemTypeWorker"
|
||||||
search-function="{firstName: $search}"
|
search-function="{firstName: $search}"
|
||||||
|
show-field="nickname"
|
||||||
value-field="id"
|
value-field="id"
|
||||||
where="{role: {inq: ['logistic', 'buyer']}}"
|
label="Atender">
|
||||||
label="Buyer">
|
|
||||||
<tpl-item>{{nickname}}</tpl-item>
|
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal class="vn-px-lg">
|
<vn-horizontal class="vn-px-lg">
|
||||||
|
@ -46,18 +45,13 @@
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal class="vn-px-lg">
|
<vn-horizontal class="vn-px-lg">
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="filter.requesterFk"
|
ng-model="filter.requesterFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
departments="['VT']"
|
||||||
search-function="{firstName: $search}"
|
label="Salesperson">
|
||||||
value-field="id"
|
</vn-worker-autocomplete>
|
||||||
where="{role: 'salesPerson'}"
|
|
||||||
label="Comercial">
|
|
||||||
<tpl-item>{{firstName}} {{lastName}}</tpl-item>
|
|
||||||
</vn-autocomplete>
|
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
|
|
||||||
<section class="vn-px-md">
|
<section class="vn-px-md">
|
||||||
<vn-horizontal class="manifold-panel vn-pa-md">
|
<vn-horizontal class="manifold-panel vn-pa-md">
|
||||||
<vn-date-picker
|
<vn-date-picker
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="search-panel">
|
<div class="search-panel">
|
||||||
<vn-crud-model
|
<vn-crud-model
|
||||||
auto-load="true"
|
auto-load="true"
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
data="warehouses">
|
data="warehouses">
|
||||||
</vn-crud-model>
|
</vn-crud-model>
|
||||||
<form id="manifold-form" ng-submit="$ctrl.onSearch()">
|
<form id="manifold-form" ng-submit="$ctrl.onSearch()">
|
||||||
|
@ -43,16 +43,12 @@
|
||||||
label="Nickname"
|
label="Nickname"
|
||||||
ng-model="filter.nickname">
|
ng-model="filter.nickname">
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="filter.salesPersonFk"
|
ng-model="filter.salesPersonFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
departments="['VT']"
|
||||||
search-function="{firstName: $search}"
|
|
||||||
value-field="id"
|
|
||||||
where="{role: 'employee'}"
|
|
||||||
label="Sales person">
|
label="Sales person">
|
||||||
<tpl-item>{{firstName}} {{name}}</tpl-item>
|
</vn-worker-autocomplete>
|
||||||
</vn-autocomplete>
|
|
||||||
<vn-textfield
|
<vn-textfield
|
||||||
vn-one
|
vn-one
|
||||||
label="Invoice"
|
label="Invoice"
|
||||||
|
|
|
@ -25,16 +25,13 @@
|
||||||
show-field="name"
|
show-field="name"
|
||||||
value-field="id">
|
value-field="id">
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="filter.workerFk"
|
ng-model="filter.workerFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
departments="['VT']"
|
||||||
search-function="{firstName: $search}"
|
|
||||||
show-field="nickname"
|
show-field="nickname"
|
||||||
value-field="id"
|
|
||||||
where="{role: 'salesPerson'}"
|
|
||||||
label="Sales person">
|
label="Sales person">
|
||||||
</vn-autocomplete>
|
</vn-worker-autocomplete>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-date-picker
|
<vn-date-picker
|
||||||
|
@ -86,4 +83,4 @@
|
||||||
<vn-submit label="Search"></vn-submit>
|
<vn-submit label="Search"></vn-submit>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,20 +8,11 @@
|
||||||
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
||||||
<vn-card class="vn-pa-lg">
|
<vn-card class="vn-pa-lg">
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
ng-model="$ctrl.route.workerFk"
|
ng-model="$ctrl.route.workerFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
|
||||||
show-field="nickname"
|
show-field="nickname"
|
||||||
search-function="{firstName: $search}"
|
|
||||||
value-field="id"
|
|
||||||
where="{role: 'employee'}"
|
|
||||||
label="Worker"
|
|
||||||
vn-name="worker">
|
vn-name="worker">
|
||||||
<tpl-item>
|
</vn-worker-autocomplete>
|
||||||
<div>{{::nickname}}</div>
|
|
||||||
<div class="text-secondary text-caption">{{::name}}</div>
|
|
||||||
</tpl-item>
|
|
||||||
</vn-autocomplete>
|
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
label="Vehicle"
|
label="Vehicle"
|
||||||
ng-model="$ctrl.route.vehicleFk"
|
ng-model="$ctrl.route.vehicleFk"
|
||||||
|
|
|
@ -8,16 +8,12 @@
|
||||||
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
||||||
<vn-card class="vn-pa-lg">
|
<vn-card class="vn-pa-lg">
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
label="Worker"
|
|
||||||
ng-model="$ctrl.route.workerFk"
|
ng-model="$ctrl.route.workerFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
show-field="nickname">
|
||||||
show-field="nickname"
|
</vn-worker-autocomplete>
|
||||||
search-function="{firstName: $search}"
|
|
||||||
where="{role: 'employee'}">
|
|
||||||
</vn-autocomplete>
|
|
||||||
<vn-date-picker
|
<vn-date-picker
|
||||||
label="Created"
|
label="Created"
|
||||||
ng-model="$ctrl.route.created">
|
ng-model="$ctrl.route.created">
|
||||||
</vn-date-picker>
|
</vn-date-picker>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="search-panel">
|
<div class="search-panel">
|
||||||
<vn-crud-model
|
<vn-crud-model
|
||||||
auto-load="true"
|
auto-load="true"
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
data="warehouses">
|
data="warehouses">
|
||||||
</vn-crud-model>
|
</vn-crud-model>
|
||||||
<form id="manifold-form" ng-submit="$ctrl.onSearch()">
|
<form id="manifold-form" ng-submit="$ctrl.onSearch()">
|
||||||
|
@ -15,16 +15,11 @@
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal class="vn-px-lg">
|
<vn-horizontal class="vn-px-lg">
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="filter.workerFk"
|
ng-model="filter.workerFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
show-field="nickname">
|
||||||
show-field="nickname"
|
</vn-worker-autocomplete>
|
||||||
search-function="{firstName: $search}"
|
|
||||||
value-field="id"
|
|
||||||
where="{role: 'employee'}"
|
|
||||||
label="Worker">
|
|
||||||
</vn-autocomplete>
|
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
label="Agency"
|
label="Agency"
|
||||||
|
|
|
@ -15,29 +15,25 @@
|
||||||
rule
|
rule
|
||||||
vn-focus>
|
vn-focus>
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="$ctrl.supplier.workerFk"
|
ng-model="$ctrl.supplier.workerFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
|
||||||
search-function="{firstName: $search}"
|
|
||||||
show-field="nickname"
|
show-field="nickname"
|
||||||
value-field="id"
|
|
||||||
where="{role: 'employee'}"
|
|
||||||
label="Responsible"
|
label="Responsible"
|
||||||
info="Responsible for approving invoices">
|
info="Responsible for approving invoices">
|
||||||
</vn-autocomplete>
|
</vn-worker-autocomplete>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-check
|
<vn-check
|
||||||
label="Verified"
|
label="Verified"
|
||||||
ng-model="$ctrl.supplier.isSerious">
|
ng-model="$ctrl.supplier.isSerious">
|
||||||
</vn-check>
|
</vn-check>
|
||||||
<vn-check
|
<vn-check
|
||||||
label="Active"
|
label="Active"
|
||||||
ng-model="$ctrl.supplier.isActive">
|
ng-model="$ctrl.supplier.isActive">
|
||||||
</vn-check>
|
</vn-check>
|
||||||
<vn-check
|
<vn-check
|
||||||
label="PayMethodChecked"
|
label="PayMethodChecked"
|
||||||
ng-model="$ctrl.supplier.isPayMethodChecked"
|
ng-model="$ctrl.supplier.isPayMethodChecked"
|
||||||
vn-acl="financial">
|
vn-acl="financial">
|
||||||
</vn-check>
|
</vn-check>
|
||||||
|
@ -45,7 +41,7 @@
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-textarea
|
<vn-textarea
|
||||||
vn-one
|
vn-one
|
||||||
label="Notes"
|
label="Notes"
|
||||||
ng-model="$ctrl.supplier.note"
|
ng-model="$ctrl.supplier.note"
|
||||||
rule>
|
rule>
|
||||||
</vn-textarea>
|
</vn-textarea>
|
||||||
|
@ -63,4 +59,4 @@
|
||||||
ng-click="watcher.loadOriginalData()">
|
ng-click="watcher.loadOriginalData()">
|
||||||
</vn-button>
|
</vn-button>
|
||||||
</vn-button-bar>
|
</vn-button-bar>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="filter.buyerId"
|
ng-model="filter.buyerId"
|
||||||
url="Workers/activeWithRole"
|
url="TicketRequests/getItemTypeWorker"
|
||||||
search-function="{firstName: $search}"
|
search-function="{firstName: $search}"
|
||||||
|
show-field="nickname"
|
||||||
value-field="id"
|
value-field="id"
|
||||||
where="{role: {inq: ['logistic', 'buyer']}}"
|
|
||||||
label="Buyer">
|
label="Buyer">
|
||||||
<tpl-item>{{nickname}}</tpl-item>
|
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
|
|
|
@ -22,9 +22,13 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.getItemTypeWorker = async filter => {
|
Self.getItemTypeWorker = async(filter, options) => {
|
||||||
|
const myOptions = {};
|
||||||
const conn = Self.dataSource.connector;
|
const conn = Self.dataSource.connector;
|
||||||
|
|
||||||
|
if (typeof options == 'object')
|
||||||
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
const query =
|
const query =
|
||||||
`SELECT DISTINCT u.id, u.nickname
|
`SELECT DISTINCT u.id, u.nickname
|
||||||
FROM itemType it
|
FROM itemType it
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="search-panel">
|
<div class="search-panel">
|
||||||
<vn-crud-model
|
<vn-crud-model
|
||||||
auto-load="true"
|
auto-load="true"
|
||||||
url="Warehouses"
|
url="Warehouses"
|
||||||
data="warehouses">
|
data="warehouses">
|
||||||
</vn-crud-model>
|
</vn-crud-model>
|
||||||
<form id="manifold-form" ng-submit="$ctrl.onSearch()">
|
<form id="manifold-form" ng-submit="$ctrl.onSearch()">
|
||||||
|
@ -62,16 +62,12 @@
|
||||||
label="Nickname"
|
label="Nickname"
|
||||||
ng-model="filter.nickname">
|
ng-model="filter.nickname">
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="filter.salesPersonFk"
|
ng-model="filter.salesPersonFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
departments="['VT']"
|
||||||
search-function="{firstName: $search}"
|
|
||||||
value-field="id"
|
|
||||||
where="{role: 'employee'}"
|
|
||||||
label="Sales person">
|
label="Sales person">
|
||||||
<tpl-item>{{firstName}} {{name}}</tpl-item>
|
</vn-worker-autocomplete>
|
||||||
</vn-autocomplete>
|
|
||||||
<vn-textfield
|
<vn-textfield
|
||||||
vn-one
|
vn-one
|
||||||
label="Invoice"
|
label="Invoice"
|
||||||
|
|
|
@ -14,22 +14,15 @@
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="$ctrl.stateFk"
|
ng-model="$ctrl.stateFk"
|
||||||
data="states"
|
data="states"
|
||||||
label="State"
|
label="State"
|
||||||
vn-focus>
|
vn-focus>
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
url="Workers/activeWithInheritedRole"
|
ng-model="$ctrl.workerFk">
|
||||||
ng-if="$ctrl.isPickerDesignedState"
|
</vn-worker-autocomplete>
|
||||||
ng-model="$ctrl.workerFk"
|
|
||||||
show-field="nickname"
|
|
||||||
search-function="{firstName: $search}"
|
|
||||||
value-field="id"
|
|
||||||
where="{role: 'employee'}"
|
|
||||||
label="Worker">
|
|
||||||
</vn-autocomplete>
|
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
</vn-card>
|
</vn-card>
|
||||||
<vn-button-bar>
|
<vn-button-bar>
|
||||||
|
@ -43,4 +36,4 @@
|
||||||
ui-sref="ticket.card.tracking.index">
|
ui-sref="ticket.card.tracking.index">
|
||||||
</vn-button>
|
</vn-button>
|
||||||
</vn-button-bar>
|
</vn-button-bar>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
Self.remoteMethod('activeWithInheritedRole', {
|
Self.remoteMethod('activeWithInheritedRole', {
|
||||||
description: 'Returns active workers with a role',
|
description: 'Returns active workers with an inherited role',
|
||||||
accessType: 'READ',
|
accessType: 'READ',
|
||||||
accepts: [{
|
accepts: [{
|
||||||
arg: 'filter',
|
arg: 'filter',
|
||||||
|
@ -24,7 +24,7 @@ module.exports = Self => {
|
||||||
`SELECT DISTINCT w.id, w.firstName, w.lastName, u.name, u.nickname
|
`SELECT DISTINCT w.id, w.firstName, w.lastName, u.name, u.nickname
|
||||||
FROM worker w
|
FROM worker w
|
||||||
JOIN account.user u ON u.id = w.userFk
|
JOIN account.user u ON u.id = w.userFk
|
||||||
JOIN account.roleRole i ON i.role = u.role
|
JOIN account.roleRole i ON i.role = u.role
|
||||||
JOIN account.role r ON r.id = i.inheritsFrom`;
|
JOIN account.role r ON r.id = i.inheritsFrom`;
|
||||||
|
|
||||||
return Self.activeWorkers(query, filter);
|
return Self.activeWorkers(query, filter);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
Self.remoteMethod('activeWithRole', {
|
Self.remoteMethod('activeWithRole', {
|
||||||
description: 'Returns active workers with an inherited role',
|
description: 'Returns active workers with a role',
|
||||||
accessType: 'READ',
|
accessType: 'READ',
|
||||||
accepts: [{
|
accepts: [{
|
||||||
arg: 'filter',
|
arg: 'filter',
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
|
||||||
|
const mergeFilters = require('vn-loopback/util/filter').mergeFilters;
|
||||||
|
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethodCtx('search', {
|
||||||
|
description: 'Returns an array of search results for a specified worker',
|
||||||
|
accepts: [{
|
||||||
|
arg: 'filter',
|
||||||
|
type: 'object',
|
||||||
|
description: 'Filter to define conditions and paginate the data.',
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'departmentCodes',
|
||||||
|
type: ['string'],
|
||||||
|
description: 'Department codes to search workers',
|
||||||
|
}],
|
||||||
|
returns: {
|
||||||
|
type: ['object'],
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
http: {
|
||||||
|
path: `/search`,
|
||||||
|
verb: 'GET'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.search = async(ctx, filter, departmentCodes) => {
|
||||||
|
const models = Self.app.models;
|
||||||
|
const conn = Self.dataSource.connector;
|
||||||
|
|
||||||
|
if (departmentCodes) {
|
||||||
|
const departments = await models.Department.find({
|
||||||
|
fields: ['id', 'sons'],
|
||||||
|
where: {code: {inq: departmentCodes}}
|
||||||
|
});
|
||||||
|
|
||||||
|
const allLeaves = await getAllLeaves(ctx, departments);
|
||||||
|
const where = {'departmentFk': {inq: allLeaves}};
|
||||||
|
filter = mergeFilters(filter, {where});
|
||||||
|
}
|
||||||
|
|
||||||
|
const stmt = new ParameterizedSQL(`
|
||||||
|
SELECT *
|
||||||
|
FROM(
|
||||||
|
SELECT DISTINCT w.id, w.code, u.name, u.nickname, u.active, b.departmentFk
|
||||||
|
FROM worker w
|
||||||
|
JOIN account.user u ON u.id = w.id
|
||||||
|
JOIN business b ON b.workerFk = w.id
|
||||||
|
) w`);
|
||||||
|
|
||||||
|
stmt.merge(conn.makeSuffix(filter));
|
||||||
|
return conn.executeStmt(stmt);
|
||||||
|
};
|
||||||
|
|
||||||
|
async function getAllLeaves(ctx, departments) {
|
||||||
|
const models = Self.app.models;
|
||||||
|
const leaves = [];
|
||||||
|
for (const department of departments) {
|
||||||
|
if (department.sons > 0) {
|
||||||
|
const subLeaves = await models.Department.getLeaves(ctx, department.id, null);
|
||||||
|
const grandLeaves = await getAllLeaves(ctx, subLeaves);
|
||||||
|
leaves.push(...grandLeaves);
|
||||||
|
}
|
||||||
|
leaves.push(department.id);
|
||||||
|
}
|
||||||
|
return leaves;
|
||||||
|
}
|
||||||
|
};
|
|
@ -16,6 +16,7 @@ module.exports = Self => {
|
||||||
require('../methods/worker/new')(Self);
|
require('../methods/worker/new')(Self);
|
||||||
require('../methods/worker/deallocatePDA')(Self);
|
require('../methods/worker/deallocatePDA')(Self);
|
||||||
require('../methods/worker/allocatePDA')(Self);
|
require('../methods/worker/allocatePDA')(Self);
|
||||||
|
require('../methods/worker/search')(Self);
|
||||||
require('../methods/worker/isAuthorized')(Self);
|
require('../methods/worker/isAuthorized')(Self);
|
||||||
|
|
||||||
Self.validatesUniquenessOf('locker', {
|
Self.validatesUniquenessOf('locker', {
|
||||||
|
|
|
@ -37,14 +37,11 @@
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
ng-model="$ctrl.worker.bossFk"
|
ng-model="$ctrl.worker.bossFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
|
||||||
show-field="nickname"
|
show-field="nickname"
|
||||||
search-function="{firstName: $search}"
|
|
||||||
where="{role: 'employee'}"
|
|
||||||
label="Boss">
|
label="Boss">
|
||||||
</vn-autocomplete>
|
</vn-worker-autocomplete>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
label="Marital status"
|
label="Marital status"
|
||||||
data="$ctrl.maritalStatus"
|
data="$ctrl.maritalStatus"
|
||||||
|
|
|
@ -131,15 +131,12 @@
|
||||||
value-field="id"
|
value-field="id"
|
||||||
label="Company">
|
label="Company">
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
vn-one
|
vn-one
|
||||||
ng-model="$ctrl.worker.bossFk"
|
ng-model="$ctrl.worker.bossFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
|
||||||
show-field="nickname"
|
show-field="nickname"
|
||||||
search-function="{firstName: $search}"
|
|
||||||
where="{role: 'employee'}"
|
|
||||||
label="Boss">
|
label="Boss">
|
||||||
</vn-autocomplete>
|
</vn-worker-autocomplete>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
|
|
|
@ -44,13 +44,11 @@
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-autocomplete
|
<vn-worker-autocomplete
|
||||||
ng-model="$ctrl.department.workerFk"
|
ng-model="$ctrl.department.workerFk"
|
||||||
url="Workers/activeWithInheritedRole"
|
|
||||||
show-field="nickname"
|
show-field="nickname"
|
||||||
search-function="{firstName: $search}"
|
|
||||||
label="Boss department">
|
label="Boss department">
|
||||||
</vn-autocomplete>
|
</vn-worker-autocomplete>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
ng-model="$ctrl.department.clientFk"
|
ng-model="$ctrl.department.clientFk"
|
||||||
url="Clients/"
|
url="Clients/"
|
||||||
|
@ -69,7 +67,7 @@
|
||||||
ng-model="$ctrl.department.hasToMistake">
|
ng-model="$ctrl.department.hasToMistake">
|
||||||
</vn-check>
|
</vn-check>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-check
|
<vn-check
|
||||||
label="worksInProduction"
|
label="worksInProduction"
|
||||||
ng-model="$ctrl.department.isProduction">
|
ng-model="$ctrl.department.isProduction">
|
||||||
|
@ -78,12 +76,12 @@
|
||||||
label="Fill in days without physical check-ins"
|
label="Fill in days without physical check-ins"
|
||||||
ng-model="$ctrl.department.hasToRefill">
|
ng-model="$ctrl.department.hasToRefill">
|
||||||
</vn-check>
|
</vn-check>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-check
|
<vn-check
|
||||||
label="Send check-ins by email"
|
label="Send check-ins by email"
|
||||||
ng-model="$ctrl.department.hasToSendMail">
|
ng-model="$ctrl.department.hasToSendMail">
|
||||||
</vn-check>
|
</vn-check>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
</vn-vertical>
|
</vn-vertical>
|
||||||
</vn-card>
|
</vn-card>
|
||||||
|
|
Loading…
Reference in New Issue