2017-12-20 13:36:12 +00:00
|
|
|
import ngModule from '../module';
|
2019-11-10 10:08:44 +00:00
|
|
|
import ModuleCard from 'salix/components/module-card';
|
2017-12-20 13:36:12 +00:00
|
|
|
|
2019-11-10 10:08:44 +00:00
|
|
|
class Controller extends ModuleCard {
|
2018-09-14 11:43:51 +00:00
|
|
|
reload() {
|
2019-11-10 10:08:44 +00:00
|
|
|
this.$http.get(`Items/${this.$params.id}/getCard`)
|
|
|
|
.then(res => this.item = res.data);
|
2023-02-21 10:48:56 +00:00
|
|
|
|
|
|
|
this.$http.get('ItemConfigs/findOne')
|
|
|
|
.then(res => {
|
|
|
|
if (this.$state.getCurrentPath()[4].state.name === 'item.card.diary') return;
|
|
|
|
this.warehouseFk = res.data.warehouseFk;
|
|
|
|
this.getWarehouseName(res.data.warehouseFk);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
getWarehouseName(warehouseFk) {
|
|
|
|
const filter = {
|
|
|
|
where: {id: warehouseFk}
|
|
|
|
};
|
|
|
|
this.$http.get('Warehouses/findOne', {filter})
|
|
|
|
.then(res => {
|
|
|
|
this.warehouseText = this.$t('WarehouseFk', {
|
|
|
|
warehouseName: res.data.name
|
|
|
|
});
|
|
|
|
});
|
2018-03-02 09:51:01 +00:00
|
|
|
}
|
2017-12-20 13:36:12 +00:00
|
|
|
}
|
2018-05-25 08:03:45 +00:00
|
|
|
|
2020-07-24 12:22:30 +00:00
|
|
|
ngModule.vnComponent('vnItemCard', {
|
2018-05-25 08:03:45 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
2017-12-20 13:36:12 +00:00
|
|
|
});
|