2017-12-19 10:05:07 +00:00
|
|
|
import ngModule from '../module';
|
2020-03-17 13:43:46 +00:00
|
|
|
import Section from 'salix/components/section';
|
2018-02-22 07:18:57 +00:00
|
|
|
import './style.scss';
|
2017-12-19 10:05:07 +00:00
|
|
|
|
2020-03-17 13:43:46 +00:00
|
|
|
class Controller extends Section {
|
|
|
|
constructor($element, $) {
|
|
|
|
super($element, $);
|
2019-02-13 08:27:11 +00:00
|
|
|
this.showFields = {
|
|
|
|
id: false,
|
|
|
|
actions: false
|
|
|
|
};
|
2019-02-28 12:50:39 +00:00
|
|
|
}
|
|
|
|
|
2021-02-22 15:43:40 +00:00
|
|
|
exprBuilder(param, value) {
|
|
|
|
switch (param) {
|
|
|
|
case 'category':
|
|
|
|
return {'ic.name': value};
|
|
|
|
case 'salesPersonFk':
|
|
|
|
return {'t.workerFk': value};
|
|
|
|
case 'grouping':
|
|
|
|
return {'b.grouping': value};
|
|
|
|
case 'packing':
|
|
|
|
return {'b.packing': value};
|
|
|
|
case 'origin':
|
|
|
|
return {'ori.code': value};
|
|
|
|
case 'niche':
|
|
|
|
return {'itn.code': value};
|
|
|
|
case 'type':
|
|
|
|
return {'i.typeFk': value};
|
|
|
|
case 'intrastat':
|
|
|
|
return {'intr.description': value};
|
|
|
|
case 'id':
|
|
|
|
case 'size':
|
|
|
|
case 'name':
|
|
|
|
case 'subname':
|
|
|
|
case 'isActive':
|
|
|
|
case 'density':
|
|
|
|
case 'stemMultiplier':
|
|
|
|
case 'stems':
|
|
|
|
return {[`i.${param}`]: value};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-25 09:50:04 +00:00
|
|
|
onCloneAccept(itemFk) {
|
|
|
|
return this.$http.post(`Items/${itemFk}/clone`)
|
|
|
|
.then(res => {
|
2018-06-07 21:47:19 +00:00
|
|
|
this.$state.go('item.card.tags', {id: res.data.id});
|
2020-04-25 09:50:04 +00:00
|
|
|
});
|
2018-02-22 12:40:23 +00:00
|
|
|
}
|
2018-06-07 21:47:19 +00:00
|
|
|
|
2020-04-25 09:50:04 +00:00
|
|
|
preview(item) {
|
2018-02-22 07:18:57 +00:00
|
|
|
this.itemSelected = item;
|
2018-06-07 21:47:19 +00:00
|
|
|
this.$.preview.show();
|
2018-02-22 07:18:57 +00:00
|
|
|
}
|
2017-12-19 10:05:07 +00:00
|
|
|
}
|
2020-03-17 13:43:46 +00:00
|
|
|
|
2020-07-24 12:22:30 +00:00
|
|
|
ngModule.vnComponent('vnItemIndex', {
|
2018-05-25 08:03:45 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
2017-12-19 10:05:07 +00:00
|
|
|
});
|