2018-07-18 12:21:58 +00:00
|
|
|
import ngModule from '../module';
|
2019-11-10 10:08:44 +00:00
|
|
|
import ModuleCard from 'salix/components/module-card';
|
2018-07-18 12:21:58 +00:00
|
|
|
|
2019-11-10 10:08:44 +00:00
|
|
|
class Controller extends ModuleCard {
|
|
|
|
reload() {
|
|
|
|
let filter = {
|
2018-07-18 12:21:58 +00:00
|
|
|
include: [
|
2019-01-31 13:14:39 +00:00
|
|
|
{
|
2019-11-10 10:08:44 +00:00
|
|
|
relation: 'agencyMode',
|
|
|
|
scope: {
|
2019-01-31 13:14:39 +00:00
|
|
|
fields: ['name']
|
|
|
|
}
|
2019-11-10 10:08:44 +00:00
|
|
|
}, {
|
|
|
|
relation: 'address',
|
|
|
|
scope: {
|
2019-01-31 13:14:39 +00:00
|
|
|
fields: ['nickname']
|
|
|
|
}
|
2019-11-10 10:08:44 +00:00
|
|
|
}, {
|
|
|
|
relation: 'rows',
|
|
|
|
scope: {
|
2019-01-31 13:14:39 +00:00
|
|
|
fields: ['id']
|
|
|
|
}
|
2019-11-10 10:08:44 +00:00
|
|
|
}, {
|
2018-07-18 12:21:58 +00:00
|
|
|
relation: 'client',
|
|
|
|
scope: {
|
2019-11-10 10:08:44 +00:00
|
|
|
fields: [
|
|
|
|
'salesPersonFk',
|
|
|
|
'name',
|
|
|
|
'isActive',
|
|
|
|
'isFreezed',
|
|
|
|
'isTaxDataChecked'
|
|
|
|
],
|
2018-07-18 12:21:58 +00:00
|
|
|
include: {
|
2020-09-15 17:43:07 +00:00
|
|
|
relation: 'salesPersonUser',
|
2019-01-31 13:14:39 +00:00
|
|
|
scope: {
|
2020-09-15 17:43:07 +00:00
|
|
|
fields: ['id', 'name']
|
2019-01-31 13:14:39 +00:00
|
|
|
}
|
2018-07-18 12:21:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
2020-03-24 16:01:11 +00:00
|
|
|
return this.$q.all([
|
2019-11-10 10:08:44 +00:00
|
|
|
this.$http.get(`Orders/${this.$params.id}`, {filter})
|
|
|
|
.then(res => this.order = res.data),
|
|
|
|
this.$http.get(`Orders/${this.$params.id}/getTotal`)
|
|
|
|
.then(res => ({total: res.data}))
|
|
|
|
]).then(res => {
|
|
|
|
this.order = Object.assign.apply(null, res);
|
2018-07-20 14:32:34 +00:00
|
|
|
});
|
2018-07-18 12:21:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-24 12:22:30 +00:00
|
|
|
ngModule.vnComponent('vnOrderCard', {
|
2018-07-18 12:21:58 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|