|
|
|
@ -21,7 +21,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('appActListCtrl', ['$scope', '$state', '$http','commonDialog', function ($scope, $state, $http,commonDialog) {
|
|
|
|
|
app.controller('appActListCtrl', ['$scope', '$state', '$http','commonDialog','$filter', function ($scope, $state, $http,commonDialog,$filter) {
|
|
|
|
|
$scope.pagination = {};
|
|
|
|
|
$scope.params = {};
|
|
|
|
|
$scope.loadActAppList = function (page) {
|
|
|
|
@ -33,7 +33,8 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
$scope.publishedOrIsValid = function (act) {
|
|
|
|
|
$scope.act = angular.copy(act);
|
|
|
|
|
$scope.act = {};
|
|
|
|
|
$scope.act.act_id = act.act_id;
|
|
|
|
|
$scope.act.is_valid = !act.is_valid;
|
|
|
|
|
$http.put('/manager/app/act/' + $scope.act.act_id, $scope.act).then(function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Success', content: '修改成功', type: 'success'});
|
|
|
|
@ -45,8 +46,9 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
|
|
|
|
|
$scope.loadActAppList(1);
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('appActNewCtrl', ['$rootScope', '$scope', '$http', 'commonDialog','$state', function ($rootScope, $scope, $http, commonDialog,$state) {
|
|
|
|
|
app.controller('appActNewCtrl', ['$rootScope', '$scope', '$http', 'commonDialog','$state','$filter', function ($rootScope, $scope, $http, commonDialog,$state,$filter) {
|
|
|
|
|
$scope.actDetail = {};
|
|
|
|
|
$scope.ctrl = {dateInput: false};
|
|
|
|
|
$scope.submit = function (form) {
|
|
|
|
|
$scope.errmsg = null;
|
|
|
|
|
if (form.$invalid) {
|
|
|
|
@ -57,6 +59,12 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ($scope.actDetail.active_date) {
|
|
|
|
|
$scope.actDetail.active_date = $filter('date')($scope.actDetail.active_date, 'yyyy-MM-dd');
|
|
|
|
|
}
|
|
|
|
|
if ($scope.actDetail.expire_date) {
|
|
|
|
|
$scope.actDetail.expire_date = $filter('date')($scope.actDetail.expire_date, 'yyyy-MM-dd');
|
|
|
|
|
}
|
|
|
|
|
$http.put('/manager/app/act/new', $scope.actDetail).then(function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Success', content: '新增成功', type: 'success'});
|
|
|
|
|
$state.go('^.detail',{act_id:resp.data.act_id},{reload:true});
|
|
|
|
@ -65,9 +73,18 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('appActDetailCtrl', ['$rootScope', '$scope', '$http', 'commonDialog', 'actDetail','$state', function ($rootScope, $scope, $http, commonDialog,actDetail,$state) {
|
|
|
|
|
app.controller('appActDetailCtrl', ['$rootScope', '$scope', '$http', 'commonDialog', 'actDetail','$state','$filter', function ($rootScope, $scope, $http, commonDialog,actDetail,$state,$filter) {
|
|
|
|
|
$scope.actDetail = actDetail.data;
|
|
|
|
|
$scope.ctrl = {dateInput: false};
|
|
|
|
|
$scope.actDetail.active_date = new Date($scope.actDetail.active_date);
|
|
|
|
|
$scope.actDetail.expire_date = new Date($scope.actDetail.expire_date);
|
|
|
|
|
$scope.submit = function () {
|
|
|
|
|
if ($scope.actDetail.active_date) {
|
|
|
|
|
$scope.actDetail.active_date = $filter('date')($scope.actDetail.active_date, 'yyyy-MM-dd');
|
|
|
|
|
}
|
|
|
|
|
if ($scope.actDetail.expire_date) {
|
|
|
|
|
$scope.actDetail.expire_date = $filter('date')($scope.actDetail.expire_date, 'yyyy-MM-dd');
|
|
|
|
|
}
|
|
|
|
|
$http.put('/manager/app/act/' + $scope.actDetail.act_id, $scope.actDetail).then(function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Success', content: '修改成功', type: 'success'});
|
|
|
|
|
$state.reload();
|
|
|
|
|