|
@@ -230,13 +230,13 @@ define(['app/app'], function(app) {
|
|
|
|
|
|
|
|
};
|
|
};
|
|
|
// 日志点击事件
|
|
// 日志点击事件
|
|
|
- $scope.journalProduct = function (data) {
|
|
|
|
|
|
|
+ $scope.journalProduct = function (goods) {
|
|
|
var modalInstance = $modal.open({
|
|
var modalInstance = $modal.open({
|
|
|
templateUrl: 'static/view/admin/modal/manage/journal_modal.html',
|
|
templateUrl: 'static/view/admin/modal/manage/journal_modal.html',
|
|
|
controller: 'journalCtrl',
|
|
controller: 'journalCtrl',
|
|
|
resolve: {
|
|
resolve: {
|
|
|
- account: function () {
|
|
|
|
|
- return angular.copy(data);
|
|
|
|
|
|
|
+ goods: function () {
|
|
|
|
|
+ return angular.copy(goods);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -258,8 +258,8 @@ define(['app/app'], function(app) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- modalInstance.result.then(function (account) {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ modalInstance.result.then(function () {
|
|
|
|
|
+ $scope.manageTableParams.reload();
|
|
|
}, function () {
|
|
}, function () {
|
|
|
|
|
|
|
|
})
|
|
})
|
|
@@ -283,6 +283,7 @@ define(['app/app'], function(app) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}]);
|
|
}]);
|
|
|
|
|
+
|
|
|
app.register.controller('exportProductCtrl', ['$scope', '$modalInstance', 'account', function($scope, $modalInstance, account) {
|
|
app.register.controller('exportProductCtrl', ['$scope', '$modalInstance', 'account', function($scope, $modalInstance, account) {
|
|
|
$scope.cancel = function () {
|
|
$scope.cancel = function () {
|
|
|
$modalInstance.dismiss();
|
|
$modalInstance.dismiss();
|
|
@@ -391,7 +392,7 @@ define(['app/app'], function(app) {
|
|
|
|
|
|
|
|
}]);
|
|
}]);
|
|
|
|
|
|
|
|
- app.register.controller('journalCtrl', ['$scope', 'account', '$modalInstance', function($scope, account, $modalInstance) {
|
|
|
|
|
|
|
+ app.register.controller('journalCtrl', ['$scope', 'goods', 'toaster', 'ngTableParams', 'BaseService', 'GoodsHistory', '$modalInstance', function($scope, goods, toaster, ngTableParams, BaseService, GoodsHistory, $modalInstance) {
|
|
|
$scope.tabs = 'basic';
|
|
$scope.tabs = 'basic';
|
|
|
|
|
|
|
|
// 日期选择框部分
|
|
// 日期选择框部分
|
|
@@ -420,6 +421,31 @@ define(['app/app'], function(app) {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ $scope.historyStatus = {
|
|
|
|
|
+ '上架' : '上架',
|
|
|
|
|
+ '发布商品' : '上架',
|
|
|
|
|
+ '下架商品' : '下架',
|
|
|
|
|
+ '批量下架公司产品' : '下架'
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 获取分页Goods数据
|
|
|
|
|
+ $scope.historyTableParams = new ngTableParams({
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ count: 3
|
|
|
|
|
+ }, {
|
|
|
|
|
+ total: 0,
|
|
|
|
|
+ getData: function ($defer, params) {
|
|
|
|
|
+ var param = BaseService.parseParams(params.url());
|
|
|
|
|
+ param.batchCode = goods.batchCode;
|
|
|
|
|
+ GoodsHistory.findDataOfUpAndDown(param, function (data) {
|
|
|
|
|
+ $scope.historyList = data.content;
|
|
|
|
|
+ params.total(data.totalElements);
|
|
|
|
|
+ $defer.resolve(data.content);
|
|
|
|
|
+ }, function () {
|
|
|
|
|
+ toaster.pop('error', '获取数据失败')
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
$scope.cancel = function () {
|
|
$scope.cancel = function () {
|
|
|
$modalInstance.dismiss();
|
|
$modalInstance.dismiss();
|
|
@@ -484,7 +510,7 @@ define(['app/app'], function(app) {
|
|
|
Goods.offShelfGoodsByProvider({batchCodes:batchs, downMsg:$scope.errorMsg}, {}, function(map){
|
|
Goods.offShelfGoodsByProvider({batchCodes:batchs, downMsg:$scope.errorMsg}, {}, function(map){
|
|
|
if (map.success) {
|
|
if (map.success) {
|
|
|
toaster.pop('success', '下架成功');
|
|
toaster.pop('success', '下架成功');
|
|
|
- $scope.batchStatus = false;
|
|
|
|
|
|
|
+ $modalInstance.close();
|
|
|
} else {
|
|
} else {
|
|
|
toaster.pop('error', map.message);
|
|
toaster.pop('error', map.message);
|
|
|
}
|
|
}
|