From 0fea884bd1e8a3dec08108bffedc86853e96049a Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Wed, 21 Mar 2018 16:04:08 +0800 Subject: [PATCH] update --- src/main/ui/static/sys/contract.js | 31 +++++++++++++++++++ .../static/sys/templates/contract_sign.html | 9 ++++++ 2 files changed, 40 insertions(+) diff --git a/src/main/ui/static/sys/contract.js b/src/main/ui/static/sys/contract.js index 2ce9fba49..76425cae3 100644 --- a/src/main/ui/static/sys/contract.js +++ b/src/main/ui/static/sys/contract.js @@ -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; }); \ No newline at end of file diff --git a/src/main/ui/static/sys/templates/contract_sign.html b/src/main/ui/static/sys/templates/contract_sign.html index c8f55c464..ea28a6db7 100644 --- a/src/main/ui/static/sys/templates/contract_sign.html +++ b/src/main/ui/static/sys/templates/contract_sign.html @@ -1,4 +1,13 @@ + +