parent
9b6b36685a
commit
c82400165e
@ -0,0 +1,102 @@
|
|||||||
|
define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], function (angular) {
|
||||||
|
'use strict';
|
||||||
|
var app = angular.module('RiskManagement', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload']);
|
||||||
|
app.config(['$stateProvider', function ($stateProvider) {
|
||||||
|
$stateProvider.state('analysis_monitoring.risk_manager', {
|
||||||
|
url: '/risk/manage',
|
||||||
|
templateUrl: '/static/risk/templates/risk.html',
|
||||||
|
controller: 'RiskManageCtrl',
|
||||||
|
}).state('analysis_monitoring.risk_detail', {
|
||||||
|
url: '/detail',
|
||||||
|
templateUrl: '/static/risk/templates/risk_detail.html',
|
||||||
|
controller: 'RiskDetailCtrl',
|
||||||
|
params : {
|
||||||
|
param:null
|
||||||
|
}
|
||||||
|
}).state('vipcustomers.detail', {
|
||||||
|
url: '/{vip_code}/detail',
|
||||||
|
templateUrl: '/static/payment/vipcustomer/templates/vipcustomer_detail.html',
|
||||||
|
controller: 'vipCustomerDetailCtrl',
|
||||||
|
}).state('vipcustomers.edit', {
|
||||||
|
url: '/{vip_code}/edit',
|
||||||
|
templateUrl: '/static/payment/vipcustomer/templates/vipcustomer_edit.html',
|
||||||
|
controller: 'vipCustomerEditCtrl',
|
||||||
|
resolve: {
|
||||||
|
vipcustomer: ['$http', '$stateParams', function ($http, $stateParams) {
|
||||||
|
return $http.get('/partner/vip/' + $stateParams.vip_code);
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}]);
|
||||||
|
app.controller('RiskManageCtrl', ['$scope', '$http','$state', function ($scope, $http,$state){
|
||||||
|
$scope.params = {};
|
||||||
|
$scope.loadRecords = function () {
|
||||||
|
var params = angular.copy($scope.params);
|
||||||
|
$http.get('/sys/risk/records', {params: params}).then(function (resp) {
|
||||||
|
$scope.records = resp.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
$scope.loadRecords(1);
|
||||||
|
$scope.jumpDetail = function (record_id,client_moniker) {
|
||||||
|
var param = {};
|
||||||
|
param.client_moniker = client_moniker;
|
||||||
|
param.record_id = record_id;
|
||||||
|
$state.go('analysis_monitoring.risk_detail',{param:param});
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
app.controller('RiskDetailCtrl', ['$scope', '$http', '$stateParams','Upload', 'commonDialog', function ($scope, $http,$stateParams, Upload, commonDialog) {
|
||||||
|
$scope.params = {};
|
||||||
|
$scope.loadOrders = function () {
|
||||||
|
|
||||||
|
$http.get('/sys/risk/orders/' + $stateParams.param.record_id).then(function (resp) {
|
||||||
|
$scope.orders = resp.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
$scope.loadOrders(1);
|
||||||
|
|
||||||
|
$scope.edit = function () {
|
||||||
|
|
||||||
|
}
|
||||||
|
}]);
|
||||||
|
app.controller('vipCustomerDetailCtrl', ['$scope', '$http','$filter','$state', '$uibModal', 'commonDialog', 'vipcustomer', function ($scope, $http,$filter, $state, $uibModal, commonDialog, vipcustomer) {
|
||||||
|
$scope.vipcustomer = vipcustomer.data;
|
||||||
|
$scope.params = {vip_customer_id:$scope.vipcustomer.vip_customer_id};
|
||||||
|
$scope.loadVipOrders = function () {
|
||||||
|
var params = angular.copy($scope.params);
|
||||||
|
$http.get('/partner/vip/payment/orders', {params: params}).then(function (resp) {
|
||||||
|
$scope.vip_orders = resp.data.data;
|
||||||
|
$scope.pagination = resp.data.pagination;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
$scope.loadVipOrders();
|
||||||
|
|
||||||
|
}]);
|
||||||
|
app.controller('vipCustomerEditCtrl', ['$scope', '$http', '$state', 'Upload', 'commonDialog', 'vipcustomer',
|
||||||
|
function ($scope, $http, $state, Upload, commonDialog, vipcustomer) {
|
||||||
|
$scope.vipcustomer = vipcustomer.data;
|
||||||
|
$scope.updateVipCustomer = function (form) {
|
||||||
|
if (form.$invalid) {
|
||||||
|
angular.forEach(form, function (item, key) {
|
||||||
|
if (key.indexOf('$') < 0) {
|
||||||
|
item.$dirty = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$http.put('/partner/vip/' + $scope.vipcustomer.vip_code, $scope.vipcustomer).then(function () {
|
||||||
|
commonDialog.alert({
|
||||||
|
title: 'Success',
|
||||||
|
content: 'Update vip customer information successfully',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
$scope.loadVipCustomers();
|
||||||
|
$state.go('^.detail', {vip_code: $scope.vipcustomer.vip_code}, {reload: true});
|
||||||
|
}, function (resp) {
|
||||||
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
}]);
|
||||||
|
|
||||||
|
return app;
|
||||||
|
});
|
@ -0,0 +1,42 @@
|
|||||||
|
<div ui-view>
|
||||||
|
<section class="content-header">
|
||||||
|
<h1>Risk Manager</h1>
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li><i class="fa fa-gift"></i> Risk</li>
|
||||||
|
<li class="active">Risk Manager</li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
<section class="content">
|
||||||
|
<div class="box box-default">
|
||||||
|
<div class="box-header">Records</div>
|
||||||
|
<div class="box-body table-responsive">
|
||||||
|
<table class="table table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Client Moniker</th>
|
||||||
|
<th>Create Time</th>
|
||||||
|
<th>Expiy Time</th>
|
||||||
|
<th>Risk Types</th>
|
||||||
|
<th>Risk Counts</th>
|
||||||
|
<th>Operation</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="record in records">
|
||||||
|
<td>{{record.client_moniker}}</td>
|
||||||
|
<td>{{record.create_time}}</td>
|
||||||
|
<td>{{record.expiry_date}}</td>
|
||||||
|
<td>{{record.risk_types}}</td>
|
||||||
|
<td>{{record.risk_counts}}</td>
|
||||||
|
<td>
|
||||||
|
<a class="text-primary" role="button" title="Detail" ng-click="jumpDetail(record.id,record.client_moniker)">
|
||||||
|
<i class="fa fa-search" ></i>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
@ -0,0 +1,40 @@
|
|||||||
|
<div ui-view>
|
||||||
|
<section class="content-header">
|
||||||
|
<h1>Risk Record</h1>
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li><i class="fa fa-gift"></i> Risk</li>
|
||||||
|
<li class="fa fa-gift">Risk Manager</li>
|
||||||
|
<li class="active">Risk records</li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
<section class="content">
|
||||||
|
<div class="box box-default">
|
||||||
|
<div class="box-header">Records Reference</div>
|
||||||
|
<div class="box-body table-responsive">
|
||||||
|
<table class="table table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Order Id</th>
|
||||||
|
<th>Amount</th>
|
||||||
|
<th>Channel</th>
|
||||||
|
<th>Risk Types</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="order in orders">
|
||||||
|
<td>{{order.order_id}}</td>
|
||||||
|
<td>{{order.amount}}</td>
|
||||||
|
<td>{{order.channel}}</td>
|
||||||
|
<td>{{order.risk_types}}</td>
|
||||||
|
<td>
|
||||||
|
<a class="text-primary" role="button" title="Detail" ui-sref=".detail({record_id:record.record_id})">
|
||||||
|
<i class="fa fa-search" ></i>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
Loading…
Reference in new issue