|
|
|
@ -15,7 +15,7 @@ |
|
|
|
|
<el-table class="c-table" |
|
|
|
|
:data="list" |
|
|
|
|
:max-height="'calc(100vh - ' + (disabled ? 260 : 300) + 'px)'" |
|
|
|
|
:span-method="span1" |
|
|
|
|
:span-method="span" |
|
|
|
|
:cell-style="{background:'#fff'}" |
|
|
|
|
border> |
|
|
|
|
<el-table-column prop="name" |
|
|
|
@ -135,7 +135,7 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
|
import { ref, defineAsyncComponent, onMounted, toRefs, reactive } from 'vue'; |
|
|
|
|
import { ref, defineAsyncComponent, onMounted, toRefs, reactive, isTheStrategyRelatedToTheProduct } from 'vue'; |
|
|
|
|
import { ElLoading, ElMessage } from 'element-plus'; |
|
|
|
|
import { saveCredit, findCredit } from '@/api/model'; |
|
|
|
|
import { getProcessInformationBasedOnRoles, addOperation } from '@/api/judgment'; |
|
|
|
@ -165,6 +165,7 @@ const form = reactive({ |
|
|
|
|
}); |
|
|
|
|
const loading = ref<boolean>(false); |
|
|
|
|
const syncVisible = ref<boolean>(false); |
|
|
|
|
const bankIds = ref<Record<string, any>[]>([]); |
|
|
|
|
|
|
|
|
|
// 配置项 |
|
|
|
|
const getConfig = async () => { |
|
|
|
@ -585,7 +586,7 @@ const rowMerge1 = [1, 4, 7, 10, 40, 43, 46]; |
|
|
|
|
const rowMerge2 = [2, 3, 5, 6, 8, 9, 11, 12, 41, 42, 44, 45, 47, 48]; |
|
|
|
|
const rowMerge3 = [0, 13, 18, 26, 33, 39, 49]; |
|
|
|
|
// 表格合并 |
|
|
|
|
const span1 = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => { |
|
|
|
|
const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => { |
|
|
|
|
if (rowMerge3.includes(rowIndex)) { |
|
|
|
|
if (!columnIndex) { |
|
|
|
|
return { |
|
|
|
@ -614,36 +615,6 @@ const span1 = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
const span = ({ row, column, rowIndex, columnIndex }: SpanMethodProps) => { |
|
|
|
|
if (!columnIndex || columnIndex === 1) { |
|
|
|
|
if (!rowIndex || rowIndex === 31) { |
|
|
|
|
return { |
|
|
|
|
rowspan: 5, |
|
|
|
|
colspan: 1, |
|
|
|
|
}; |
|
|
|
|
} else if (rowIndex === 5 || rowIndex === 11 || rowIndex === 39 || rowIndex === 53) { |
|
|
|
|
return { |
|
|
|
|
rowspan: 2, |
|
|
|
|
colspan: 1, |
|
|
|
|
}; |
|
|
|
|
} else if (rowIndex === 7 || rowIndex === 13 || rowIndex === 17 || rowIndex === 27 || rowIndex === 41 || rowIndex === 45 || rowIndex === 49) { |
|
|
|
|
return { |
|
|
|
|
rowspan: 4, |
|
|
|
|
colspan: 1, |
|
|
|
|
}; |
|
|
|
|
} else if (rowIndex === 21 || rowIndex === 24 || rowIndex === 36) { |
|
|
|
|
return { |
|
|
|
|
rowspan: 3, |
|
|
|
|
colspan: 1, |
|
|
|
|
}; |
|
|
|
|
} else { |
|
|
|
|
return { |
|
|
|
|
rowspan: 0, |
|
|
|
|
colspan: 0, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 选择框回调 |
|
|
|
|
const checkAll = (row: Record<string, any>, i: number) => { |
|
|
|
@ -763,60 +734,81 @@ const addRecord = async () => { |
|
|
|
|
// 提交 |
|
|
|
|
const submit = async (synchronizeUpdate?: number) => { |
|
|
|
|
loading.value = true; |
|
|
|
|
const param = []; |
|
|
|
|
|
|
|
|
|
list.value.forEach((e, i) => { |
|
|
|
|
const child = { |
|
|
|
|
id: e?.id || '', |
|
|
|
|
dimensionId: e.dimensionId ?? '', |
|
|
|
|
recordName: e.index ?? '', |
|
|
|
|
score: e.score, |
|
|
|
|
percentage: e.percentage, |
|
|
|
|
}; |
|
|
|
|
const temp = { |
|
|
|
|
calculationFormula: e.calculationFormula ?? '', |
|
|
|
|
dimensionId: e.dimensionId ?? '', |
|
|
|
|
strategyId: id.value || '', |
|
|
|
|
recordName: e.name, |
|
|
|
|
isChoose: +e.isChoose, |
|
|
|
|
}; |
|
|
|
|
if (e.middle) { |
|
|
|
|
temp.dimensionIndexList = [child]; |
|
|
|
|
if ((e.answerId2 > 595 && e.answerId2 < 600) || (e.answerId2 > 687 && e.answerId2 < 691)) |
|
|
|
|
temp.dimensionIndexList.push( |
|
|
|
|
{ |
|
|
|
|
id: list.value[i + 1].id ?? '', |
|
|
|
|
dimensionId: list.value[i + 1].dimensionId ?? '', |
|
|
|
|
recordName: list.value[i + 1].index ?? '', |
|
|
|
|
score: list.value[i + 1].score, |
|
|
|
|
percentage: list.value[i + 1].percentage, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: list.value[i + 2].id ?? '', |
|
|
|
|
dimensionId: list.value[i + 2].dimensionId ?? '', |
|
|
|
|
recordName: list.value[i + 2].index ?? '', |
|
|
|
|
score: list.value[i + 2].score, |
|
|
|
|
percentage: list.value[i + 2].percentage, |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
temp.recordName = e.sub; |
|
|
|
|
param.push(temp); |
|
|
|
|
} else if (e.top) { |
|
|
|
|
param.push(temp); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
await saveCredit({ |
|
|
|
|
id: id.value, |
|
|
|
|
...form, |
|
|
|
|
...getIds(), |
|
|
|
|
synchronizeUpdate, |
|
|
|
|
dimensionOfTheRatingTableList: param, |
|
|
|
|
}); |
|
|
|
|
addRecord(); |
|
|
|
|
try { |
|
|
|
|
const param = []; |
|
|
|
|
|
|
|
|
|
list.value.forEach((e, i) => { |
|
|
|
|
const child = { |
|
|
|
|
id: e?.id || '', |
|
|
|
|
dimensionId: e.dimensionId ?? '', |
|
|
|
|
recordName: e.index ?? '', |
|
|
|
|
score: e.score, |
|
|
|
|
percentage: e.percentage, |
|
|
|
|
}; |
|
|
|
|
const temp = { |
|
|
|
|
calculationFormula: e.calculationFormula ?? '', |
|
|
|
|
dimensionId: e.dimensionId ?? '', |
|
|
|
|
strategyId: id.value || '', |
|
|
|
|
recordName: e.name, |
|
|
|
|
isChoose: +e.isChoose, |
|
|
|
|
}; |
|
|
|
|
if (e.middle) { |
|
|
|
|
temp.dimensionIndexList = [child]; |
|
|
|
|
if ((e.answerId2 > 595 && e.answerId2 < 600) || (e.answerId2 > 687 && e.answerId2 < 691)) |
|
|
|
|
temp.dimensionIndexList.push( |
|
|
|
|
{ |
|
|
|
|
id: list.value[i + 1].id ?? '', |
|
|
|
|
dimensionId: list.value[i + 1].dimensionId ?? '', |
|
|
|
|
recordName: list.value[i + 1].index ?? '', |
|
|
|
|
score: list.value[i + 1].score, |
|
|
|
|
percentage: list.value[i + 1].percentage, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: list.value[i + 2].id ?? '', |
|
|
|
|
dimensionId: list.value[i + 2].dimensionId ?? '', |
|
|
|
|
recordName: list.value[i + 2].index ?? '', |
|
|
|
|
score: list.value[i + 2].score, |
|
|
|
|
percentage: list.value[i + 2].percentage, |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
temp.recordName = e.sub; |
|
|
|
|
param.push(temp); |
|
|
|
|
} else if (e.top) { |
|
|
|
|
param.push(temp); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
await saveCredit({ |
|
|
|
|
id: id.value, |
|
|
|
|
...form, |
|
|
|
|
...getIds(), |
|
|
|
|
synchronizeUpdate, |
|
|
|
|
dimensionOfTheRatingTableList: param, |
|
|
|
|
bankIds: bankIds.value, |
|
|
|
|
}); |
|
|
|
|
addRecord(); |
|
|
|
|
} catch (e) { |
|
|
|
|
loading.value = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
const confirmSubmit = () => { |
|
|
|
|
const confirmSubmit = async () => { |
|
|
|
|
if (!form.scoreCardName) return ElMessage.error('请输入策略名称!'); |
|
|
|
|
syncVisible.value = true; |
|
|
|
|
|
|
|
|
|
// 编辑需要判断是否有绑定产品 |
|
|
|
|
if (id.value) { |
|
|
|
|
const res = await isTheStrategyRelatedToTheProduct({ |
|
|
|
|
tacticsId: id.value, |
|
|
|
|
strategyType: 9, |
|
|
|
|
}); |
|
|
|
|
if (res.isRelated) { |
|
|
|
|
bankIds.value = res.bankIds; |
|
|
|
|
syncVisible.value = true; |
|
|
|
|
} else { |
|
|
|
|
submit(); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
submit(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|