39 lines
861 B
JavaScript
39 lines
861 B
JavaScript
|
import ngModule from '../module';
|
||
|
import './style.scss';
|
||
|
|
||
|
class Controller {
|
||
|
constructor($scope, $http) {
|
||
|
this.$ = $scope;
|
||
|
this.$http = $http;
|
||
|
this.diary = [];
|
||
|
}
|
||
|
|
||
|
set warehouseFk(value) {
|
||
|
this._getItemDiary(value);
|
||
|
this._warehouseFk = value;
|
||
|
}
|
||
|
|
||
|
get warehouseFk() {
|
||
|
return this._warehouseFk;
|
||
|
}
|
||
|
|
||
|
_getItemDiary(warehouse) {
|
||
|
if (warehouse == null)
|
||
|
return;
|
||
|
let params = {itemFk: this.item.id, warehouseFk: warehouse};
|
||
|
this.$http.get(`/item/api/Items/getDiary?params=${JSON.stringify(params)}`).then(res => {
|
||
|
this.diary = res.data;
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Controller.$inject = ['$scope', '$http'];
|
||
|
|
||
|
ngModule.component('vnItemDiary', {
|
||
|
template: require('./index.html'),
|
||
|
controller: Controller,
|
||
|
bindings: {
|
||
|
item: '<'
|
||
|
}
|
||
|
});
|