🐞fix(royalpay): 修复风控中心风控材料文件显示bug

master
xiao.tang 4 years ago
parent cf20ef1ff6
commit 34340abe32

@ -212,15 +212,15 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
params.startAmount = sectionArray[0];
params.endAmount = sectionArray[1];
}
$http.get('/risk/business/events', {params: params}).then(function (resp) {
$http.get('/risk/business/events', { params: params }).then(function (resp) {
$scope.riskEvents = resp.data.data;
$scope.pagination = resp.data.pagination;
});
$http.get('/risk/business/events/analysis/industry', {params: params}).then(function (resp) {
$http.get('/risk/business/events/analysis/industry', { params: params }).then(function (resp) {
$scope.riskEventsByIndustry = resp.data;
$scope.risk_industry_chart = chartParser.parse(industryAmount(industries), $scope.riskEventsByIndustry);
});
$http.get('/risk/business/events/analysis/amount', {params: params}).then(function (resp) {
$http.get('/risk/business/events/analysis/amount', { params: params }).then(function (resp) {
$scope.riskEventsByAmount = resp.data;
$scope.risk_amount_chart = chartParser.parse(intervalsAmount(), $scope.riskEventsByAmount);
});
@ -265,7 +265,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
}
}
},
column: {key: 'amount', name: 'industry'}
column: { key: 'amount', name: 'industry' }
}]
}
};
@ -309,7 +309,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
}
}
},
column: {key: 'amount', name: 'intervals'}
column: { key: 'amount', name: 'intervals' }
}]
}
};
@ -332,10 +332,10 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.riskEvent = riskEvent.data;
$scope.saveRemark = function () {
$http.put('/risk/business/' + $scope.riskEvent.risk_id + '/remark', {remark: $scope.riskEvent.remark}).then(function (resp) {
$http.put('/risk/business/' + $scope.riskEvent.risk_id + '/remark', { remark: $scope.riskEvent.remark }).then(function (resp) {
$scope.ctrl.editRemark = false;
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' });
})
};
@ -389,7 +389,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
type: 'error'
});
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' });
})
})
};
@ -405,21 +405,21 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
}).then(function () {
$http.put('/risk/business/commitWaitRiskStatus/' + $scope.riskEvent.risk_id + '/' + codeKey).then(function () {
$state.go('analysis_monitoring.risk_business');
commonDialog.alert({title: 'Success', content: '风控状态已修改为等待风控审核状态', type: 'success'});
commonDialog.alert({ title: 'Success', content: '风控状态已修改为等待风控审核状态', type: 'success' });
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' });
});
})
};
$scope.commitChargebackStatus = function (std) {
commonDialog.confirm({title: '确认操作', content: '当前操作不可逆,并会将风控项标记为办结状态,确认操作?'}).then(function () {
$http.put('/risk/business/chargebacks/' + $scope.riskEvent.risk_id + '/mark_status', {status: std}).then(function () {
commonDialog.confirm({ title: '确认操作', content: '当前操作不可逆,并会将风控项标记为办结状态,确认操作?' }).then(function () {
$http.put('/risk/business/chargebacks/' + $scope.riskEvent.risk_id + '/mark_status', { status: std }).then(function () {
$state.reload();
commonDialog.alert({title: 'Success', content: '修改成功', type: success})
commonDialog.alert({ title: 'Success', content: '修改成功', type: success })
}, function (res) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'})
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' })
})
})
@ -543,7 +543,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$http.put('/risk/business/partner/' + isValid, $scope.riskEvent).then(function () {
$state.reload('analysis_monitoring.risk_business.riskEvent_detail');
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' });
})
})
};
@ -560,7 +560,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$http.put(url).then(function () {
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
commonDialog.alert({ title: 'Error', content: resp.data.message, type: 'error' });
})
})
};
@ -581,7 +581,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
let file = files[i];
Upload.upload({
url: '/attachment/riskFiles',
data: {file: file}
data: { file: file }
}).then(function (resp) {
urls.push(resp.data.url);
}, function (resp) {
@ -672,6 +672,18 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$http.get('/risk/business/' + $scope.riskEvent.risk_id + '/all_material_info').then(function (resp) {
$scope.riskMaterial = resp.data;
const reg = /\.(png|jpg|gif|jpeg|bmp)$/
console.log()
$scope.riskMaterial.material.forEach(element => {
if (element.file) {
element.file.forEach((item, index) => {
const fileType = item.substring(item.lastIndexOf('.')).toLowerCase()
const flag = reg.test(item.substring(item.lastIndexOf('.')).toLowerCase())
element.file[index] = { isImg: flag, type: fileType, src: item }
})
}
})
console.log($scope.riskMaterial)
});
};
$scope.loadRiskMaterial();
@ -684,14 +696,18 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
if (files && files.length) {
let urls = [];
let value = 0;
const reg = /\.(png|jpg|gif|jpeg|bmp)$/
$scope.riskMaterial.material[index].fileProgressValue = 0;
for (let i = 0; i < files.length; i++) {
let file = files[i];
Upload.upload({
url: '/attachment/riskFiles',
data: {file: file}
data: { file: file }
}).then(function (resp) {
urls.push(resp.data.url);
const fileType = resp.data.url.substring(resp.data.url.lastIndexOf('.')).toLowerCase()
const flag = reg.test(resp.data.url.substring(resp.data.url.lastIndexOf('.')).toLowerCase())
urls.push({ isImg: flag, type: fileType, src: resp.data.url })
// urls.push(resp.data.url);
delete $scope.riskMaterial.material[index].fileProgressValue;
}, function (resp) {
delete $scope.riskMaterial.material[index].fileProgressValue;
@ -745,8 +761,8 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
}).then(function () {
// $scope.riskEvent.result_type = auditType;
$http.put(url, $scope.riskEvent).then(function (resp) {
commonDialog.alert({title: 'Success', content: "材料已通过!"});
$state.go('^', {}, {reload: true});
commonDialog.alert({ title: 'Success', content: "材料已通过!" });
$state.go('^', {}, { reload: true });
}, function (resp) {
commonDialog.alert({
title: 'Error',
@ -758,11 +774,11 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
} else if (auditType === 4) {
url = '/risk/business/' + $scope.riskEvent.risk_id + '/refuse';
//warningMessageHTML = '是否确定<span style="color: red; font-weight: bolder; font-size: 20px;">拒绝</span>该材料?'
commonDialog.inputText({title: 'Input Refuse Description', size: 'lg'}).then(function (text) {
commonDialog.inputText({ title: 'Input Refuse Description', size: 'lg' }).then(function (text) {
$scope.riskEvent.refuse_description = text;
$http.put(url, $scope.riskEvent).then(function () {
commonDialog.alert({title: 'Success', content: "材料已拒绝!"});
$state.go('^', {}, {reload: true});
commonDialog.alert({ title: 'Success', content: "材料已拒绝!" });
$state.go('^', {}, { reload: true });
}, function (resp) {
commonDialog.alert({
title: 'Error',
@ -785,16 +801,16 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.mailTemplate = mailTemplate;
$scope.royapayOrderTypes = royalpayOrderTypesMap;
$scope.warningOrderTypes = warningOrderTypesMap;
$scope.materials = [{key: 0, value: ""}];
$scope.materials = [{ key: 0, value: "" }];
$scope.canMinus = false;
$scope.riskEvent = {};
$scope.searchForChargeback = function () {
$scope.riskEvent.order_ids = null;
let channelOrderId = $scope.riskEvent.channel_order_id;
$http.get('/risk/business/chargeback_orders', {params: {channel_order_id: channelOrderId}}).then(function (res) {
$http.get('/risk/business/chargeback_orders', { params: { channel_order_id: channelOrderId } }).then(function (res) {
$scope.channel_orders = res.data;
}, function (res) {
commonDialog.alert({type: 'error', title: 'Error', content: res.data.message})
commonDialog.alert({ type: 'error', title: 'Error', content: res.data.message })
});
};
$scope.chooseOrderForChargeback = function (chargebackOrder) {
@ -821,7 +837,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.increase = function ($index) {
$scope.materials.splice($index + 1, 0,
{key: new Date().getTime(), value: ""}); // 用时间戳作为每个item的key
{ key: new Date().getTime(), value: "" }); // 用时间戳作为每个item的key
// 增加新的input后允许删除
$scope.canMinus = true;
};
@ -899,7 +915,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
content: 'Register new riskEvent successfully',
type: 'success'
});
$state.go('^', {}, {reload: true});
$state.go('^', {}, { reload: true });
}, function (resp) {
saveRiskBtn.innerHTML = saveRiskBtnInnerHtmlBak;
saveRiskBtn.disabled = false;
@ -913,7 +929,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$scope.partnerParam = {};
$scope.loadParnters = function () {
$scope.partnerParam.sub_merchant_id = $scope.riskEvent.sub_merchant_id;
$http.get('/risk/business/partners', {params: $scope.partnerParam}).then(function (resp) {
$http.get('/risk/business/partners', { params: $scope.partnerParam }).then(function (resp) {
$scope.partners = resp.data;
if ($scope.partners != null && $scope.partners.length > 0) {
// 由于通用号调单可能无法提供商户client_moniker,所以后台无法查询到订单

@ -9,18 +9,15 @@
</style>
<div class="panel panel-default" ng-if="fileLength != 0">
<div class="panel-heading">Audit Files &nbsp;&nbsp;&nbsp;
<a class="btn-group btn btn-success"
ng-href="{{downloadAsZip()}}"
target="_blank">
<a class="btn-group btn btn-success" ng-href="{{downloadAsZip()}}" target="_blank">
<i class="fa fa-cloud-download">一键下载</i>
</a>
<a class="btn-group btn btn-success pull-right"
ng-if="(riskEvent.result_type == 2 || riskEvent.result_type == 1) && ('10000000000'|withRole)"
ng-click="auditMaterial(3)">通过
ng-if="(riskEvent.result_type == 2 || riskEvent.result_type == 1) && ('10000000000'|withRole)"
ng-click="auditMaterial(3)">通过
</a>
<a class="btn-group btn btn-warning pull-right"
ng-if="riskEvent.result_type == 2 && ('10000000000'|withRole)"
ng-click="auditMaterial(4)" style="margin: 0 10px">打回
<a class="btn-group btn btn-warning pull-right" ng-if="riskEvent.result_type == 2 && ('10000000000'|withRole)"
ng-click="auditMaterial(4)" style="margin: 0 10px">打回
</a>
</div>
<div class="panel-body">
@ -42,27 +39,28 @@
</div>
<div class="col-sm-12">
<div class="col-xs-12">
<button class="btn btn-primary"
type="button"
ng-if="uploadShowFlag && ('10000000000'|withRole)"
ngf-select="uploadFile($files, $index)"
ngf-multiple="true">
<button class="btn btn-primary" type="button"
ng-if="uploadShowFlag && ('10000000000'|withRole)"
ngf-select="uploadFile($files, $index)" ngf-multiple="true">
<i class="fa fa-upload"></i> Upload
</button>
</div>
&nbsp;&nbsp;<br>
<div class="col-xs-12">
<uib-progressbar value="item.fileProgressValue"
type="success"
animate="true"
ng-if="item.fileProgressValue"
max="100"
ng-if="uploadShowFlag"
>{{item.fileProgressValue}}%</uib-progressbar>
<uib-progressbar value="item.fileProgressValue" type="success" animate="true"
ng-if="item.fileProgressValue" max="100" ng-if="uploadShowFlag">
{{item.fileProgressValue}}%</uib-progressbar>
<img class="col-xs-3 logo-width"
ng-repeat="url in (item.file) track by $index"
ng-src="{{url}}">
<div ng-repeat="file in (item.file) track by $index">
<img ng-if="file.isImg" class="col-xs-3 logo-width" ng-src="{{file.src}}">
<a ng-if="!file.isImg" href="{{file.src}}">
<i ng-if="file.type === '.zip'" class="fa fa-file-archive-o" aria-hidden="true"></i>
<i ng-if="file.type === '.pdf'" class="fa fa-file-pdf-o" aria-hidden="true"></i>
<i ng-if="file.type !== '.pdf' && file.type !== '.zip'" class="fa fa-file-text"
aria-hidden="true"></i>
<span style="font-size: 12px">download</span>
</a>
</div>
</div>
</div>
</div>
@ -70,12 +68,9 @@
<div class="form-group">
<label class="control-label col-sm-2">Description</label>
<div class="col-sm-10">
<textarea class="form-control" required
ng-model="riskMaterial.description"
placeholder="No more than 500"
name="description"
ng-disabled="!uploadShowFlag"
maxlength="500"></textarea>
<textarea class="form-control" required ng-model="riskMaterial.description"
placeholder="No more than 500" name="description" ng-disabled="!uploadShowFlag"
maxlength="500"></textarea>
</div>
</div>
@ -83,15 +78,10 @@
</form>
</div>
<div class="panel-footer">
<a role="button" id="test-btn"
ui-sref="^.^"
class="btn btn-info">返回
<a role="button" id="test-btn" ui-sref="^.^" class="btn btn-info">返回
</a>
<button
class="btn btn-success"
ng-disabled="!uploadShowFlag || (!riskMaterial.description)"
ng-if="uploadShowFlag && ('10000000000'|withRole)"
ng-click="submit(uploadForm);">Submit</button>
<button class="btn btn-success" ng-disabled="!uploadShowFlag || (!riskMaterial.description)"
ng-if="uploadShowFlag && ('10000000000'|withRole)" ng-click="submit(uploadForm);">Submit</button>
</div>
</div>
</div>
Loading…
Cancel
Save