This commit is contained in:
xuyucheng 2022-11-03 14:55:17 +08:00
parent f1fe8b40c3
commit 65ed81c291
11 changed files with 780 additions and 374 deletions

View File

@ -424,12 +424,12 @@ input[type="number"] {
border: none;
&__title {
color: $theme-color;
color: rgb(255, 255, 255, 0.87);
}
&__content {
p {
color: $theme-color;
color:rgb(255, 255, 255, 0.87);
}
}
}

View File

@ -51,7 +51,7 @@
"
></el-button>
</p>
<el-row style="width: 70%; height: 300px; margin: 20px 0 20px 0px">
<el-row style="width: 70%; margin: 20px 0 20px 0px">
<fecr-table :data="data.parameters" :column="paramColumn">
<template v-slot:operation="value">
<el-button
@ -152,7 +152,7 @@ export default {
)
.then(() => {
this.paramVisible = false;
this.$notify.success("配置参数成功");
this.$notify.success({ title: "提示", success: "配置参数成功" });
this.init();
});
},
@ -165,7 +165,7 @@ export default {
removeParams(id) {
request.post(`/index_store/parameters/${id}/delete`).then(() => {
this.$notify.success("删除成功");
this.$notify.success({ title: "提示", success: "删除成功" });
this.init();
});
},
@ -183,7 +183,7 @@ export default {
submit() {
request.post(`/index_store/edit/${this.id}/`, this.data).then(() => {
this.visible = false;
this.$notify.success("编辑成功");
this.$notify.success({ title: "提示", success: "编辑成功" });
this.init();
});
},
@ -230,7 +230,7 @@ export default {
.des {
p {
span {
margin:20px 0;
margin: 20px 0;
display: block;
}
}

View File

@ -286,7 +286,7 @@ export default {
request.post("/index_store/create/", data).then((res) => {
this.visible = false;
this.sendID = res.id;
this.$notify.success("创建成功");
this.$notify.success({ title: "提示", success: "创建成功" });
});
},
},

View File

@ -282,7 +282,7 @@ export default {
file: val.file,
})
.then(() => {
this.$notify.success("新建成功");
this.$notify.success({ title: "提示", success: "新建成功" });
this.handleChange(this.active);
});
},
@ -293,7 +293,7 @@ export default {
mid: this.$store.state.tabsKey,
})
.then(() => {
this.$notify.success("删除成功");
this.$notify.success({ title: "提示", success: "删除成功" });
this.handleChange(this.active);
});
},
@ -440,7 +440,7 @@ export default {
.then(() => {
this.init();
this.visible = false;
this.$notify.success("修改成功");
this.$notify.success({ title: "提示", success: "修改成功" });
});
},

View File

