|
|
|
@ -9,6 +9,10 @@ define(['angular'], function (angular) {
|
|
|
|
|
url: '/contract',
|
|
|
|
|
templateUrl: '/static/sys/templates/contract_sign.html',
|
|
|
|
|
controller: 'contractAnalysisCtrl'
|
|
|
|
|
}).state('rate_warnings', {
|
|
|
|
|
url: '/rate_warnings',
|
|
|
|
|
templateUrl: '/static/analysis/templates/settle_warnings.html',
|
|
|
|
|
controller: 'settleWarningsCtrl'
|
|
|
|
|
})
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('contractAnalysisCtrl', ['$scope', '$http', '$state', '$filter', 'commonDialog', function ($scope, $http, $state, $filter, commonDialog) {
|
|
|
|
@ -19,5 +23,32 @@ define(['angular'], function (angular) {
|
|
|
|
|
};
|
|
|
|
|
$scope.getContractAnalysis();
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
app.controller('settleWarningsCtrl', ['$scope', '$http', '$filter', 'commonDialog', function ($scope, $http, $filter, commonDialog) {
|
|
|
|
|
$scope.loadWarnings = function () {
|
|
|
|
|
$http.get('/manage/clearing/rate_warnings').then(function (resp) {
|
|
|
|
|
$scope.warning = resp.data;
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
$scope.loadWarnings();
|
|
|
|
|
$scope.generateRate = function (client) {
|
|
|
|
|
commonDialog.confirm({title: 'Confirm Required', content: '根据上季度总交易额自动计算下周期费率,确定执行?'}).then(function () {
|
|
|
|
|
$http.put('/manage/clearing/clients/' + client.client_moniker + '/auto_rate').then(function (resp) {
|
|
|
|
|
var content = 'New Rate value=' + resp.data.rate_value + '; expiry_time=' + $filter('date')(resp.data.expiry_time, 'dd/MMM/yyyy');
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
type: 'success',
|
|
|
|
|
title: 'New Rate Generated',
|
|
|
|
|
content: content
|
|
|
|
|
}).then(function () {
|
|
|
|
|
$scope.loadWarnings();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message});
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return app;
|
|
|
|
|
});
|