1.培训班管理上下架操作
2.用户列表的导出功能 3.太湖英才表单增加职称、科室、地区选项
This commit is contained in:
@@ -321,7 +321,7 @@ this.$emit('delete',[row])
|
||||
row.isEdit = false
|
||||
var url = ""
|
||||
if(this.oprateType == "yingxiao"){
|
||||
url = "/master/medicineLabelAndMarket/editMarketSort"
|
||||
url = "/master/psycheLabelAndMarket/editMarketSort"
|
||||
}else{
|
||||
return
|
||||
}
|
||||
|
||||
@@ -59,15 +59,18 @@
|
||||
<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" width="140">
|
||||
<template slot-scope="scope">{{ scope.row.department }}</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">
|
||||
<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>
|
||||
@@ -141,17 +144,83 @@
|
||||
<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-select v-model="addForm.title" placeholder="请选择">
|
||||
<el-option value="主任" label="主任">主任</el-option>
|
||||
<el-option value="副主任" label="副主任">副主任</el-option>
|
||||
<el-option value="主任医师" label="主任医师">主任医师</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="科室" prop="department">
|
||||
<el-select v-model="addForm.department" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in departmentList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.label">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属地域" prop="region" v-if="!changeStatus">
|
||||
<div class="el-select">
|
||||
<el-input v-model="addForm.region" disabled class="el-input el-input--suffix"></el-input>
|
||||
</div>
|
||||
<el-button size="mini" type="default" class="editBtn" @click="changeCountry">修改</el-button>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="所属地域" v-if="changeStatus">
|
||||
<el-select
|
||||
v-model="selectCode"
|
||||
placeholder="请选择国家"
|
||||
:loading="countryLoading"
|
||||
@change="handleCountryChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="country in countries"
|
||||
:key="country.areaId"
|
||||
:label="country.title"
|
||||
:value="country.code"
|
||||
></el-option>
|
||||
</el-select>
|
||||
|
||||
<el-select
|
||||
v-model="selectedProvId"
|
||||
placeholder="请选择省份"
|
||||
:loading="provinceLoading"
|
||||
:disabled="!chinaStatus"
|
||||
@focus="loadProvinces"
|
||||
@change="handleProvinceChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="province in provinces"
|
||||
:key="province.provId"
|
||||
:label="province.provName"
|
||||
:value="province.provId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
|
||||
<el-select
|
||||
v-model="selectedCity"
|
||||
placeholder="请选择城市"
|
||||
:loading="cityLoading"
|
||||
:disabled="!chinaStatus"
|
||||
@change="handleCityChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="city in cities"
|
||||
:key="city.cityId"
|
||||
:label="city.cityName"
|
||||
:value="city.cityName"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</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>
|
||||
@@ -200,6 +269,7 @@ export default {
|
||||
userId: "",
|
||||
id: "", //新增不传
|
||||
name: "",
|
||||
department: '',
|
||||
title: "",
|
||||
specialty: "",
|
||||
region: "",
|
||||
@@ -208,6 +278,32 @@ export default {
|
||||
clinic: "",
|
||||
icon: ""
|
||||
},
|
||||
departmentList: [
|
||||
{
|
||||
value: '1',
|
||||
label: '消化专科'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '呼吸专科'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '风湿免疫专科'
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '肿瘤专科'
|
||||
},
|
||||
{
|
||||
value: '5',
|
||||
label: '妇科专科'
|
||||
},
|
||||
{
|
||||
value: '6',
|
||||
label: '全科医生'
|
||||
}
|
||||
],
|
||||
editId: "",
|
||||
addFormRule: {
|
||||
tel: [
|
||||
@@ -221,18 +317,6 @@ export default {
|
||||
required: true,
|
||||
message: "请输入姓名",
|
||||
},
|
||||
],
|
||||
title: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入职称",
|
||||
},
|
||||
],
|
||||
region: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入所属地域",
|
||||
},
|
||||
]
|
||||
},
|
||||
dataList: [],
|
||||
@@ -247,11 +331,31 @@ export default {
|
||||
titlesub: '',
|
||||
|
||||
current: 1,
|
||||
limit: 10
|
||||
limit: 10,
|
||||
|
||||
// 选择的值
|
||||
selectedCountry: '',
|
||||
selectedProvince: '',
|
||||
selectedCity: '',
|
||||
|
||||
// 加载状态
|
||||
countryLoading: false,
|
||||
provinceLoading: false,
|
||||
cityLoading: false,
|
||||
|
||||
// 数据存储
|
||||
countries: [],
|
||||
provinces: [],
|
||||
cities: [],
|
||||
chinaStatus: false,
|
||||
selectCode: null,
|
||||
selectedProvId: null,
|
||||
changeStatus: false
|
||||
};
|
||||
},
|
||||
activated(){
|
||||
this.getDataList();
|
||||
this.loadCountries();
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
@@ -305,10 +409,23 @@ export default {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.titlesub = '新增';
|
||||
this.statusType = 0; //新增
|
||||
this.$refs["addFormRef"].resetFields();
|
||||
|
||||
this.changeStatus = true;
|
||||
this.chinaStatus = false;
|
||||
this.selectCode = null;
|
||||
this.selectedProvId = null;
|
||||
this.selectedCity = '';
|
||||
|
||||
this.selectCode = null;
|
||||
this.selectedProvId = null;
|
||||
this.selectedCity = '';
|
||||
this.fileList = [];
|
||||
this.stopLoad = false;
|
||||
this.addForm = {
|
||||
tel: '',
|
||||
name: "",
|
||||
title: "",
|
||||
department: '',
|
||||
specialty: "",
|
||||
region: "",
|
||||
reservation: "",
|
||||
@@ -316,11 +433,23 @@ export default {
|
||||
clinic: "",
|
||||
icon: ""
|
||||
}
|
||||
this.fileList = [];
|
||||
this.stopLoad = false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addFormRef.clearValidate();
|
||||
});
|
||||
},
|
||||
//点击确定
|
||||
addOrEditCate(){
|
||||
//如果是中国 城市必选
|
||||
if(this.chinaStatus){
|
||||
if(!this.selectedCity){
|
||||
this.$message({
|
||||
message: "请选择城市",
|
||||
type: "warning"
|
||||
});
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
if(this.statusType==0){ //如果是新增
|
||||
this.addCate();
|
||||
}else if(this.statusType==1){ //如果是修改
|
||||
@@ -331,9 +460,17 @@ export default {
|
||||
this.$refs["addFormRef"].validate(valid => {
|
||||
if (valid) {
|
||||
var icon = '';
|
||||
var region = '';
|
||||
if(this.fileList&&this.fileList.length>0){
|
||||
icon = this.fileList[0].url
|
||||
}
|
||||
if(this.selectedCountry){
|
||||
if(!this.selectedProvince){
|
||||
region = this.selectedCountry
|
||||
}else{
|
||||
region = this.selectedProvince + this.selectedCity;
|
||||
}
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/taihuTalent/addTaihuTalent"),
|
||||
method: "post",
|
||||
@@ -341,8 +478,9 @@ export default {
|
||||
userId: this.addForm.userId,
|
||||
name: this.addForm.name,
|
||||
title: this.addForm.title,
|
||||
department: this.addForm.department,
|
||||
specialty: this.addForm.specialty,
|
||||
region: this.addForm.region,
|
||||
region: region,
|
||||
reservation: this.addForm.reservation,
|
||||
introduce: this.addForm.introduce,
|
||||
clinic: this.addForm.clinic,
|
||||
@@ -355,7 +493,7 @@ export default {
|
||||
type: "success"
|
||||
});
|
||||
this.addOrUpdateVisible = false;
|
||||
|
||||
this.dataList = [];
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
@@ -366,9 +504,17 @@ export default {
|
||||
this.$refs["addFormRef"].validate(valid => {
|
||||
if (valid) {
|
||||
var icon = '';
|
||||
var region = '';
|
||||
if(this.fileList&&this.fileList.length>0){
|
||||
icon = this.fileList[0].url
|
||||
}
|
||||
if(this.selectedCountry){
|
||||
if(!this.selectedProvince){
|
||||
region = this.selectedCountry
|
||||
}else{
|
||||
region = this.selectedProvince + this.selectedCity;
|
||||
}
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/taihuTalent/updateTaihuTalent"),
|
||||
method: "post",
|
||||
@@ -376,8 +522,9 @@ export default {
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
title: data.title,
|
||||
department: data.department,
|
||||
specialty: data.specialty,
|
||||
region: data.region,
|
||||
region: region,
|
||||
reservation: data.reservation,
|
||||
introduce: data.introduce,
|
||||
clinic: data.clinic,
|
||||
@@ -390,13 +537,20 @@ export default {
|
||||
type: "success"
|
||||
});
|
||||
this.addOrUpdateVisible = false;
|
||||
|
||||
this.dataList = [];
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
//修改地域
|
||||
changeCountry(){
|
||||
this.changeStatus = true;
|
||||
this.chinaStatus = false;
|
||||
this.selectCode = null;
|
||||
this.selectedProvId = null;
|
||||
},
|
||||
//取消
|
||||
cancleClose(){
|
||||
this.addOrUpdateVisible = false;
|
||||
@@ -420,10 +574,12 @@ export default {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.titlesub = '修改';
|
||||
this.statusType = 1; //修改
|
||||
this.changeStatus = false;
|
||||
|
||||
this.addForm.id = data.id;
|
||||
this.addForm.name = data.name;
|
||||
this.addForm.title = data.title;
|
||||
this.addForm.department = data.department;
|
||||
this.addForm.specialty = data.specialty;
|
||||
this.addForm.region = data.region;
|
||||
this.addForm.reservation = data.reservation;
|
||||
@@ -436,6 +592,9 @@ export default {
|
||||
url: data.icon
|
||||
});
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addFormRef.clearValidate();
|
||||
});
|
||||
},
|
||||
//点击删除
|
||||
deleteHandle(data){
|
||||
@@ -489,6 +648,85 @@ export default {
|
||||
handleRemove(file, fileList) {
|
||||
this.fileList = [];
|
||||
},
|
||||
|
||||
//获取国家数据
|
||||
loadCountries() {
|
||||
this.countryLoading = true;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/common/baseArea/getAllBaseArea"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
if (data.baseAreas&&data.baseAreas.length>0) {
|
||||
this.countryLoading = false;
|
||||
this.countries = data.baseAreas;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//获取中国省份
|
||||
loadProvinces() {
|
||||
this.provinceLoading = true;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/common/province/getProvinceList"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
if (data.provinceList&&data.provinceList.length>0) {
|
||||
this.provinceLoading = false;
|
||||
this.provinces = data.provinceList;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//选择国家
|
||||
handleCountryChange(code){
|
||||
if(code=='86'){
|
||||
this.chinaStatus = true;
|
||||
}else{
|
||||
this.chinaStatus = false;
|
||||
}
|
||||
const data = this.countries.find(country => country.code === code);
|
||||
this.selectedCountry = data.title;
|
||||
this.selectedProvince = '';
|
||||
this.selectedCity = '';
|
||||
this.selectedProvId = null;
|
||||
this.provinces = [];
|
||||
this.cities = [];
|
||||
|
||||
console.log('所选国家-', this.selectedCountry)
|
||||
},
|
||||
//选择省份
|
||||
handleProvinceChange(provId){
|
||||
this.cityLoading = true;
|
||||
const data = this.provinces.find(prov => prov.provId === provId);
|
||||
this.selectedProvince = data.provName;
|
||||
this.selectedCity = '';
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/common/province/getCityList?provId="+ provId),
|
||||
method: "post",
|
||||
data: this.$http.adornData({}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
if (data.prov&&data.prov.length>0) {
|
||||
this.cities = data.prov;
|
||||
this.cityLoading = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
console.log('所选省份-', this.selectedProvince)
|
||||
},
|
||||
//选择城市
|
||||
handleCityChange(val){
|
||||
this.selectedCity = val;
|
||||
|
||||
console.log('所选城市-', this.selectedCity)
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -560,4 +798,10 @@ export default {
|
||||
::v-deep.el-form-item__label{
|
||||
width: 110px;
|
||||
}
|
||||
.editBtn{
|
||||
margin-left: 10px;
|
||||
width: 70px;
|
||||
border-color: #17B3A3;
|
||||
color: #17B3A3;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -116,6 +116,20 @@
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否上架" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
@change="changeDisplayFlag(scope.row)"
|
||||
v-model="scope.row.displayFlag"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#999"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
active-text="上架"
|
||||
inactive-text="下架">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="排序" align="center" prop="sort" width="90"></el-table-column>
|
||||
|
||||
@@ -132,7 +146,7 @@
|
||||
@click="editHandle(scope.row)"
|
||||
>修改</el-button
|
||||
>
|
||||
<router-link :to="{ path: '/training-course-user', query: { id: scope.row.id } }">
|
||||
<router-link :to="{ path: '/training-course-user', query: { id: scope.row.id, title: scope.row.title } }">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@@ -231,6 +245,18 @@
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否上架" prop="displayFlag">
|
||||
<el-switch
|
||||
v-model="addForm.displayFlag"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#999"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
inactive-text="下架"
|
||||
active-text="上架"
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传海报" prop="icon">
|
||||
<el-upload
|
||||
:limit="1"
|
||||
@@ -283,6 +309,7 @@ export default {
|
||||
year: '', //日期
|
||||
trainingDate: '',
|
||||
singupFlag: '', //1可报名 0不可报名
|
||||
displayFlag: '', //0上架 1下架
|
||||
},
|
||||
addForm: {
|
||||
id: "", //新增不传
|
||||
@@ -300,6 +327,7 @@ export default {
|
||||
threeHuFee: '',
|
||||
fiveHuFee: '',
|
||||
singupFlag: 1, //1可报名 0不可报名
|
||||
displayFlag: 0, //0上架 1下架
|
||||
sort: ''
|
||||
},
|
||||
editId: "",
|
||||
@@ -397,7 +425,8 @@ export default {
|
||||
title: this.dataForm.title,
|
||||
type: this.dataForm.type,
|
||||
year: this.dataForm.year,
|
||||
singupFlag: this.dataForm.singupFlag
|
||||
singupFlag: this.dataForm.singupFlag,
|
||||
displayFlag: this.dataForm.displayFlag
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
@@ -409,7 +438,11 @@ export default {
|
||||
},
|
||||
//设置开关 修改数据
|
||||
changeSingupFlag(data){
|
||||
this.editCate(data);
|
||||
this.editCate(data, '1');
|
||||
},
|
||||
//上下架开关
|
||||
changeDisplayFlag(data){
|
||||
this.editCate(data, '1');
|
||||
},
|
||||
|
||||
//新增
|
||||
@@ -417,7 +450,6 @@ export default {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.statusType = 0; //新增
|
||||
this.titlesub = '新增';
|
||||
this.$refs["addFormRef"].resetFields();
|
||||
this.addForm = {
|
||||
title: "", //标题
|
||||
type: 1, //1线上 2线下
|
||||
@@ -433,18 +465,22 @@ export default {
|
||||
threeHuFee: '',
|
||||
fiveHuFee: '',
|
||||
singupFlag: 1, //1可报名 0不可报名
|
||||
displayFlag: 0,
|
||||
sort: ''
|
||||
}
|
||||
this.fileList = [];
|
||||
this.vipType = [];
|
||||
this.svipType = [];
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addFormRef.clearValidate();
|
||||
});
|
||||
},
|
||||
//点击确定
|
||||
addOrEditCate(){
|
||||
if(this.statusType==0){ //如果是新增
|
||||
this.addCate();
|
||||
}else if(this.statusType==1){ //如果是修改
|
||||
this.editCate(this.addForm);
|
||||
this.editCate(this.addForm, '0');
|
||||
}
|
||||
},
|
||||
//取消
|
||||
@@ -452,47 +488,56 @@ export default {
|
||||
this.addOrUpdateVisible = false;
|
||||
},
|
||||
//修改
|
||||
editCate(data){
|
||||
this.$refs["addFormRef"].validate(valid => {
|
||||
if (valid) {
|
||||
var icon = '';
|
||||
if(this.fileList&&this.fileList.length>0){
|
||||
icon = this.fileList[0].url
|
||||
editCate(data, type){
|
||||
if(type=='0'){
|
||||
this.$refs["addFormRef"].validate(valid => {
|
||||
if (valid) {
|
||||
this.submitData(data);
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/trainingClass/editTrainingClass"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: data.id,
|
||||
title: data.title,
|
||||
type: data.type,
|
||||
year: data.year,
|
||||
trainingDate: data.trainingDate,
|
||||
endDate: data.endDate,
|
||||
singupFlag: data.singupFlag,
|
||||
icon: icon,
|
||||
fee: data.fee,
|
||||
vipType: String(this.vipType),
|
||||
vipFee: data.vipFee,
|
||||
svipType: String(this.svipType),
|
||||
svipFee: data.svipFee,
|
||||
threeHuFee: data.threeHuFee,
|
||||
fiveHuFee: data.fiveHuFee,
|
||||
sort: data.sort
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success"
|
||||
});
|
||||
this.addOrUpdateVisible = false;
|
||||
|
||||
this.getDataList();
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.submitData(data);
|
||||
}
|
||||
},
|
||||
//修改
|
||||
submitData(data){
|
||||
var icon = '';
|
||||
if(this.fileList&&this.fileList.length>0){
|
||||
icon = this.fileList[0].url
|
||||
}
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/trainingClass/editTrainingClass"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: data.id,
|
||||
title: data.title,
|
||||
type: data.type,
|
||||
year: data.year,
|
||||
trainingDate: data.trainingDate,
|
||||
endDate: data.endDate,
|
||||
singupFlag: data.singupFlag,
|
||||
displayFlag: data.displayFlag,
|
||||
icon: icon,
|
||||
fee: data.fee,
|
||||
vipType: String(this.vipType),
|
||||
vipFee: data.vipFee,
|
||||
svipType: String(this.svipType),
|
||||
svipFee: data.svipFee,
|
||||
threeHuFee: data.threeHuFee,
|
||||
fiveHuFee: data.fiveHuFee,
|
||||
sort: data.sort
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success"
|
||||
});
|
||||
this.addOrUpdateVisible = false;
|
||||
|
||||
this.getDataList();
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
@@ -523,6 +568,7 @@ export default {
|
||||
trainingDate: this.addForm.trainingDate,
|
||||
endDate: this.addForm.endDate,
|
||||
singupFlag: String(this.addForm.singupFlag),
|
||||
displayFlag: String(this.addForm.displayFlag),
|
||||
icon: icon,
|
||||
fee: this.addForm.fee,
|
||||
vipType: String(this.vipType),
|
||||
@@ -563,6 +609,7 @@ export default {
|
||||
this.addForm.trainingDate = data.trainingDate;
|
||||
this.addForm.endDate = data.endDate;
|
||||
this.addForm.singupFlag = Number(data.singupFlag);
|
||||
this.addForm.displayFlag = Number(data.displayFlag);
|
||||
this.addForm.icon = data.icon;
|
||||
//图片赋值
|
||||
if(data.icon){
|
||||
@@ -578,6 +625,9 @@ export default {
|
||||
this.addForm.threeHuFee = data.threeHuFee;
|
||||
this.addForm.fiveHuFee = data.fiveHuFee;
|
||||
this.addForm.sort = data.sort;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addFormRef.clearValidate();
|
||||
});
|
||||
},
|
||||
//上传图片
|
||||
handlePreview(file) {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:inline="true"
|
||||
:model="dataForm"
|
||||
@keyup.enter.native="getDataList()"
|
||||
style="position: relative;"
|
||||
>
|
||||
<el-form-item label="手机号">
|
||||
<el-input
|
||||
@@ -27,6 +28,12 @@
|
||||
>报名</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
<el-form-item style="position: absolute; right: 0; top: 0; margin-right: 0;">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleExport()">
|
||||
导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
@@ -61,7 +68,7 @@
|
||||
<el-table-column label="支付方式" align="center">
|
||||
<template slot-scope="scope">{{ scope.row.payMethod }}:{{ scope.row.realMoney }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="抵扣方式" align="center">
|
||||
<el-table-column label="积分抵扣" align="center">
|
||||
<template slot-scope="scope">积分:{{ scope.row.jfDeduction }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -130,6 +137,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
trainingId: null,
|
||||
trainingTitle: '',
|
||||
dataForm: {
|
||||
tel: ''
|
||||
},
|
||||
@@ -171,6 +179,7 @@ export default {
|
||||
},
|
||||
activated(){
|
||||
this.trainingId = this.$route.query.id;
|
||||
this.trainingTitle = this.$route.query.title;
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
@@ -343,6 +352,44 @@ export default {
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
//导出
|
||||
handleExport() {
|
||||
try {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/trainingClass/exportTrainingClassUser"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
current: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
trainingId: this.trainingId,
|
||||
tel: this.dataForm.tel,
|
||||
createTimeSort: this.sortParams.date
|
||||
}),
|
||||
responseType: "blob"
|
||||
}).then(res => {
|
||||
const blob = new Blob([res.data], {
|
||||
type:
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
});
|
||||
|
||||
const link = document.createElement("a");
|
||||
link.href = window.URL.createObjectURL(blob);
|
||||
link.download = '['+ this.trainingTitle +']-用户数据文件';
|
||||
link.click();
|
||||
|
||||
window.URL.revokeObjectURL(link.href); // 释放内存
|
||||
this.$message({
|
||||
message: "培训班用户数据文件下载完成,请注意查看!",
|
||||
type: "success",
|
||||
duration: 3000,
|
||||
showClose: true
|
||||
});
|
||||
|
||||
});
|
||||
} catch (err) {
|
||||
this.$message.error("文件下载失败!");
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user