fix 80613
This commit is contained in:
@@ -1,6 +1,22 @@
|
||||
<template>
|
||||
<internal-detail-page :title="pageTitle">
|
||||
<template v-if="!$route.query.assessResults">
|
||||
<div v-for="(type, index) in showTables" :key="index" class="table-item">
|
||||
<a-divider orientation="left">{{ EvaluationResultType.nameOfIndex(type.type) }}</a-divider>
|
||||
<j-table
|
||||
:columns="getColumns(type)"
|
||||
:dataSource="getData(type)"
|
||||
:can-drag="true"
|
||||
rowKey="id"
|
||||
:row-selection="null"
|
||||
:pagination="false"
|
||||
:scroll="{x: '100%'}"
|
||||
:loading="loading">
|
||||
</j-table>
|
||||
</div>
|
||||
</template>
|
||||
<j-table
|
||||
v-else
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:can-drag="true"
|
||||
@@ -24,10 +40,11 @@ export default {
|
||||
components: { JTable, InternalDetailPage },
|
||||
data () {
|
||||
return {
|
||||
pageTitle: EvaluationResultType.nameOfIndex(this.$route.query.assessResults),
|
||||
EvaluationResultType,
|
||||
pageTitle: this.$route.query.assessResults ? EvaluationResultType.nameOfIndex(this.$route.query.assessResults) : '',
|
||||
dataSource: [],
|
||||
// 符合表头
|
||||
coincidenceListHead: [
|
||||
coincidenceListHeader: [
|
||||
// 标准编号/条款号
|
||||
{
|
||||
dataIndex: 'termNumber',
|
||||
@@ -54,7 +71,7 @@ export default {
|
||||
}
|
||||
],
|
||||
// 不符合表头
|
||||
doesNotMatchTheHeader: [
|
||||
doesNotMatchHeader: [
|
||||
// 标准编号/条款号
|
||||
{
|
||||
dataIndex: 'termNumber',
|
||||
@@ -93,7 +110,7 @@ export default {
|
||||
}
|
||||
],
|
||||
// 待验证表头
|
||||
tableHeaderToBeVerified: [
|
||||
tableHeaderToBeVerifiedHeader: [
|
||||
// 标准编号/条款号
|
||||
{
|
||||
dataIndex: 'termNumber',
|
||||
@@ -132,7 +149,7 @@ export default {
|
||||
}
|
||||
],
|
||||
// 不涉及表头
|
||||
noTableHeaderIsInvolved: [
|
||||
noTableHeaderIsInvolvedHeader: [
|
||||
// 标准编号/条款号
|
||||
{
|
||||
dataIndex: 'termNumber',
|
||||
@@ -158,6 +175,11 @@ export default {
|
||||
width: 120
|
||||
}
|
||||
],
|
||||
coincidenceListData: [],
|
||||
doesNotMatchData: [],
|
||||
tableHeaderToBeVerifiedData: [],
|
||||
noTableHeaderIsInvolvedData: [],
|
||||
showTables: [], // 展示的表格
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
@@ -165,19 +187,19 @@ export default {
|
||||
columns () {
|
||||
// 符合
|
||||
if (this.$route.query.assessResults === EvaluationResultType.accordWith.value) {
|
||||
return this.coincidenceListHead
|
||||
return this.coincidenceListHeader
|
||||
}
|
||||
// 不符合
|
||||
if (this.$route.query.assessResults === EvaluationResultType.inconformity.value) {
|
||||
return this.doesNotMatchTheHeader
|
||||
return this.doesNotMatchHeader
|
||||
}
|
||||
// 待验证
|
||||
if (this.$route.query.assessResults === EvaluationResultType.toBeVerified.value) {
|
||||
return this.tableHeaderToBeVerified
|
||||
return this.tableHeaderToBeVerifiedHeader
|
||||
}
|
||||
// 不涉及
|
||||
if (this.$route.query.assessResults === EvaluationResultType.uninvolved.value) {
|
||||
return this.noTableHeaderIsInvolved
|
||||
return this.noTableHeaderIsInvolvedHeader
|
||||
}
|
||||
return []
|
||||
}
|
||||
@@ -186,6 +208,45 @@ export default {
|
||||
this.loading = true
|
||||
accordWithAndInconformityList({ id: this.$route.query.id }).then(res => {
|
||||
if (res.success) {
|
||||
if (!this.$route.query.assessResults) {
|
||||
const resultList = [EvaluationResultType.accordWith.value, EvaluationResultType.inconformity.value, EvaluationResultType.toBeVerified.value, EvaluationResultType.uninvolved.value]
|
||||
resultList.forEach(type => {
|
||||
switch (type) {
|
||||
// 符合
|
||||
case EvaluationResultType.accordWith.value:
|
||||
this.coincidenceListData = res.result.accordWithList || []
|
||||
if (this.coincidenceListData.length > 0) {
|
||||
this.showTables.push({ type, tableName: 'coincidenceList' })
|
||||
}
|
||||
break
|
||||
// 不符合
|
||||
case EvaluationResultType.inconformity.value:
|
||||
this.doesNotMatchData = res.result.notCompliantList || []
|
||||
if (this.doesNotMatchData.length > 0) {
|
||||
this.showTables.push({ type, tableName: 'doesNotMatch' })
|
||||
}
|
||||
break
|
||||
// 待验证
|
||||
case EvaluationResultType.toBeVerified.value:
|
||||
this.tableHeaderToBeVerifiedData = res.result.toBeVerifiedList || []
|
||||
if (this.tableHeaderToBeVerifiedData.length > 0) {
|
||||
this.showTables.push({ type, tableName: 'tableHeaderToBeVerified' })
|
||||
}
|
||||
break
|
||||
// 不涉及
|
||||
case EvaluationResultType.uninvolved.value:
|
||||
this.noTableHeaderIsInvolvedData = res.result.notInvolvedList || []
|
||||
if (this.noTableHeaderIsInvolvedData.length > 0) {
|
||||
this.showTables.push({ type, tableName: 'noTableHeaderIsInvolved' })
|
||||
}
|
||||
break
|
||||
default:
|
||||
this.dataSource = []
|
||||
break
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
switch (this.$route.query.assessResults) {
|
||||
// 符合
|
||||
case EvaluationResultType.accordWith.value:
|
||||
@@ -213,10 +274,37 @@ export default {
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getColumns (type) {
|
||||
return this[`${type.tableName}Header`]
|
||||
},
|
||||
getData (type) {
|
||||
return this[`${type.tableName}Data`]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
@import '~@assets/less/common.less';
|
||||
|
||||
</style>
|
||||
.table-item {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.ant-divider-horizontal.ant-divider-with-text-left /deep/ .ant-divider-inner-text {
|
||||
font-size: 16px;
|
||||
font-family: PingFang SC-Medium, PingFang SC, sans-serif;
|
||||
font-weight: 550;
|
||||
color: #1D2129;
|
||||
}
|
||||
|
||||
.ant-divider-horizontal.ant-divider-with-text-left {
|
||||
margin: 0 0 16px;
|
||||
}
|
||||
|
||||
.ant-divider-horizontal.ant-divider-with-text-left::before, .ant-divider-horizontal.ant-divider-with-text-left::after {
|
||||
border-top-color: @primary-color;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -450,10 +450,10 @@ export default {
|
||||
/**
|
||||
* 评估结果
|
||||
*/
|
||||
toEvaluationResult ({ assessResults, id }) {
|
||||
toEvaluationResult ({ id }) {
|
||||
this.$router.push({
|
||||
path: '/projectLibrary/EvaluationResultPage',
|
||||
query: { assessResults, id }
|
||||
query: { id }
|
||||
})
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user