alipay风控

master
james.zhao 6 years ago
parent 7f16d92781
commit bd3aec323f

@ -542,6 +542,36 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.orderTypes = orderTypesMap; $scope.orderTypes = orderTypesMap;
$scope.royapayOrderTypes = royalpayOrderTypesMap; $scope.royapayOrderTypes = royalpayOrderTypesMap;
$scope.warningOrderTypes = warningOrderTypesMap; $scope.warningOrderTypes = warningOrderTypesMap;
$scope.materials = [{key: 0, value: ""}];
$scope.canMinus = false;
$scope.increase = function($index) {
$scope.materials.splice($index + 1, 0,
{key: new Date().getTime(), value: ""}); // 用时间戳作为每个item的key
// 增加新的input后允许删除
$scope.canMinus = true;
}
$scope.decrease = function($index) {
// 如果input大于1删除
if ($scope.materials.length > 1) {
$scope.materials.splice($index, 1);
}
// 如果回复数为1不允许删除
if ($scope.materials.length == 1) {
$scope.canMinus = false;
}
}
var array=new Array();
$scope.combineMaterials = function() {
for (var i = 0; i < $scope.materials.length; i++) {
var cr = {};
cr['question'+(i+1)] = $scope.materials[i].value;
array[i] = cr;
}
console.log(JSON.stringify(array));
return JSON.stringify(array);
}
$scope.save = function(form) { $scope.save = function(form) {
if (form.$invalid) { if (form.$invalid) {
@ -565,6 +595,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.riskEvent.receive_email_date = $filter('date')($scope.riskEvent.receive_email_date, 'yyyy-MM-dd'); $scope.riskEvent.receive_email_date = $filter('date')($scope.riskEvent.receive_email_date, 'yyyy-MM-dd');
$scope.riskEvent.alipay_materials = $scope.combineMaterials();
$http.post('/risk/business/events', $scope.riskEvent).then(function (resp) { $http.post('/risk/business/events', $scope.riskEvent).then(function (resp) {
commonDialog.alert({ commonDialog.alert({
title: 'Success', title: 'Success',

@ -209,6 +209,30 @@
</textarea> </textarea>
</div> </div>
</div> </div>
<div class="form-group"ng-repeat="material in materials"
ng-if="riskEvent.order_type == 2"
ng-class="{'has-error':riskEventForm.client_moniker.$invalid && riskEventForm.client_moniker.$dirty}">
<label class="control-label col-sm-2"
for="material{{$index+1}}">Material{{$index + 1}}
</label>
<div class="col-sm-8">
<input class="form-control"
ng-model="material.value"
type="text"
name="material{{$index+1}}"
id="material{{$index+1}}"
required
ng-pattern="/^[a-zA-Z0-9]+$/"
>
</div>
<div class="col-sm-2">
<a class="text-success" ng-click="increase($index)"><i class="fa fa-plus-circle" style="width: 30px"></i></a>
<a class="text-danger" ng-click="decrease($index)" ng-show="canMinus"><i class="fa fa-minus-circle" style="width: 30px"></i></a>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save