提交 7d6f07d9 authored 作者: Yroc's avatar Yroc

后台功能添加

上级 e2247469
......@@ -17,7 +17,7 @@
</el-option>
</el-select>
</div>
<table class="table_box">
<table class="table_box" :id="chart_id">
<tr>
<!-- #038d6e -->
<th v-for="(e, i) in labers" :key="i" style="padding: 15px 10px">
......@@ -53,7 +53,7 @@
<script>
export default {
props: ['table_data', 'labers'],
props: ['table_data', 'labers', 'chart_id'],
data() {
return {
sort_field: null,
......
......@@ -10,7 +10,7 @@
<!-- <el-select v-model="">
<el-option></el-option>
</el-select> -->
<table class="table_box">
<table class="table_box" :id="chart_id">
<!-- <tr>
<th v-for="(e, i) in labers" :key="i">{{ e.label }}</th>
</tr> -->
......@@ -25,7 +25,7 @@
<script>
export default {
props: ['table_data'],
props: ['table_data', 'chart_id'],
data() {
return {
sel: '',
......@@ -43,6 +43,7 @@ export default {
methods: {
//保留两位,四舍五入
keepTwoDecimal(num) {
if (num == 0 || !num) return num;
if (num.includes(',')) {
return num;
} else {
......
......@@ -7,7 +7,7 @@
<!-- -->
<template>
<div class="container_box">
<table class="table_box">
<table class="table_box" :id="chart_id">
<tr>
<th v-for="(e, i) in labers" :key="i" style="padding: 15px 10px">
{{ e.label
......@@ -89,7 +89,7 @@
<script>
export default {
props: ['table_data', 'labers'],
props: ['table_data', 'labers', 'chart_id'],
data() {
return {
sort_field: null,
......@@ -149,15 +149,15 @@ export default {
width: 100%;
height: 100%;
position: relative;
}
.el-icon-caret-bottom {
position: absolute;
top: 20px;
}
.el-icon-caret-top {
position: absolute;
top: 13px;
.el-icon-caret-bottom {
position: absolute;
top: 20px;
}
.el-icon-caret-top {
position: absolute;
top: 13px;
}
}
.table_box {
......
/**
* @Author: AnthonyD
* @Date: 2023-04-21 15:02:15
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-21 19:06:40
*/
const style_text = '<style>table {\
border-collapse: collapse;\
}.table_box{width:80%;margin:auto;text-align: center;border: 1px solid #000; }\
th,td{ border-bottom: 1px solid #000; border-right: 1px solid #000;}</style>'
export default style_text;
......@@ -21,6 +21,17 @@
</div>
</el-col>
<el-col :span="12" style="text-align: right">
<el-button
v-if="original_data.print_id"
style="backgrount-color: #000; margin-right: 10px"
icon="el-icon-printer"
size="mini"
circle
class="print_box"
@click="print_()"
>
</el-button>
<el-checkbox
v-if="original_data.is_show"
v-model="original_data.is_show.value"
......@@ -34,6 +45,7 @@
<Table
v-if="original_data"
:table_data="original_data.list"
:chart_id="original_data.chart_id"
:labers="original_data.labers"
></Table>
</div>
......@@ -42,6 +54,7 @@
v-if="original_data"
:table_data="original_data"
:labers="original_data.labers"
:chart_id="original_data.chart_id"
>
</SelectTabe>
</div>
......@@ -63,7 +76,10 @@
></bar-chart>
</div>
<div class="content_container" v-if="original_data.type == 'simple_table'">
<simple-table :table_data="original_data"></simple-table>
<simple-table
:table_data="original_data"
:chart_id="original_data.chart_id"
></simple-table>
</div>
<!-- 眼光稳定性 -->
<div
......@@ -85,6 +101,7 @@ import BarChart from './components/BarChart.vue';
import SimpleTable from './components/SimpleTable.vue';
import EyeStabilityTable from './components/EyeStabilityTable.vue';
import SelectTabe from './components/SelectTabe.vue';
import style_text from './components/table_style';
export default {
props: ['module_data'],
data() {
......@@ -105,7 +122,7 @@ export default {
computed: {},
created() {
this.original_data = { ...this.module_data };
// console.log(this.original_data);
console.log(this.original_data);
},
mounted() {},
......@@ -114,6 +131,32 @@ export default {
changeSelect() {
this.$emit('changeSelect', this.original_data.is_show);
},
print_() {
let domObj = document.getElementById(this.original_data.chart_id);
var newWin = window.open(''); //新打开一个空窗口
let title = this.original_data.topic
? `<div> <h4>${this.original_data.topic}</h4></div>`
: '';
let body = `<div style="text-align: center">
<h2>${this.original_data.title}</h2>
${title}
${domObj.outerHTML}
</div>`;
if (domObj) {
newWin.document.write(body);
// newWin.document.write(outerHTML);
// console.log(domObj.outerHTML);
newWin.document.head.innerHTML = style_text; //给打印的内容加上样式
newWin.document.close(); //在IE浏览器中使用必须添加这一句
newWin.focus(); //在IE浏览器中使用必须添加这一句
setTimeout(() => {
newWin.print(); //打印
newWin.close(); //关闭窗口
}, 500);
}
},
},
};
</script>
......
......@@ -191,7 +191,7 @@ export default {
// console.log(val);
// console.log(data);
this.examination_questions_select_data = '';
this.$emit('btnClick', { val, data });
this.$emit('btnClick', val, data);
},
uploadCode(val) {
this.btn_code = val;
......
......@@ -241,7 +241,7 @@ export default {
btnClick(val) {
console.log('右侧按钮');
console.log(val);
if (val.val == 'add') this.addTobaccoInfo();
if (val == 'add') this.addTobaccoInfo();
},
init() {
......
......@@ -371,6 +371,8 @@ export default {
return {
type: 'table',
chart_id: 'result_section',
print_id: 'result_section',
color: '#39c183f0',
title: '成绩分段值',
labers,
......@@ -392,6 +394,7 @@ export default {
chart_id: 'bar_chart',
color: '#E6A23C',
title: '南方北方烟得分情况',
labers,
keys,
raw_data: datas,
......@@ -450,6 +453,8 @@ export default {
return {
type: 'simple_table',
chart_id: 'HighesLowesttScore_table',
print_id: 'HighesLowesttScore_table',
color: '#99A9BF',
title: '最高分、最低分、平均分,中位数、众数、离散(变异系数)',
labers,
......@@ -467,6 +472,8 @@ export default {
return {
type: 'select_table',
chart_id: 'transcript_bar_chart',
print_id: 'transcript_bar_chart',
color: '#99A9BF',
title: '学员得分情况',
......@@ -516,7 +523,8 @@ export default {
});
return {
type: 'eye_stability_table',
chart_id: 'wrong_group',
chart_id: 'eye_stability',
print_id: 'eye_stability',
color: '#529B2E',
title: '眼光稳定性',
labers,
......@@ -546,6 +554,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_table',
print_id: 'wrong_table',
color: '#F56C6C',
title: '易错题分析',
labers,
......@@ -573,6 +583,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_table',
print_id: 'wrong_table',
color: '#529B2E',
title: '易对题分析',
labers,
......@@ -604,6 +616,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_position',
print_id: 'wrong_position',
color: '#E6A23C',
title: '错误部位',
labers,
......@@ -632,6 +646,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_level',
print_id: 'wrong_level',
color: '#505F79',
title: '错误上下一级',
labers,
......@@ -663,6 +679,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_color',
print_id: 'wrong_color',
color: '#99A9BF',
title: '错误颜色',
labers,
......@@ -693,6 +711,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_group',
print_id: 'wrong_group',
color: '#529B2E',
title: '错误组别',
labers,
......
......@@ -3,7 +3,7 @@
* @Author: AnthonyD
* @Date: 2023-03-28 10:34:24
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-21 13:59:01
* @Last Modified time: 2023-04-21 14:57:51
*/
</script>
<template>
......@@ -244,7 +244,7 @@ export default {
this.getListData();
},
btnClick(val) {
if (val.val == 'add') this.addInformation();
if (val == 'add') this.addInformation();
},
init() {
......
......@@ -366,8 +366,12 @@ export default {
console.log(res);
this.is_loading = false;
this.head_data.title = res.title_list; //标题
this.result_section = this.changeScore(res.ScoreScore); //成绩分段
this.area_score = this.changeAreaScore(res.AreaScore); //南北方得分
this.result_section = this.changeScore(res.ScoreScore); //成绩分段
this.province_score = this.changeProvinceScore(res.ProvinceScore); //省区得分
this.province_score = this.changeProvinceScore(res.ProvinceScore); //省区得分
this.breed_score = this.changeBreedScore(res.breedScore); //品种得分
this.transcript_data = this.changeTranscript(res.Transcript); //学员得分
......@@ -427,6 +431,7 @@ export default {
chart_id: 'result_section',
color: '#39c183f0',
title: '成绩分段值',
print_id: 'result_section',
labers,
list,
data,
......@@ -491,6 +496,7 @@ export default {
chart_id: 'province_bar_chart',
color: '#505F79',
title: '省级产区得分情况',
labers,
keys,
raw_data: datas,
......@@ -512,6 +518,7 @@ export default {
return {
type: 'bar',
chart_id: 'breed_bar_chart',
color: '#39c183f0',
title: '品种得分情况',
......@@ -535,9 +542,10 @@ export default {
return {
type: 'select_table',
chart_id: 'transcript_bar_chart',
print_id: 'transcript_bar_chart',
color: '#99A9BF',
title: '学员得分情况',
labers,
topic: select_list,
select_value: select_list[0],
......@@ -565,6 +573,7 @@ export default {
return {
type: 'simple_table',
chart_id: 'HighesLowesttScore_table',
print_id: 'HighesLowesttScore_table',
color: '#99A9BF',
title: '最高分、最低分、平均分,中位数、众数、离散(变异系数)',
labers,
......@@ -598,7 +607,8 @@ export default {
});
return {
type: 'eye_stability_table',
chart_id: 'wrong_group',
print_id: 'eye_stability',
chart_id: 'eye_stability',
color: '#E6A23C',
title: '眼光稳定性',
labers,
......@@ -635,6 +645,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_table',
print_id: 'wrong_table',
color: '#F56C6C',
title: '易错题分析',
labers,
......@@ -669,6 +681,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_table',
print_id: 'wrong_table',
color: '#529B2E',
title: '易对题分析',
labers,
......@@ -697,6 +711,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_position',
print_id: 'wrong_position',
color: '#E6A23C',
title: '错误部位',
labers,
......@@ -729,6 +745,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_level',
print_id: 'wrong_level',
color: '#505F79',
title: '错误上下一级',
labers,
......@@ -761,6 +779,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_color',
print_id: 'wrong_color',
color: '#99A9BF',
title: '错误颜色',
labers,
......@@ -793,6 +813,8 @@ export default {
return {
type: 'table',
chart_id: 'wrong_group',
print_id: 'wrong_group',
color: '#529B2E',
title: '错误组别',
labers,
......
......@@ -3,7 +3,7 @@
* @Author: AnthonyD
* @Date: 2023-03-28 10:34:24
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-21 13:49:45
* @Last Modified time: 2023-04-21 14:50:03
*/
</script>
<template>
......@@ -302,16 +302,17 @@ export default {
this.request_params.val = '';
this.getExaminationQuestionsDetail();
},
btnClick(val) {
btnClick(val, data = null) {
// console.log('右侧按钮');
// console.log(val);
console.log(val);
console.log(data);
if (val.val == 'add') this.addInformation();
if (val.val == 'template_download') this.templateDownload(val.data);
if (val == 'add') this.addInformation();
if (val == 'template_download') this.templateDownload(data);
/* pictureBatchUpload */
if (val.val == 'batch_upload') this.pictureBatchUpload();
if (val.val == 'examination_download') this.createAnswerCard();
if (val.val == 'select_score') this.selectScoreData(val.data);
if (val == 'batch_upload') this.pictureBatchUpload();
if (val == 'examination_download') this.createAnswerCard();
if (val == 'select_score') this.selectScoreData(data);
},
init() {
......
......@@ -3,17 +3,27 @@
* @Author: AnthonyD
* @Date: 2023-03-28 10:34:24
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-21 13:45:13
* @Last Modified time: 2023-04-21 17:26:42
*/
</script>
<template>
<div class="module_container">
<div class="card_container">
<el-card class="box-card">
<table-head :head_data="head_data" @search="searchEvent" @resetting="resetting" @btnClick="btnClick"
@upload="sliderRequest"></table-head>
<table-head
:head_data="head_data"
@search="searchEvent"
@resetting="resetting"
@btnClick="btnClick"
@upload="sliderRequest"
></table-head>
<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>
<el-table-column prop="name" label="姓名" width="100">
......@@ -39,54 +49,105 @@
<el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status == 1" type="success">正常</el-tag>
<el-tag v-if="scope.row.status == 2 || scope.row.status == 3" type="danger">禁止</el-tag>
<el-tag v-if="scope.row.status == 1" type="success"
>正常</el-tag
>
<el-tag
v-if="scope.row.status == 2 || scope.row.status == 3"
type="danger"
>禁止</el-tag
>
</div>
</template>
</el-table-column>
<el-table-column prop="work_info" label="工作单位">
</el-table-column>
<el-table-column prop="remark" label="备注">
<template slot-scope="scope">
<div class="remark_box" :title="scope.row.remark">{{ scope.row.remark }}
<div class="remark_box" :title="scope.row.remark">
{{ scope.row.remark }}
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="120">
<template slot-scope="scope">
<el-button size="mini" type="text" style="color: #000;"
@click="updateInformation(scope.row)">编辑</el-button>
<el-button size="mini" type="text" style="color: #000;" @click="viewDetails(scope.row)">详情</el-button>
<el-button v-if="scope.row.status == 1" size="mini" type="text" style="color: #F56C6C;"
@click="deleteInformation(scope.row)">禁用</el-button>
<el-button
size="mini"
type="text"
style="color: #000"
@click="updateInformation(scope.row)"
>编辑</el-button
>
<el-button
size="mini"
type="text"
style="color: #000"
@click="viewDetails(scope.row)"
>详情</el-button
>
<el-button
v-if="scope.row.status == 1"
size="mini"
type="text"
style="color: #f56c6c"
@click="deleteInformation(scope.row)"
>禁用</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div style="text-align: right;">
<el-pagination @current-change="handleCurrentChange" :current-page.sync="request_params.page"
:page-size="request_params.limit" layout="total, prev, pager, next" :total="request_params.total">
<div style="text-align: right">
<el-pagination
@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>
</div>
</el-card>
</div>
<el-dialog :title="is_updata_type == 'view' ? '查看学员' : (is_updata_type == 'add' ? '新增学员' : '修改学员')"
:visible.sync="is_dialogVisible" width="60%" :before-close="handleClose">
<el-dialog
:title="
is_updata_type == 'view'
? '查看学员'
: is_updata_type == 'add'
? '新增学员'
: '修改学员'
"
:visible.sync="is_dialogVisible"
width="60%"
:before-close="handleClose"
>
<div>
<el-form :model="detailed_information" :rules="rules" ref="ruleForm" label-width="100px">
<el-form
:model="detailed_information"
:rules="rules"
ref="ruleForm"
label-width="100px"
>
<el-row>
<el-col :span="12">
<el-form-item label="姓名">
<el-input v-model="detailed_information.name" placeholder="姓名"
:disabled="is_updata_type == 'view'"></el-input>
<el-input
v-model="detailed_information.name"
placeholder="姓名"
:disabled="is_updata_type == 'view'"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="性别">
<el-select v-model="detailed_information.sex" placeholder="请选择" :disabled="is_updata_type == 'view'">
<el-option :label="'男'" :value="'男'">
</el-option>
<el-option :label="'女'" :value="'女'">
</el-option>
<el-select
v-model="detailed_information.sex"
placeholder="请选择"
:disabled="is_updata_type == 'view'"
>
<el-option :label="'男'" :value="'男'"> </el-option>
<el-option :label="'女'" :value="'女'"> </el-option>
</el-select>
</el-form-item>
</el-col>
......@@ -94,56 +155,87 @@
<el-row>
<el-col :span="12">
<el-form-item label="年龄">
<el-input v-model="detailed_information.age" placeholder="年龄"
:disabled="is_updata_type == 'view'"></el-input>
<el-input
v-model="detailed_information.age"
placeholder="年龄"
:disabled="is_updata_type == 'view'"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="籍贯">
<el-input v-model="detailed_information.native_place" placeholder="籍贯" type="textarea" :rows="2"
:disabled="is_updata_type == 'view'"></el-input>
<el-input
v-model="detailed_information.native_place"
placeholder="籍贯"
type="textarea"
:rows="2"
:disabled="is_updata_type == 'view'"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="省市区">
<el-cascader v-if="province_list" :options="province_list" v-model="detailed_information.linkage_id"
:show-all-levels="false" @change="handleChange" clearable filterable
:disabled="is_updata_type == 'view'"></el-cascader>
<el-cascader
v-if="province_list"
:options="province_list"
v-model="detailed_information.linkage_id"
:show-all-levels="false"
@change="handleChange"
clearable
filterable
:disabled="is_updata_type == 'view'"
></el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工作单位">
<el-input v-model="detailed_information.work_info" placeholder="工作单位"
:disabled="is_updata_type == 'view'"></el-input>
<el-input
v-model="detailed_information.work_info"
placeholder="工作单位"
:disabled="is_updata_type == 'view'"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="证件号">
<el-input v-model="detailed_information.idcard" placeholder="证件号"
:disabled="is_updata_type == 'view'"></el-input>
<el-input
v-model="detailed_information.idcard"
placeholder="证件号"
:disabled="is_updata_type == 'view'"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="手机号">
<el-input v-model="detailed_information.phone" placeholder="手机号" type="number"
:disabled="is_updata_type == 'view'"></el-input>
<el-input
v-model="detailed_information.phone"
placeholder="手机号"
type="number"
:disabled="is_updata_type == 'view'"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="邮箱">
<el-input v-model="detailed_information.email" placeholder="邮箱"
:disabled="is_updata_type == 'view'"></el-input>
<el-input
v-model="detailed_information.email"
placeholder="邮箱"
:disabled="is_updata_type == 'view'"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="状态">
<el-radio-group v-model="detailed_information.status" :disabled="is_updata_type == 'view'">
<el-radio-group
v-model="detailed_information.status"
:disabled="is_updata_type == 'view'"
>
<el-radio :label="1">正常</el-radio>
<!-- <el-radio :label="2">禁用</el-radio> -->
<el-radio :label="3">禁用</el-radio>
......@@ -154,29 +246,46 @@
<el-row>
<el-col :span="12">
<el-form-item label="开始工作时间">
<el-date-picker v-model="detailed_information.start_working" type="date" placeholder="选择日期"
:disabled="is_updata_type == 'view'">
<el-date-picker
v-model="detailed_information.start_working"
type="date"
placeholder="选择日期"
:disabled="is_updata_type == 'view'"
>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="密码">
<el-input v-model="detailed_information.password" placeholder="密码"
:disabled="is_updata_type == 'view'"></el-input>
<el-input
v-model="detailed_information.password"
placeholder="密码"
:disabled="is_updata_type == 'view'"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="备注">
<el-input v-model="detailed_information.remark" placeholder="备注" type="textarea" :rows="2"
:disabled="is_updata_type == 'view'"></el-input>
<el-input
v-model="detailed_information.remark"
placeholder="备注"
type="textarea"
:rows="2"
:disabled="is_updata_type == 'view'"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="简介">
<el-input v-model="detailed_information.brief_introduction" placeholder="简介" type="textarea" :rows="2"
:disabled="is_updata_type == 'view'"></el-input>
<el-input
v-model="detailed_information.brief_introduction"
placeholder="简介"
type="textarea"
:rows="2"
:disabled="is_updata_type == 'view'"
></el-input>
</el-form-item>
</el-col>
</el-row>
......@@ -192,10 +301,19 @@
<script>
import TableHead from '@/components/TableHead/index';
import { get_province_list, get_student_list, add_student, delete_student, updat_student, get_student_detail, download_student_info, upload_student_info } from '@/api/student';
import {
get_province_list,
get_student_list,
add_student,
delete_student,
updat_student,
get_student_detail,
download_student_info,
upload_student_info,
} from '@/api/student';
import { exportText } from '@/utils/tool.js';
const standard_template = {
name: "",
name: '',
password: '',
sex: null,
age: null,
......@@ -205,14 +323,14 @@ const standard_template = {
area: null,
work_info: null,
idcard: null,
phone: "",
email: "",
phone: '',
email: '',
remark: null,
status: 1,
start_working: null,
brief_introduction: "",
linkage_id: [],//三级联动id
}
brief_introduction: '',
linkage_id: [], //三级联动id
};
export default {
data() {
return {
......@@ -220,7 +338,7 @@ export default {
//头部按钮
head_data: {
is_search_show: true,
search_placeholder: "学员姓名/手机号",
search_placeholder: '学员姓名/手机号',
right_buttons: [
{
text: '新增',
......@@ -256,12 +374,8 @@ export default {
detailed_information: {},
//表单校验
rules: {
name: [
{ required: true, message: '请输入姓名名称', trigger: 'blur' },
],
name: [{ required: true, message: '请输入姓名名称', trigger: 'blur' }],
},
};
},
......@@ -270,7 +384,7 @@ export default {
computed: {},
mounted() {
this.init()
this.init();
},
methods: {
......@@ -289,8 +403,8 @@ export default {
btnClick(val) {
console.log('右侧按钮');
console.log(val);
if (val.val == 'add') this.addInformation();
if (val.val == 'download') this.downloadFormwork();
if (val == 'add') this.addInformation();
if (val == 'download') this.downloadFormwork();
},
init() {
......@@ -308,7 +422,7 @@ export default {
console.log('要提交的数据');
console.log(params);
if (this.is_updata_type == 'add') {
add_student(params).then(res => {
add_student(params).then((res) => {
console.log('新增回调');
console.log(res);
if (res.code == 200) {
......@@ -316,10 +430,10 @@ export default {
this.is_dialogVisible = false;
this.getListData();
}
})
});
} else {
let id = this.detailed_information.id;
updat_student(id, params).then(res => {
updat_student(id, params).then((res) => {
console.log('修改回调');
console.log(res);
if (res.code == 200) {
......@@ -327,7 +441,7 @@ export default {
this.is_dialogVisible = false;
this.getListData();
}
})
});
}
},
//获取省市区泪飙
......@@ -339,30 +453,30 @@ export default {
if (list[i].children.length == 0) {
delete list[i].children;
} else {
removeNodeInTree(list[i].children)
removeNodeInTree(list[i].children);
}
}
return list
}
get_province_list({ name_is_value: true }).then(res => {
return list;
};
get_province_list({ name_is_value: true }).then((res) => {
if (res.length) {
this.province_list = removeNodeInTree(res);
} else {
this.province_list = [];
}
})
});
},
//获取列表数据
getListData() {
let params = this.$removeProperty(this.request_params);
this.is_loading = true;
get_student_list(params).then(res => {
get_student_list(params).then((res) => {
console.log('列表数据');
console.log(res);
this.tableData = res.data || [];
this.request_params.total = res.total;
this.is_loading = false;
})
});
},
//分页
handleCurrentChange(val) {
......@@ -380,23 +494,31 @@ export default {
this.is_updata_type = 'edit';
let id = item.id;
//获取详情
get_student_detail(id).then(res => {
get_student_detail(id).then((res) => {
console.log('详细信息');
console.log(res);
this.detailed_information = JSON.parse(JSON.stringify(res)) || {};
this.detailed_information['linkage_id'] = [res.province, res.city, res.area];
this.detailed_information['linkage_id'] = [
res.province,
res.city,
res.area,
];
this.is_dialogVisible = true;
})
});
},
//查看详情
viewDetails(item) {
let id = item.id;
this.is_updata_type = 'view';
get_student_detail(id).then(res => {
get_student_detail(id).then((res) => {
this.detailed_information = JSON.parse(JSON.stringify(res)) || {};
this.detailed_information['linkage_id'] = [res.province, res.city, res.area];
this.detailed_information['linkage_id'] = [
res.province,
res.city,
res.area,
];
this.is_dialogVisible = true;
})
});
},
//删除
deleteInformation(item) {
......@@ -404,34 +526,36 @@ export default {
this.$confirm('是否禁用此用户?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delete_student(id).then(res => {
if (res.code == 200) {
this.$message.success(res.message);
this.init();
}
type: 'warning',
})
.then(() => {
delete_student(id).then((res) => {
if (res.code == 200) {
this.$message.success(res.message);
this.init();
}
});
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
});
});
});
},
//省市区选择监听
handleChange(val) {
console.log('选择的值');
console.log(val);
if (val.length == 3) {
this.detailed_information.province = val[0];//省
this.detailed_information.city = val[1];//市
this.detailed_information.area = val[2];//区
this.detailed_information.province = val[0]; //省
this.detailed_information.city = val[1]; //市
this.detailed_information.area = val[2]; //区
}
},
//下载
downloadFormwork() {
download_student_info({ val: this.request_params.val }).then(res => {
download_student_info({ val: this.request_params.val }).then((res) => {
console.log('下载模板');
console.log(res);
if (res.code == 200) {
......@@ -439,7 +563,7 @@ export default {
let url = `${this.IP}${res.message}`;
exportText(url, str[str.length - 1]);
}
})
});
},
//上传类型的按钮回调
sliderRequest(upload) {
......@@ -447,13 +571,13 @@ export default {
console.log(upload);
if (upload.btn_code == 'upload') {
const formData = new FormData();
formData.append('file', upload.file)
upload_student_info(formData).then(res => {
formData.append('file', upload.file);
upload_student_info(formData).then((res) => {
if (res.code == 200) {
this.$message.success(res.message);
this.getListData();
}
})
});
}
if (upload.btn_code == 'batch_reservation') {
console.log('批量上传');
......@@ -461,26 +585,24 @@ export default {
},
//手机号加密
phoneEncryption(phone_number) {
let tel = "" + phone_number;
let tel = '' + phone_number;
if (tel.length == 11) {
return tel.substr(0, 3) + "****" + tel.substr(7);
return tel.substr(0, 3) + '****' + tel.substr(7);
} else {
return phone_number
return phone_number;
}
},
//身份证加密
idcardEncryption(id) {
let tel = "" + id;
let tel = '' + id;
if (tel.length == 18) {
return tel.substr(0, 4) + "**********" + tel.substr(14);
return tel.substr(0, 4) + '**********' + tel.substr(14);
} else {
return id
return id;
}
},
},
}
};
</script>
<style lang="scss" scoped>
.remark_box {
......
......@@ -3,7 +3,7 @@
* @Author: AnthonyD
* @Date: 2023-03-29 17:06:03
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-19 10:34:19
* @Last Modified time: 2023-04-21 17:13:47
*/
</script>
<template>
......@@ -261,6 +261,7 @@ export default {
chart_id: 'bar_chart1',
color: '#E6A23C',
title: '南北方正确/错误率',
labers,
keys,
raw_data: datas,
......@@ -375,6 +376,7 @@ export default {
type: 'table',
chart_id: 'wrong_group',
color: '#529B2E',
title: '错误组别',
labers,
list,
......@@ -401,7 +403,8 @@ export default {
});
return {
type: 'table',
chart_id: 'wrong_group',
chart_id: 'wrong_groups',
color: '#529B2E',
title: '错误正副组',
labers,
......@@ -460,7 +463,7 @@ export default {
});
return {
type: 'eye_stability_table',
chart_id: 'wrong_group',
chart_id: 'eye_stability',
color: '#E6A23C',
title: '眼光稳定性',
labers,
......
......@@ -203,7 +203,7 @@ export default {
btnClick(val) {
console.log('右侧按钮');
console.log(val);
if (val.val == 'add') this.addInformation();
if (val == 'add') this.addInformation();
},
init() {
......
......@@ -3,16 +3,26 @@
* @Author: AnthonyD
* @Date: 2023-03-28 10:34:24
* @Last Modified by: AnthonyD
* @Last Modified time: 2023-04-21 13:58:02
* @Last Modified time: 2023-04-21 14:57:01
*/
</script>
<template>
<div class="module_container">
<div class="card_container">
<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">
<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>
<el-table-column prop="grade" label="品种等级">
......@@ -21,40 +31,63 @@
<div>{{ scope.row.grade_name }}</div>
</template>
</el-table-column>
<el-table-column prop="appearance_characteristics" label="等级外观特征">
<el-table-column
prop="appearance_characteristics"
label="等级外观特征"
>
<template slot-scope="scope">
<el-popover placement="right" trigger="hover">
<div v-for="(item, key, index) in scope.row.appearance_characteristics" :key="index">
<div
v-for="(item, key, index) in scope.row
.appearance_characteristics"
:key="index"
>
<span>{{ key }}</span> :
<span>{{ scope.row.appearance_characteristics[key] }}</span>
</div>
<el-button slot="reference" type="text" size="mini" title="点击查看">. . .</el-button>
<el-button
slot="reference"
type="text"
size="mini"
title="点击查看"
>. . .</el-button
>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="price1" label="一价区" width="100">
<template slot-scope="scope"><span>¥{{ scope.row.price1 }}</span></template>
<template slot-scope="scope"
><span>¥{{ scope.row.price1 }}</span></template
>
</el-table-column>
<el-table-column prop="price2" label="二价区" width="100">
<template slot-scope="scope"><span>¥{{ scope.row.price2 }}</span></template>
<template slot-scope="scope"
><span>¥{{ scope.row.price2 }}</span></template
>
</el-table-column>
<el-table-column prop="price3" label="三价区" width="100">
<template slot-scope="scope"><span>¥{{ scope.row.price3 }}</span></template>
</el-table-column>
<el-table-column prop="grade2" label="组别">
</el-table-column>
<el-table-column prop="remark" label="备注">
<template slot-scope="scope"
><span>¥{{ scope.row.price3 }}</span></template
>
</el-table-column>
<el-table-column prop="grade2" label="组别"> </el-table-column>
<el-table-column prop="remark" label="备注"> </el-table-column>
<el-table-column prop="adjacent_grade" label="同组别紧邻等级">
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.adjacent_grade" :key="index">
<div
v-for="(item, index) in scope.row.adjacent_grade"
:key="index"
>
<span>{{ item }},</span>
</div>
</template>
</el-table-column>
<el-table-column prop="quality_adjacent" label="外观质量相邻等级">
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.quality_adjacent" :key="index">
<div
v-for="(item, index) in scope.row.quality_adjacent"
:key="index"
>
<span>{{ item }},</span>
</div>
</template>
......@@ -63,27 +96,51 @@
</el-table-column>
<el-table-column label="操作" width="120">
<template slot-scope="scope">
<el-button size="mini" type="text" style="color: #000;"
@click="editTobaccoGrades(scope.row)">编辑</el-button>
<el-button size="mini" type="text" style="color: #F56C6C;"
@click="deleteTobaccoGrades(scope.row)">删除</el-button>
<el-button
size="mini"
type="text"
style="color: #000"
@click="editTobaccoGrades(scope.row)"
>编辑</el-button
>
<el-button
size="mini"
type="text"
style="color: #f56c6c"
@click="deleteTobaccoGrades(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div style="text-align: right;">
<el-pagination @current-change="handleCurrentChange" :current-page.sync="request_params.page"
:page-size="request_params.limit" layout="total, prev, pager, next" :total="request_params.total">
<div style="text-align: right">
<el-pagination
@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>
</div>
</el-card>
</div>
<el-dialog :title="is_updata_type == 'add' ? '新增烟草等级' : '修改烟草等级'" :visible.sync="is_dialogVisible" width="60%"
top="50px" :before-close="handleClose">
<el-dialog
:title="is_updata_type == 'add' ? '新增烟草等级' : '修改烟草等级'"
:visible.sync="is_dialogVisible"
width="60%"
top="50px"
:before-close="handleClose"
>
<div>
<Dialog v-if="is_dialogVisible" :tobacco_grades_infos="tobacco_grades_info" @handleClose="handleClose"
@submitData="submitData"></Dialog>
<Dialog
v-if="is_dialogVisible"
:tobacco_grades_infos="tobacco_grades_info"
@handleClose="handleClose"
@submitData="submitData"
></Dialog>
</div>
</el-dialog>
</div>
......@@ -92,27 +149,34 @@
<script>
import TableHead from '@/components/TableHead/index';
import Dialog from './components/dialog.vue';
import { get_tobacco_grades_all, get_tobacco_grades_list, add_tobacco_grades, delete_tobacco_grades, updata_tobacco_grades, get_tobacco_grades_detail } from '@/api/student';
import {
get_tobacco_grades_all,
get_tobacco_grades_list,
add_tobacco_grades,
delete_tobacco_grades,
updata_tobacco_grades,
get_tobacco_grades_detail,
} from '@/api/student';
const standard_template = {
grade_code: "",
grade_name: "",
grade: "",
position: "",
color: "",
large_scale: "",
grade2: "",
grade_code: '',
grade_name: '',
grade: '',
position: '',
color: '',
large_scale: '',
grade2: '',
adjacent_grade: [],
quality_adjacent: [],
price1: "",
price2: "",
price3: "",
price4: "",
price_other: "",
price1: '',
price2: '',
price3: '',
price4: '',
price_other: '',
appearance_characteristics: {},
appearance_characteristics_list: [],
remark: ""
}
remark: '',
};
export default {
data() {
return {
......@@ -125,12 +189,12 @@ export default {
text: '新增',
icon: 'el-icon-plus',
event: 'add',
}
},
],
},
//初始化请求参数
request_params: {
val: "",
val: '',
page: 1,
limit: 10,
total: null,
......@@ -143,7 +207,6 @@ export default {
//烟草品级信息
tobacco_grades_info: {},
//全部烟草品级,用来选择
};
},
......@@ -152,7 +215,7 @@ export default {
computed: {},
mounted() {
this.init()
this.init();
},
methods: {
......@@ -171,7 +234,7 @@ export default {
btnClick(val) {
console.log('右侧按钮');
console.log(val);
if (val.val == 'add') this.addTobaccoGrades();
if (val == 'add') this.addTobaccoGrades();
},
init() {
......@@ -189,7 +252,7 @@ export default {
console.log(val);
let params = this.$handleParams(val);
if (this.is_updata_type == 'add') {
add_tobacco_grades(params).then(res => {
add_tobacco_grades(params).then((res) => {
console.log('新增');
console.log(res);
if (res.code == 200) {
......@@ -197,10 +260,10 @@ export default {
this.is_dialogVisible = false;
this.getTobaccoGradesList();
}
})
});
} else {
let id = val.id;
updata_tobacco_grades(id, params).then(res => {
updata_tobacco_grades(id, params).then((res) => {
console.log('修改');
console.log(res);
if (res.code == 200) {
......@@ -208,32 +271,32 @@ export default {
this.is_dialogVisible = false;
this.getTobaccoGradesList();
}
})
});
}
},
//获取全部烟草品级
getTobaccoGradesAll() {
get_tobacco_grades_all().then(res => {
get_tobacco_grades_all().then((res) => {
console.log('全部烟草');
console.log(res);
let list = res.map(item => {
return { label: item.grade_name, value: item.grade_code }
})
let list = res.map((item) => {
return { label: item.grade_name, value: item.grade_code };
});
console.log(list);
})
});
},
//获取列表
getTobaccoGradesList() {
this.is_loading = true;
let params = this.$removeProperty(this.request_params);
get_tobacco_grades_list(params).then(res => {
get_tobacco_grades_list(params).then((res) => {
console.log('烟草等级列表');
console.log(res);
this.tableData = res.data || [];
this.request_params.total = res.total;
this.is_loading = false;
})
});
},
//分页
handleCurrentChange(val) {
......@@ -250,17 +313,19 @@ export default {
editTobaccoGrades(item) {
this.is_updata_type = 'edit';
let id = item.id;
get_tobacco_grades_detail(id).then(res => {
get_tobacco_grades_detail(id).then((res) => {
console.log('获取详情');
console.log(res);
this.tobacco_grades_info = { ...res };
this.tobacco_grades_info.appearance_characteristics_list = [];
for (const key in res.appearance_characteristics) {
this.tobacco_grades_info.appearance_characteristics_list.push({ label: key, value: res.appearance_characteristics[key] })
this.tobacco_grades_info.appearance_characteristics_list.push({
label: key,
value: res.appearance_characteristics[key],
});
}
this.is_dialogVisible = true;
})
});
},
//删除
deleteTobaccoGrades(item) {
......@@ -268,23 +333,24 @@ export default {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delete_tobacco_grades(id).then(res => {
if (res.code == 200) {
this.$message.success(res.message);
this.init();
}
type: 'warning',
})
.then(() => {
delete_tobacco_grades(id).then((res) => {
if (res.code == 200) {
this.$message.success(res.message);
this.init();
}
});
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
});
});
});
},
},
}
};
</script>
<style lang="scss" scoped></style>
......@@ -236,7 +236,7 @@ export default {
btnClick(val) {
console.log('右侧按钮');
console.log(val);
if (val.val == 'add') {
if (val == 'add') {
this.addDepartment(null);
}
},
......
......@@ -192,7 +192,7 @@ export default {
btnClick(val) {
console.log('右侧按钮');
console.log(val);
if (val.val == 'add') this.addRoles();
if (val == 'add') this.addRoles();
},
init() {
this.getPermissionBtnMenu();
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论