|
@ -74,6 +74,7 @@ |
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="AppletAnswerTrainList" @selection-change="handleSelectionChange"> |
|
|
<el-table v-loading="loading" :data="AppletAnswerTrainList" @selection-change="handleSelectionChange"> |
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
|
|
|
<el-table-column label="唯一标识" align="center" prop="id" /> |
|
|
<el-table-column label="关联题目ID" align="center" prop="questionId" v-if="columns[0].visible"/> |
|
|
<el-table-column label="关联题目ID" align="center" prop="questionId" v-if="columns[0].visible"/> |
|
|
<el-table-column label="关联用户ID" align="center" prop="userId" v-if="columns[1].visible"/> |
|
|
<el-table-column label="关联用户ID" align="center" prop="userId" v-if="columns[1].visible"/> |
|
|
<el-table-column label="答案内容" align="center" prop="answer" v-if="columns[2].visible"/> |
|
|
<el-table-column label="答案内容" align="center" prop="answer" v-if="columns[2].visible"/> |
|
@ -121,6 +122,9 @@ |
|
|
<el-form-item label="审核备注" prop="remark"> |
|
|
<el-form-item label="审核备注" prop="remark"> |
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> |
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="删除标识" prop="delFlag"> |
|
|
|
|
|
<el-input v-model="form.delFlag" placeholder="请输入删除标识" /> |
|
|
|
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
@ -184,12 +188,16 @@ export default { |
|
|
{ required: true, message: "答案内容不能为空", trigger: "blur" } |
|
|
{ required: true, message: "答案内容不能为空", trigger: "blur" } |
|
|
], |
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
delFlag: [ |
|
|
|
|
|
{ required: true, message: "删除标识不能为空", trigger: "blur" } |
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
columns: [ |
|
|
columns: [ |
|
|
{ key: 0, label: "关联题目ID", visible: true }, |
|
|
|
|
|
{ key: 1, label: "关联用户ID", visible: true }, |
|
|
|
|
|
{ key: 2, label: "答案内容", visible: true }, |
|
|
|
|
|
{ key: 3, label: "审核备注", visible: true }, |
|
|
|
|
|
|
|
|
{ key: 1, label: "关联题目ID", visible: true }, |
|
|
|
|
|
{ key: 2, label: "关联用户ID", visible: true }, |
|
|
|
|
|
{ key: 3, label: "答案内容", visible: true }, |
|
|
|
|
|
{ key: 4, label: "审核备注", visible: true }, |
|
|
], |
|
|
], |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
@ -214,6 +222,8 @@ export default { |
|
|
// 表单重置 |
|
|
// 表单重置 |
|
|
reset() { |
|
|
reset() { |
|
|
this.form = { |
|
|
this.form = { |
|
|
|
|
|
id: null, |
|
|
|
|
|
|
|
|
questionId: null, |
|
|
questionId: null, |
|
|
|
|
|
|
|
|
userId: null, |
|
|
userId: null, |
|
@ -222,6 +232,16 @@ export default { |
|
|
|
|
|
|
|
|
remark: null, |
|
|
remark: null, |
|
|
|
|
|
|
|
|
|
|
|
delFlag: null, |
|
|
|
|
|
|
|
|
|
|
|
createBy: null, |
|
|
|
|
|
|
|
|
|
|
|
createTime: null, |
|
|
|
|
|
|
|
|
|
|
|
updateBy: null, |
|
|
|
|
|
|
|
|
|
|
|
updateTime: null, |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
this.resetForm("form"); |
|
|
this.resetForm("form"); |
|
|
}, |
|
|
}, |
|
@ -237,7 +257,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
// 多选框选中数据 |
|
|
// 多选框选中数据 |
|
|
handleSelectionChange(selection) { |
|
|
handleSelectionChange(selection) { |
|
|
this.ids = selection.map(item => item.questionId) |
|
|
|
|
|
|
|
|
this.ids = selection.map(item => item.id) |
|
|
this.single = selection.length!==1 |
|
|
this.single = selection.length!==1 |
|
|
this.multiple = !selection.length |
|
|
this.multiple = !selection.length |
|
|
}, |
|
|
}, |
|
@ -250,8 +270,8 @@ export default { |
|
|
/** 修改按钮操作 */ |
|
|
/** 修改按钮操作 */ |
|
|
handleUpdate(row) { |
|
|
handleUpdate(row) { |
|
|
this.reset(); |
|
|
this.reset(); |
|
|
const questionId = row.questionId || this.ids |
|
|
|
|
|
getAppletAnswerTrain(questionId).then(response => { |
|
|
|
|
|
|
|
|
const id = row.id || this.ids |
|
|
|
|
|
getAppletAnswerTrain(id).then(response => { |
|
|
this.form = response.data; |
|
|
this.form = response.data; |
|
|
this.open = true; |
|
|
this.open = true; |
|
|
this.title = "修改用户培训考核答案"; |
|
|
this.title = "修改用户培训考核答案"; |
|
@ -261,7 +281,7 @@ export default { |
|
|
submitForm() { |
|
|
submitForm() { |
|
|
this.$refs["form"].validate(valid => { |
|
|
this.$refs["form"].validate(valid => { |
|
|
if (valid) { |
|
|
if (valid) { |
|
|
if (this.form.questionId != null) { |
|
|
|
|
|
|
|
|
if (this.form.id != null) { |
|
|
updateAppletAnswerTrain(this.form).then(response => { |
|
|
updateAppletAnswerTrain(this.form).then(response => { |
|
|
this.$modal.msgSuccess("修改成功"); |
|
|
this.$modal.msgSuccess("修改成功"); |
|
|
this.open = false; |
|
|
this.open = false; |
|
@ -279,9 +299,9 @@ export default { |
|
|
}, |
|
|
}, |
|
|
/** 删除按钮操作 */ |
|
|
/** 删除按钮操作 */ |
|
|
handleDelete(row) { |
|
|
handleDelete(row) { |
|
|
const questionIds = row.questionId || this.ids; |
|
|
|
|
|
this.$modal.confirm('是否确认删除用户培训考核答案编号为"' + questionIds + '"的数据项?').then(function() { |
|
|
|
|
|
return delAppletAnswerTrain(questionIds); |
|
|
|
|
|
|
|
|
const ids = row.id || this.ids; |
|
|
|
|
|
this.$modal.confirm('是否确认删除用户培训考核答案编号为"' + ids + '"的数据项?').then(function() { |
|
|
|
|
|
return delAppletAnswerTrain(ids); |
|
|
}).then(() => { |
|
|
}).then(() => { |
|
|
this.getList(); |
|
|
this.getList(); |
|
|
this.$modal.msgSuccess("删除成功"); |
|
|
this.$modal.msgSuccess("删除成功"); |
|
|