master
lion 6 days ago
parent 9eeaf8b552
commit 6445a02d59

@ -87,19 +87,19 @@
><el-table-column
label="姓名"
><template slot-scope="scope">{{
(scope.row.user || {}).name || "—"
(scope.row.respondent || scope.row.user || {}).name || "—"
}}</template></el-table-column><el-table-column
label="学号"
><template slot-scope="scope">{{
(scope.row.user || {}).no || "—"
(scope.row.respondent || scope.row.user || {}).no || "—"
}}</template></el-table-column><el-table-column
label="公司"
><template slot-scope="scope">{{
(scope.row.user || {}).company_name || "—"
(scope.row.respondent || scope.row.user || {}).company_name || "—"
}}</template></el-table-column><el-table-column
label="职务"
><template slot-scope="scope">{{
(scope.row.user || {}).company_position || "—"
(scope.row.respondent || scope.row.user || {}).company_position || "—"
}}</template></el-table-column><el-table-column
label="最近提交时间"
><template slot-scope="scope">{{
@ -138,13 +138,13 @@
border
:column="2"
><el-descriptions-item label="姓名">{{
(reply.user || {}).name || "—"
(reply.respondent || reply.user || {}).name || "—"
}}</el-descriptions-item><el-descriptions-item label="最近提交时间">{{
reply.updated_at || reply.created_at
}}</el-descriptions-item><el-descriptions-item label="公司">{{
(reply.user || {}).company_name || "—"
(reply.respondent || reply.user || {}).company_name || "—"
}}</el-descriptions-item><el-descriptions-item label="学号">{{
(reply.user || {}).no || "—"
(reply.respondent || reply.user || {}).no || "—"
}}</el-descriptions-item></el-descriptions>
<SurveyQuestion
v-for="q in reply.questions"
@ -263,7 +263,7 @@ export default {
if (this.deletingId !== null) return
const epoch = this.epoch
try {
await this.$confirm('确定删除“' + ((row.user || {}).name || '该学员') + '”的答卷?删除后不再计入列表、统计和导出,记录及附件会保留。', '删除答卷', { type: 'warning', confirmButtonText: '删除', cancelButtonText: '取消' })
await this.$confirm('确定删除“' + ((row.respondent || row.user || {}).name || '该学员') + '”的答卷?删除后不再计入列表、统计和导出,记录及附件会保留。', '删除答卷', { type: 'warning', confirmButtonText: '删除', cancelButtonText: '取消' })
} catch (_) { return }
if (epoch !== this.epoch) return
this.deletingId = row.id

@ -416,7 +416,8 @@ describe('Survey editing and results', () => {
title: '提交时的标题',
desc: '<p><strong>历史问卷说明</strong></p>'
},
user: { name: '学员' },
user: { name: null, company_name: null },
respondent: { name: '问卷中的姓名', company_name: '问卷中的公司' },
questions: [
{ id: 1, name: '历史题目', edit_input: 'number', display_value: '0' }
]
@ -437,6 +438,8 @@ describe('Survey editing and results', () => {
await wrapper.vm.openReply({ id: 7 })
await flush()
expect(wrapper.vm.reply.snapshot.title).toBe('提交时的标题')
expect(document.body.textContent).toContain('问卷中的姓名')
expect(document.body.textContent).toContain('问卷中的公司')
expect(
document.body.querySelector('.reply .description strong').textContent
).toBe('历史问卷说明')

Loading…
Cancel
Save