|
|
@@ -34,7 +34,7 @@ define(['app/app'], function(app) {
|
|
|
$scope.soldOutProduct = function (batchArray) {
|
|
|
var modalInstance = $modal.open({
|
|
|
templateUrl: 'static/view/admin/modal/manage/ManageSoldOut.html',
|
|
|
- controller: 'soleOutCtrl',
|
|
|
+ controller: 'soleOutDetailCtrl',
|
|
|
resolve: {
|
|
|
batchArray: function () {
|
|
|
return angular.copy(batchArray);
|
|
|
@@ -48,8 +48,27 @@ define(['app/app'], function(app) {
|
|
|
})
|
|
|
};
|
|
|
|
|
|
+ // 日志点击事件
|
|
|
+ $scope.journalProduct = function (goods) {
|
|
|
+ var modalInstance = $modal.open({
|
|
|
+ templateUrl: 'static/view/admin/modal/manage/journal_modal.html',
|
|
|
+ controller: 'journalDetailCtrl',
|
|
|
+ resolve: {
|
|
|
+ goods: function () {
|
|
|
+ return angular.copy(goods);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ modalInstance.result.then(function (account) {
|
|
|
+
|
|
|
+ }, function () {
|
|
|
+
|
|
|
+ })
|
|
|
+ };
|
|
|
+
|
|
|
}]);
|
|
|
- app.register.controller('soleOutCtrl', ['$scope', 'batchArray', 'Goods', 'toaster', '$modalInstance', function($scope, batchArray, Goods, toaster, $modalInstance) {
|
|
|
+
|
|
|
+ app.register.controller('soleOutDetailCtrl', ['$scope', 'batchArray', 'Goods', 'toaster', '$modalInstance', function($scope, batchArray, Goods, toaster, $modalInstance) {
|
|
|
$scope.errorMsg = '';
|
|
|
$scope.otherMessage = '';
|
|
|
$scope.errorArray = ['价格异常', '图片违规', '基本信息有误', '短缺货'];
|
|
|
@@ -117,4 +136,64 @@ define(['app/app'], function(app) {
|
|
|
};
|
|
|
|
|
|
}]);
|
|
|
+
|
|
|
+ app.register.controller('journalDetailCtrl', ['$scope', 'goods', 'toaster', 'ngTableParams', 'BaseService', 'GoodsHistory', '$modalInstance', function($scope, goods, toaster, ngTableParams, BaseService, GoodsHistory, $modalInstance) {
|
|
|
+ $scope.tabs = 'basic';
|
|
|
+
|
|
|
+ // 日期选择框部分
|
|
|
+ $scope.condition = [{open: false},{open: false} ];
|
|
|
+ $scope.openDatePicker = function ($event, item, openParam) {
|
|
|
+ $event.preventDefault();
|
|
|
+ $event.stopPropagation();
|
|
|
+ openParam === 0 ? $scope.condition[1].open = false : $scope.condition[0].open = false;
|
|
|
+ item[openParam].open = !item[openParam].open;
|
|
|
+ };
|
|
|
+ $scope.onDateCondition = function (bool) {
|
|
|
+ if (bool === 1) {
|
|
|
+ if($scope.startDate && !$scope.endDate) {
|
|
|
+ var nowTime = new Date();
|
|
|
+ $scope.endDate = new Date(nowTime.getFullYear(), nowTime.getMonth(), nowTime.getDate());
|
|
|
+ }
|
|
|
+ if ($scope.startDate && $scope.endDate) {
|
|
|
+ if($scope.startDate.getTime() > $scope.endDate) {
|
|
|
+ $scope.endDate = new Date($scope.startDate.getTime() + 86400000)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (bool === 2) {
|
|
|
+ if ($scope.startDate && $scope.endDate) {
|
|
|
+ $scope.startDate = new Date($scope.endDate.getTime() - 86400000);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ $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 () {
|
|
|
+ $modalInstance.dismiss();
|
|
|
+ }
|
|
|
+ }]);
|
|
|
});
|