13404089107
2025-04-30 3440f64e619a42700b46e1ed3f77a2380e8ed194
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<template>
    <el-dialog :visible.sync="dialogVisible" title="课题评定详情" width="70%" @close="handleClose">
        <el-form :model="form" inline label-position="top" :rules="rules" ref="formRef">
            <el-row :gutter="20">
                <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
                    <el-form-item label="报告编号" prop="reportNo" required>
                        <el-input v-model="form.reportNo" disabled placeholder="自动生成" />
                    </el-form-item>
                </el-col>
                <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
                    <el-form-item label="报告名称" prop="reportName">
                        <el-input v-model="form.reportName" placeholder="请输入" />
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <div class="content-box">
            <el-row :gutter="16">
                <el-col style="margin-top: 5px;" :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
                    <Table :total="0" :height="null" :data="criteriaList" show-summary :summary-method="getSummaries"
                        :span-method="arraySpanMethod">
                        <el-table-column type="index" label="序号" width="80" />
                        <el-table-column prop="criteria" label="规程型课题评定标准" />
                        <el-table-column prop="fullScore" label="满分值" width="100" />
                        <el-table-column label="评定分值" prop="score" width="200">
                            <template #default="{ row }">
                                <el-input-number v-model="row.score" :min="0" :max="row.fullScore" :step="1" />
                            </template>
                        </el-table-column>
                        <el-table-column label="创新型课题报告评分规则">
                            <template>
                                <div>
                                    <div>1、规程型课题评定总分的满分为5分。</div>
                                    <div>2、某分项工作完成,但出现以下三种错误中的1种,则减1分:</div>
                                    <div>①有缺项、漏项;</div>
                                    <div>②或不完整清晰;</div>
                                    <div>③或工作效率人为拖延。</div>
                                    <div>3、不能完成某分项的全部工作,或课题不涉及该分项内容,则该分项评0分。</div>
                                </div>
                            </template>
                        </el-table-column>
                    </Table>
                </el-col>
            </el-row>
        </div>
        <template #footer>
            <span class="select-member-footer">
                <el-button type="primary">提交评定结果</el-button>
            </span>
        </template>
    </el-dialog>
</template>
 
<script>
export default {
    name: 'AssessmentDialog',
    props: {
        modelValue: {
            type: Boolean,
            default: false
        },
        reportData: {
            type: Object,
            default: () => { }
        }
    },
    data() {
        return {
            dialogVisible: false,
            form: {
                reportNo: '',
                reportName: '',
            },
            rules: {
                reportName: [
                    { required: true, message: '请输入报告名称', trigger: 'blur' }
                ],
            },
            criteriaList: [
                {
                    criteria: '文献资料调查:全面性,系统性 编辑逻辑清晰,表达规范',
                    fullScore: 1,
                    score: 0,
                },
                {
                    criteria: '专业/技术路线与方法:合理性、可行性;实验设计科学、能实现研究目标,方法先进、完整、可靠;',
                    fullScore: 2,
                    score: 0,
                },
                {
                    criteria: '课题报告完成度高,预期研究结果果是否具有技术价值和应用价值。风险识别:识别了潜在的技术风险、市场风险和管理风险。',
                    fullScore: 3,
                    score: 0,
                },
            ]
        }
    },
    watch: {
        modelValue: {
            handler(val) {
                this.dialogVisible = val;
            },
            immediate: true
        },
        reportData: {
            handler(val) {
                if (val) {
                    this.form.reportNo = val.reportNo || '';
                    this.form.reportName = val.reportName || '';
                }
            },
            immediate: true
        }
    },
    methods: {
        handleClose() {
            this.$emit('update:modelValue', false);
        },
        async handleSubmit() {
            try {
                await this.$refs.formRef.validate();
                const totalScore = this.criteriaList.reduce((sum, item) => sum + (item.score || 0), 0);
                const assessmentData = {
                    ...this.form,
                    totalScore,
                    criteriaScores: this.criteriaList.map(item => ({
                        criteria: item.criteria,
                        score: item.score || 0
                    }))
                };
                this.$emit('submit', assessmentData);
                this.handleClose();
            } catch (error) {
                // 表单验证失败
            }
        },
        getSummaries(param) {
            const { columns, data } = param;
            const sums = [];
            columns.forEach((column, index) => {
                if (index === 0) {
                    sums[index] = '合计';
                    return;
                }
                const values = data.map(item => Number(item[column.property]));
                if (!values.every(value => isNaN(value))) {
                    sums[index] = values.reduce((prev, curr) => {
                        const value = Number(curr);
                        if (!isNaN(value)) {
                            return prev + curr;
                        } else {
                            return prev;
                        }
                    }, 0);
                    sums[index] += ' 分';
                } else {
                    sums[index] = '';
                }
            });
            return sums;
        },
        arraySpanMethod({ row, column, rowIndex, columnIndex }) {
            if (columnIndex === 4 && rowIndex == 0) {
                return {
                    rowspan: 6,
                    colspan: 1
                }
            } else if (rowIndex !== 0 && columnIndex === 4) {
                return [0, 0]
            }
        }
    }
}
</script>
 
<style lang="less" scoped>
.content-box {
 
    &-left {
        margin-top: 5px;
        display: flex;
        flex-direction: column;
        border: 1px solid #EBEEF5;
        border-radius: 8px 8px 0px 0px;
        font-size: 12px;
 
        &-th {
            line-height: 40px;
            background: #FAFAFA !important;
            color: #909399;
            padding: 0 10px;
            font-weight: bold;
        }
 
        &-body {
            padding: 0 10px;
            line-height: 23px;
        }
    }
}
</style>