|
|
@@ -22,9 +22,20 @@
|
|
|
<el-table-column prop="label" label="二级指标" min-width="35" align="center"> </el-table-column>
|
|
|
<el-table-column prop="sub" label="评定项目和要求" min-width="120" show-overflow-tooltip> </el-table-column>
|
|
|
<el-table-column prop="score" label="分值" min-width="20" align="center"> </el-table-column>
|
|
|
- <el-table-column prop="score" label="参考分" min-width="20" align="center">
|
|
|
+ <el-table-column label="参考分" align="center" width="120">
|
|
|
<template slot-scope="{ row }">
|
|
|
- {{ getValue(row.value) }}
|
|
|
+ <span v-if="!canEdit">{{ getValue(row.value) }}</span>
|
|
|
+ <div v-else>
|
|
|
+ <el-input-number
|
|
|
+ style="width:100%"
|
|
|
+ v-model="referenceForm[row.value]"
|
|
|
+ size="mini"
|
|
|
+ :min="0"
|
|
|
+ :max="row.score"
|
|
|
+ :step="1"
|
|
|
+ >
|
|
|
+ </el-input-number>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="img" label="图片" min-width="90" width="90" align="center">
|
|
|
@@ -34,7 +45,7 @@
|
|
|
<el-image
|
|
|
:key="index"
|
|
|
style="width: 30px; height: 30px;"
|
|
|
- :src="item"
|
|
|
+ :src="item + '?x-oss-process=image/resize,h_100,m_lfit'"
|
|
|
fit="cover"
|
|
|
:preview-src-list="getImg(row.value)"
|
|
|
></el-image>
|
|
|
@@ -45,8 +56,7 @@
|
|
|
|
|
|
<el-table-column label="最终评分" align="center" width="120">
|
|
|
<template slot-scope="{ row }">
|
|
|
- <span v-if="getExpertScore(row.value)">{{ getExpertScore(row.value) }}</span>
|
|
|
- <div v-else>
|
|
|
+ <div v-if="final">
|
|
|
<el-input-number
|
|
|
style="width:100%"
|
|
|
v-model="form[row.value]"
|
|
|
@@ -57,23 +67,62 @@
|
|
|
>
|
|
|
</el-input-number>
|
|
|
</div>
|
|
|
+ <span v-else-if="$route.query.status == 'SUBMIT_GRADE'">暂无</span>
|
|
|
+ <span v-else-if="getExpertScore(row.value) > -1">{{ getExpertScore(row.value) }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <div style="margin: 15px 12px 0 0; font-size: 14px">
|
|
|
+ <div style="margin: 8px 12px 0 0; font-size: 14px">
|
|
|
<el-card shadow="never">
|
|
|
{{ remark }}
|
|
|
</el-card>
|
|
|
</div>
|
|
|
<div style="padding:20px 50px;display:flex" class="fixed-btn">
|
|
|
<el-button @click="$router.go(-1)">返回</el-button>
|
|
|
- <div style="flex-grow:1"></div>
|
|
|
- <el-button type="danger" v-if="submitList.length !== 0" @click="saveDismiss" :loading="loading">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ v-if="submitList.length !== 0 && $route.query.status == 'SUBMIT_GRADE'"
|
|
|
+ @click="saveDismiss"
|
|
|
+ :loading="loading"
|
|
|
+ >
|
|
|
退回
|
|
|
</el-button>
|
|
|
- <el-button type="primary" v-if="submitList.length !== 0" @click="saveExpertScore" :loading="loading">
|
|
|
+ <div style="flex-grow:1"></div>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ @click="canEdit = true"
|
|
|
+ v-if="!canEdit && !final && $route.query.status == 'SUBMIT_GRADE'"
|
|
|
+ :loading="loading"
|
|
|
+ >
|
|
|
+ 修改参考分
|
|
|
+ </el-button>
|
|
|
+ <el-button type="success" @click="saveReferenceScore" v-if="canEdit && !final" :loading="loading">
|
|
|
+ 保存参考分
|
|
|
+ </el-button>
|
|
|
+ <el-button @click="cancelScore" v-if="canEdit && !final" :loading="loading">
|
|
|
+ 取消
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="final = true"
|
|
|
+ v-if="!final && !canEdit && $route.query.status == 'SUBMIT_GRADE'"
|
|
|
+ :loading="loading"
|
|
|
+ >
|
|
|
最终评分
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-if="submitList.length !== 0 && final"
|
|
|
+ @click="saveExpertScore"
|
|
|
+ :loading="loading"
|
|
|
+ >
|
|
|
+ 保存最终评分
|
|
|
+ </el-button>
|
|
|
+ <el-button @click="final = false && !canEdit" v-if="final" :loading="loading">
|
|
|
+ 取消
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -91,11 +140,14 @@ export default {
|
|
|
loading: false,
|
|
|
downloading: false,
|
|
|
spanArr: [],
|
|
|
- tableHeight1: 730,
|
|
|
+ tableHeight1: 600,
|
|
|
rateList: [],
|
|
|
info: {},
|
|
|
form: {},
|
|
|
- remark: ''
|
|
|
+ remark: '',
|
|
|
+ canEdit: false,
|
|
|
+ final: false,
|
|
|
+ referenceForm: {}
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -111,16 +163,20 @@ export default {
|
|
|
return !!info;
|
|
|
},
|
|
|
submitList() {
|
|
|
- return [...this.rateList]
|
|
|
- .filter(item => {
|
|
|
- return !item.expertScore;
|
|
|
- })
|
|
|
- .map(item => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- expertScore: this.form[item.type]
|
|
|
- };
|
|
|
- });
|
|
|
+ return [...this.rateList].map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ expertScore: this.form[item.type]
|
|
|
+ };
|
|
|
+ });
|
|
|
+ },
|
|
|
+ referenceList() {
|
|
|
+ return [...this.rateList].map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ score: this.referenceForm[item.type]
|
|
|
+ };
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -129,20 +185,39 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
saveExpertScore() {
|
|
|
+ console.log(this.submitList);
|
|
|
this.loading = true;
|
|
|
- this.$http
|
|
|
- .post('/rateExpertAudit/batchSave', {
|
|
|
- audits: JSON.stringify(this.submitList)
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- return this.$http.post('/rateExpertAudit/grade', {
|
|
|
- rateId: this.$route.query.id
|
|
|
- });
|
|
|
+ this.$alert('提交后评分将不能修改,确认提交吗?', '警告', { type: 'error' })
|
|
|
+ .then(() => {
|
|
|
+ this.$http
|
|
|
+ .post('/rateExpertAudit/batchSave', {
|
|
|
+ audits: JSON.stringify(this.submitList)
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ return this.$http.post('/rateExpertAudit/grade', {
|
|
|
+ rateId: this.$route.query.id
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success('评审完成');
|
|
|
+ this.loading = false;
|
|
|
+ this.getGride();
|
|
|
+ this.final = false;
|
|
|
+ this.$router
|
|
|
+ .replace({
|
|
|
+ query: {
|
|
|
+ ...this.$route.query,
|
|
|
+ status: 'SUBMIT_PAPER_MATERIALS'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(_ => {});
|
|
|
+ });
|
|
|
})
|
|
|
- .then(res => {
|
|
|
- this.$message.success('评审完成');
|
|
|
+ .catch(e => {
|
|
|
this.loading = false;
|
|
|
- this.getGride();
|
|
|
+ if (e !== 'cancel') {
|
|
|
+ console.log(e.error);
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
getGride() {
|
|
|
@@ -160,7 +235,6 @@ export default {
|
|
|
.then(res => {
|
|
|
if (!res.empty) {
|
|
|
this.rateList = res.content;
|
|
|
-
|
|
|
let form = {};
|
|
|
// console.log(this.categories);
|
|
|
|
|
|
@@ -168,7 +242,7 @@ export default {
|
|
|
form[item.value] = this.getValue(item.value);
|
|
|
});
|
|
|
// console.log(form);
|
|
|
-
|
|
|
+ this.referenceForm = form;
|
|
|
this.form = form;
|
|
|
}
|
|
|
});
|
|
|
@@ -324,18 +398,27 @@ export default {
|
|
|
}, 0);
|
|
|
return;
|
|
|
} else if (index === 4) {
|
|
|
- sums[index] = data.reduce((total, currentValue) => {
|
|
|
- return total + this.getValue(currentValue.value);
|
|
|
- }, 0);
|
|
|
+ if (this.canEdit) {
|
|
|
+ sums[index] = data.reduce((total, currentValue) => {
|
|
|
+ return total + this.referenceForm[currentValue.value];
|
|
|
+ }, 0);
|
|
|
+ } else {
|
|
|
+ sums[index] = data.reduce((total, currentValue) => {
|
|
|
+ return total + this.getValue(currentValue.value);
|
|
|
+ }, 0);
|
|
|
+ }
|
|
|
return;
|
|
|
} else if (index === 6) {
|
|
|
- if (this.$route.status == '') {
|
|
|
+ if (this.$route.query.status == 'SUBMIT_GRADE' && !this.final) {
|
|
|
+ sums[index] = '暂无';
|
|
|
+ return;
|
|
|
+ } else if (this.final) {
|
|
|
sums[index] = data.reduce((total, currentValue) => {
|
|
|
- return total + this.getExpertScore(currentValue.value);
|
|
|
+ return total + this.form[currentValue.value];
|
|
|
}, 0);
|
|
|
} else {
|
|
|
sums[index] = data.reduce((total, currentValue) => {
|
|
|
- return total + this.form[currentValue.value];
|
|
|
+ return total + this.getExpertScore(currentValue.value);
|
|
|
}, 0);
|
|
|
}
|
|
|
|
|
|
@@ -395,6 +478,35 @@ export default {
|
|
|
console.log(e);
|
|
|
this.$message.error(e.error);
|
|
|
});
|
|
|
+ },
|
|
|
+ saveReferenceScore() {
|
|
|
+ this.loading = true;
|
|
|
+ this.$alert('提交后评分将覆盖专家的分数,确认提交吗?', '提示', { type: 'primary' })
|
|
|
+ .then(() => {
|
|
|
+ this.$http
|
|
|
+ .post('/rateExpertAudit/batchSave', {
|
|
|
+ audits: JSON.stringify(this.referenceList)
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success('评审完成');
|
|
|
+ this.loading = false;
|
|
|
+ this.getGride();
|
|
|
+ this.canEdit = false;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.loading = false;
|
|
|
+ if (e !== 'cancel') {
|
|
|
+ console.log(e.error);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ cancelScore() {
|
|
|
+ this.canEdit = false;
|
|
|
+ [...this.categories].forEach(item => {
|
|
|
+ this.referenceForm[item.value] = this.getValue(item.value);
|
|
|
+ });
|
|
|
+ this.loading = false;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -417,4 +529,7 @@ export default {
|
|
|
content: none;
|
|
|
}
|
|
|
}
|
|
|
+// /deep/ .el-table .cell {
|
|
|
+// white-space: pre-line !important;
|
|
|
+// }
|
|
|
</style>
|