@ -63,8 +63,8 @@
<el-form-item label="类别">
<el-select v-model="form.collation">
<el-option
v-for="item in options"
:key="item"
v-for="(item,index) in options"
:key="index"
:label="item"
:value="item"
></el-option>
@ -87,61 +87,32 @@ export default {
visible: false,
data: [
{
id: 1,
label: "非金融企业债务融资工具",
label:"主体评级",
children:[
{label:"国家主权评级"},
{label:"地方政府信用评级"},
{label:"城投公司主体信用评级"},
{label:"工商企业主体信用评级"},
{label:"金融机构主体信用评级"}
]
},
{
id: 2,
label: "公司债券评级",
label:"债项评级",
children:[]
},
{
id: 3,
label: "资产证券化评级",
label:"固定收益评级",
children:[]
},
{
id: 4,
label: "金融机构债券评级",
},
{
id: 5,
label: "企业债券评级",
},
{
id: 6,
label: "企业主体评级",
},
{
id: 7,
label: "非标准化债权资产评级",
},
{
id: 8,
label: "绿色债券评级",
},
{
id: 9,
label: "地方政府债券评级",
},
{
id: 10,
label: "熊猫债评级",
},
{
id: 11,
label: "境外机构主体评级",
},
{
id: 12,
label: "借款企业评级",
},
{
id: 13,
label: "ESG模型",
},
{
id: 14,
label: "其他",
},
label:"绿色金融评级",
children:[
{label:"绿色认证"},
{label:"ESG评级"},
{label:"企业碳资信评价"},
{label:"生态产品价值(GEP)核算"}
]
}
],
form: {
name: "",
@ -166,30 +137,24 @@ export default {
{ prop: "name", label: "名称" },
{ prop: "collation", label: "类别" },
],
options: [
"非金融企业债务融资工具",
"公司债券评级",
"资产证券化评级",
"金融机构债券评级",
"企业债券评级",
"企业主体评级",
"非标准化债权资产评级",
"绿色债券评级",
"地方政府债券评级",
"熊猫债评级",
"境外机构主体评级",
"借款企业评级",
"ESG模型",
"其他",
],
options: [],
};
},
created() {
this.setOptions()
this.init();
},
methods: {
setOptions(){
this.options = this.data.map(item=>{
return item.children.map(e=>{
return e.label
})
}).flat()
},
init() {
request
.post("/score_card_config/management/search", this.page)
@ -216,7 +181,7 @@ export default {
.post("/score_card_config/management/create", this.form)
.then((res) => {
this.visible = false;
this.$notify.success(res);
this.$notify.success({ title: "提示", success: res });
this.init();
});
},

View File

@ -1,329 +1,369 @@
<!-- 结果确认 -->
<!-- 外部支持 -->
<template>
<el-row>
<el-row type="flex" justify="space-between">
<h2>评级结果</h2>
<el-row>
<el-popconfirm title="确认删除?" @confirm="remove">
<el-button type="danger" slot="reference" style="margin-right: 20px"
>结果取消</el-button
>
</el-popconfirm>
<el-button type="primary" @click="submit">确认结果</el-button>
</el-row>
<el-row class="row">
<el-row type="flex" justify="space-between" class="select-box">
<div>
<span>政府提供信用级别</span>
<el-input
v-model="governmentLevel"
@blur="setFinallyLevel()"
></el-input>
</div>
<div>
<span>受评主体的个体信用状况</span>
<el-input
v-model="individualCredit"
@blur="setFinallyLevel()"
></el-input>
</div>
</el-row>
<el-row type="flex" justify="space-around">
<el-col :span="12">
<span>打分级别</span>
<span>{{ data.rank }}</span>
</el-col>
<el-col :span="12">
<span>评级得分</span>
<span>{{ data.total_score }}</span>
</el-col>
<el-row type="flex" align="middle">
<h2>政府支持意愿矩阵</h2>
</el-row>
<el-divider></el-divider>
<h2>评级数据</h2>
<el-row style="padding: 0 20px">
<el-row type="flex" align="middle" style="margin-bottom: 20px">
<div class="badge-qualitative"></div>
<span>定性指标</span>
<div class="badge-quantitative"></div>
<span>定量指标</span>
</el-row>
<fecr-table
:data="data.detail"
:column="indicatorColumn"
:spanMethod="spanMethod"
:slots="['operation', 'index2']"
>
<template v-slot:index2="value">
<span
:style="{
color: value.value.nature === 'quality' ? '#2db7f5' : '#87d068',
}"
>{{ value.value.index2 }}</span
>
</template>
<template v-slot:operation="value">
<el-button
type="text"
@click="(visible = true), (target = value.value)"
>查看</el-button
>
</template>
</fecr-table>
</el-row>
<el-divider></el-divider>
<h2>财报数据</h2>
<el-row>
<el-collapse v-model="active" accordion>
<el-collapse-item
:title="index"
:name="index"
v-for="(item, index) in data_sheets"
:key="index"
<el-row class="fake-table">
<el-row style="height: 80px" type="flex">
<el-col
:span="8"
class="fake-table-cell"
style="height: 80px; line-height: 80px"
>政府支持意愿</el-col
>
<fecr-tran-table
:isEdit="false"
:data="data_sheets[active]"
:column="
Object.keys(data_sheets[active][0]).map((item) => {
return item;
})
"
/>
</el-collapse-item>
</el-collapse>
</el-row>
<fecr-dialog
v-if="visible"
:width="'900px'"
:visible="visible"
:footerSlot="true"
@cancel="visible = false"
>
<template slot="body">
<el-form>
<el-form-item label="指标描述">
<p>{{ target.description }}</p>
</el-form-item>
<el-form-item label="档位">
<fecr-table
:slots="['level']"
:data="target.judge"
:column="gearColumn"
<el-col
:span="16"
style="
height: 80px;
border-left: none;
border-right: 1px solid #d9d9d9;
border-bottom: 1px solid #d9d9d9;
"
>
<el-row
type="flex"
class="fake-table-cell"
style="border-left: 1px solid #d9d9d9"
>实体对政府的重要性</el-row
>
<el-row type="flex" class="fake-table-cell">
<el-col class="fake-table-cell">极其重要</el-col>
<el-col class="fake-table-cell">较重要</el-col>
<el-col class="fake-table-cell">一般</el-col>
<el-col class="fake-table-cell">重要性低</el-col>
</el-row>
</el-col>
</el-row>
<el-row type="flex" style="height: 160px">
<el-col
:span="4"
class="fake-table-cell"
style="
height: 160px;
line-height: 160px;
border-bottom: 1px solid #d9d9d9;
"
>
实体违约的负面影响
</el-col>
<el-col
:span="20"
style="
height: 160px;
border: none;
border-right: 1px solid #d9d9d9;
border-bottom: 1px solid #d9d9d9;
"
>
<el-row type="flex">
<el-col class="fake-table-cell">极其严重</el-col>
<el-col>极强</el-col>
<el-col>极强</el-col>
<el-col>较强</el-col>
<el-col>较强</el-col>
</el-row>
<el-row type="flex">
<el-col class="fake-table-cell">较严重</el-col>
<el-col>极强</el-col>
<el-col>较强</el-col>
<el-col>较强</el-col>
<el-col>一般</el-col>
</el-row>
<el-row type="flex">
<el-col class="fake-table-cell">一般</el-col>
<el-col>较强</el-col>
<el-col>较强</el-col>
<el-col>一般</el-col>
<el-col></el-col>
</el-row>
<el-row type="flex">
<el-col
class="fake-table-cell"
style="border-bottom: 1px solid #d9d9d9"
>影响较弱</el-col
>
<template v-slot:level="value">
<span
>{{
numberConvertToUppercase(value.value.level - 1)
}}</span
>
</template>
</fecr-table>
</el-form-item>
<el-form-item label="打分理由" v-if="target.nature === 'quality'">
<p v-html="target.reason"></p>
</el-form-item>
<el-form-item label="参数">
<fecr-table
:data="target.parameters"
:column="paramColumn"
></fecr-table>
</el-form-item>
</el-form>
</template>
<template slot="dialog-footer"></template>
</fecr-dialog>
<el-col>较强</el-col>
<el-col>一般</el-col>
<el-col></el-col>
<el-col></el-col>
</el-row>
</el-col>
</el-row>
</el-row>
<el-divider></el-divider>
<el-row type="flex" justify="space-between" class="select-box">
<div>
<span>选择实体违约的负面影响</span>
<el-select v-model="form.impact">
<el-option
v-for="(item, index) in impactOptions"
:key="index"
:label="item"
:value="item"
></el-option>
</el-select>
</div>
<div>
<span>选择实体对政府的重要性</span>
<el-select v-model="form.importance">
<el-option
v-for="(item, index) in importanceOptions"
:key="index"
:label="item"
:value="item"
></el-option>
</el-select>
</div>
</el-row>
<el-row class="select-box" type="flex" align="middle">
<h2>政府支持意愿</h2>
<el-tag style="margin-left: 20px" v-if="form.governmentSupport">{{
form.governmentSupport
}}</el-tag>
</el-row>
<el-row class="select-box" type="flex" align="middle">
<h2>受评主体最终信用级别</h2>
<el-tag
style="margin-left: 20px"
v-for="(item, index) in finallyLevel"
:key="index"
>{{ item }}</el-tag
>
</el-row>
<el-row
style="margin-top: 40px"
v-if="
finallyLevel.length &&
level.findIndex((item) => {
return governmentLevel === item;
}) >
level.findIndex((item) => {
return finallyLevel[0] === item;
})
"
>
<h2>证据说明(表明政府信用状况的恶化不会传导至受评主体的信用状况)</h2>
<div style="margin-top: 20px; border: 1px solid #d9d9d9">
<Toolbar style="border-bottom: 1px solid #ccc" :editor="editor" />
<Editor
style="height: 500px; overflow-y: hidden"
v-model="html"
:defaultConfig="editorConfig"
@onCreated="onCreated"
/>
</div>
</el-row>
<el-divider></el-divider>
<el-row type="flex" justify="space-between">
<el-button @click="$emit('setActive', 4)" type="primary">
上一步
</el-button>
<el-button @click="submit" type="primary"> 下一步 </el-button>
</el-row>
</el-row>
</template>
<script>
import request from "@/api/request";
import FecrTable from "@/components/FecrTable";
import FecrDialog from "@/components/FecrDialog";
import FecrTranTable from "@/components/FecrTranTable";
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
export default {
components: { FecrTable, FecrDialog, FecrTranTable },
props: {
mid: [String],
rid: [String],
},
components: { Editor, Toolbar },
data() {
return {
active: "0",
visible: false,
target: {},
data: [],
data_sheets: {},
indicatorColumn: [
{ label: "一级指标", prop: "index1" },
{ label: "二级指标", prop: "index2" },
{ label: "指标数值", prop: "value" },
{ label: "得分", prop: "score" },
{ label: "权重", prop: "weight" },
{ label: "操作", prop: "operation" },
governmentLevel: "C",
individualCredit: "BBB",
finallyLevel: [],
html: "",
editor: null,
editorConfig: {},
form: {
impact: "",
importance: "",
governmentSupport: "",
},
impactOptions: ["极其严重", "较严重", "一般", "影响较弱"],
importanceOptions: ["极其重要", "较重要", "一般", "重要性低"],
level: [
"AAA",
"AA+",
"AA",
"AA-",
"A+",
"A",
"A-",
"BBB+",
"BBB",
"BBB-",
"BB+",
"BB",
"BB-",
"B",
"CCC",
"CC",
"C",
],
gearColumn: [
{ label: "档位", prop: "level" },
{ label: "论据", prop: "case" },
],
paramColumn: [
{ label: "参数", prop: "param" },
{ label: "参数值", prop: "value" },
],
format: [
{ date: "00", report: "年报" },
{ date: "03", report: "一季报" },
{ date: "06", report: "半年报" },
{ date: "09", report: "三季报" },
matrix: [
{ importance: "极其重要", impact: "极其严重", result: "极强" },
{ importance: "较重要", impact: "极其严重", result: "极强" },
{ importance: "一般", impact: "极其严重", result: "较强" },
{ importance: "重要性低", impact: "极其严重", result: "较强" },
{ importance: "极其重要", impact: "较严重", result: "极强" },
{ importance: "较重要", impact: "较严重", result: "较强" },
{ importance: "一般", impact: "较严重", result: "较强" },
{ importance: "重要性低", impact: "较严重", result: "一般" },
{ importance: "极其重要", impact: "一般", result: "较强" },
{ importance: "较重要", impact: "一般", result: "较强" },
{ importance: "一般", impact: "一般", result: "一般" },
{ importance: "重要性低", impact: "一般", result: "弱" },
{ importance: "极其重要", impact: "影响较弱", result: "较强" },
{ importance: "较重要", impact: "影响较弱", result: "一般" },
{ importance: "一般", impact: "影响较弱", result: "弱" },
{ importance: "重要性低", impact: "影响较弱", result: "弱" },
],
};
},
created() {
this.dataSheet();
this.init();
},
methods: {
numberConvertToUppercase(i) {
const data = ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十"];
return data[i];
onCreated(editor) {
this.editor = Object.seal(editor);
},
init() {
request
.get("score_card_config/rating/get_result_summary", {
rid: this.rid,
})
.then((res) => {
this.data = res;
});
},
dataSheet() {
request
.get("score_card_config/rating/get_data_summary", {
rid: this.rid,
})
.then((res) => {
this.flag = Object.keys(res["填报数据"]).length;
this.parseData(res["填报数据"]);
});
},
parseData(val) {
this.active = Object.keys(val)[0];
Object.keys(val).forEach((index) => {
const ele = Object.keys(val[index]).map((key) => {
return Object.assign(val[index][key], {
报告期:
key.substring(0, 4) +
this.format.find((item) => {
return key.substring(4) === item.date;
}).report,
});
});
this.$set(this.data_sheets, index, ele);
setFinallyLevel() {
const gIndex = this.level.findIndex((item) => {
return this.governmentLevel === item;
});
},
mergeCell(key) {
const data = [];
for (let i = 0; i < this.data.detail.length - 1; i++) {
if (this.data.detail[i][key] !== this.data.detail[i + 1][key]) {
data.push(i + 1);
}
}
data.unshift(0);
data.push(this.data.detail.length);
return data;
},
const iIndex = this.level.findIndex((item) => {
return this.individualCredit === item;
});
spanMethod({ rowIndex, columnIndex }) {
if (columnIndex === 0) {
const data = this.mergeCell("index1");
for (let i = 0; i < data.length - 1; i++) {
if (rowIndex === data[i]) {
return [data[i + 1] - data[i], 1];
} else if (i === data.length - 2) {
return [0, 0];
switch (this.form.governmentSupport) {
case "极强":
if (gIndex < iIndex) {
this.finallyLevel = [this.governmentLevel, this.level[gIndex + 1]];
} else {
continue;
this.finallyLevel = [this.individualCredit];
}
}
} else if (columnIndex === 1) {
const data = this.mergeCell("index2");
for (let i = 0; i < data.length - 1; i++) {
if (rowIndex === data[i]) {
return [data[i + 1] - data[i], 1];
} else if (i === data.length - 2) {
return [0, 0];
break;
case "较强":
if (gIndex <= iIndex - 4) {
this.finallyLevel = [
this.level[iIndex - 4],
this.level[iIndex - 3],
];
} else if (iIndex - 4 < gIndex && gIndex <= iIndex) {
for (let i = gIndex + 1; i < iIndex + 1; i++) {
this.finallyLevel.push(this.level[i]);
}
} else {
continue;
this.finallyLevel = [this.individualCredit];
}
}
break;
case "一般":
if (gIndex <= iIndex - 2) {
this.finallyLevel = [
this.level[iIndex - 1],
this.level[iIndex - 2],
];
} else if (iIndex - 2 < gIndex && gIndex < iIndex) {
this.finallyLevel = [this.governmentLevel];
} else {
this.finallyLevel = [this.individualCredit];
}
break;
case "弱":
this.finallyLevel = [this.individualCredit];
break;
default:
this.finallyLevel = [];
}
},
remove() {
request
.get("score_card_config/rating/cancel", { rid: this.rid })
.then(() => {
this.$notify.success("结果取消");
const key = this.$store.state.tabs.findIndex((item) => {
return this.$store.state.tabsKey == item.id;
});
this.$store.commit("delete_tabs_item", this.$store.state.tabs[key]);
this.$store.commit(
"set_tabs_key",
this.$store.state.tabs[key - 1].id
);
});
},
submit() {
request
.get("score_card_config/rating/confirm", { rid: this.rid })
.then(() => {
this.$notify.success("结果确认");
const key = this.$store.state.tabs.findIndex((item) => {
return this.$store.state.tabsKey == item.id;
});
this.$store.commit("delete_tabs_item", this.$store.state.tabs[key]);
this.$store.commit(
"set_tabs_key",
this.$store.state.tabs[key - 1].id
);
});
this.$emit("setActive", 5);
},
},
watch: {
form: {
handler(newVal) {
if (newVal.impact && newVal.importance) {
this.form.governmentSupport = this.matrix.filter((item) => {
return (
newVal.importance === item.importance &&
newVal.impact === item.impact
);
})[0].result;
this.setFinallyLevel();
}
},
deep: true,
immediate: true,
},
},
};
</script>
<style lang='scss' scoped>
.el-row {
margin: 20px 0;
}
.el-col {
height: 80px;
display: flex;
justify-content: space-around;
align-items: center;
background-color: #409eff;
border-radius: 6px;
margin-right: 40px;
.row {
padding: 20px 0;
height: calc(100% - 60px);
position: relative;
span {
font-size: 30px;
font-weight: 800;
.el-row {
margin-bottom: 20px;
}
}
.el-col:last-child {
background-color: $success;
margin: 0 0 0 20px;
.fake-table {
.el-row {
margin: 0;
}
&-cell {
display: flex;
justify-content: center;
align-items: center;
height: 40px;
background: #bf933b;
}
.el-col {
text-align: center;
height: 40px;
line-height: 40px;
border-top: 1px solid #d9d9d9;
border-left: 1px solid #d9d9d9;
font-weight: 900;
}
}
.el-collapse {
padding: 0 20px;
}
.el-divider {
.select-box {
margin: 40px 0;
}
::v-deep .el-form-item__label {
width: 100%;
text-align: left;
}
::v-deep .el-form-item__content {
width: 100%;
p {
text-indent: 1em;
div {
display: flex;
align-items: center;
span {
width: auto;
margin-right: 20px;
}
}
}
</style>

View File

@ -4,10 +4,26 @@
<el-row type="flex" justify="center" align="middle" class="box">
<el-descriptions :column="1">
<el-descriptions-item label="企业名称">
<el-input v-model="data.company"></el-input>
<el-input v-model="data.company" @blur="setCompany"></el-input>
</el-descriptions-item>
<el-descriptions-item label="财报日期">
<el-input v-model="data.report_date"></el-input>
<el-row type="flex" justify="space-between">
<el-input
placeholder="填写年度"
v-model="report_year"
style="width: 120px"
></el-input>
<el-select
placeholder="选择财报季度"
v-model="report_date"
style="width: 120px"
>
<el-option label="一季报" value="3-31"></el-option>
<el-option label="半年报" value="6-30"></el-option>
<el-option label="三季报" value="9-30"></el-option>
<el-option label="年报" value="12-31"></el-option>
</el-select>
</el-row>
</el-descriptions-item>
<el-descriptions-item label="选择模型">
<el-select v-model="data.mid" @change="handlerChange">
@ -48,19 +64,34 @@ export default {
return {
data: {
mid: "",
cid: "asdfghjk",
cid: null,
model: "",
report_date: "2020-12-31",
company: "远东资信评估有限公司",
report_date: "",
company: "",
},
model: [],
report_year: "",
report_date: "",
};
},
created() {
this.setData();
this.init();
},
methods: {
setData() {
this.$store.state.tabs.forEach((item) => {
if (item.id === this.$store.state.tabsKey) {
for (let i in this.data) {
this.data[i] = item.param[i];
}
}
});
this.report_year = this.data.report_date.substring(0, 4);
this.report_date = this.data.report_date.substring(5)
},
init() {
request
.post("/score_card_config/management/search", {
@ -74,11 +105,28 @@ export default {
});
},
setCompany() {
request
.post("score_card_config/rating/search_company", {
company: this.data.company,
})
.then((res) => {
if (res.length) {
for (let i in res[0]) {
this.data[i] = res[0][i];
}
} else {
console.log(this.data);
}
});
},
handlerChange() {
this.$emit("setMid", this.data.mid);
},
submit() {
this.data.report_date = this.report_year +'-'+ this.report_date;
this.data.model = this.model.find((item) => {
return item.mid === this.data.mid;
}).name;
@ -98,7 +146,7 @@ export default {
.box {
height: 100%;
.el-descriptions {
width: 300px;
width: 500px;
}
::v-deep .el-descriptions-item__container {

View File

@ -6,7 +6,8 @@
<el-step title="开始评级"></el-step>
<el-step title="数据填报"></el-step>
<el-step title="指标数值"></el-step>
<el-step title="打分评级"></el-step>
<el-step title="基本信用状况评价"></el-step>
<el-step title="外部支持"></el-step>
<el-step title="结果确认"></el-step>
</el-steps>
<first-step
@ -36,7 +37,8 @@
:value="value"
@setActive="setActive"
></fourth-step>
<fifth-step :rid="data.rid" v-else></fifth-step>
<fifth-step :rid="data.rid" v-else-if="active === 4"></fifth-step>
<sixth-step :rid="data.rid" v-else></sixth-step>
</el-card>
</template>
@ -46,11 +48,19 @@ import secondStep from "./secondStep";
import thirdStep from "./thirdStep";
import fourthStep from "./fourthStep";
import fifthStep from "./fifthStep";
import sixthStep from "./sixthStep";
export default {
components: { firstStep, secondStep, thirdStep, fourthStep, fifthStep },
components: {
firstStep,
secondStep,
thirdStep,
fourthStep,
fifthStep,
sixthStep,
},
data() {
return {
active: 0,
active: 4,
data: {
mid: "",
rid: "",

View File

@ -0,0 +1,329 @@
<!-- 结果确认 -->
<template>
<el-row>
<el-row type="flex" justify="space-between">
<h2>评级结果</h2>
<el-row>
<el-popconfirm title="确认删除?" @confirm="remove">
<el-button type="danger" slot="reference" style="margin-right: 20px"
>结果取消</el-button
>
</el-popconfirm>
<el-button type="primary" @click="submit">确认结果</el-button>
</el-row>
</el-row>
<el-row type="flex" justify="space-around">
<el-col :span="12">
<span>打分级别</span>
<span>{{ data.rank }}</span>
</el-col>
<el-col :span="12">
<span>评级得分</span>
<span>{{ data.total_score }}</span>
</el-col>
</el-row>
<el-divider></el-divider>
<h2>评级数据</h2>
<el-row style="padding: 0 20px">
<el-row type="flex" align="middle" style="margin-bottom: 20px">
<div class="badge-qualitative"></div>
<span>定性指标</span>
<div class="badge-quantitative"></div>
<span>定量指标</span>
</el-row>
<fecr-table
:data="data.detail"
:column="indicatorColumn"
:spanMethod="spanMethod"
:slots="['operation', 'index2']"
>
<template v-slot:index2="value">
<span
:style="{
color: value.value.nature === 'quality' ? '#2db7f5' : '#87d068',
}"
>{{ value.value.index2 }}</span
>
</template>
<template v-slot:operation="value">
<el-button
type="text"
@click="(visible = true), (target = value.value)"
>查看</el-button
>
</template>
</fecr-table>
</el-row>
<el-divider></el-divider>
<h2>财报数据</h2>
<el-row>
<el-collapse v-model="active" accordion>
<el-collapse-item
:title="index"
:name="index"
v-for="(item, index) in data_sheets"
:key="index"
>
<fecr-tran-table
:isEdit="false"
:data="data_sheets[active]"
:column="
Object.keys(data_sheets[active][0]).map((item) => {
return item;
})
"
/>
</el-collapse-item>
</el-collapse>
</el-row>
<fecr-dialog
v-if="visible"
:width="'900px'"
:visible="visible"
:footerSlot="true"
@cancel="visible = false"
>
<template slot="body">
<el-form>
<el-form-item label="指标描述">
<p>{{ target.description }}</p>
</el-form-item>
<el-form-item label="档位">
<fecr-table
:slots="['level']"
:data="target.judge"
:column="gearColumn"
>
<template v-slot:level="value">
<span
>{{
numberConvertToUppercase(value.value.level - 1)
}}</span
>
</template>
</fecr-table>
</el-form-item>
<el-form-item label="打分理由" v-if="target.nature === 'quality'">
<p v-html="target.reason"></p>
</el-form-item>
<el-form-item label="参数">
<fecr-table
:data="target.parameters"
:column="paramColumn"
></fecr-table>
</el-form-item>
</el-form>
</template>
<template slot="dialog-footer"></template>
</fecr-dialog>
</el-row>
</template>
<script>
import request from "@/api/request";
import FecrTable from "@/components/FecrTable";
import FecrDialog from "@/components/FecrDialog";
import FecrTranTable from "@/components/FecrTranTable";
export default {
components: { FecrTable, FecrDialog, FecrTranTable },
props: {
mid: [String],
rid: [String],
},
data() {
return {
active: "0",
visible: false,
target: {},
data: [],
data_sheets: {},
indicatorColumn: [
{ label: "一级指标", prop: "index1" },
{ label: "二级指标", prop: "index2" },
{ label: "指标数值", prop: "value" },
{ label: "得分", prop: "score" },
{ label: "权重", prop: "weight" },
{ label: "操作", prop: "operation" },
],
gearColumn: [
{ label: "档位", prop: "level" },
{ label: "论据", prop: "case" },
],
paramColumn: [
{ label: "参数", prop: "param" },
{ label: "参数值", prop: "value" },
],
format: [
{ date: "00", report: "年报" },
{ date: "03", report: "一季报" },
{ date: "06", report: "半年报" },
{ date: "09", report: "三季报" },
],
};
},
created() {
this.dataSheet();
this.init();
},
methods: {
numberConvertToUppercase(i) {
const data = ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十"];
return data[i];
},
init() {
request
.get("score_card_config/rating/get_result_summary", {
rid: this.rid,
})
.then((res) => {
this.data = res;
});
},
dataSheet() {
request
.get("score_card_config/rating/get_data_summary", {
rid: this.rid,
})
.then((res) => {
this.flag = Object.keys(res["填报数据"]).length;
this.parseData(res["填报数据"]);
});
},
parseData(val) {
this.active = Object.keys(val)[0];
Object.keys(val).forEach((index) => {
const ele = Object.keys(val[index]).map((key) => {
return Object.assign(val[index][key], {
报告期:
key.substring(0, 4) +
this.format.find((item) => {
return key.substring(4) === item.date;
}).report,
});
});
this.$set(this.data_sheets, index, ele);
});
},
mergeCell(key) {
const data = [];
for (let i = 0; i < this.data.detail.length - 1; i++) {
if (this.data.detail[i][key] !== this.data.detail[i + 1][key]) {
data.push(i + 1);
}
}
data.unshift(0);
data.push(this.data.detail.length);
return data;
},
spanMethod({ rowIndex, columnIndex }) {
if (columnIndex === 0) {
const data = this.mergeCell("index1");
for (let i = 0; i < data.length - 1; i++) {
if (rowIndex === data[i]) {
return [data[i + 1] - data[i], 1];
} else if (i === data.length - 2) {
return [0, 0];
} else {
continue;
}
}
} else if (columnIndex === 1) {
const data = this.mergeCell("index2");
for (let i = 0; i < data.length - 1; i++) {
if (rowIndex === data[i]) {
return [data[i + 1] - data[i], 1];
} else if (i === data.length - 2) {
return [0, 0];
} else {
continue;
}
}
}
},
remove() {
request
.get("score_card_config/rating/cancel", { rid: this.rid })
.then(() => {
this.$notify.success({ title: "提示", success: "结果取消" });
const key = this.$store.state.tabs.findIndex((item) => {
return this.$store.state.tabsKey == item.id;
});
this.$store.commit("delete_tabs_item", this.$store.state.tabs[key]);
this.$store.commit(
"set_tabs_key",
this.$store.state.tabs[key - 1].id
);
});
},
submit() {
request
.get("score_card_config/rating/confirm", { rid: this.rid })
.then(() => {
this.$notify.success({ title: "提示", success: "结果确认" });
const key = this.$store.state.tabs.findIndex((item) => {
return this.$store.state.tabsKey == item.id;
});
this.$store.commit("delete_tabs_item", this.$store.state.tabs[key]);
this.$store.commit(
"set_tabs_key",
this.$store.state.tabs[key - 1].id
);
});
},
},
};
</script>
<style lang='scss' scoped>
.el-row {
margin: 20px 0;
}
.el-col {
height: 80px;
display: flex;
justify-content: space-around;
align-items: center;
background-color: #409eff;
border-radius: 6px;
margin-right: 40px;
span {
font-size: 30px;
font-weight: 800;
}
}
.el-col:last-child {
background-color: $success;
margin: 0 0 0 20px;
}
.el-collapse {
padding: 0 20px;
}
.el-divider {
margin: 40px 0;
}
::v-deep .el-form-item__label {
width: 100%;
text-align: left;
}
::v-deep .el-form-item__content {
width: 100%;
p {
text-indent: 1em;
}
}
</style>

View File

@ -115,7 +115,6 @@ export default {
},
created() {
this.init()
},
methods: {
init() {

View File

@ -83,7 +83,22 @@ export default {
this.init();
},
view() {},
view(val) {
if (val.status !== "进行") {
this.$notify.success({
title: "提示",
message: "该企业评级流程已" + val.status,
});
} else {
this.$store.commit("set_tabs_key", "3");
this.$store.commit("set_tabs", {
id: "3",
title: "流程",
content: "process",
param: val,
});
}
},
create() {
this.$store.commit("set_tabs_key", "3");