Commit cf3d00a1 authored by caimeng's avatar caimeng

风险列表,新增调整风险等级部分的内容

parent 807a53ca
......@@ -262,7 +262,6 @@ export default {
const i1 = this.fileList.findIndex((item)=>item.name===name)
if(i1!==-1) {
this.fileList.splice(i1,1)
// this.fileList = nArr
}
},
......
<template>
<div class="page-dialog">
<block-header :title="title"></block-header>
<el-table
border
size="mini"
:highlight-current-row="true"
:header-row-class-name="headerStyle"
:data="data"
stripe
<block-header :title="title">
<el-button type="primary" @click="changeRiskLevel" size="small">调整风险等级</el-button>
</block-header>
<el-table border size="mini" :highlight-current-row="true" :header-row-class-name="headerStyle" :data="data" stripe
style="width: 100%;">
<el-table-column align="center" prop="clientName" label="姓名"></el-table-column>
<el-table-column align="center" width="140" prop="riskGmtCreated" :formatter="dateFormats" label="修改日期"></el-table-column>
<el-table-column align="center" prop="riskType" label="风险等级" ></el-table-column>
<el-table-column align="center" prop="riskContent" label="风险描述" ></el-table-column>
<el-table-column align="center" prop="riskGmtCreated" :formatter="dateFormats" label="修改日期"></el-table-column>
<el-table-column align="center" prop="riskType" label="操作人"></el-table-column>
<el-table-column align="center" prop="riskType" label="风险等级"></el-table-column>
<el-table-column align="center" prop="riskGmtCreated" :formatter="dateFormats" label="自定义解除日期"></el-table-column>
<el-table-column align="center" prop="riskContent" label="风险描述"></el-table-column>
<el-table-column align="center" prop="memo" label="备注"></el-table-column>
<el-table-column align="center" prop="memo" label="资料"></el-table-column>
</el-table>
<!-- 调整风险等级弹框 -->
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" title="调整风险等级" width="35%"
:visible.sync="visible" :before-close="handleCancel">
<div>
<div class="box-agreement">
<el-form label-suffix=":" :rules="rules" label-width="130px" label-position="left" :model="riskForm"
ref="form">
<el-row>
<el-col :span="24">
<el-form-item prop="level" label="风险等级">
<el-select v-model="riskForm.level" size="small" placeholder="请选择风险等级">
<el-option v-for="item in this.$enumUtils.toValue('RiskLevelEnum')" :key="item.value"
:label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<template v-if="riskForm.level==='2'||riskForm.level==='3'||riskForm.level==='4'||riskForm.level==='4'">
<el-form-item prop="raido" label="是否自定义解除">
<el-radio-group v-model="riskForm.radio">
<el-radio label="YES"></el-radio>
<el-radio label="NO"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="riskForm.radio==='YES'" prop="time" label="自定义解除日期">
<el-date-picker size="small" v-model="riskForm.time" type="date" placeholder="选择日期">
</el-date-picker>
</el-form-item>
</template>
<el-form-item prop="memo" label="风险描述">
<el-input type="textarea" :row="6" size="small" maxlength="20" show-word-limit clearable
v-model.trim="riskForm.memo" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item prop="certNo" label="资料">
<el-upload :file-list="fileList" class="upload-demo" list-type="picture-card" :action="oss.action"
:data="oss.data" :multiple="oss.multiple" accept=".jpeg,.jpg,.png" :http-request="uploadSectionFile"
:before-upload="handleBeforeApplyUpload" :on-remove="handleLoanApplyRemove">
<i class="el-icon-plus"></i>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="handleCancel">取 消</el-button>
<el-button size="small" type="primary" @click="onSubmit">提 交</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Axios from 'axios'
import * as moment from "moment";
export default {
name: 'RiskInfo',
......@@ -46,7 +104,36 @@ export default {
endDate: "",
startDate: ""
},
data: []
data: [],
fileList: [],
oss: {
action: '',
data: {},
multiple: false,
},
file: null,
visible: false,
rules: {
level: [
{ required: true, message: "请选择风险等级", trigger: 'change' }
],
time: [
{ required: true, message: "请选择解除日期", trigger: 'blur' }
],
radio: [
{ required: true, message: "请选择是否解除", trigger: 'change' }
],
memo: [
{ required: true, message: "请输入风险描述", trigger: 'blur' }
]
},
riskForm: {
level: "",
time: "",
radio: "",
memo: "",
file: ''
}
}
},
async created() {
......@@ -60,7 +147,7 @@ export default {
},
async init() {
const res = await this.$$post('/risk/getRiskLogPage', this.form);
const {success, result} = res.data;
const { success, result } = res.data;
if (success && result !== null) {
this.data = result.records;
}
......@@ -75,11 +162,96 @@ export default {
},
handleClose() {
this.$emit("handleClose");
},
/** 风险等级调整弹框显示 */
changeRiskLevel() {
this.visible = true
},
/** 风险等级调整表单取消 */
handleCancel() {
this.visible = false
},
/** 风险等级调整表单提交 */
onSubmit() {
console.log(this.fileList, '文件列表');
const feedVoucher = [];
this.fileList.forEach(item => {
feedVoucher.push(item.url);
})
this.$refs['ruleForm'].validate((valid) => {
if (!valid) {
return false
}
console.log('干正事')
});
},
handleBeforeApplyUpload(file) {
const attachType = 'LOESS_TRANSFER_APPLY';
return this.$$get(`/oss/signature/?fileType=` + attachType + "&fileName=" + file.name).then(res => {
if (res.data.code !== '200') {
this.$message.error(res.data.message);
return false
}
const result = res.data.result.result;
const data = {};
const tempOss = {};
data.OSSAccessKeyId = result.accessId;
data.policy = result.policy;
data.Signature = result.signature;
data.key = result.dir;
tempOss.action = result.host;
tempOss.data = data;
this.oss = tempOss;
});
},
uploadSectionFile(params) {
const { action, data } = this.oss
console.log(params, '图片信息')
const d = new FormData();
d.append("key", data.key);
d.append("policy", data.policy);
d.append("OSSAccessKeyId", data.OSSAccessKeyId);
d.append("success_action_status", "200");
d.append("Signature", data.Signature);
d.append("file", params.file);
const baseUrl = action;
Axios({
url: baseUrl,
method: 'post',
data: d,
headers: { 'Content-Type': 'multipart/form-data' }
}).then((res) => {
if (res.status === 200) {
const imgUrl = `${baseUrl}/${data.key}`;
this.$notify({ title: '成功', message: params.file.name + ",上传成功", type: 'success' });
this.fileList.push({
name: params.file.name,
url: imgUrl
})
}
}).catch((e) => {
console.log(e, '错误')
});
},
handleLoanApplyRemove(file, fileList) {
const { name } = file;
console.log(file, 'r2')
console.log(fileList, 'r3')
const i1 = this.fileList.findIndex((item) => item.name === name)
if (i1 !== -1) {
this.fileList.splice(i1, 1)
}
},
}
}
</script>
<style>
</style>
<style></style>
......@@ -453,6 +453,8 @@ const enumUtils = {
]
};
for (var enumOptNum in enumOpts) {
if (enumOpts[enumOptNum].enumName == enumName) {
for (var msgNum in enumOpts[enumOptNum].values) {
......@@ -705,6 +707,18 @@ const enumUtils = {
]
};
/** 放款资方*/
enumOpts[21] = {
enumName: 'RiskLevelEnum', values: [
{value: '1', label: '解除等级'},
{value: '2', label: 'RP1-未到期低风险(预警)'},
{value: '3', label: 'R1-低风险(预警)'},
{value: '4', label: 'R2-中风险(警告)'},
{value: '5', label: 'R3-高风险(冻结)'},
{value: '6', label: 'R4-黑名单(禁止)'},
]
};
for (var enumOptNum in enumOpts) {
if (enumOpts[enumOptNum].enumName == enumName) {
return enumOpts[enumOptNum].values;
......
......@@ -16,7 +16,8 @@
<el-input clearable v-model.trim="form.certNo" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item prop="brandName" label="品牌名称">
<el-input clearable v-model.trim="form.brandName" placeholder="请输入"></el-input>
<el-input type="textarea" :row="3" maxlength="20" show-word-limit clearable
v-model.trim="form.brandName" placeholder="请输入"></el-input>
</el-form-item>
</el-col>
......@@ -87,6 +88,8 @@ export default {
setTimeout(() => {
this.handleCancel()
}, 1500)
} else {
this.$message({ message: res.data.message, type: 'error' });
}
} catch (err) {
this.$message({ message: '异常', type: 'error' });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment