太湖英才管理
This commit is contained in:
@@ -77,6 +77,7 @@ const mainRoutes = {
|
||||
|
||||
{ path: '/training-course-list', component: _import('modules/trainingCourse/training-course-list'), name: 'training-course-list', meta: { title: '培训班管理', isTab: true } },
|
||||
{ path: '/training-course-user', component: _import('modules/trainingCourse/training-course-user'), name: 'training-course-user', meta: { title: '用户列表', isTab: true } },
|
||||
{ path: '/talents-list', component: _import('modules/talents/talents-list'), name: 'talents-list', meta: { title: '太湖英才列表', isTab: true } },
|
||||
],
|
||||
beforeEnter (to, from, next) {
|
||||
let token = Vue.cookie.get('token')
|
||||
|
||||
557
src/views/modules/talents/talents-list.vue
Normal file
557
src/views/modules/talents/talents-list.vue
Normal file
@@ -0,0 +1,557 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="dataForm"
|
||||
@keyup.enter.native="getDataList()"
|
||||
>
|
||||
<el-form-item label="姓名">
|
||||
<el-input
|
||||
v-model="dataForm.name"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属地域">
|
||||
<el-input
|
||||
v-model="dataForm.region"
|
||||
placeholder="请输入所属地域"
|
||||
clearable
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
@click="
|
||||
pageIndex = 1;
|
||||
getDataList();
|
||||
"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="addHandle()"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
align="center"
|
||||
width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" align="center" width="120">
|
||||
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="头像" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<img width="50px" :src="scope.row.icon" v-if="scope.row.icon" alt="" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="职称" align="center" width="140">
|
||||
<template slot-scope="scope">{{ scope.row.title }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="业务专长" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.specialty }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预约信息" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.reservation }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所属地域" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.region }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" width="160">
|
||||
<template slot-scope="scope">{{ scope.row.createTime }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="editHandle(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="deleteHandle(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
>
|
||||
</el-pagination>
|
||||
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<el-dialog
|
||||
:visible.sync="addOrUpdateVisible"
|
||||
:title="titlesub"
|
||||
class="dialog_box"
|
||||
@close="cancleClose"
|
||||
>
|
||||
<el-form
|
||||
:model="addForm"
|
||||
ref="addFormRef"
|
||||
:rules="addFormRule"
|
||||
label-width="110px"
|
||||
>
|
||||
<el-form-item label="手机号/邮箱" prop="tel" v-if="statusType==0">
|
||||
<div style="display: flex;align-items: center;">
|
||||
<el-autocomplete
|
||||
style=" width: 100%;"
|
||||
v-model="addForm.tel"
|
||||
:fetch-suggestions="loadAll"
|
||||
placeholder="请输入手机号/邮箱"
|
||||
@select="handleSelect"
|
||||
>
|
||||
<template #default="{ item }">
|
||||
<div class="custom-item">
|
||||
<span>{{ item.tel ? item.tel : item.email }}</span>
|
||||
<span
|
||||
style="color: gray; margin-left: 10px;"
|
||||
v-if="item.name"
|
||||
>({{ item.name }})</span
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-autocomplete>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="addForm.name" placeholder="请输入姓名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="职称" prop="title">
|
||||
<el-input v-model="addForm.title" placeholder="请输入职称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务专长" prop="specialty">
|
||||
<el-input v-model="addForm.specialty" placeholder="请输入业务专长"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="预约信息" prop="reservation">
|
||||
<el-input v-model="addForm.reservation" placeholder="请输入预约信息"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属地域" prop="region">
|
||||
<el-input v-model="addForm.region" placeholder="请输入所属地域"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="出诊信息" prop="clinic">
|
||||
<el-input v-model="addForm.clinic" placeholder="请输入出诊信息"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="介绍" prop="introduce">
|
||||
<el-input type="textarea" v-model="addForm.introduce" placeholder="请输入介绍"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传头像" prop="icon">
|
||||
<el-upload
|
||||
:limit="1"
|
||||
class="el-uploadfeng"
|
||||
:action="baseUrl + '/oss/fileoss'"
|
||||
list-type="picture-card"
|
||||
:on-preview="handlePreview"
|
||||
:file-list="fileList"
|
||||
:on-success="handleSuccess"
|
||||
accept=".jpeg,.jpg,.gif,.png"
|
||||
:on-remove="handleRemove"
|
||||
>
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
<span>支持图片类型:.jpeg,.jpg,.gif,.png</span>
|
||||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
||||
<img width="100%" :src="addForm.icon" alt="" />
|
||||
</el-dialog>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancleClose">取 消</el-button>
|
||||
<el-button type="primary" @click="addOrEditCate">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import global from "../../common/common.vue"; //引入共用组间
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
baseUrl: global.baseUrl,
|
||||
dataForm: {
|
||||
name: "",
|
||||
region: ""
|
||||
},
|
||||
addForm: {
|
||||
tel: "",
|
||||
userId: "",
|
||||
id: "", //新增不传
|
||||
name: "",
|
||||
title: "",
|
||||
specialty: "",
|
||||
region: "",
|
||||
reservation: "",
|
||||
introduce: "",
|
||||
clinic: "",
|
||||
icon: ""
|
||||
},
|
||||
editId: "",
|
||||
addFormRule: {
|
||||
tel: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入手机号/邮箱",
|
||||
},
|
||||
],
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入姓名",
|
||||
},
|
||||
],
|
||||
title: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入职称",
|
||||
},
|
||||
],
|
||||
region: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入所属地域",
|
||||
},
|
||||
]
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
fileList: [],
|
||||
statusType: 0,
|
||||
dialogVisible: false,
|
||||
dataListLoading: false,
|
||||
addOrUpdateVisible: false,
|
||||
titlesub: '',
|
||||
};
|
||||
},
|
||||
activated(){
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/taihuTalent/getTaihuTalents"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
name: this.dataForm.name,
|
||||
region: this.dataForm.region
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.list;
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
loadAll(queryString, cb) {
|
||||
if (queryString == "") {
|
||||
return false;
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/user/getUserList"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
page: 1,
|
||||
limit: 9999,
|
||||
key: queryString
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
var arr = data.user.records;
|
||||
cb(arr);
|
||||
} else {
|
||||
cb([]);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSelect(item) {
|
||||
console.log(item);
|
||||
this.addForm.tel = item.tel;
|
||||
this.addForm.userId = item.id;
|
||||
},
|
||||
//新增
|
||||
addHandle(){
|
||||
this.addOrUpdateVisible = true;
|
||||
this.titlesub = '新增';
|
||||
this.statusType = 0; //新增
|
||||
this.$refs["addFormRef"].resetFields();
|
||||
this.addForm = {
|
||||
name: "",
|
||||
title: "",
|
||||
specialty: "",
|
||||
region: "",
|
||||
reservation: "",
|
||||
introduce: "",
|
||||
clinic: "",
|
||||
icon: ""
|
||||
}
|
||||
this.fileList = [];
|
||||
this.stopLoad = false;
|
||||
},
|
||||
//点击确定
|
||||
addOrEditCate(){
|
||||
if(this.statusType==0){ //如果是新增
|
||||
this.addCate();
|
||||
}else if(this.statusType==1){ //如果是修改
|
||||
this.editCate(this.addForm);
|
||||
}
|
||||
},
|
||||
addCate(){
|
||||
this.$refs["addFormRef"].validate(valid => {
|
||||
if (valid) {
|
||||
var icon = '';
|
||||
if(this.fileList&&this.fileList.length>0){
|
||||
icon = this.fileList[0].url
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/taihuTalent/addTaihuTalent"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
userId: this.addForm.userId,
|
||||
name: this.addForm.name,
|
||||
title: this.addForm.title,
|
||||
specialty: this.addForm.specialty,
|
||||
region: this.addForm.region,
|
||||
reservation: this.addForm.reservation,
|
||||
introduce: this.addForm.introduce,
|
||||
clinic: this.addForm.clinic,
|
||||
icon: icon
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success"
|
||||
});
|
||||
this.addOrUpdateVisible = false;
|
||||
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
editCate(data){
|
||||
this.$refs["addFormRef"].validate(valid => {
|
||||
if (valid) {
|
||||
var icon = '';
|
||||
if(this.fileList&&this.fileList.length>0){
|
||||
icon = this.fileList[0].url
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/taihuTalent/updateTaihuTalent"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
title: data.title,
|
||||
specialty: data.specialty,
|
||||
region: data.region,
|
||||
reservation: data.reservation,
|
||||
introduce: data.introduce,
|
||||
clinic: data.clinic,
|
||||
icon: icon
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success"
|
||||
});
|
||||
this.addOrUpdateVisible = false;
|
||||
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
//取消
|
||||
cancleClose(){
|
||||
this.addOrUpdateVisible = false;
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val;
|
||||
this.pageIndex = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val;
|
||||
this.getDataList();
|
||||
},
|
||||
|
||||
//操作
|
||||
//点击修改
|
||||
editHandle(data){
|
||||
this.fileList = [];
|
||||
this.addOrUpdateVisible = true;
|
||||
this.titlesub = '修改';
|
||||
this.statusType = 1; //修改
|
||||
|
||||
this.addForm.id = data.id;
|
||||
this.addForm.name = data.name;
|
||||
this.addForm.title = data.title;
|
||||
this.addForm.specialty = data.specialty;
|
||||
this.addForm.region = data.region;
|
||||
this.addForm.reservation = data.reservation;
|
||||
this.addForm.introduce = data.introduce;
|
||||
this.addForm.clinic = data.clinic;
|
||||
this.addForm.icon = data.icon;
|
||||
//图片赋值
|
||||
if(data.icon){
|
||||
this.fileList.push({
|
||||
url: data.icon
|
||||
});
|
||||
}
|
||||
},
|
||||
//点击删除
|
||||
deleteHandle(data){
|
||||
this.$confirm("确定删除该数据?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/taihuTalent/delTaihuTalent"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: data.id
|
||||
})
|
||||
})
|
||||
.then(({ data }) => {
|
||||
if (data.code == 0) {
|
||||
this.$message.success("删除成功");
|
||||
this.getDataList();
|
||||
}
|
||||
})
|
||||
.catch(({ e }) => {
|
||||
console.log(e, "e");
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
//上传图片
|
||||
handlePreview(file) {
|
||||
this.fileList = [];
|
||||
this.addForm.icon = file.url;
|
||||
this.fileList.push({
|
||||
url: file.url
|
||||
});
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
//图片上传成功
|
||||
handleSuccess(res, file) {
|
||||
if (res.msg == "success") {
|
||||
this.fileList.push({
|
||||
url: res.url
|
||||
});
|
||||
this.$message.success("图片上传成功");
|
||||
} else {
|
||||
this.$message.error("图片上传失败");
|
||||
}
|
||||
},
|
||||
//图片删除操作
|
||||
handleRemove(file, fileList) {
|
||||
this.fileList = [];
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" >
|
||||
::v-deep.custom-height {
|
||||
height: 370px;
|
||||
}
|
||||
.avatar-uploader {
|
||||
height: 1px;
|
||||
}
|
||||
.general_editor {
|
||||
height: 420px;
|
||||
width: 1060px !important;
|
||||
}
|
||||
.editor_form {
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
.dialog_box {
|
||||
.el-form-item__content {
|
||||
width: calc(100% - 120px) !important;
|
||||
}
|
||||
.form_item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.el-form-item {
|
||||
width: 290px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.checkbox-group .el-checkbox{
|
||||
margin-left: 0;
|
||||
margin-right: 20px;
|
||||
|
||||
.el-checkbox__label{
|
||||
padding-left: 6px;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
.hufen_block{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
span{
|
||||
width: 70px;
|
||||
display: inline-block;
|
||||
}
|
||||
.el-input{
|
||||
width: 90%;
|
||||
line-height: 34px;
|
||||
}
|
||||
.el-input__inner{
|
||||
width: 220px;
|
||||
height: 30px;
|
||||
line-height: 34px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
.el-input__inner::placeholder {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
.custom-flatpickr .el-range-input{
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
::v-deep.el-form-item__label{
|
||||
width: 110px;
|
||||
}
|
||||
</style>
|
||||
@@ -5,8 +5,8 @@
|
||||
window.SITE_CONFIG = {};
|
||||
|
||||
// api接口请求地址
|
||||
//window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com';
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';
|
||||
window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com';
|
||||
//window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';
|
||||
//window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb';
|
||||
|
||||
// cdn地址 = 域名 + 版本号
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
window.SITE_CONFIG = {};
|
||||
|
||||
// api接口请求地址
|
||||
//window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; //川
|
||||
window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
|
||||
//window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; //川
|
||||
//window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb'; //本地
|
||||
|
||||
// cdn地址 = 域名 + 版本号
|
||||
|
||||
Reference in New Issue
Block a user