lion 1 year ago
parent a1a5816dc5
commit bd1fc8cc0f

@ -153,7 +153,7 @@ export default {
type: 'success' type: 'success'
}, { }, {
id: 2, id: 2,
value: '驳回', value: '审核不通过',
type: 'warning' type: 'warning'
}, { }, {
id: 3, id: 3,

@ -69,7 +69,7 @@
</div> </div>
<div style="margin-top:15px"> <div style="margin-top:15px">
<el-button type="primary" style='margin:15px;' @click="submit(1)"></el-button> <el-button type="primary" style='margin:15px;' @click="submit(1)"></el-button>
<el-button type="primary" style='margin:15px;' @click="submit(2)"></el-button> <el-button type="primary" style='margin:15px;' @click="submit(2)"></el-button>
<el-button type="primary" plain style='margin:15px;' @click="submit(3)"></el-button> <el-button type="primary" plain style='margin:15px;' @click="submit(3)"></el-button>
</div> </div>
</div> </div>

@ -75,7 +75,9 @@
this.dialogVisible = false; this.dialogVisible = false;
}, },
// //
async getHeaders() { async getHeaders() {
//
const res = await realTableShow({ const res = await realTableShow({
table_name: this.tableName table_name: this.tableName
}) })
@ -192,7 +194,8 @@
}, },
computed: {}, computed: {},
watch: { watch: {
formInfo(newVal) { formInfo(newVal) {
console.log("formInfo", newVal)
if (newVal && newVal instanceof Array) { if (newVal && newVal instanceof Array) {
this.table = this.headers = newVal.map((i) => { this.table = this.headers = newVal.map((i) => {
return { return {
@ -203,12 +206,29 @@
} }
}, },
dialogVisible(newval) { dialogVisible(newval) {
console.log("newval", newval, this.tableName) console.log("newval", newval, this.tableName,this.formInfo)
if (newval) { if (newval) {
let changeTableName = this.tableName.replace('_', '-') let changeTableName = this.tableName.replace('_', '-')
this.action = `${process.env.VUE_APP_BASE_API}/api/admin/${changeTableName}/excel-show` this.action = `${process.env.VUE_APP_BASE_API}/api/admin/${changeTableName}/excel-show`
this.import_action = `/api/admin/${changeTableName}/import` this.import_action = `/api/admin/${changeTableName}/import`
this.getHeaders()
//
if(this.tableName==='users'){
this.import_action = `/api/admin/${changeTableName}/import-study`
this.table = this.headers = this.formInfo.map((i) => {
if(i.prop){
return {
key: i.prop,
title: i.label,
};
}
});
console.log("this.table",this.headers)
}else{
this.getHeaders()
}
console.log("action", this.action, this.import_action) console.log("action", this.action, this.import_action)
} else { } else {
this.tableList = [] this.tableList = []

@ -33,8 +33,10 @@
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange" :table-item="table_item"> <xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange" :table-item="table_item">
<template v-slot:dateRange> <template v-slot:dateRange>
<el-table-column align='center' label="开课日期" width="200" header-align="center"> <el-table-column align='center' label="开课日期" width="200" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.start_date}}{{scope.row.end_date}} <div>
{{scope.row.start_date?scope.row.start_date+'至'+scope.row.end_date:''}}
</div>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>

@ -117,7 +117,7 @@
<template v-slot:image_id v-if="active===0"> <template v-slot:image_id v-if="active===0">
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold;"> <div class="xy-table-item-label" style="font-weight: bold;">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>课程封面680*380 <span style="color: red;font-weight: bold;padding-right: 4px;"></span>课程封面680*380
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-upload :action="action" class='upload-demo' :on-exceed="onExceed" :limit="1" list-type="picture-card" <el-upload :action="action" class='upload-demo' :on-exceed="onExceed" :limit="1" list-type="picture-card"
@ -265,10 +265,10 @@
required: true, required: true,
message: '请选择课程类别' message: '请选择课程类别'
}], }],
image_id: [{ // image_id: [{
required: true, // required: true,
message: '请上传课程封面' // message: ''
}], // }],
// content: [{ // content: [{
// required: true, // required: true,
// message: '' // message: ''

@ -8,7 +8,7 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span> <span style="color: red;font-weight: bold;padding-right: 4px;"></span>
</div> </div>
<div class="xy-table-item-content" style="flex-grow:1;text-align:center" v-if="row.fee_files && row.fee_files.length>0"> <div class="xy-table-item-content" style="flex-grow:1;text-align:center" v-if="row.fee_files && row.fee_files.length>0">
<div v-for="item in row.fee_files"> <div v-for="item in row.fee_files" style="height:300px">
<img style="height:300px" :src="item.url" alt=""> <img style="height:300px" :src="item.url" alt="">
</div> </div>
<div> <div>

@ -68,8 +68,7 @@
show({ show({
id: this.id id: this.id
}).then(res => { }).then(res => {
this.form = this.base.requestToForm(res, this.form) this.form = this.base.deepCopy(res, this.form)
this.$forceUpdate()
}) })
}, },
}, },

@ -16,8 +16,10 @@
</div> </div>
</div> </div>
<div class="code" v-if="imgSrc"> <div class="code">
<img :src="imgSrc"></img> <div v-if="imgSrc">
<img :src="imgSrc"></img>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -86,12 +88,12 @@
} }
.code { .code {
height: 300px; height: 200px;
text-align: center; text-align: center;
>img { img {
width: 300px; width: 200px;
height: 300px; height: 200px;
} }
} }
</style> </style>

