2023-05-30 12:49:28 +00:00
|
|
|
import ngModule from '../../module';
|
|
|
|
import Autocomplete from '../autocomplete';
|
|
|
|
|
|
|
|
export default class WorkerAutocomplete extends Autocomplete {
|
2023-06-08 09:07:57 +00:00
|
|
|
constructor(...args) {
|
|
|
|
super(...args);
|
|
|
|
Object.assign(this, {
|
|
|
|
label: 'Worker',
|
|
|
|
url: 'Workers/search',
|
|
|
|
fields: ['id', 'name', 'nickname'],
|
|
|
|
searchFunction: function($search) {
|
|
|
|
return {and: [
|
|
|
|
{active: {neq: false}},
|
|
|
|
{or: [
|
|
|
|
{name: $search},
|
|
|
|
{nickname: {like: '%' + $search + '%'}},
|
|
|
|
{code: {like: $search + '%'}}
|
|
|
|
]}
|
|
|
|
]};
|
|
|
|
}
|
|
|
|
});
|
2023-05-30 12:49:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ngModule.vnComponent('vnWorkerAutocomplete', {
|
2023-06-08 09:07:57 +00:00
|
|
|
slotTemplate: require('./index.html'),
|
2023-05-30 12:49:28 +00:00
|
|
|
controller: WorkerAutocomplete
|
|
|
|
});
|