Commit 4622dd7a authored by 赵茹林's avatar 赵茹林

新增 导出完课用户

新增 数据管理更新时间
新增 设备移交原因
新增 用户转移
更新 期数名称3个
优化 选择用户样式
parent 230fd530
......@@ -30,7 +30,8 @@
</el-form-item>
<el-form-item style="float: right">
<div class="search-btn-wrapper">
<el-button @click="onAdd" type="success" v-if="!$store.state.readonly">+添加班级</el-button>
<el-button @click="onExport" type="primary" v-if="$store.state.export" plain>导出完课用户</el-button>
<el-button @click="onAdd" type="success" v-if="!$store.state.readonly">添加班级</el-button>
<el-button type="success" @click="sendMsg">发送活动通知</el-button>
</div>
</el-form-item>
......@@ -159,7 +160,8 @@ import {
getDefaultPeriodsApi,
postActiveNoticeApi,
getConfigListApi,
getSourceStudentApi
getSourceStudentApi,
exportExcelApi
} from "../../service/api";
import classDialog from "./dialog";
import { GOODSTYPE, CLASSSOURCE } from "../../util/wordbook";
......@@ -506,6 +508,12 @@ export default {
});
});
},
onExport() {
let json = {
periods_id: this.selectedGoods[1]
};
exportExcelApi("/api/admin/periods/finish/user/export", json);
},
onAdd() {
this.dialogObj = {
show: true,
......
<template>
<div class="channel-trans-list">
<el-form ref="searchFrom" :model="searchFrom" label-width="100px" inline>
<el-form-item label="更新时间">
{{updateTime ? updateTime : '-'}}
</el-form-item>
<el-form-item label="进量日期">
<el-date-picker
v-model="searchFrom.payTime"
......@@ -121,7 +124,8 @@
import {
getChannelConversionListApi,
getGoodsListApi,
getConfigListApi
getConfigListApi,
getUpdateTimeApi
} from "../../service/api";
import { GOODSTYPE, CLASSSOURCE } from "../../util/wordbook";
import { tipArr2 } from "../../util/tipArr";
......@@ -131,6 +135,7 @@ export default {
name: "channelConversionList",
data() {
return {
updateTime: '',
typeList:[],
width: 0,
nowPage: 1,
......@@ -186,7 +191,6 @@ export default {
];
}
},
propertyList: [],
spanArr: [],
contentSpanArr: [],
searchFrom: {
......@@ -430,11 +434,19 @@ export default {
this.list = [];
}
});
},
getUpdateTime() {
getUpdateTimeApi().then(res => {
if (res.time) {
this.updateTime = res.time
}
})
}
},
mounted() {
this.getChannelTransList();
this.getGoodsOption();
this.getUpdateTime()
// this.getGoodsList();
}
};
......
<template>
<div class="channel-trans-list">
<el-form ref="searchFrom" :model="searchFrom" label-width="100px" inline>
<el-form-item label="更新时间">
{{updateTime ? updateTime : '-'}}
</el-form-item>
<el-form-item label="进量日期">
<el-date-picker
v-model="searchFrom.payTime"
......@@ -140,7 +144,8 @@
import {
getChannelGoodsConversionListApi,
getGoodsListApi,
getConfigListApi
getConfigListApi,
getUpdateTimeApi
} from "../../service/api";
import page from "../framework/page";
import { GOODSTYPE, CLASSSOURCE } from "../../util/wordbook";
......@@ -149,6 +154,7 @@ export default {
name: "channelGoodsConversionList",
data() {
return {
updateTime: '',
typeList:[],
width: 0,
nowPage: 1,
......@@ -480,13 +486,21 @@ export default {
this.list = [];
}
});
},
getUpdateTime() {
getUpdateTimeApi().then(res => {
if (res.time) {
this.updateTime = res.time
}
})
}
},
mounted() {
this.getChannelTransList();
// this.getPeriodsList();
// this.getGoodsList();
this.getGoodsOption()
this.getGoodsOption();
this.getUpdateTime()
}
};
</script>
......
<template>
<div class="channel-trans-list">
<el-form ref="searchFrom" :model="searchFrom" label-width="100px" inline>
<el-form-item label="更新时间">
{{updateTime ? updateTime : '-'}}
</el-form-item>
<el-form-item label="进量日期">
<el-date-picker
v-model="searchFrom.payTime"
......@@ -156,7 +159,8 @@ import {
getGoodsListApi,
exportExcelApi,
getPeriodsOtherListApi,
getConfigListApi
getConfigListApi,
getUpdateTimeApi
} from "../../service/api";
import page from "../framework/page";
import { GOODSTYPE, CLASSSOURCE } from "../../util/wordbook";
......@@ -165,6 +169,7 @@ export default {
name: "channelTransList",
data() {
return {
updateTime: '',
typeList:[],
width: 0,
nowPage: 1,
......@@ -559,6 +564,13 @@ export default {
this.list = [];
}
});
},
getUpdateTime() {
getUpdateTimeApi().then(res => {
if (res.time) {
this.updateTime = res.time
}
})
}
},
mounted() {
......@@ -567,6 +579,7 @@ export default {
// this.getPeriodsList();
this.getGoodsList();
this.getPeriodsOtherList();
this.getUpdateTime();
}
};
</script>
......
<template>
<div style="padding-top: 20px;">
<el-form ref="searchFrom" class="searchFrom" :model="searchFrom" label-width="100px" inline>
<el-form-item label="更新时间">
{{updateTime ? updateTime : '-'}}
</el-form-item>
<el-form-item label="进量日期">
<el-date-picker
v-model="searchFrom.payTime"
......@@ -94,11 +97,12 @@
</template>
<script>
import { getMarketEnrollmentConversionListApi,getPeriodsOtherListApi } from "../../service/api";
import { getMarketEnrollmentConversionListApi,getPeriodsOtherListApi,getUpdateTimeApi } from "../../service/api";
export default {
name: "index",
data() {
return {
updateTime: '',
list: [],
dateList: [],
propertyList: [
......@@ -307,11 +311,19 @@ export default {
// colspan: 1
// };
// }
},
getUpdateTime() {
getUpdateTimeApi().then(res => {
if (res.time) {
this.updateTime = res.time
}
})
}
},
created() {
this.getList();
this.getPeriodsOtherList()
this.getPeriodsOtherList();
this.getUpdateTime()
}
};
</script>
......
<template>
<div class="channel-trans-list">
<el-form ref="searchFrom" :model="searchFrom" label-width="100px" inline>
<el-form-item label="更新时间">
{{updateTime ? updateTime : '-'}}
</el-form-item>
<el-form-item label="进量日期">
<el-date-picker
v-model="searchFrom.payTime"
......@@ -140,7 +143,7 @@
</div>
</template>
<script>
import { getPeriodsConversionListApi, getGoodsListApi, getPeriodsOtherListApi, getTeacherListApi } from "../../service/api";
import { getPeriodsConversionListApi, getGoodsListApi, getPeriodsOtherListApi, getTeacherListApi, getUpdateTimeApi } from "../../service/api";
import page from "../framework/page";
import { GOODSTYPE, CLASSSOURCE } from "../../util/wordbook";
import { tipArr3 } from "../../util/tipArr";
......@@ -148,6 +151,7 @@ export default {
name: "periodsConversionList",
data() {
return {
updateTime: '',
width: 0,
nowPage: 1,
total: 0,
......@@ -577,6 +581,13 @@ export default {
this.list = [];
}
});
},
getUpdateTime() {
getUpdateTimeApi().then(res => {
if (res.time) {
this.updateTime = res.time
}
})
}
},
mounted() {
......@@ -584,7 +595,8 @@ export default {
// this.getPeriodsList();
this.getGoodsList();
this.getPeriodsOtherList();
this.getTeacherList()
this.getTeacherList();
this.getUpdateTime()
}
};
</script>
......
<template>
<div class="channel-trans-list">
<el-form ref="searchFrom" :model="searchFrom" label-width="100px" inline>
<el-form-item label="更新时间">
{{updateTime ? updateTime : '-'}}
</el-form-item>
<el-form-item label="进量日期">
<el-date-picker
v-model="searchFrom.payTime"
......@@ -99,7 +102,8 @@
import {
getSquadConversionListApi,
getGoodsListApi,
getPeriodsOtherListApi
getPeriodsOtherListApi,
getUpdateTimeApi
} from "../../service/api";
import page from "../framework/page";
import { GOODSTYPE, CLASSSOURCE } from "../../util/wordbook";
......@@ -108,6 +112,7 @@ export default {
name: "squadConversionList",
data() {
return {
updateTime: '',
width: 0,
nowPage: 1,
total: 0,
......@@ -162,7 +167,6 @@ export default {
];
}
},
propertyList: [],
spanArr: [],
contentSpanArr: [],
searchFrom: {
......@@ -454,12 +458,20 @@ export default {
this.list = [];
}
});
},
getUpdateTime() {
getUpdateTimeApi().then(res => {
if (res.time) {
this.updateTime = res.time
}
})
}
},
mounted() {
this.getChannelTransList();
this.getGoodsList();
this.getPeriodsOtherList()
this.getPeriodsOtherList();
this.getUpdateTime()
}
};
</script>
......
<template>
<div class="channel-trans-list">
<el-form ref="searchFrom" :model="searchFrom" label-width="100px" inline>
<el-form-item label="更新时间">
{{updateTime ? updateTime : '-'}}
</el-form-item>
<el-form-item label="进量日期">
<el-date-picker
v-model="searchFrom.payTime"
......@@ -103,7 +106,8 @@
import {
getTeacherConversionListApi,
getGoodsListApi,
getPeriodsOtherListApi
getPeriodsOtherListApi,
getUpdateTimeApi
} from "../../service/api";
import page from "../framework/page";
import { GOODSTYPE, CLASSSOURCE } from "../../util/wordbook";
......@@ -112,6 +116,7 @@ export default {
name: "teacherConversionList",
data() {
return {
updateTime: '',
width: 0,
nowPage: 1,
total: 0,
......@@ -181,7 +186,6 @@ export default {
teacher_id: "",
periods_title: ""
},
propertyList: [],
watchList: [
{ id: 0, title: 5 },
{ id: 1, title: 6 },
......@@ -457,12 +461,20 @@ export default {
this.list = [];
}
});
},
getUpdateTime() {
getUpdateTimeApi().then(res => {
if (res.time) {
this.updateTime = res.time
}
})
}
},
mounted() {
this.getChannelTransList();
this.getPeriodsOtherList();
this.getGoodsList();
this.getUpdateTime();
}
};
</script>
......
<template>
<div class="channel-trans-list">
<el-form ref="searchFrom" :model="searchFrom" label-width="100px" inline>
<el-form-item label="更新时间">
{{updateTime ? updateTime : '-'}}
</el-form-item>
<el-form-item label="进量日期">
<el-date-picker
v-model="searchFrom.payTime"
......@@ -94,7 +97,7 @@
:style="{width: width+'px'}"
fixed>
<!--<el-table-column prop="periods_title" label="期数名称"></el-table-column>-->
<el-table-column prop="periods_title" label="期数名称" width="170px">
<el-table-column prop="periods_title" label="期数名称" width="180px">
<template slot-scope="scope">
<div v-html="periodName(scope.row)"></div>
</template>
......@@ -103,8 +106,7 @@
prop="duration_over_at"
label="开课看课时间"
style="font-size:12px;"
width="200"
>
width="180">
<template slot-scope="scope">
开课日期:{{scope.row.start_at}}
<br>
......@@ -151,7 +153,8 @@ import {
getTeacherPeriodsConversionListApi,
getGoodsListApi,
getPeriodsOtherListApi,
getTeacherListApi
getTeacherListApi,
getUpdateTimeApi
} from "../../service/api";
import page from "../framework/page";
import { GOODSTYPE, CLASSSOURCE } from "../../util/wordbook";
......@@ -160,6 +163,7 @@ export default {
name: "teacherPeriodsConversionList",
data() {
return {
updateTime: '',
width: 0,
nowPage: 1,
total: 0,
......@@ -594,6 +598,13 @@ export default {
this.list = [];
}
});
},
getUpdateTime() {
getUpdateTimeApi().then(res => {
if (res.time) {
this.updateTime = res.time
}
})
}
},
mounted() {
......@@ -601,6 +612,7 @@ export default {
this.getPeriodsOtherList();
this.getGoodsList();
this.getTeacherList();
this.getUpdateTime();
}
};
</script>
......
<template>
<div class="page-div">
<el-pagination
:small="small"
@size-change="handleSizeChange"
:page-sizes="[5, 10, 20, 30, 40, 50, 60, 80, 100]"
:page-size="limit"
:current-page.sync="nowPage"
layout="total , sizes, prev, pager, next, jumper"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
......@@ -19,16 +20,20 @@
nowPage: 1
}
},
props:{
'total' : {
props: {
'total': {
required: true
},
'limit': {
default: 10
},
'small': {
type: Boolean,
default: false
}
},
watch:{
nowPage(value){
watch: {
nowPage(value) {
this.$emit("pageChange", value);
}
},
......@@ -42,7 +47,7 @@
</script>
<style scoped>
.page-div{
.page-div {
display: block;
text-align: center;
}
......
......@@ -146,9 +146,9 @@
</el-col>
</el-row>
<el-row v-if="form.goods_type==1||form.goods_type==2">
<el-col :span="12" >
<el-col :span="12">
<el-form-item label-width="120" label="课程标题(客户端展示)" required>
<el-input v-model="form.goods_desc.course_title" style="width:200px;" ></el-input>
<el-input v-model="form.goods_desc.course_title" style="width:200px;"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -161,10 +161,10 @@
</el-form-item>
</el-col>
</el-row>
<el-form-item v-if="form.goods_type==4" label="领取到期时间(小时)" label-width="160px" >
<el-input-number v-model="form.goods_desc.time_limit" ></el-input-number>
<el-form-item v-if="form.goods_type==4" label="领取到期时间(小时)" label-width="160px">
<el-input-number v-model="form.goods_desc.time_limit"></el-input-number>
</el-form-item>
<el-form-item v-if="form.goods_type==1||form.goods_type==2" label="是否赠送优惠券" label-width="160px" >
<el-form-item v-if="form.goods_type==1||form.goods_type==2" label="是否赠送优惠券" label-width="160px">
<el-select v-model="form.goods_desc.coupon_goods_id" placeholder="请选择">
<el-option v-for="data in coupongoods"
:key="data.id"
......@@ -219,7 +219,8 @@
v-model="form.is_real"
:active-value="1"
:inactive-value="0">
</el-switch> <span style="font-size: 12px;">打开后提示用户填写具体住址</span>
</el-switch>
<span style="font-size: 12px;">打开后提示用户填写具体住址</span>
</el-form-item>
<el-row v-if="form.goods_type === 1 ">
<el-col :span="12">
......@@ -256,7 +257,7 @@
</el-row>
<el-row v-if="form.goods_type === 2">
<el-col :span="12">
<el-form-item label="成团人数(人)" >
<el-form-item label="成团人数(人)">
<el-input-number v-model="form.desc.group_number" label="成团人数"></el-input-number>
</el-form-item>
</el-col>
......@@ -302,7 +303,7 @@
<el-col :span="24">
<el-form-item label="商品详情" required>
<!-- <el-input type="textarea" :rows="25" v-model="form.desc.detail"></el-input> -->
<editor-detail :lookData="form.desc" />
<editor-detail :lookData="form.desc"/>
</el-form-item>
</el-col>
</el-row>
......@@ -325,13 +326,21 @@
</template>
<script>
import {getLessonApi,addGoodsApi,editGoodsApi,getGoodsDetailApi,uploadFileApi,getGoodsListApi} from "../../service/api";
import {TEACHERTYPE,GOODSTYPE} from "../../util/wordbook";
import {
getLessonApi,
addGoodsApi,
editGoodsApi,
getGoodsDetailApi,
uploadFileApi,
getGoodsListApi
} from "../../service/api";
import {TEACHERTYPE, GOODSTYPE} from "../../util/wordbook";
import editorDetail from "./editorDetail"
import editorKnow from "./editorKnow"
export default {
name: "dialogObj",
props:[
props: [
'dialogObj',
],
components: { // 引入组件
......@@ -339,136 +348,136 @@
editorKnow
},
filters: {
filterGoods(val){
return '[' + GOODSTYPE[val.goods_type] + ']' + '[' +val.current_price / 100 + '元]' + val.name
}
},
data(){
return{
tiny:{
height:300
},
sendObj:{
content:'nihao'
},
loading:true,
goodsYou:[],
goodsList:[],
form:{
name:'',
goods_type:1,
goods_desc:{
desc:"",
imgLesson:[],
img:[],
course_title:'',
time_limit:0
},
course_id :'',
course_type:0,
watch_num:'',
invite_earnings:0,
original_price:'',
current_price:'',
is_real:0,
is_auth_user:0,
is_auth_teacher:0,
share_desc:{
title:'',
content:'',
img:[],
refImg:[]
},
desc:{
detail:"",
qa:"",
customer_service:[],
after_goods_id:'',
before_goods_id:''
},
is_into_periods:'0'
},
lessonList:[],
goOn_goods_Id:{
after_goods_id:'',
before_goods_id:''
},
coupongoods:[],
false:false
}
},
methods:{
goodsChange(){
if(this.form.goods_type==4||this.form.goods_type==3){
filterGoods(val) {
return '[' + GOODSTYPE[val.goods_type] + ']' + '[' + val.current_price / 100 + '元]' + val.name
}
},
data() {
return {
tiny: {
height: 300
},
sendObj: {
content: 'nihao'
},
loading: true,
goodsYou: [],
goodsList: [],
form: {
name: '',
goods_type: 1,
goods_desc: {
desc: "",
imgLesson: [],
img: [],
course_title: '',
time_limit: 0
},
course_id: '',
course_type: 0,
watch_num: '',
invite_earnings: 0,
original_price: '',
current_price: '',
is_real: 0,
is_auth_user: 0,
is_auth_teacher: 0,
share_desc: {
title: '',
content: '',
img: [],
refImg: []
},
desc: {
detail: "",
qa: "",
customer_service: [],
after_goods_id: '',
before_goods_id: ''
},
is_into_periods: '0'
},
lessonList: [],
goOn_goods_Id: {
after_goods_id: '',
before_goods_id: ''
},
coupongoods: [],
false: false
}
},
methods: {
goodsChange() {
if (this.form.goods_type == 4 || this.form.goods_type == 3) {
let json = {
limit: '999',
page: '1',
goods_type:'1,2',
status:"1"
goods_type: '1,2',
status: "1"
};
getGoodsListApi(json).then(res=>{
getGoodsListApi(json).then(res => {
console.log(json)
// debugger
this.goodsList = res.list
});
}else if(this.form.goods_type==1||this.form.goods_type==2){
} else if (this.form.goods_type == 1 || this.form.goods_type == 2) {
// debugger
let json = {
limit: '999',
page: '1',
goods_type:'4',
goods_type: '4',
};
getGoodsListApi(json).then(res=>{
getGoodsListApi(json).then(res => {
console.log(res)
// debugger
let item = {
name:'不赠送',
id:'0',
goods_type:4,
course_type:0,
current_price:0
name: '不赠送',
id: '0',
goods_type: 4,
course_type: 0,
current_price: 0
}
this.coupongoods = res.list
this.coupongoods.unshift(item)
});
}
},
sub(){
sub() {
console.log(this.form)
if(!this.form.share_desc.img&&this.form.goods_type==2){
if (!this.form.share_desc.img && this.form.goods_type == 2) {
this.$message({
type: 'success',
message: '请上传主图!'
});
return
}
let _json = JSON.parse(JSON.stringify(this.form)+'');
let _json = JSON.parse(JSON.stringify(this.form) + '');
console.log(this.form)
// debugger
if(_json.goods_type === 3 || _json.goods_type === 4 || _json.goods_type === 5){
_json.course_id=0;
if (_json.goods_type === 3 || _json.goods_type === 4 || _json.goods_type === 5) {
_json.course_id = 0;
_json.watch_num = 0;
}
if(_json.goods_type === 5){
_json.is_real=1;
if (_json.goods_type === 5) {
_json.is_real = 1;
}
_json.desc.before_goods_id = this.goOn_goods_Id.before_goods_id;
if(this.goodsYou.length < 1){
if (this.goodsYou.length < 1) {
_json.desc.use_goods_ids = ''
}else{
} else {
_json.desc.use_goods_ids = this.goodsYou.toString()
}
_json.desc.after_goods_id = this.goOn_goods_Id.after_goods_id;
_json.original_price = (_json.original_price*100).toFixed(0);
_json.current_price = (_json.current_price*100).toFixed(0);
_json.invite_earnings = (_json.invite_earnings*100).toFixed(0);
_json.original_price = (_json.original_price * 100).toFixed(0);
_json.current_price = (_json.current_price * 100).toFixed(0);
_json.invite_earnings = (_json.invite_earnings * 100).toFixed(0);
_json.goods_desc = JSON.stringify(_json.goods_desc);
_json.desc = JSON.stringify(_json.desc);
_json.share_desc = JSON.stringify(_json.share_desc);
switch(this.dialogObj.type){
switch (this.dialogObj.type) {
case 1:
editGoodsApi(this.dialogObj.id,_json).then(res=>{
editGoodsApi(this.dialogObj.id, _json).then(res => {
this.$message({
type: 'success',
message: '修改成功!'
......@@ -479,7 +488,7 @@
break;
case 0:
console.log(_json)
addGoodsApi(_json).then(res=>{
addGoodsApi(_json).then(res => {
this.$message({
type: 'success',
message: '新增成功!'
......@@ -490,275 +499,328 @@
break
}
},
removeFileMain(a){
let x = this.form.goods_desc.img.findIndex(i=>{return i.name === a.name});
this.form.goods_desc.img.splice(x,1);
removeFileMain(a) {
let x = this.form.goods_desc.img.findIndex(i => {
return i.name === a.name
});
this.form.goods_desc.img.splice(x, 1);
},
uploadFileLesson(a){
this.$store.dispatch('setProgress',{type:'new',id:a.file.uid});
uploadFileLesson(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file:a.file,type:'local'}).then(res=>{
this.form.goods_desc.imgLesson=[{name:res.url,url:process.env.IMAGE_URL_HEAD + res.url,title:'',lable:''}];
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.form.goods_desc.imgLesson = [{
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}];
this.$message({
message: '上传成功',
type: 'success'
});
})
},
removeFileLesson(){
this.form.goods_desc.imgLesson=[]
removeFileLesson() {
this.form.goods_desc.imgLesson = []
},
uploadFileMain(a){
uploadFileMain(a) {
console.log(a)
// debugger
this.$store.dispatch('setProgress',{type:'new',id:a.file.uid});
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file:a.file,type:'local'}).then(res=>{
this.form.goods_desc.img.push({name:res.url,url:process.env.IMAGE_URL_HEAD + res.url,title:'',lable:''});
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.form.goods_desc.img.push({
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
});
this.$message({
message: '上传成功',
type: 'success'
});
})
},
removeFileShareRef(){
this.form.share_desc.refImg=[]
removeFileShareRef() {
this.form.share_desc.refImg = []
},
uploadFileMainShareRef(a){
this.$store.dispatch('setProgress',{type:'new',id:a.file.uid});
uploadFileMainShareRef(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file:a.file,type:'local'}).then(res=>{
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.$message({
message: '上传成功',
type: 'success'
});
if(this.form.share_desc.refImg){
this.form.share_desc.refImg[0] = {name:res.url,url:process.env.IMAGE_URL_HEAD + res.url,title:'',lable:''}
}else{
this.form.share_desc.refImg=[];
this.form.share_desc.refImg[0] = {name:res.url,url:process.env.IMAGE_URL_HEAD + res.url,title:'',lable:''}
if (this.form.share_desc.refImg) {
this.form.share_desc.refImg[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
} else {
this.form.share_desc.refImg = [];
this.form.share_desc.refImg[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
}
})
},
uploadFileMainShare(a){
this.$store.dispatch('setProgress',{type:'new',id:a.file.uid});
uploadFileMainShare(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file:a.file,type:'local'}).then(res=>{
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.$message({
message: '上传成功',
type: 'success'
});
if(this.form.share_desc.img){
this.form.share_desc.img[0] = {name:res.url,url:process.env.IMAGE_URL_HEAD + res.url,title:'',lable:''}
}else{
this.form.share_desc.img=[];
this.form.share_desc.img[0] = {name:res.url,url:process.env.IMAGE_URL_HEAD + res.url,title:'',lable:''}
if (this.form.share_desc.img) {
this.form.share_desc.img[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
} else {
this.form.share_desc.img = [];
this.form.share_desc.img[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
}
})
},
removeFileService(){
this.form.desc.customer_service=[];
removeFileService() {
this.form.desc.customer_service = [];
},
uploadFileMainService(a){
this.$store.dispatch('setProgress',{type:'new',id:a.file.uid});
uploadFileMainService(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file:a.file,type:'local'}).then(res=>{
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.$message({
message: '上传成功',
type: 'success'
});
if(this.form.desc.customer_service){
this.form.desc.customer_service[0] = {name:res.url,url:process.env.IMAGE_URL_HEAD + res.url,title:'',lable:''}
}else{
this.form.desc.customer_service=[];
this.form.desc.customer_service[0] = {name:res.url,url:process.env.IMAGE_URL_HEAD + res.url,title:'',lable:''}
if (this.form.desc.customer_service) {
this.form.desc.customer_service[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
} else {
this.form.desc.customer_service = [];
this.form.desc.customer_service[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
}
})
},
uploadFileShare(a){
this.$store.dispatch('setProgress',{type:'new',id:a.file.uid});
uploadFileShare(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file:a.file,type:'local'}).then(res=>{
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.$message({
message: '上传成功',
type: 'success'
});
if(this.form.share_desc.img){
this.form.share_desc.img[0] = {name:res.url,url:process.env.IMAGE_URL_HEAD + res.url,title:'',lable:''}
}else{
this.form.share_desc.img=[];
this.form.share_desc.img[0] = {name:res.url,url:process.env.IMAGE_URL_HEAD + res.url,title:'',lable:''}
if (this.form.share_desc.img) {
this.form.share_desc.img[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
} else {
this.form.share_desc.img = [];
this.form.share_desc.img[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
}
})
},
initDialog(){
switch(this.dialogObj.type){
initDialog() {
switch (this.dialogObj.type) {
case 0:
this.loading = false;
this.goOn_goods_Id.after_goods_id = '';
this.goodsYou = [];
this.goOn_goods_Id.before_goods_id = '';
this.form={
name:'',
goods_type:1,
goods_desc:{
desc:"",
img:[],
course_title:""
},
course_id :'',
course_type:0,
watch_num:'',
duration_num:0,
original_price:'',
current_price:'',
is_real:0,
is_auth_user:0,
is_auth_teacher:0,
share_desc:{
title:'',
content:'',
refImg:[],
img:[]
},
desc:{
detail:"",
qa:"",
customer_service:[],
before_goods_id:0,
after_goods_id:0
},
is_into_periods:'0'
this.form = {
name: '',
goods_type: 1,
goods_desc: {
desc: "",
img: [],
course_title: ""
},
course_id: '',
course_type: 0,
watch_num: '',
duration_num: 0,
original_price: '',
current_price: '',
is_real: 0,
is_auth_user: 0,
is_auth_teacher: 0,
share_desc: {
title: '',
content: '',
refImg: [],
img: []
},
desc: {
detail: "",
qa: "",
customer_service: [],
before_goods_id: 0,
after_goods_id: 0
},
is_into_periods: '0'
},
this.getLessonList();
console.log(this.form.course_type)
if(this.form.goods_type==1||this.form.goods_type==2){
let json={
limit:200,
nowPage:1,
goods_type:'4'
if (this.form.goods_type == 1 || this.form.goods_type == 2) {
let json = {
limit: 200,
nowPage: 1,
goods_type: '4'
}
getGoodsListApi(json).then(res=>{
getGoodsListApi(json).then(res => {
// debugger
let item = {
name:'不赠送',
id:'0',
goods_type:4,
course_type:0,
current_price:0
name: '不赠送',
id: '0',
goods_type: 4,
course_type: 0,
current_price: 0
}
this.coupongoods = res.list
this.coupongoods.unshift(item)
});
}
break;
case 1: case 2:
case 1:
case 2:
this.goOn_goods_Id.after_goods_id = '';
this.goOn_goods_Id.before_goods_id = '';
this.goodsYou = [];
this.form={
name:'',
goods_type:1,
goods_desc:{
desc:"",
img:[],
course_title:''
},
course_id :'',
course_type:0,
watch_num:'',
duration_num:0,
original_price:'',
current_price:'',
is_real:0,
is_auth_user:0,
is_auth_teacher:0,
share_desc:{
title:'',
content:'',
refImg:[],
img:[]
},
desc:{
detail:"",
qa:"",
customer_service:[],
before_goods_id:0,
after_goods_id:0
},
is_into_periods:'0'
this.form = {
name: '',
goods_type: 1,
goods_desc: {
desc: "",
img: [],
course_title: ''
},
course_id: '',
course_type: 0,
watch_num: '',
duration_num: 0,
original_price: '',
current_price: '',
is_real: 0,
is_auth_user: 0,
is_auth_teacher: 0,
share_desc: {
title: '',
content: '',
refImg: [],
img: []
},
desc: {
detail: "",
qa: "",
customer_service: [],
before_goods_id: 0,
after_goods_id: 0
},
is_into_periods: '0'
};
getGoodsDetailApi(this.dialogObj.id).then(res=>{
getGoodsDetailApi(this.dialogObj.id).then(res => {
this.loading = false;
let share_desc = JSON.parse(res.share_desc);
if(!share_desc.refImg){
if (!share_desc.refImg) {
share_desc.refImg = []
}
this.form={
name:res.name,
goods_type:res.goods_type,
goods_desc:JSON.parse(res.goods_desc),
course_id :res.course_id,
course_type:res.course_type,
watch_num:res.watch_num,
duration_num:res.duration_num,
original_price:res.original_price/100,
current_price:res.current_price/100,
is_real:res.is_real,
is_auth_user:res.is_auth_user,
share_desc:JSON.parse(res.share_desc),
desc:JSON.parse(res.desc),
invite_earnings: res.invite_earnings/100,
this.form = {
name: res.name,
goods_type: res.goods_type,
goods_desc: JSON.parse(res.goods_desc),
course_id: res.course_id,
course_type: res.course_type,
watch_num: res.watch_num,
duration_num: res.duration_num,
original_price: res.original_price / 100,
current_price: res.current_price / 100,
is_real: res.is_real,
is_auth_user: res.is_auth_user,
share_desc: JSON.parse(res.share_desc),
desc: JSON.parse(res.desc),
invite_earnings: res.invite_earnings / 100,
is_auth_teacher: res.is_auth_teacher,
is_into_periods:res.is_into_periods
is_into_periods: res.is_into_periods
};
if(this.form.desc.before_goods_id){
if (this.form.desc.before_goods_id) {
this.goOn_goods_Id.before_goods_id = this.form.desc.before_goods_id;
}
if(this.form.desc.after_goods_id){
if (this.form.desc.after_goods_id) {
this.goOn_goods_Id.after_goods_id = this.form.desc.after_goods_id;
}
if(this.form.desc.use_goods_ids){
if (this.form.desc.use_goods_ids) {
this.goodsYou = this.form.desc.use_goods_ids.split(',');
this.goodsYou=this.goodsYou.map(function(item) {
this.goodsYou = this.goodsYou.map(function (item) {
return +item;
});
}
console.log(this.form)
if(this.form.course_type!=1&&this.form.course_type!=2){
if (this.form.course_type != 1 && this.form.course_type != 2) {
// debugger
getGoodsListApi({limit:200}).then(res=>{
getGoodsListApi({limit: 200}).then(res => {
this.goodsList = res.list
});
}
// debugger
console.log(this.form.course_type)
if(this.form.goods_type==4){
if (this.form.goods_type == 4) {
// debugger
this.getLessonList()
let json={
limit:200,
nowPage:1,
goods_type:'1,2'
let json = {
limit: 200,
nowPage: 1,
goods_type: '1,2'
}
getGoodsListApi(json).then(res=>{
getGoodsListApi(json).then(res => {
this.goodsList = res.list
});
}
if(this.form.goods_type==1||this.form.goods_type==2){
let json={
limit:200,
nowPage:1,
goods_type:'4'
if (this.form.goods_type == 1 || this.form.goods_type == 2) {
let json = {
limit: 200,
nowPage: 1,
goods_type: '4'
}
getGoodsListApi(json).then(res=>{
getGoodsListApi(json).then(res => {
// debugger
let item = {
name:'不赠送',
id:'0',
goods_type:4,
course_type:0,
current_price:0
name: '不赠送',
id: '0',
goods_type: 4,
course_type: 0,
current_price: 0
}
this.coupongoods = res.list
this.coupongoods.unshift(item)
......@@ -772,14 +834,14 @@
this.show = this.dialogObj.show;
this.id = this.dialogObj.id;
this.type = 2;
if(this.form.goods_type==1||this.form.goods_type==2){
if (this.form.goods_type == 1 || this.form.goods_type == 2) {
this.getLessonList()
let json={
limit:200,
nowPage:1,
goods_type:'4'
let json = {
limit: 200,
nowPage: 1,
goods_type: '4'
}
getGoodsListApi(json).then(res=>{
getGoodsListApi(json).then(res => {
this.coupongoods = res.list
});
}
......@@ -794,19 +856,19 @@
break
}
},
changeLessonType(){
changeLessonType() {
this.getLessonList()
},
getLessonList(){
getLessonApi({type:this.form.course_type}).then(res=>{
getLessonList() {
getLessonApi({type: this.form.course_type}).then(res => {
this.lessonList = res.list
})
}
},
watch:{
dialogObj:{
watch: {
dialogObj: {
handler: function () {
if(this.dialogObj.show){
if (this.dialogObj.show) {
console.log(this.dialogObj)
this.loading = true;
this.initDialog()
......@@ -814,36 +876,41 @@
},
deep: true
},
"dialogObj.show":function(a){
"dialogObj.show": function (a) {
},
show(value){
this.$emit("changeShow",value);
show(value) {
this.$emit("changeShow", value);
}
}
}
</script>
<style scoped lang="less">
.el-col{
.el-col {
min-height: 50px;
text-align: center;
margin-bottom: 10px;
line-height: 40px;
.el-select,.el-select{
.el-select, .el-select {
width: 100%;
}
img{
img {
width: 50px;
border-radius: 100px;
}
label{
label {
color: #5982e6;
}
}
.dialog-footer{
.dialog-footer {
display: block;
text-align: center;
}
.size {
color: #666;
font-size: 14px;
......
......@@ -96,7 +96,7 @@
total:0,
limit: 10,
roleList:[],
exportMenuList:[
exportMenuList:[ // 导出权限
'2-3','5-10','5-2','5-1','5-3','5-8','5-9','3-1','7-9','6-3', '10-8'
],
dialog:{
......
......@@ -239,7 +239,7 @@
</div>
</el-dialog>
<el-dialog width="500px" :visible.sync="transfer.show">
<el-dialog width="500px" :visible.sync="transfer.show" title="移交">
<el-form ref="transferForm" :rules="transfer.form.rules" :model="transfer.form" label-width="100px">
<el-form-item label="当前设备:" prop="teacher_name">
{{transfer.form.teacher_name}}
......@@ -264,6 +264,16 @@
type="datetime" placeholder="选择时间"></el-date-picker>
</div>
</el-form-item>
<el-form-item label="移交原因:" prop="reason">
<el-select v-model="transfer.form.reason" filterable placeholder="请选择" :clearable="false" @change="transferReasonName">
<el-option
v-for="(data,index) in transfer.reasonList"
:key="index"
:label="data.name"
:value="data.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="transferToggle">取消</el-button>
......@@ -289,6 +299,8 @@
transfer: {
show: false,
form: {
reason: '',
reason_name: '',
teacher_name: '',
teacher_id: '',
staff_current_name: '', // 当前顾问名
......@@ -298,9 +310,23 @@
rules: {
staff_id: [{required: true, message: '请选择', trigger: 'change'}],
transfer_at: [{required: true, message: '请选择', trigger: 'change'}],
reason: [{required: true, message: '请选择', trigger: 'change'}],
},
},
staff: [0]
staff: [0],
reasonList: [{
id: 0,
name: '人员入职',
},{
id: 1,
name: '人员离职',
},{
id: 2,
name: '请假',
},{
id: 3,
name: '其它',
},]
},
searchFrom:{
name:'',
......@@ -440,6 +466,9 @@
transferStaffName(data) {
this.transfer.form.staff_name = this.transfer.staff.find(x => x.id == data).name;
},
transferReasonName(data) {
this.transfer.form.reason_name = this.transfer.reasonList.find(x => x.id == data).name;
},
transferToggle(data) {
this.transfer.show = !this.transfer.show;
if (this.transfer.show){
......@@ -467,8 +496,9 @@
this.$confirm(`确定将
<span style="color: red;">${this.transfer.form.teacher_name}</span> 移交给
<span style="color: red;">${this.transfer.form.staff_name}</span> ?<br>移交开始时间
${this.transfer.form.transfer_at}`, '提示', {
<span style="color: red;">${this.transfer.form.staff_name}</span> ?<br>
移交开始时间 ${this.transfer.form.transfer_at} <br>
移交原因 ${this.transfer.form.reason_name}`, '提示', {
dangerouslyUseHTMLString: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -478,6 +508,7 @@
teacher_id: this.transfer.form.teacher_id,
staff_id: this.transfer.form.staff_id,
transfer_at: this.transfer.form.transfer_at,
reason: this.transfer.form.reason,
};
postTransferTeacherApi(json).then(res => {
this.$message({type: 'success', message: '移交成功!'});
......
......@@ -441,58 +441,34 @@
<user-list :userObj="userObj" @reflash="getTeacherDetail"/>
<choose-good-dialog :dialogObj="chooseGoodDialogObj" @changeShow="changeShow"/>
<el-dialog append-to-body :visible.sync="addShow">
<el-form label-width="90px">
<el-dialog append-to-body :visible.sync="addShow" top="5vh">
<el-form label-width="90px" inline>
<!--<el-form-item label="用户id">-->
<!--<el-input v-model="addId"></el-input>-->
<!--</el-form-item>-->
<el-row>
<el-col :span="8">
<el-form-item label="ID">
<el-input v-model="searchFrom.userId"></el-input>
<el-form-item>
<el-input style="width: 160px;" placeholder="ID" @change="getUser" v-model="searchFrom.userId"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="昵称">
<el-input v-model="searchFrom.nickName"></el-input>
<el-form-item>
<el-input style="width: 160px;" placeholder="昵称" @change="getUser" v-model="searchFrom.nickName"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="电话">
<el-input v-model="searchFrom.mobile"></el-input>
<el-form-item>
<el-input style="width: 160px;" placeholder="电话" @change="getUser" v-model="searchFrom.mobile"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" :offset="16">
<el-form-item>
<el-button style="float: right" type="primary" plain @click="getUser">搜索</el-button>
<el-button type="primary" plain @click="getUser">搜索</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table
:data="userList"
ref="multipleTable"
@selection-change="handleSelectionChange"
style="width: 100%">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
className="f-c"
label="用户">
<el-table border size="small" :data="userList" ref="multipleTable" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column className="f-c" label="用户">
<template slot-scope="scope">
<img style="margin-right:5px;width: 50px;height: 50px;border-radius: 50px" :src="scope.row.avatar">{{scope.row.nickname}}(ID:{{scope.row.user_id}})
<img style="margin-right:8px;width: 50px;height: 50px;border-radius: 50px" :src="scope.row.avatar">{{scope.row.nickname}}(ID:{{scope.row.user_id}})
</template>
</el-table-column>
<el-table-column
prop="mobile"
label="手机号">
</el-table-column>
<el-table-column prop="mobile" label="手机号"></el-table-column>
</el-table>
<page :total="userObj.total" :limit="userObj.limit" @pageChange="onPageChange3" @sizeChange="onSizeChange3"/>
<page :total="userObj.total" :limit="userObj.limit" :small="true" @pageChange="onPageChange3" @sizeChange="onSizeChange3"/>
<span slot="footer" class="dialog-footer">
<el-button @click="addShow = false">取 消</el-button>
<el-button type="primary" @click="onAdd">确 定</el-button>
......
......@@ -23,7 +23,7 @@
<div v-for="data in task3List" class="task3-table" style="width:47%">
<div class="table" >
<div class="title" style="width:8%">
<div class="header bg-h">期数</div>
<div class="header bg-h">期数名称</div>
<div>
<!--{{data.title}}-->
<div v-html="periodName(data)"></div>
......@@ -61,7 +61,7 @@
<div>往期意向用户:</div>
<div class="table" >
<div class="title" style="width:8%">
<div class="header bg-h">期数</div>
<div class="header bg-h">期数名称</div>
<div>
往期活跃用户数(近三天)
</div>
......
......@@ -10,9 +10,10 @@
<div v-for="data in task3List" class="task3-table">
<div class="table">
<div class="title" style="width:8%">
<div class="header bg-h">期数</div>
<div class="header bg-h">期数名称</div>
<div>
{{data.title}}
<!--{{data.title}}-->
<div v-html="periodName(data)"></div>
</div>
</div>
<div class="total">
......@@ -358,6 +359,29 @@
}
},
methods:{
periodName(val) {
let str = '';
if (!val.title) {
str = '-'
} else {
if (val.goods_id) {
str += `【${val.goods_id}】`
}
if (val.title) {
str += `${val.title}<br>`
}
if (val.watch_num) {
str += `${val.watch_num}课时`
}
if (val.start_at) {
str += `(${val.start_at.slice(5).replace('-', '')})`
}
if (val.has_watch_num || val.has_watch_num == 0) {
str += `-d${val.has_watch_num}`
}
}
return str
},
showSourceByDate(row){
this.sourceByDateDialogJson = {
"periods_id":row.periods_id,
......
......@@ -33,16 +33,17 @@
<img class="avatar" :src="scope.row.avatar">{{scope.row.nickname}}<br>(ID:{{scope.row.user_id}})
</template>
</el-table-column>
<el-table-column prop="mobile" label="手机号"></el-table-column>
<el-table-column prop="created_at" label="注册时间" width="105px" sortable></el-table-column>
<el-table-column prop="last_login_at" label="最后登录" width="105px" sortable></el-table-column>
<el-table-column prop="mobile" label="手机号" width="110px"></el-table-column>
<el-table-column prop="created_at" label="注册时间" sortable></el-table-column>
<el-table-column prop="last_login_at" label="最后登录" sortable></el-table-column>
<!--<el-table-column prop="last_login_at" label="最后登录时间" width="120px" sortable></el-table-column>-->
<el-table-column prop="baby_name" label="宝宝名称"></el-table-column>
<el-table-column prop="birthday" label="宝宝生日" width="105px"></el-table-column>
<el-table-column prop="birthday" label="宝宝生日" width="110px"></el-table-column>
<el-table-column prop="sex" label="宝宝性别" width="80px" :formatter="sexFormatter"></el-table-column>
<el-table-column label="操作" width="100px">
<el-table-column label="操作" width="200px">
<template slot-scope="scope">
<el-button size="mini" plain type="primary" @click="goToDetail(scope.row.user_id)">查看详情</el-button>
<el-button size="mini" v-if="!$store.state.readonly" plain type="warning" @click="userTransfer(scope.row)">用户转移</el-button>
</template>
</el-table-column>
</el-table>
......@@ -54,39 +55,93 @@
<user-detail :parentDetail="dialogDetail"></user-detail>
</div>
</el-dialog>
<!--用户移交-->
<el-dialog append-to-body :visible.sync="addShow" top="5vh" :title="`把 ${userObj.transfer_user_name} 转移为`">
<el-form label-width="90px" inline>
<el-form-item>
<el-input style="width: 160px;" placeholder="ID" @change="getTransferUser" v-model="userObj.searchFrom.userId"></el-input>
</el-form-item>
<el-form-item>
<el-input style="width: 160px;" placeholder="昵称" @change="getTransferUser" v-model="userObj.searchFrom.nickName"></el-input>
</el-form-item>
<el-form-item>
<el-input style="width: 160px;" placeholder="电话" @change="getTransferUser" v-model="userObj.searchFrom.mobile"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" plain @click="getTransferUser">搜索</el-button>
</el-form-item>
</el-form>
<el-table border size="small" :data="userTransferList" ref="multipleTable" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column className="f-c" label="用户">
<template slot-scope="scope">
<img style="margin-right:8px;width: 50px;height: 50px;border-radius: 50px" :src="scope.row.avatar">{{scope.row.nickname}}(ID:{{scope.row.user_id}})
</template>
</el-table-column>
<el-table-column prop="mobile" label="手机号"></el-table-column>
</el-table>
<page :total="userObj.total" :limit="userObj.limit" :small="true" @pageChange="onPageChange3" @sizeChange="onSizeChange3"/>
<span slot="footer" class="dialog-footer">
<el-button @click="addShow = false">取 消</el-button>
<el-button type="primary" @click="transferSave">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {getUserListApi,getSyncUserApi} from "../../service/api";
import {getUserListApi, getSyncUserApi, postUserTransferApi} from "../../service/api";
import page from '../framework/page'
import detailDialog from './detail'
import teacherDialog from './dialog'
import userDetail from '../userDetail/index'
export default {
name: "index",
data(){
data() {
return {
searchFrom:{
nickName:'',
mobile:'',
level:'',
addShow: false,
userTransferList: [],
userObj: {
title: '',
show: false,
total: 0,
limit: 10,
nowPage: 1,
transfer_user_id: '',
transfer_user_name: '',
receive_user_id: '',
receive_user_name: '',
searchFrom: {
nickName: '',
mobile: '',
level: '',
userId: ''
},
dialogDetail:{
show:false,
id:''
},
userList:[],
total:0,
nowPage:1,
multipleSelection: [],
searchFrom: {
nickName: '',
mobile: '',
level: '',
userId: ''
},
dialogDetail: {
show: false,
id: ''
},
userList: [],
total: 0,
nowPage: 1,
limit: 10,
showDetail:false,
showId:'',
dialogObj:{
show:false,
title:'绑定老师',
id:0,
showDetail: false,
showId: '',
dialogObj: {
show: false,
title: '绑定老师',
id: 0,
teacher_id: 0
},
dialogDetailObj: {
......@@ -96,40 +151,133 @@
loading: false
}
},
components:{
components: {
page,
detailDialog,
userDetail,
teacherDialog
},
mounted(){
mounted() {
this.getUser()
},
methods:{
tagChange() {
methods: {
userTransfer(row) {
this.addShow = true;
this.userObj.total = 0;
this.userObj.nowPage = 1;
this.getTransferUser();
this.userObj.transfer_user_id = row.user_id;
this.userObj.transfer_user_name = row.nickname;
this.userObj.receive_user_id = '';
this.userObj.receive_user_name = '';
},
transferSave() {
if (this.multipleSelection.length === 0) {
this.$message({
type: 'error',
message: '请选择用户!'
});
return
} else if (this.multipleSelection.length !== 1) {
this.$message({
type: 'error',
message: '只能选择一个用户!'
});
return
} else if (!this.userObj.transfer_user_id || !this.userObj.transfer_user_name) {
return
}
this.$confirm(`确定将
<span style="color: red;">${this.userObj.transfer_user_name}</span> 转移为
<span style="color: red;">${this.userObj.receive_user_name}</span> ?`, '提示', {
dangerouslyUseHTMLString: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let json = {
transfer_user_id: this.userObj.transfer_user_id,
receive_user_id: this.userObj.receive_user_id,
}
postUserTransferApi(json).then(res => {
this.$message({
type: 'success',
message: '用户转移成功!'
});
this.getUser();
this.addShow = false;
this.userObj.transfer_user_id = '';
this.userObj.transfer_user_name = '';
this.userObj.receive_user_id = '';
this.userObj.receive_user_name = '';
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消转移'
});
});
},
sexFormatter(item){
if(item.sex==0){
onPageChange3(val) {
this.userObj.nowPage = val
this.getTransferUser()
},
onSizeChange3(val) {
this.userObj.limit = val;
this.userObj.nowPage = 1;
this.getTransferUser()
},
getTransferUser() {
let json = {
page: this.userObj.nowPage,
limit: this.userObj.limit,
};
if (this.userObj.searchFrom.userId) {
json.user_id = this.userObj.searchFrom.userId
}
if (this.userObj.searchFrom.nickName) {
json.nickname = this.userObj.searchFrom.nickName
}
if (this.userObj.searchFrom.mobile) {
json.mobile = this.userObj.searchFrom.mobile
}
getUserListApi(json).then(res => {
this.userTransferList = res.list;
this.userObj.total = res.total;
})
},
handleSelectionChange(val) {
this.multipleSelection = val;
this.userObj.receive_user_name = val[0].nickname;
this.userObj.receive_user_id = val[0].user_id;
},
sexFormatter(item) {
if (item.sex == 0) {
return '保密'
}
if(item.sex==1){
if (item.sex == 1) {
return '男'
}
if(item.sex==2){
if (item.sex == 2) {
return '女'
}
},
onPageChange(val){
onPageChange(val) {
this.nowPage = val
this.getUser()
},
onSizeChange(val){
onSizeChange(val) {
this.limit = val;
this.nowPage = 1;
this.getUser()
},
getUser(){
getUser() {
let json = {
page: this.nowPage,
limit: this.limit
......@@ -146,43 +294,43 @@
if (this.searchFrom.level) {
json.level = this.searchFrom.level
}
getUserListApi(json).then(res=>{
getUserListApi(json).then(res => {
this.userList = res.list;
this.total = res.total
})
},
detail(data){
detail(data) {
this.dialogDetailObj = {
show: true,
id: data.user_id
}
},
changeShow(data){
this.dialogDetailObj.show=data
changeShow(data) {
this.dialogDetailObj.show = data
},
bindTeacher(data){
bindTeacher(data) {
this.dialogObj = {
show:true,
title:'绑定老师',
id:data.user_id,
show: true,
title: '绑定老师',
id: data.user_id,
teacher_id: data.teacher_id
}
},
goToDetail(id){
goToDetail(id) {
this.dialogDetail.id = id;
this.dialogDetail.show = true
// this.$router.push('/userDetail/'+ id);
},
syncUser(){
syncUser() {
this.loading = true
getSyncUserApi().then((data)=>{
getSyncUserApi().then((data) => {
this.loading = false
this.$message({
showClose: true,
message: `已更新${data}条用户数据`,
type: 'success'
})
}).catch(()=>{
}).catch(() => {
this.loading = false
})
}
......@@ -192,14 +340,16 @@
<style lang="less">
/*@import "../../util/public";*/
.user{
.user {
/*height: 100%;*/
overflow: auto;
padding: 20px 0;
.btn-content{
.btn-content {
text-align: center;
}
}
.flexRow {
display: flex;
flex-flow: row;
......
......@@ -163,7 +163,7 @@
</el-table-column>
<el-table-column prop="teacher_name" label="班级老师">
</el-table-column>
<el-table-column prop="class_source" width="80" label="活动方案">
<el-table-column prop="class_source" label="活动方案" width="180px">
<template slot-scope="scope">
{{scope.row.class_source|classType}}
</template>
......@@ -905,10 +905,14 @@ export default {
.sms {
padding: 20px 0;
}
.el-button+.el-button{
.el-table {
.el-button + .el-button {
margin-left: 0;
/* margin-top: 10px; */
margin-top: 10px;
}
}
.avatar {
width: 50px;
min-width: 50px;
......
import Vue from 'vue';
import axios from 'axios'
import { post, fetch, patch, put, del, upload } from './index'
import {post, fetch, patch, put, del, upload} from './index'
import md5 from "js-md5";
import CommonJs from '../util/common';
const _baseUrl = process.env.API_URL;
Vue.prototype.$post = post;
Vue.prototype.$fetch = fetch;
......@@ -14,7 +15,7 @@ Vue.prototype.$upload = upload;
//登录
const loginURL = `${_baseUrl}api/admin/login`;
export const loginApi = function (json) {
return Vue.prototype.$post(loginURL, { "username": json.username, "passwd": json.password })
return Vue.prototype.$post(loginURL, {"username": json.username, "passwd": json.password})
};
//退出登录
const logOutUrl = `${_baseUrl}api/admin/logout`;
......@@ -56,6 +57,11 @@ const getUserDetailUrl = `${_baseUrl}api/admin/student/info`;
export const getUserDetailApi = function (id) {
return Vue.prototype.$fetch(`${getUserDetailUrl}/${id}`)
};
// 用户转移
const postUserTransferUrl = `${_baseUrl}api/admin/user/data/transfer`;
export const postUserTransferApi = function (json) {
return Vue.prototype.$post(postUserTransferUrl, json)
};
//获取教师列表
const getTeacherListUrl = `${_baseUrl}api/admin/teacher/list`;
export const getTeacherListApi = function (json) {
......@@ -148,7 +154,7 @@ export const downGoodsApi = function (id) {
//查询元素、菜单分类
const getCategoryUrl = `${_baseUrl}api/admin/category/list/0`;
export const getCategoryApi = function (pid) {
return Vue.prototype.$fetch(getCategoryUrl, { 'pid': pid })
return Vue.prototype.$fetch(getCategoryUrl, {'pid': pid})
};
// 添加教材菜单
......@@ -362,7 +368,7 @@ export const delBannerApi = function (id) {
// 移动顺序
const moveUrl = `${_baseUrl}api/admin/banner/sort`;
export const moveApi = function (upId, downId) {
return Vue.prototype.$patch(`${moveUrl}`, { banner_up_id: upId, banner_down_id: downId })
return Vue.prototype.$patch(`${moveUrl}`, {banner_up_id: upId, banner_down_id: downId})
};
// 获取期数列表
......@@ -668,6 +674,7 @@ const editAdminPasswordUrl = `/api/admin/user/passwd`;
export const editAdminPasswordApi = function (json) {
return Vue.prototype.$patch(editAdminPasswordUrl, json)
};
// 导出
function exportExcel(form) {
return axios({ // 用axios发送post请求
......@@ -681,18 +688,33 @@ function exportExcel(form) {
})
// return Vue.prototype.$post(form.url, form.params)
}
export const exportExcelApi = function (url,params,fname) {
export const exportExcelApi = function (url, params, fname) {
url = `${url}`;
let obj = {
'url' : url,
params:params
'url': url,
params: params
}
exportExcel(obj).then(res => { // 处理返回的文件流
console.log(res)
let blob = new Blob([res.data], {type: 'text/csv'})
console.log(res.headers['content-disposition'].split('filename=')[1])
CommonJs.dateFmt(new Date(),"yyyy-MM-dd")
let filename = fname+CommonJs.dateFmt(new Date(),"yyyy-MM-dd")+'.xls'
let blob = new Blob([res.data], {type: res.data.type}), filename;
//console.log(res.headers['content-disposition'].split('filename=')[1])
//CommonJs.dateFmt(new Date(), "yyyy-MM-dd")
if (!fname && res.headers['content-disposition'].split('filename=')[1]) {
let str = res.headers['content-disposition'].split('filename=')[1];
if (str[str.length - 1] == '"' || str[str.length - 1] == "'") {
//str = str.substring(-1,(str.length-1));
str = str.replace(/\"|\'/g, "")
}
if (str.indexOf('.xls') > -1) {
filename = str
} else {
filename = str + '.xls'
}
} else {
filename = fname + CommonJs.dateFmt(new Date(), "yyyy-MM-dd") + '.xls'
}
console.log('filename: ' + filename);
var link = document.createElement('a');
link.href = window.URL.createObjectURL(blob);
link.download = filename;
......@@ -705,15 +727,15 @@ const exportReceiveInfoUrl = `${_baseUrl}api/admin/order/deliver/periods/export/
export const exportReceiveInfoApi = function (periods_id) {
return new Promise((resolve, reject) => {
let obj = {
'url' :`${exportReceiveInfoUrl}${periods_id}`,
params:{}
'url': `${exportReceiveInfoUrl}${periods_id}`,
params: {}
}
exportExcel(obj).then(res => { // 处理返回的文件流
console.log(res)
let blob = new Blob([res.data], {type: 'text/csv'})
console.log(res.headers['content-disposition'].split('filename=')[1])
CommonJs.dateFmt(new Date(),"yyyy-MM-dd")
let filename = '收货信息'+CommonJs.dateFmt(new Date(),"yyyy-MM-dd")+'.xls'
//CommonJs.dateFmt(new Date(), "yyyy-MM-dd")
let filename = '收货信息' + CommonJs.dateFmt(new Date(), "yyyy-MM-dd") + '.xls'
var link = document.createElement('a');
link.href = window.URL.createObjectURL(blob);
link.download = filename;
......@@ -1262,8 +1284,8 @@ export const postSourceStudentApi = function (json) {
export const delSourceStudentApi = function (type) {
return Vue.prototype.$del(`${_baseUrl}api/admin/source/student/delete/${type}`)
};
export const putSourceStudentApi = function (type,json) {
return Vue.prototype.$put(`${_baseUrl}api/admin/source/student/edit/${type}`,json)
export const putSourceStudentApi = function (type, json) {
return Vue.prototype.$put(`${_baseUrl}api/admin/source/student/edit/${type}`, json)
};
// /api/admin/source/student/list
// 获取标签
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment