You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

352 lines
12 KiB

1 year ago
<template>
<div>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
1 year ago
<div slot="content">
1 year ago
1 year ago
<div class="searchwrap" style="display: flex;align-items: center;">
1 year ago
<div>
1 year ago
<div>
<el-input v-model="select.name" placeholder="请输入姓名"></el-input>
1 year ago
</div>
<div>
<el-input v-model="select.mobile" placeholder="请输入手机号"></el-input>
1 year ago
</div>
<div>
<el-input v-model="select.company_name" placeholder="请输入公司名称"></el-input>
</div>
<div>
<el-select v-model="select.company_position" placeholder="请选择职务" clearable>
1 year ago
<el-option v-for="item in formSelect.company_position" :key="item.id" :label="item.value"
:value="item.value">
1 year ago
</el-option>
</el-select>
</div>
<div>
1 year ago
<el-select v-model="select.company_area" placeholder="请选择所属区域" clearable>
<el-option v-for="item in formSelect.company_area" :key="item.id" :label="item.value"
:value="item.value">
1 year ago
</el-option>
</el-select>
</div>
<div>
1 year ago
<el-select v-model="select.company_type" placeholder="请选择企业性质" clearable>
<el-option v-for="item in formSelect.company_type" :key="item.id" :label="item.value"
:value="item.value">
1 year ago
</el-option>
</el-select>
</div>
1 year ago
1 year ago
<div>
<el-select v-model="select.company_industry" placeholder="请选择所属行业" clearable>
1 year ago
<el-option v-for="item in formSelect.company_industry" :key="item.id" :label="item.value"
:value="item.value">
1 year ago
</el-option>
</el-select>
</div>
1 year ago
<div>
<el-select v-model="select.type" placeholder="请选择人才类型" clearable>
<el-option v-for="item in formSelect.type" :key="item.id" :label="item.value" :value="item.value">
</el-option>
</el-select>
</div>
<div>
<el-select v-model="select.education" placeholder="请选择学历" clearable>
<el-option v-for="item in formSelect.education" :key="item.id" :label="item.value"
:value="item.value">
</el-option>
</el-select>
</div>
<div>
<el-select v-model="select.is_vip" placeholder="请选择学员身份" clearable>
<el-option v-for="item in is_vip_list" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
1 year ago
</div>
<div>
<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>
</el-select>
1 year ago
</div>
<div>
<el-date-picker style="width:100%" @change="changeDate" v-model="select.courses_end_date" type="date"
placeholder="课程结束日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd">
</el-date-picker>
</div>
<div>
1 year ago
<el-button type="primary" size="small" @click="select.page=1,getList()"></el-button>
1 year ago
<el-button type="primary" size="small" @click="importTable"></el-button>
1 year ago
<el-button type="primary" size="small" @click="updateSchoolmates(1)"></el-button>
<el-button type="primary" size="small" @click="updateSchoolmates(0)"></el-button>
</div>
1 year ago
</div>
1 year ago
1 year ago
</div>
</div>
</lx-header>
</div>
</div>
1 year ago
<div>
1 year ago
<xy-table :list="list" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange" :showIndex="false"
@selection-change="selectionChange" :total="total" :table-item="table_item">
<template v-slot:course_list>
<el-table-column align='left' label="课程" width="320" header-align="center">
<template slot-scope="scope">
<div v-for="(item,index) in scope.row.courses">
<div>{{index+1}}{{item.name}}</div>
</div>
</template>
</el-table-column>
1 year ago
</template>
<template v-slot:mobile>
<el-table-column align='center' label="联系方式" width="120" header-align="center">
<template slot-scope="scope">
{{base.maskPhoneNumber(scope.row.mobile)}}
</template>
</el-table-column>
</template>
1 year ago
<template v-slot:is_schoolmate>
<el-table-column align='center' label="是否校友库学员" width="120" header-align="center">
1 year ago
<template slot-scope="scope">
<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>
1 year ago
</div>
</template>
</el-table-column>
</template>
<template v-slot:is_vip>
<el-table-column align='center' label="学员身份" width="120" header-align="center">
1 year ago
<template slot-scope="scope">
<!-- <div v-for="item in is_schoolmate_list">
<div v-if="scope.row.is_vip===item.id">{{item.value}}</div>
</div> -->
<div v-if="scope.row.is_vip===1">VIP</div>
1 year ago
<div v-else></div>
1 year ago
</template>
</el-table-column>
</template>
1 year ago
<template v-slot:btns>
<el-table-column align='center' label="操作" fixed="right" width="80" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="showDetail('show',scope.row.id)"></el-button>
</template>
</el-table-column>
</template>
</xy-table>
</div>
1 year ago
<student-detail ref="studentDetail"></student-detail>
1 year ago
<imports ref="imports" :table-name="'users'" @refresh="getList"></imports>
1 year ago
1 year ago
</div>
</template>
<script>
import studentDetail from './components/detail.vue';
1 year ago
import myMixins from "@/mixin/selectMixin.js";
1 year ago
import formMixin from "@/mixin/formMixin.js";
1 year ago
import {
1 year ago
indexStudy,
updateSchoolmate
1 year ago
} from '@/api/student/index.js'
1 year ago
import imports from "@/views/component/imports.vue"
1 year ago
export default {
1 year ago
mixins: [myMixins, formMixin],
1 year ago
components: {
1 year ago
studentDetail,
imports
1 year ago
},
data() {
1 year ago
return {
path: '',
1 year ago
select: {
1 year ago
name: '',
mobile: '',
1 year ago
course_name: '',
company_name: '',
company_position: '',
company_area: '',
company_type: '',
company_industry: '',
1 year ago
is_vip: '',
is_schoolmate: '',
1 year ago
courses_end_date: '',
1 year ago
page: 1,
page_size: 10,
1 year ago
},
1 year ago
list: [],
1 year ago
total: 0,
1 year ago
seleSchoolmates: [],
1 year ago
table_item: [{
1 year ago
type: 'selection',
width: 50,
fixed: 'left'
}, {
prop: 'course_list',
label: '课程',
align: 'left',
}, {
1 year ago
prop: 'username',
1 year ago
label: '姓名',
1 year ago
align: 'center',
width: 120
1 year ago
}, {
1 year ago
prop: 'sex',
label: '性别',
align: 'center',
width: 120
1 year ago
}, {
1 year ago
prop: 'idcard',
label: '身份证号',
align: 'center',
width: 180
1 year ago
}, {
prop: 'mobile',
label: '联系方式',
align: 'center',
width: 120,
}, {
prop: 'birthday',
label: '出生日期',
align: 'center',
width: 120,
}, {
prop: 'email',
label: '邮箱',
align: 'center',
width: 120,
}, {
1 year ago
prop: 'company_name',
1 year ago
label: '公司名称',
1 year ago
align: 'left',
}, {
1 year ago
prop: 'company_position',
1 year ago
label: '职务',
align: 'center',
width: 120,
}, {
1 year ago
prop: 'is_schoolmate',
label: '是否校友库学员',
align: 'center',
width: 120,
}, {
prop: 'is_vip',
label: '学员身份',
1 year ago
align: 'center',
width: 120,
1 year ago
}]
1 year ago
}
},
created() {
1 year ago
this.getList()
1 year ago
},
1 year ago
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}
},
1 year ago
pageIndexChange(e) {
this.select.page = e
this.getList()
},
pageSizeChange(e) {
this.select.page_size = e
this.select.page = 1
this.getList()
1 year ago
},
1 year ago
async getList() {
const res = await indexStudy({
page: this.select.page,
page_size: this.select.page_size,
1 year ago
name: this.select.name,
mobile: this.select.mobile,
1 year ago
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,
1 year ago
courses_end_date: this.select.courses_end_date,
is_schoolmate: this.select.is_schoolmate
1 year ago
})
1 year ago
this.list = res.list.data
1 year ago
this.total = res.list.total
},
changeDate(e) {
if (e) {
this.select.courses_end_date = e
} else {
this.select.courses_end_date = ''
}
},
// 批量设置校友库
selectionChange(e) {
console.log(e)
this.seleSchoolmates = e
},
updateSchoolmates(vip) {
if (this.seleSchoolmates.length > 0) {
let ids = []
this.seleSchoolmates.map(item => {
ids.push(item.id)
})
updateSchoolmate({
is_schoolmate: vip,
ids: ids.join(',')
}).then(res => {
this.$Message.success("批量设置成功")
this.getList()
})
} else {
this.$Message.warning("请先选择学员")
return
}
1 year ago
},
1 year ago
showDetail(type, id) {
this.$refs.studentDetail.id = id
this.$refs.studentDetail.type = type
this.$refs.studentDetail.isShow = true
1 year ago
}
1 year ago
}
}
</script>
<style lang="scss" scoped>
.searchwrap {
display: flex;
align-items: center;
1 year ago
flex-wrap: wrap;
1 year ago
1 year ago
&>div {
display: flex;
align-items: center;
1 year ago
// margin-bottom: 10px;
flex-wrap: wrap;
1 year ago
&>div {
1 year ago
margin-right: 10px;
margin-bottom: 10px;
width: 150px;
&:last-child {
width: auto
1 year ago
}
1 year ago
}
}
}
</style>