|
|
|
|
@ -18,7 +18,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
|
"2": "BD已提交材料,等待审核",
|
|
|
|
|
"3": "材料审核通过",
|
|
|
|
|
"4": "材料审核不通过,已打回",
|
|
|
|
|
"5": "已处理()",
|
|
|
|
|
"5": "已处理",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var emailStatusMap = {
|
|
|
|
|
@ -55,15 +55,19 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
app.controller('riskBusinessCtrl', ['$scope', '$state', '$http', '$uibModal', 'commonDialog',
|
|
|
|
|
function ($scope, $state, $http, $uibModal, commonDialog) {
|
|
|
|
|
app.controller('riskBusinessCtrl', ['$scope', '$state', '$http', '$uibModal', '$filter', 'commonDialog', 'industryMap',
|
|
|
|
|
function ($scope, $state, $http, $uibModal, $filter, commonDialog, industryMap) {
|
|
|
|
|
$scope.orderTypes = orderTypesMap;
|
|
|
|
|
$scope.resultTypes = resultTypesMap;
|
|
|
|
|
$scope.industries = industryMap.configs();
|
|
|
|
|
$scope.pagination = {};
|
|
|
|
|
$scope.params = {};
|
|
|
|
|
|
|
|
|
|
$scope.loadRiskEvents = function (page) {
|
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
|
|
params.page = page || $scope.pagination.page || 1;
|
|
|
|
|
params.replyEmailDate = $filter('date')(params.replyEmailDate, 'yyyy-MM-dd');
|
|
|
|
|
params.receiveEmailDate = $filter('date')(params.receiveEmailDate, 'yyyy-MM-dd');
|
|
|
|
|
$http.get('/risk/business/events', {params: params}).then(function (resp) {
|
|
|
|
|
$scope.riskEvents = resp.data.data;
|
|
|
|
|
$scope.pagination = resp.data.pagination;
|
|
|
|
|
@ -80,7 +84,14 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
|
$scope.orderTypes = orderTypesMap;
|
|
|
|
|
|
|
|
|
|
$scope.riskEvent = riskEvent.data;
|
|
|
|
|
|
|
|
|
|
var orderChannel = 'enable_';
|
|
|
|
|
if ($scope.riskEvent.order_type == 1) {
|
|
|
|
|
orderChannel += 'wechat';
|
|
|
|
|
} else if ($scope.riskEvent.order_type == 2) {
|
|
|
|
|
orderChannel += 'alipay';
|
|
|
|
|
} else {
|
|
|
|
|
orderChannel = null;
|
|
|
|
|
}
|
|
|
|
|
// 编辑表格的数据保存对象,重新从源数据复制,从而取消保存操作时不会更新视图
|
|
|
|
|
$scope.riskEventEdit = angular.copy(riskEvent.data);
|
|
|
|
|
|
|
|
|
|
@ -92,6 +103,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
|
|
|
|
|
|
// 商户信息
|
|
|
|
|
$scope.clientInfo = $scope.riskEvent.clientInfo;
|
|
|
|
|
if (orderChannel != null)
|
|
|
|
|
$scope.enableChannel = $scope.clientInfo[orderChannel];
|
|
|
|
|
|
|
|
|
|
// 控制编辑表格的显示
|
|
|
|
|
$scope.editFlag = false;
|
|
|
|
|
@ -100,8 +113,10 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
|
// 如果是在编辑状态,需要将日期转换为date类型(前端控件需要)
|
|
|
|
|
// 如果是在非编辑状态,需要将日期转换为yyyy-MM-dd格式
|
|
|
|
|
if ($scope.editFlag) {
|
|
|
|
|
$scope.riskEventEdit.receive_email_date = new Date($scope.riskEventEdit.receive_email_date.replace(/-/g, "/"));
|
|
|
|
|
$scope.riskEventEdit.reply_email_date = new Date($scope.riskEventEdit.reply_email_date.replace(/-/g, "/"));
|
|
|
|
|
} else {
|
|
|
|
|
$scope.riskEvent.receive_email_date = $filter('date')($scope.riskEvent.receive_email_date, 'yyyy-MM-dd');
|
|
|
|
|
$scope.riskEvent.reply_email_date = $filter('date')($scope.riskEvent.reply_email_date, 'yyyy-MM-dd');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
@ -118,6 +133,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
|
|
|
|
|
|
// 保存时需要重新将日期转换为yyyy-MM-dd格式传入后端
|
|
|
|
|
$scope.riskEventEdit.reply_email_date = $filter('date')($scope.riskEventEdit.reply_email_date, 'yyyy-MM-dd');
|
|
|
|
|
$scope.riskEventEdit.receive_email_date = $filter('date')($scope.riskEventEdit.receive_email_date, 'yyyy-MM-dd');
|
|
|
|
|
$http.put('/risk/business/events', $scope.riskEventEdit).then(function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
@ -134,14 +150,40 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 关停渠道
|
|
|
|
|
$scope.updateChannel = function (orderType) {
|
|
|
|
|
/**
|
|
|
|
|
* 关停渠道
|
|
|
|
|
* @param orderType 调单类型
|
|
|
|
|
* @param channelFlag
|
|
|
|
|
* @param temporaryFlag 是否临时关闭
|
|
|
|
|
|
|
|
|
|
$scope.updateChannel = function (orderType, channelFlag, temporaryFlag) {
|
|
|
|
|
var channel;
|
|
|
|
|
if (orderType == "1")
|
|
|
|
|
channel = 'wechat';
|
|
|
|
|
else if (orderType == "2")
|
|
|
|
|
channel = 'alipay';
|
|
|
|
|
$http.put('/sys/partners/' + $scope.riskEvent.client_moniker + '/channels/' + channel + '/permission', {allow: channelFlag}).then(function () {
|
|
|
|
|
|
|
|
|
|
$state.reload('analysis_monitoring.riskEvent_detail');
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Failed to change ' + channel + ' channel permission status',
|
|
|
|
|
content: resp.data.message,
|
|
|
|
|
type: 'error'
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
};*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.updateChannel = function (orderType, channelFlag, temporaryFlag) {
|
|
|
|
|
var channel;
|
|
|
|
|
if (orderType == "1")
|
|
|
|
|
channel = 'wechat';
|
|
|
|
|
else if (orderType == "2")
|
|
|
|
|
channel = 'alipay';
|
|
|
|
|
$http.put('/sys/partners/' + $scope.riskEvent.client_moniker + '/channels/' + channel + '/permission', {allow: $scope.clientInfo['enable_' + channel]}).then(function () {
|
|
|
|
|
$scope.riskEvent.temporary_close_channel = temporaryFlag;
|
|
|
|
|
$http.put('/risk/business/channel/' + channel + '/permission/' + channelFlag, $scope.riskEvent).then(function () {
|
|
|
|
|
|
|
|
|
|
$state.reload('analysis_monitoring.riskEvent_detail');
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
@ -153,20 +195,13 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 关停商户
|
|
|
|
|
$scope.updateClient = function(isValid) {
|
|
|
|
|
if (isValid) {
|
|
|
|
|
$http.put('/sys/partners/' + $scope.riskEvent.client_moniker + '/revert').then(function () {
|
|
|
|
|
$state.reload('analysis_monitoring.riskEvent_detail');
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
$http.delete('/sys/partners/' + $scope.riskEvent.client_moniker).then(function () {
|
|
|
|
|
$state.reload('analysis_monitoring.riskEvent_detail');
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
$scope.updateClient = function(isValid, temporaryFlag) {
|
|
|
|
|
$scope.riskEvent.temporary_close_merchant = temporaryFlag;
|
|
|
|
|
$http.put('/risk/business/partner/' + isValid, $scope.riskEvent).then(function () {
|
|
|
|
|
$state.reload('analysis_monitoring.riskEvent_detail');
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -191,16 +226,62 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
|
|
|
|
|
|
app.controller('auditMaterialCtrl', ['$scope', '$state', '$http', '$uibModal', '$filter', 'commonDialog',
|
|
|
|
|
function ($scope, $state, $http, $uibModal, $filter, commonDialog) {
|
|
|
|
|
|
|
|
|
|
// 一键下载功能
|
|
|
|
|
$scope.downloadAsZip = function () {
|
|
|
|
|
var url = '/risk/business/' + $scope.riskEvent.risk_id + '/download/materialsAsZIP';
|
|
|
|
|
return url;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 加载提交材料
|
|
|
|
|
$scope.fileObject = {};
|
|
|
|
|
$scope.loadRiskMaterial = function() {
|
|
|
|
|
$http.get('/risk/business/' + $scope.riskEvent.risk_id + '/material').then(function(resp) {
|
|
|
|
|
var riskMaterial = resp.data;
|
|
|
|
|
for (var i = 1; i <= 10; i++) {
|
|
|
|
|
var key = "file" + i;
|
|
|
|
|
if (riskMaterial[key + '_url'] != null)
|
|
|
|
|
$scope.fileObject[key] = riskMaterial[key + '_url'];
|
|
|
|
|
}
|
|
|
|
|
$scope.fileLength = Object.keys($scope.fileObject).length;
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
$scope.loadRiskMaterial();
|
|
|
|
|
|
|
|
|
|
// 材料审核
|
|
|
|
|
$scope.auditMaterial = function(auditType) {
|
|
|
|
|
$scope.riskEvent.result_type = auditType;
|
|
|
|
|
// 后面把url当做参数传递进去,删除重复的代码
|
|
|
|
|
if (auditType == 3) {
|
|
|
|
|
$http.put('/risk/business/events', $scope.riskEvent).then(function (resp) {
|
|
|
|
|
$state.go('^', {}, {reload: true});
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Error',
|
|
|
|
|
content: resp.data.message,
|
|
|
|
|
type: 'error'
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else if (auditType == 4) {
|
|
|
|
|
$http.put('/risk/business/' + $scope.riskEvent.risk_id + '/refuse').then(function(resp) {
|
|
|
|
|
$state.go('^', {}, {reload: true});
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Error',
|
|
|
|
|
content: resp.data.message,
|
|
|
|
|
type: 'error'
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
app.controller('newRiskEventCtrl', ['$scope', '$state', '$http', '$uibModal', '$filter', 'commonDialog',
|
|
|
|
|
function ($scope, $state, $http, $uibModal, $filter, commonDialog) {
|
|
|
|
|
|
|
|
|
|
$scope.today = new Date();
|
|
|
|
|
$scope.orderTypes = orderTypesMap;
|
|
|
|
|
|
|
|
|
|
$scope.save = function(form) {
|
|
|
|
|
@ -213,11 +294,15 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 默认设置邮件回复截止日期为七天后
|
|
|
|
|
var replyDeadline = new Date();
|
|
|
|
|
if ($scope.riskEvent.receive_email_date == null)
|
|
|
|
|
$scope.riskEvent.receive_email_date = new Date();
|
|
|
|
|
// 默认设置邮件回复截止日期为收到邮件的七天后
|
|
|
|
|
var replyDeadline = angular.copy($scope.riskEvent.receive_email_date);
|
|
|
|
|
replyDeadline.setDate(replyDeadline.getDate() + 7);
|
|
|
|
|
$scope.riskEvent.reply_email_date = $filter('date')(replyDeadline, 'yyyy-MM-dd');
|
|
|
|
|
|
|
|
|
|
$scope.riskEvent.receive_email_date = $filter('date')($scope.riskEvent.receive_email_date, 'yyyy-MM-dd');
|
|
|
|
|
|
|
|
|
|
$http.post('/risk/business/events', $scope.riskEvent).then(function (resp) {
|
|
|
|
|
commonDialog.alert({
|
|
|
|
|
title: 'Success',
|
|
|
|
|
|