@ -80,8 +80,8 @@
<el-table-column v-if="url_type=='pay'" align='center' fixed="right" label="操作" width="80" <el-table-column v-if="url_type=='pay'" align='center' fixed="right" label="操作" width="80"
header-align="center"> header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- --> <!-- -->
<el-button type="primary" v-if="scope.row.fee_status===3" size="small" <el-button type="primary" size="small" v-if="scope.row.fee_status===3"
@click="showCheckPay(scope.row)">核对</el-button> @click="showCheckPay(scope.row)">核对</el-button>
</template> </template>
</el-table-column> </el-table-column>

@ -10,9 +10,9 @@
<div> <div>
<div> <div>
<el-input v-model="select.name" placeholder="请输入姓名"></el-input> <el-input v-model="select.name" placeholder="请输入姓名"></el-input>
</div> </div>
<div> <div>
<el-input v-model="select.mobile" placeholder="请输入手机号"></el-input> <el-input v-model="select.mobile" placeholder="请输入手机号"></el-input>
</div> </div>
<div> <div>
<el-input v-model="select.company_name" placeholder="请输入公司名称"></el-input> <el-input v-model="select.company_name" placeholder="请输入公司名称"></el-input>
@ -64,12 +64,12 @@
<el-option v-for="item in is_vip_list" :key="item.id" :label="item.value" :value="item.id"> <el-option v-for="item in is_vip_list" :key="item.id" :label="item.value" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<div> <div>
<el-select v-model="select.is_schoolmate" placeholder="请选择是否校友" clearable> <el-select v-model="select.is_schoolmate" placeholder="请选择是否校友" clearable>
<el-option v-for="item in is_schoolmate_list" :key="item.id" :label="item.value" :value="item.id"> <el-option v-for="item in is_schoolmate_list" :key="item.id" :label="item.value" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<div> <div>
<el-date-picker style="width:100%" @change="changeDate" v-model="select.courses_end_date" type="date" <el-date-picker style="width:100%" @change="changeDate" v-model="select.courses_end_date" type="date"
@ -78,7 +78,7 @@
</div> </div>
<div> <div>
<el-button type="primary" size="small" @click="select.page=1,getList()"></el-button> <el-button type="primary" size="small" @click="select.page=1,getList()"></el-button>
<el-button type="primary" size="small">导入</el-button> <el-button type="primary" size="small" @click="importTable"></el-button>
<el-button type="primary" size="small" @click="updateSchoolmates(1)"></el-button> <el-button type="primary" size="small" @click="updateSchoolmates(1)"></el-button>
<el-button type="primary" size="small" @click="updateSchoolmates(0)"></el-button> <el-button type="primary" size="small" @click="updateSchoolmates(0)"></el-button>
</div> </div>
@ -106,20 +106,20 @@
</template> </template>
<template v-slot:is_schoolmate> <template v-slot:is_schoolmate>
<el-table-column align='center' label="是否校友库学员" width="120" header-align="center"> <el-table-column align='center' label="是否校友库学员" width="120" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-for="item in is_schoolmate_list"> <div v-for="item in is_schoolmate_list">
<el-tag v-if="scope.row.is_schoolmate===item.id" :type="item.type">{{item.value}}</el-tag> <el-tag v-if="scope.row.is_schoolmate===item.id" :type="item.type">{{item.value}}</el-tag>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<template v-slot:is_vip> <template v-slot:is_vip>
<el-table-column align='center' label="学员身份" width="120" header-align="center"> <el-table-column align='center' label="学员身份" width="120" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <div v-for="item in is_schoolmate_list"> <!-- <div v-for="item in is_schoolmate_list">
<div v-if="scope.row.is_vip===item.id">{{item.value}}</div> <div v-if="scope.row.is_vip===item.id">{{item.value}}</div>
</div> --> </div> -->
<div v-if="scope.row.is_vip===1">VIP</div> <div v-if="scope.row.is_vip===1">VIP</div>
<div v-else></div> <div v-else></div>
</template> </template>
</el-table-column> </el-table-column>
@ -134,7 +134,9 @@
</xy-table> </xy-table>
</div> </div>
<student-detail ref="studentDetail"></student-detail> <student-detail ref="studentDetail"></student-detail>
<imports ref="imports" :formInfo="table_item" :table-name="'users'" @refresh="getList"></imports>
</div> </div>
</template> </template>
@ -146,25 +148,27 @@
indexStudy, indexStudy,
updateSchoolmate updateSchoolmate
} from '@/api/student/index.js' } from '@/api/student/index.js'
import imports from "@/views/component/imports.vue"
export default { export default {
mixins: [myMixins, formMixin], mixins: [myMixins, formMixin],
components: { components: {
studentDetail studentDetail,
imports
}, },
data() { data() {
return { return {
path: '', path: '',
select: { select: {
name: '', name: '',
mobile:'', mobile: '',
course_name: '', course_name: '',
company_name: '', company_name: '',
company_position: '', company_position: '',
company_area: '', company_area: '',
company_type: '', company_type: '',
company_industry: '', company_industry: '',
is_vip: '', is_vip: '',
is_schoolmate:'', is_schoolmate: '',
courses_end_date: '', courses_end_date: '',
page: 1, page: 1,
page_size: 10, page_size: 10,
@ -236,7 +240,16 @@
created() { created() {
this.getList() this.getList()
}, },
methods: { methods: {
importTable(row) {
// this.$refs.imports.tableData = {
// 'data[course_id]': row.course_id,
// 'data[course_content_id]': row.id
// }
this.$refs.imports.show()
// {"course_id":15,"course_content_id":188}
},
pageIndexChange(e) { pageIndexChange(e) {
this.select.page = e this.select.page = e
this.getList() this.getList()
@ -250,16 +263,16 @@
const res = await indexStudy({ const res = await indexStudy({
page: this.select.page, page: this.select.page,
page_size: this.select.page_size, page_size: this.select.page_size,
name: this.select.name, name: this.select.name,
mobile:this.select.mobile, mobile: this.select.mobile,
company_name: this.select.company_name, company_name: this.select.company_name,
company_position: this.select.company_position, company_position: this.select.company_position,
company_area: this.select.company_area, company_area: this.select.company_area,
company_type: this.select.company_type, company_type: this.select.company_type,
company_industry: this.select.company_industry, company_industry: this.select.company_industry,
is_vip: this.select.is_vip, is_vip: this.select.is_vip,
courses_end_date: this.select.courses_end_date, courses_end_date: this.select.courses_end_date,
is_schoolmate:this.select.is_schoolmate is_schoolmate: this.select.is_schoolmate
}) })
this.list = res.list.data this.list = res.list.data
this.total = res.list.total this.total = res.list.total
@ -316,11 +329,12 @@
flex-wrap: wrap; flex-wrap: wrap;
&>div { &>div {
margin-right: 10px; margin-right: 10px;
margin-bottom: 10px; margin-bottom: 10px;
width: 150px; width: 150px;
&:last-child {
width:auto &:last-child {
width: auto
} }
} }

@ -72,7 +72,7 @@
</div> </div>
<div> <div>
<el-button type="primary" size="small" @click="select.page=1,getList()"></el-button> <el-button type="primary" size="small" @click="select.page=1,getList()"></el-button>
<el-button type="primary" size="small">导出</el-button> <el-button type="primary" size="small" @click="exportExcel"></el-button>
</div> </div>
</div> </div>
@ -130,7 +130,10 @@
<script> <script>
import studentDetail from './components/detail.vue'; import studentDetail from './components/detail.vue';
import myMixins from "@/mixin/selectMixin.js"; import myMixins from "@/mixin/selectMixin.js";
import formMixin from "@/mixin/formMixin.js"; import formMixin from "@/mixin/formMixin.js";
import {
download
} from "@/utils/downloadRequest";
import { import {
indexStudy indexStudy
} from '@/api/student/index.js' } from '@/api/student/index.js'
@ -260,6 +263,30 @@
this.$refs.studentDetail.id = id this.$refs.studentDetail.id = id
this.$refs.studentDetail.type = type this.$refs.studentDetail.type = type
this.$refs.studentDetail.isShow = true this.$refs.studentDetail.isShow = true
},
exportExcel() {
let _export = {}
this.table_item.map(item => {
_export[item.prop] = item.label
})
download(
'/api/admin/users/study',
'get', {
export_fields: _export,
name: this.select.name,
mobile:this.select.mobile,
company_name: this.select.company_name,
company_position: this.select.company_position,
company_area: this.select.company_area,
company_type: this.select.company_type,
company_industry: this.select.company_industry,
is_vip: this.select.is_vip,
courses_end_date: this.select.courses_end_date,
is_export: 1,
page: 1,
page_size: 999
},
`学员信息.xlsx`)
} }
} }
} }

Loading…
Cancel
Save