diff --git a/src/main/ui/static/analysis/risk_business.js b/src/main/ui/static/analysis/risk_business.js index 4fcecd4fc..5737d7d47 100644 --- a/src/main/ui/static/analysis/risk_business.js +++ b/src/main/ui/static/analysis/risk_business.js @@ -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,17 @@ 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 } + }) + } + }) }); }; $scope.loadRiskMaterial(); @@ -684,14 +695,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 +760,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 +773,11 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'], } else if (auditType === 4) { url = '/risk/business/' + $scope.riskEvent.risk_id + '/refuse'; //warningMessageHTML = '是否确定拒绝该材料?' - 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 +800,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 +836,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 +914,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 +928,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,所以后台无法查询到订单 diff --git a/src/main/ui/static/analysis/templates/audit_material.html b/src/main/ui/static/analysis/templates/audit_material.html index ba1a98fc7..4619fa055 100644 --- a/src/main/ui/static/analysis/templates/audit_material.html +++ b/src/main/ui/static/analysis/templates/audit_material.html @@ -9,18 +9,15 @@
Audit Files     - + 一键下载 通过 + ng-if="(riskEvent.result_type == 2 || riskEvent.result_type == 1) && ('10000000000'|withRole)" + ng-click="auditMaterial(3)">通过 - 打回 + 打回
@@ -42,27 +39,28 @@
-
  
- {{item.fileProgressValue}}% + + {{item.fileProgressValue}}% - +
+ + + + + + download + +
@@ -70,12 +68,9 @@
- +
@@ -83,15 +78,10 @@ - + \ No newline at end of file