提交 e2247469 authored 作者: Yroc's avatar Yroc

'按钮异常修复'

上级 a03a374b
...@@ -75,20 +75,6 @@ ...@@ -75,20 +75,6 @@
width="320" width="320"
trigger="hover" trigger="hover"
> >
<!-- <el-table height="400" :data="examination_questions_select_data">
<el-table-column
align="center"
prop="name"
label="每道题得分选择"
>
</el-table-column>
<el-table-column align="center" label="操作" width="100">
<template slot-scope="scope">
>
</template>
</el-table-column>
</el-table> -->
<el-row> <el-row>
<el-col :span="16"> <el-col :span="16">
<el-input <el-input
......
...@@ -241,7 +241,7 @@ export default { ...@@ -241,7 +241,7 @@ export default {
btnClick(val) { btnClick(val) {
console.log('右侧按钮'); console.log('右侧按钮');
console.log(val); console.log(val);
if (val == 'add') this.addTobaccoInfo(); if (val.val == 'add') this.addTobaccoInfo();
}, },
init() { init() {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: AnthonyD * @Author: AnthonyD
* @Date: 2023-03-28 10:34:24 * @Date: 2023-03-28 10:34:24
* @Last Modified by: AnthonyD * @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-20 15:34:11 * @Last Modified time: 2023-04-21 13:49:45
*/ */
</script> </script>
<template> <template>
...@@ -305,11 +305,12 @@ export default { ...@@ -305,11 +305,12 @@ export default {
btnClick(val) { btnClick(val) {
// console.log('右侧按钮'); // console.log('右侧按钮');
// console.log(val); // console.log(val);
if (val == 'add') this.addInformation();
if (val.val == 'add') this.addInformation();
if (val.val == 'template_download') this.templateDownload(val.data); if (val.val == 'template_download') this.templateDownload(val.data);
/* pictureBatchUpload */ /* pictureBatchUpload */
if (val == 'batch_upload') this.pictureBatchUpload(); if (val.val == 'batch_upload') this.pictureBatchUpload();
if (val == 'examination_download') this.createAnswerCard(); if (val.val == 'examination_download') this.createAnswerCard();
if (val.val == 'select_score') this.selectScoreData(val.data); if (val.val == 'select_score') this.selectScoreData(val.data);
}, },
...@@ -553,10 +554,11 @@ export default { ...@@ -553,10 +554,11 @@ export default {
}, },
//试题下载 //试题下载
createAnswerCard() { createAnswerCard() {
console.log('11111');
let id = this.examination_questions_id; let id = this.examination_questions_id;
create_answer_card(id).then((res) => { create_answer_card(id).then((res) => {
// console.log('下载答题卡回调'); console.log('下载答题卡回调');
// console.log(res); console.log(res);
if (res.code == 200) { if (res.code == 200) {
let s = res.message.split('='); let s = res.message.split('=');
let name = s[s.length - 1]; let name = s[s.length - 1];
...@@ -567,7 +569,9 @@ export default { ...@@ -567,7 +569,9 @@ export default {
}, },
//得分选择 //得分选择
selectScoreData(val) { selectScoreData(val) {
console.log(val);
let amendData = this.$handleParams({ fraction: val }); let amendData = this.$handleParams({ fraction: val });
let id = this.examination_questions_id; let id = this.examination_questions_id;
console.log(amendData); console.log(amendData);
console.log(id); console.log(id);
......
<script>
/**
* @Author: AnthonyD
* @Date: 2023-03-28 10:34:24
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-21 13:45:13
*/
</script>
<template> <template>
<div class="module_container"> <div class="module_container">
<div class="card_container"> <div class="card_container">
...@@ -282,8 +289,8 @@ export default { ...@@ -282,8 +289,8 @@ export default {
btnClick(val) { btnClick(val) {
console.log('右侧按钮'); console.log('右侧按钮');
console.log(val); console.log(val);
if (val == 'add') this.addInformation(); if (val.val == 'add') this.addInformation();
if (val == 'download') this.downloadFormwork(); if (val.val == 'download') this.downloadFormwork();
}, },
init() { init() {
......
...@@ -9,15 +9,34 @@ ...@@ -9,15 +9,34 @@
<div class="module_container"> <div class="module_container">
<div class="card_container"> <div class="card_container">
<el-card class="box-card"> <el-card class="box-card">
<table-head :head_data="head_data" @search="searchEvent" @resetting="resetting" @btnClick="btnClick"></table-head> <table-head
:head_data="head_data"
@search="searchEvent"
@resetting="resetting"
@btnClick="btnClick"
></table-head>
<div class="table_container"> <div class="table_container">
<el-table v-loading="is_loading" :data="tableData" style="width: 100%;margin-bottom: 20px;" height="650"> <el-table
v-loading="is_loading"
:data="tableData"
style="width: 100%; margin-bottom: 20px"
height="650"
>
<el-table-column prop="id" label="编号" width="50"> <el-table-column prop="id" label="编号" width="50">
</el-table-column> </el-table-column>
<el-table-column prop="examination_questions_title" label="考试标题"> <el-table-column
prop="examination_questions_title"
label="考试标题"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-document" style="color: #005FC2;" <el-button
@click="toDetail(scope.row)">{{ scope.row.examination_questions_title }}</el-button> size="mini"
type="text"
icon="el-icon-document"
style="color: #005fc2"
@click="toDetail(scope.row)"
>{{ scope.row.examination_questions_title }}</el-button
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="学员姓名"> <el-table-column prop="name" label="学员姓名">
...@@ -27,48 +46,81 @@ ...@@ -27,48 +46,81 @@
</el-table-column> </el-table-column>
<el-table-column prop="begin_answer_time" label="开始时间"> <el-table-column prop="begin_answer_time" label="开始时间">
</el-table-column> </el-table-column>
<el-table-column prop="answer_duration" label="答题时间" width="100"> <el-table-column
prop="answer_duration"
label="答题时间"
width="100"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.answer_duration">{{ seconds_to_minutes(scope.row.answer_duration) }}</div> <div v-if="scope.row.answer_duration">
{{ seconds_to_minutes(scope.row.answer_duration) }}
</div>
<div v-else>暂无</div> <div v-else>暂无</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="score" label="得分"> <el-table-column prop="score" label="得分"> </el-table-column>
</el-table-column>
<el-table-column prop="created_at" label="创建时间"> <el-table-column prop="created_at" label="创建时间">
</el-table-column> </el-table-column>
<el-table-column prop="path" label="状态"> <el-table-column prop="path" label="状态">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<el-tag v-if="scope.row.status == 1" type="success">预约完成</el-tag> <el-tag v-if="scope.row.status == 1" type="success"
<el-tag v-if="scope.row.status == 2" type="success" >预约完成</el-tag
style="background-color: #b4d7c6;border-color: #71b7a0;color: #038D6E;">考试完成</el-tag> >
<el-tag v-if="scope.row.status == 3" type="success">已发布</el-tag> <el-tag
v-if="scope.row.status == 2"
type="success"
style="
background-color: #b4d7c6;
border-color: #71b7a0;
color: #038d6e;
"
>考试完成</el-tag
>
<el-tag v-if="scope.row.status == 3" type="success"
>已发布</el-tag
>
<el-tag v-if="scope.row.status == 4" type="info">取消</el-tag> <el-tag v-if="scope.row.status == 4" type="info">取消</el-tag>
<el-tag v-if="scope.row.status == 6" type="danger">失效</el-tag> <el-tag v-if="scope.row.status == 6" type="danger"
>失效</el-tag
>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="120"> <el-table-column label="操作" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" style="color: #F56C6C;" @click="cancelReservation(scope.row)" <el-button
v-if="scope.row.status == 1">取消预约</el-button> size="mini"
type="text"
style="color: #f56c6c"
@click="cancelReservation(scope.row)"
v-if="scope.row.status == 1"
>取消预约</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div style="text-align: right;"> <div style="text-align: right">
<el-pagination @current-change="handleCurrentChange" :current-page.sync="request_params.page" <el-pagination
:page-size="request_params.limit" layout="total, prev, pager, next" :total="request_params.total"> @current-change="handleCurrentChange"
:current-page.sync="request_params.page"
:page-size="request_params.limit"
layout="total, prev, pager, next"
:total="request_params.total"
>
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
</div> </div>
<el-dialog title="提示" :visible.sync="is_dialogVisible" width="60%" :before-close="handleClose"> <el-dialog
<div> title="提示"
:visible.sync="is_dialogVisible"
</div> width="60%"
:before-close="handleClose"
>
<div></div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button> <el-button @click="handleClose">取 消</el-button>
<el-button type="primary" @click="submitData">确 定</el-button> <el-button type="primary" @click="submitData">确 定</el-button>
...@@ -83,17 +135,17 @@ import { get_test_results_list, cancel_reservation } from '@/api/student'; ...@@ -83,17 +135,17 @@ import { get_test_results_list, cancel_reservation } from '@/api/student';
import { secondsToMinutes } from '@/utils/tool'; import { secondsToMinutes } from '@/utils/tool';
const standard_template = { const standard_template = {
id: null, id: null,
father_id: -1,//父级id father_id: -1, //父级id
is_show: false,//是否展示为菜单 is_show: false, //是否展示为菜单
name: null,//英文名称 name: null, //英文名称
name_zh: null,//中文名称 name_zh: null, //中文名称
path: null,//路由路径 path: null, //路由路径
sort: null,//排序 sort: null, //排序
status: 1,//状态 status: 1, //状态
type: 1,//类型:菜单/按钮 type: 1, //类型:菜单/按钮
view_path: null,//视图路径 view_path: null, //视图路径
icon: null,//图标 icon: null, //图标
} };
export default { export default {
data() { data() {
return { return {
...@@ -101,7 +153,7 @@ export default { ...@@ -101,7 +153,7 @@ export default {
//头部按钮 //头部按钮
head_data: { head_data: {
is_search_show: true, is_search_show: true,
search_placeholder: "学员姓名/手机号", search_placeholder: '学员姓名/手机号',
right_buttons: [ right_buttons: [
// { // {
// text: '新增', // text: '新增',
...@@ -129,12 +181,10 @@ export default { ...@@ -129,12 +181,10 @@ export default {
components: { TableHead }, components: { TableHead },
computed: { computed: {},
},
mounted() { mounted() {
this.init() this.init();
}, },
methods: { methods: {
...@@ -153,8 +203,7 @@ export default { ...@@ -153,8 +203,7 @@ export default {
btnClick(val) { btnClick(val) {
console.log('右侧按钮'); console.log('右侧按钮');
console.log(val); console.log(val);
if (val == 'add') this.addInformation(); if (val.val == 'add') this.addInformation();
}, },
init() { init() {
...@@ -166,20 +215,18 @@ export default { ...@@ -166,20 +215,18 @@ export default {
this.is_dialogVisible = false; this.is_dialogVisible = false;
}, },
//提交 //提交
submitData() { submitData() {},
},
//获取列表数据 //获取列表数据
getListData() { getListData() {
let params = this.$removeProperty(this.request_params); let params = this.$removeProperty(this.request_params);
this.is_loading = true; this.is_loading = true;
get_test_results_list(params).then(res => { get_test_results_list(params).then((res) => {
console.log('列表数据'); console.log('列表数据');
console.log(res); console.log(res);
this.tableData = res.data || []; this.tableData = res.data || [];
this.request_params.total = res.total; this.request_params.total = res.total;
this.is_loading = false; this.is_loading = false;
}) });
}, },
//分页 //分页
handleCurrentChange(val) { handleCurrentChange(val) {
...@@ -206,24 +253,25 @@ export default { ...@@ -206,24 +253,25 @@ export default {
this.$confirm('确认取消?', '提示', { this.$confirm('确认取消?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning',
}).then(() => { })
let id = item.id; .then(() => {
cancel_reservation(id).then(res => { let id = item.id;
console.log('取消预约'); cancel_reservation(id).then((res) => {
console.log(res); console.log('取消预约');
if (res.code == 200) { console.log(res);
this.$message.success(res.message); if (res.code == 200) {
this.getListData(); this.$message.success(res.message);
} this.getListData();
}
});
}) })
}).catch(() => { .catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消' message: '已取消',
});
}); });
});
}, },
//跳转详情 //跳转详情
toDetail(item) { toDetail(item) {
...@@ -232,9 +280,9 @@ export default { ...@@ -232,9 +280,9 @@ export default {
this.$router.push({ this.$router.push({
path: '/student/test_results_detail', path: '/student/test_results_detail',
query: { query: {
id: id id: id,
}, },
}) });
}, },
//秒转分 //秒转分
...@@ -242,11 +290,10 @@ export default { ...@@ -242,11 +290,10 @@ export default {
if (num) { if (num) {
return secondsToMinutes(num); return secondsToMinutes(num);
} else { } else {
return '暂无' return '暂无';
} }
} },
}, },
} };
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
<script>
/**
* @Author: AnthonyD
* @Date: 2023-03-28 10:34:24
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-21 13:58:02
*/
</script>
<template> <template>
<div class="module_container"> <div class="module_container">
<div class="card_container"> <div class="card_container">
...@@ -164,7 +171,7 @@ export default { ...@@ -164,7 +171,7 @@ export default {
btnClick(val) { btnClick(val) {
console.log('右侧按钮'); console.log('右侧按钮');
console.log(val); console.log(val);
if (val == 'add') this.addTobaccoGrades(); if (val.val == 'add') this.addTobaccoGrades();
}, },
init() { init() {
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论