Commit 99540928 authored by 赵茹林's avatar 赵茹林

回访信息 [更新] 去掉只读时不能添加回访信息的权限判断

回访信息 [修复] 班级成员界面点沟通情况时未传teacher id导致不能添加回访信息的问题
教师列表选择框 [更新] 接口条数限制改为500
parent 24b04b2a
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
v-for="(data,index) in teacherList" v-for="(data,index) in teacherList"
:key="index" :key="index"
:label="data.name" :label="data.name"
:value="data.id" > :value="data.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
v-for="(data,index) in classSource" v-for="(data,index) in classSource"
:key="index" :key="index"
:label="data.name" :label="data.name"
:value="data.type" > :value="data.type">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -62,66 +62,77 @@ ...@@ -62,66 +62,77 @@
</template> </template>
<script> <script>
import {getTeacherListApi,getClassDetailApi,editClassApi,addClassApi,getPeriodsApi,getGoodsListApi,getPeriodsTeacherApi,uploadFileApi,getSourceStudentApi} from "../../service/api"; import {
import {GOODSTYPE,CLASSSOURCE} from '../../util/wordbook'; getTeacherListApi,
getClassDetailApi,
editClassApi,
addClassApi,
getPeriodsApi,
getGoodsListApi,
getPeriodsTeacherApi,
uploadFileApi,
getSourceStudentApi
} from "../../service/api";
import {GOODSTYPE, CLASSSOURCE} from '../../util/wordbook';
export default { export default {
props:[ props: [
'dialogObj' 'dialogObj'
], ],
data(){ data() {
// let classSource=[]; // let classSource=[];
// for (let x in CLASSSOURCE ) { // for (let x in CLASSSOURCE ) {
// classSource.push({label:CLASSSOURCE[x],value:Number(x)}) // classSource.push({label:CLASSSOURCE[x],value:Number(x)})
// } // }
return{ return {
imageList:[], imageList: [],
form:{ form: {
teacher_id:'', teacher_id: '',
max_join_num:'', max_join_num: '',
class_name:"", class_name: "",
source:"", source: "",
qr:"" qr: ""
}, },
type:0, type: 0,
classSource:[], classSource: [],
teacherList:[], teacherList: [],
exitTeacherList: [], exitTeacherList: [],
goodsList: [], goodsList: [],
periods: {}, periods: {},
uploadShow: true uploadShow: true
} }
}, },
methods:{ methods: {
beforeAvatarUpload(){ beforeAvatarUpload() {
this.uploadShow = false this.uploadShow = false
}, },
handleRemove(){ handleRemove() {
this.uploadShow = true this.uploadShow = true
}, },
handleAvatarSuccess(res) { handleAvatarSuccess(res) {
this.imageList = [{name:res.data.url,url:process.env.IMAGE_URL_HEAD + res.data.url}] this.imageList = [{name: res.data.url, url: process.env.IMAGE_URL_HEAD + res.data.url}]
}, },
uploadFile(a) { uploadFile(a) {
this.loading = true; this.loading = true;
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; this.fileUid = a.file.uid;
uploadFileApi({file:a.file,type:'all'}).then(res=>{ uploadFileApi({file: a.file, type: 'all'}).then(res => {
this.form.media_id = res.wechat_info ? res.wechat_info.media_id : ''; this.form.media_id = res.wechat_info ? res.wechat_info.media_id : '';
this.imageList = [{name:res.url,url:process.env.IMAGE_URL_HEAD + res.url}]; this.imageList = [{name: res.url, url: process.env.IMAGE_URL_HEAD + res.url}];
this.uploadShow = false; this.uploadShow = false;
this.loading = false; this.loading = false;
this.$message({ this.$message({
type: 'success', type: 'success',
message: '上传成功!' message: '上传成功!'
}); });
}).catch(()=>{ }).catch(() => {
this.loading = false; this.loading = false;
}) })
}, },
findDifferentArray(array1, array2){ findDifferentArray(array1, array2) {
let newArray = []; let newArray = [];
array1.forEach((val)=>{ array1.forEach((val) => {
let index = array2.findIndex((item)=>{ let index = array2.findIndex((item) => {
return item.teacher_id === val.id return item.teacher_id === val.id
}) })
if (index === -1) { if (index === -1) {
...@@ -130,33 +141,33 @@ ...@@ -130,33 +141,33 @@
}) })
return newArray return newArray
}, },
getTeacher(){ getTeacher() {
getTeacherListApi({limit:100,status:0}).then(res=>{ getTeacherListApi({limit: 500, status: 0}).then(res => {
this.teacherList = res.list this.teacherList = res.list
}); });
}, },
getTeacherByPeriods(){ getTeacherByPeriods() {
getTeacherListApi({limit:100,status:0}).then(res=>{ getTeacherListApi({limit: 500, status: 0}).then(res => {
this.teacherList = res.list this.teacherList = res.list
}) })
}, },
initPage(){ initPage() {
// 1为编辑 // 1为编辑
getSourceStudentApi().then(res=>{ getSourceStudentApi().then(res => {
this.classSource = res this.classSource = res
}) })
this.periods = this.dialogObj.periods this.periods = this.dialogObj.periods
switch (this.dialogObj.type) { switch (this.dialogObj.type) {
case 0: case 0:
if(!this.dialogObj.periodsId){ if (!this.dialogObj.periodsId) {
this.getPeriodList(); this.getPeriodList();
} }
this.form = { this.form = {
teacher_id:'', teacher_id: '',
max_join_num:'', max_join_num: '',
class_name: '', class_name: '',
source:'', source: '',
qr:"" qr: ""
}; };
this.type = 0; this.type = 0;
this.uploadShow = true this.uploadShow = true
...@@ -164,16 +175,16 @@ ...@@ -164,16 +175,16 @@
break; break;
case 1: case 1:
this.type = 1; this.type = 1;
getClassDetailApi(this.dialogObj.id).then(res=>{ getClassDetailApi(this.dialogObj.id).then(res => {
this.form = { this.form = {
teacher_id: parseInt(res.teacher_id), teacher_id: parseInt(res.teacher_id),
max_join_num:res.max_join_num, max_join_num: res.max_join_num,
class_name:res.class_name, class_name: res.class_name,
source:res.source, source: res.source,
}; };
if(res.qr){ if (res.qr) {
this.form.qr = res.qr this.form.qr = res.qr
this.imageList = [{name:res.qr,url:res.qr}]; this.imageList = [{name: res.qr, url: res.qr}];
} }
this.form.media_id = res.media_id ? res.media_id : ''; this.form.media_id = res.media_id ? res.media_id : '';
this.uploadShow = !res.qr this.uploadShow = !res.qr
...@@ -182,41 +193,43 @@ ...@@ -182,41 +193,43 @@
}) })
} }
}, },
getPeriodList(){ getPeriodList() {
getGoodsListApi().then(res=>{ getGoodsListApi().then(res => {
res.list.forEach(i=>{ res.list.forEach(i => {
i.name = '[' + GOODSTYPE[i.goods_type] + ']' + '[' +i.current_price / 100 + '元]' + i.name i.name = '[' + GOODSTYPE[i.goods_type] + ']' + '[' + i.current_price / 100 + '元]' + i.name
i.children = []; i.children = [];
}); });
this.goodsList = res.list; this.goodsList = res.list;
if(!this.periods) { if (!this.periods) {
getPeriodsApi({goods_id:this.goodsList[0].id}).then(res=>{ getPeriodsApi({goods_id: this.goodsList[0].id}).then(res => {
res.list.forEach(i=>{i.name = i.title}); res.list.forEach(i => {
i.name = i.title
});
this.goodsList[0].children = res.list; this.goodsList[0].children = res.list;
this.periods = res.list[0] this.periods = res.list[0]
}) })
} }
}); });
}, },
onSave(){ onSave() {
if(this.imageList.length > 0){ if (this.imageList.length > 0) {
this.form.qr = this.imageList[0].url; this.form.qr = this.imageList[0].url;
} }
let json = { let json = {
max_join_num:String(this.form.max_join_num), max_join_num: String(this.form.max_join_num),
teacher_id:String(this.form.teacher_id), teacher_id: String(this.form.teacher_id),
source : this.form.source, source: this.form.source,
class_name:this.form.class_name, class_name: this.form.class_name,
media_id:this.form.media_id media_id: this.form.media_id
}; };
if(this.form.qr){ if (this.form.qr) {
json.qr = this.form.qr json.qr = this.form.qr
} }
console.log(json) console.log(json)
switch (this.dialogObj.type) { switch (this.dialogObj.type) {
case 0: case 0:
let id = this.dialogObj.periodsId ? this.dialogObj.periodsId : this.periods.id; let id = this.dialogObj.periodsId ? this.dialogObj.periodsId : this.periods.id;
addClassApi(id,json).then(res=>{ addClassApi(id, json).then(res => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '添加成功!' message: '添加成功!'
...@@ -226,39 +239,47 @@ ...@@ -226,39 +239,47 @@
}); });
break; break;
case 1: case 1:
editClassApi(this.dialogObj.id,json).then(res=>{ editClassApi(this.dialogObj.id, json).then(res => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '修改成功!' message: '修改成功!'
}); });
this.$emit("reflash",this.periods); this.$emit("reflash", this.periods);
this.dialogObj.show = false; this.dialogObj.show = false;
}) })
} }
}, },
handleItemChange(val){ handleItemChange(val) {
getPeriodsApi({goods_id:val[0]}).then(res=>{ getPeriodsApi({goods_id: val[0]}).then(res => {
res.list.forEach(i=>{i.name = i.title}); res.list.forEach(i => {
this.goodsList.find(i=>{return i.id === val[0]}).children = res.list i.name = i.title
});
this.goodsList.find(i => {
return i.id === val[0]
}).children = res.list
}) })
}, },
changePeriods(data){ changePeriods(data) {
if(data.length>1){ if (data.length > 1) {
let nowGoods = this.goodsList.find(i=>{return i.id === data[0]}); let nowGoods = this.goodsList.find(i => {
this.periods = nowGoods.children.find(i=>{return i.id === data[1]}); return i.id === data[0]
});
this.periods = nowGoods.children.find(i => {
return i.id === data[1]
});
this.getTeacherByPeriods() this.getTeacherByPeriods()
} }
}, },
selectName(val,id){ selectName(val, id) {
let filterVal=val.filter(function(item,i){ let filterVal = val.filter(function (item, i) {
return item.id == id return item.id == id
}); });
this.form.class_name=filterVal[0].name+"一班"; this.form.class_name = filterVal[0].name + "一班";
} }
}, },
watch:{ watch: {
'dialogObj.show'(value){ 'dialogObj.show'(value) {
if(value){ if (value) {
this.initPage() this.initPage()
} }
} }
...@@ -267,12 +288,13 @@ ...@@ -267,12 +288,13 @@
</script> </script>
<style scoped> <style scoped>
.qr-img { .qr-img {
width: 148px !important; width: 148px !important;
border: none !important; border: none !important;
border-radius: 0 !important; border-radius: 0 !important;
} }
.disabled .el-upload--picture-card {
.disabled .el-upload--picture-card {
display: none !important; display: none !important;
} }
</style> </style>
...@@ -88,7 +88,9 @@ ...@@ -88,7 +88,9 @@
<el-table-column type="selection" width="40"></el-table-column> <el-table-column type="selection" width="40"></el-table-column>
<el-table-column width="120" label="沟通情况"> <el-table-column width="120" label="沟通情况">
<template slot-scope="scope"> <template slot-scope="scope">
<teacher-desc :row="scope.row" :typeFlag="true" :descType="2" @onSuccess="searchList()"></teacher-desc> <!--<teacher-desc :row="scope.row" :typeFlag="true" :descType="2" @onSuccess="searchList()"></teacher-desc>-->
<!---->
<teacher-desc :teacherId="userObj.teacherId" :row="scope.row" :typeFlag="true" :descType="2" @onSuccess="searchList()"></teacher-desc>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="用户" className="f-c" min-width="180" sortable prop="user_id"> <el-table-column label="用户" className="f-c" min-width="180" sortable prop="user_id">
......
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
</div> </div>
</template> </template>
<script> <script>
import { import {
getTeacherListApi, getTeacherListApi,
getchannelTransListApi, getchannelTransListApi,
getPeriodsApi, getPeriodsApi,
...@@ -163,16 +163,16 @@ import { ...@@ -163,16 +163,16 @@ import {
getPeriodsOtherListApi, getPeriodsOtherListApi,
getConfigListApi, getConfigListApi,
getUpdateTimeApi getUpdateTimeApi
} from "../../service/api"; } from "../../service/api";
import page from "../framework/page"; import page from "../framework/page";
import { GOODSTYPE, CLASSSOURCE } from "../../util/wordbook"; import {GOODSTYPE, CLASSSOURCE} from "../../util/wordbook";
export default { export default {
name: "channelTransList", name: "channelTransList",
data() { data() {
return { return {
updateTime: '', updateTime: '',
typeList:[], typeList: [],
width: 0, width: 0,
nowPage: 1, nowPage: 1,
limit: 20, limit: 20,
...@@ -276,7 +276,7 @@ export default { ...@@ -276,7 +276,7 @@ export default {
contentSpanArr: [], contentSpanArr: [],
searchFrom: { searchFrom: {
payTime: [], payTime: [],
classTime:[], classTime: [],
start_at: "", start_at: "",
end_at: "", end_at: "",
invite_type: "", invite_type: "",
...@@ -289,14 +289,14 @@ export default { ...@@ -289,14 +289,14 @@ export default {
}, },
propertyList: [], propertyList: [],
watchList: [ watchList: [
{ id: 0, title: 5 }, {id: 0, title: 5},
{ id: 1, title: 6 }, {id: 1, title: 6},
{ id: 2, title: 10 }, {id: 2, title: 10},
{ id: 3, title: 20 } {id: 3, title: 20}
] ]
}; };
}, },
components: { page }, components: {page},
methods: { methods: {
periodName(row) { periodName(row) {
//return `【${row.goods_id}】${row.periods_title}${row.watch_num}课时(${row.start_at.slice(5).replace('-', '')})-d${this.title.has_watch_num}` //return `【${row.goods_id}】${row.periods_title}${row.watch_num}课时(${row.start_at.slice(5).replace('-', '')})-d${this.title.has_watch_num}`
...@@ -319,7 +319,7 @@ export default { ...@@ -319,7 +319,7 @@ export default {
}, },
exportDataTable() { exportDataTable() {
let json = {}; let json = {};
if(this.searchFrom.sort_value){ if (this.searchFrom.sort_value) {
json.sort_value = this.searchFrom.sort_value; json.sort_value = this.searchFrom.sort_value;
json.sort_key = this.searchFrom.sort_key; json.sort_key = this.searchFrom.sort_key;
} }
...@@ -364,7 +364,7 @@ export default { ...@@ -364,7 +364,7 @@ export default {
// } // }
}, },
handleItemChange(val) { handleItemChange(val) {
getPeriodsApi({ goods_id: val[0], limit: 100 }).then(res => { getPeriodsApi({goods_id: val[0], limit: 100}).then(res => {
res.list.forEach(i => { res.list.forEach(i => {
i.name = i.title; i.name = i.title;
}); });
...@@ -416,12 +416,12 @@ export default { ...@@ -416,12 +416,12 @@ export default {
getTeacherList() { getTeacherList() {
let json = { let json = {
page: 1, page: 1,
limit: 200 limit: 500
}; };
getTeacherListApi(json).then(res => { getTeacherListApi(json).then(res => {
this.teacherList = res.list; this.teacherList = res.list;
}); });
getConfigListApi({page:1, limit: 100,key:'code_rule_type'}).then(res=>{ getConfigListApi({page: 1, limit: 100, key: 'code_rule_type'}).then(res => {
this.typeList = res.list this.typeList = res.list
}) })
}, },
...@@ -450,9 +450,9 @@ export default { ...@@ -450,9 +450,9 @@ export default {
}); });
}, },
getPeriodsOtherList() { getPeriodsOtherList() {
let json = { limit: 1000,page:1,max_watch_num:20 }; let json = {limit: 1000, page: 1, max_watch_num: 20};
getPeriodsOtherListApi(json).then(res => { getPeriodsOtherListApi(json).then(res => {
res.list.forEach(val=>{ res.list.forEach(val => {
val.label = `【${val.goods_id}${val.title}${val.watch_num}课时(${val.start_at.slice(5).replace('-', '')})-d${val.has_watch_num}` val.label = `【${val.goods_id}${val.title}${val.watch_num}课时(${val.start_at.slice(5).replace('-', '')})-d${val.has_watch_num}`
}) })
this.periodList = res.list; this.periodList = res.list;
...@@ -467,7 +467,7 @@ export default { ...@@ -467,7 +467,7 @@ export default {
if (this.searchFrom.invite_type) { if (this.searchFrom.invite_type) {
json.invite_type = this.searchFrom.invite_type; json.invite_type = this.searchFrom.invite_type;
} }
if(this.searchFrom.sort_value){ if (this.searchFrom.sort_value) {
json.sort_value = this.searchFrom.sort_value; json.sort_value = this.searchFrom.sort_value;
json.sort_key = this.searchFrom.sort_key; json.sort_key = this.searchFrom.sort_key;
} }
...@@ -486,7 +486,7 @@ export default { ...@@ -486,7 +486,7 @@ export default {
if (this.searchFrom.teacher_id) { if (this.searchFrom.teacher_id) {
json.teacher_id = this.searchFrom.teacher_id; json.teacher_id = this.searchFrom.teacher_id;
} }
if (this.searchFrom.payTime&&this.searchFrom.payTime.length > 0) { if (this.searchFrom.payTime && this.searchFrom.payTime.length > 0) {
if ( if (
this.searchFrom.payTime[0] && this.searchFrom.payTime[0] &&
this.searchFrom.payTime[0].length > 0 this.searchFrom.payTime[0].length > 0
...@@ -502,7 +502,7 @@ export default { ...@@ -502,7 +502,7 @@ export default {
json.end_at = this.searchFrom.end_at; json.end_at = this.searchFrom.end_at;
} }
} }
if (this.searchFrom.classTime&&this.searchFrom.classTime.length > 0) { if (this.searchFrom.classTime && this.searchFrom.classTime.length > 0) {
console.log(this.searchFrom.classTime) console.log(this.searchFrom.classTime)
if ( if (
this.searchFrom.classTime[0] && this.searchFrom.classTime[0] &&
...@@ -583,12 +583,12 @@ export default { ...@@ -583,12 +583,12 @@ export default {
this.getPeriodsOtherList(); this.getPeriodsOtherList();
this.getUpdateTime(); this.getUpdateTime();
} }
}; };
</script> </script>
<style lang="less" scope> <style lang="less" scope>
.channel-trans-list { .channel-trans-list {
padding: 20px 0; padding: 20px 0;
} }
</style> </style>
...@@ -145,11 +145,18 @@ ...@@ -145,11 +145,18 @@
</div> </div>
</template> </template>
<script> <script>
import { getPeriodsConversionListApi, getGoodsListApi, getPeriodsOtherListApi, getTeacherListApi, getUpdateTimeApi } from "../../service/api"; import {
import page from "../framework/page"; getPeriodsConversionListApi,
import { GOODSTYPE, CLASSSOURCE } from "../../util/wordbook"; getGoodsListApi,
import { tipArr3 } from "../../util/tipArr"; getPeriodsOtherListApi,
export default { getTeacherListApi,
getUpdateTimeApi
} from "../../service/api";
import page from "../framework/page";
import {GOODSTYPE, CLASSSOURCE} from "../../util/wordbook";
import {tipArr3} from "../../util/tipArr";
export default {
name: "periodsConversionList", name: "periodsConversionList",
data() { data() {
return { return {
...@@ -253,7 +260,7 @@ export default { ...@@ -253,7 +260,7 @@ export default {
contentSpanArr: [], contentSpanArr: [],
searchFrom: { searchFrom: {
payTime: [], payTime: [],
classTime:[], classTime: [],
start_at: "", start_at: "",
end_at: "", end_at: "",
invite_type: "", invite_type: "",
...@@ -266,14 +273,14 @@ export default { ...@@ -266,14 +273,14 @@ export default {
}, },
propertyList: [], propertyList: [],
watchList: [ watchList: [
{ id: 0, title: 5 }, {id: 0, title: 5},
{ id: 1, title: 6 }, {id: 1, title: 6},
{ id: 2, title: 10 }, {id: 2, title: 10},
{ id: 3, title: 20 } {id: 3, title: 20}
] ]
}; };
}, },
components: { page }, components: {page},
methods: { methods: {
periodName(val) { periodName(val) {
let str = ''; let str = '';
...@@ -296,7 +303,7 @@ export default { ...@@ -296,7 +303,7 @@ export default {
} }
return str return str
}, },
rendertip(h, { column }) { rendertip(h, {column}) {
// console.log(h) // console.log(h)
return h("span", [ return h("span", [
h("span", column.label), h("span", column.label),
...@@ -318,11 +325,11 @@ export default { ...@@ -318,11 +325,11 @@ export default {
) )
]); ]);
}, },
sortMethod(data){ sortMethod(data) {
this.searchFrom.sort_key = data.prop this.searchFrom.sort_key = data.prop
if(data.order=='ascending'){ if (data.order == 'ascending') {
this.searchFrom.sort_value = 'asc' this.searchFrom.sort_value = 'asc'
}else{ } else {
this.searchFrom.sort_value = 'desc' this.searchFrom.sort_value = 'desc'
} }
this.getChannelTransList() this.getChannelTransList()
...@@ -330,7 +337,7 @@ export default { ...@@ -330,7 +337,7 @@ export default {
getTeacherList() { getTeacherList() {
let json = { let json = {
page: 1, page: 1,
limit: 200 limit: 500
}; };
getTeacherListApi(json).then(res => { getTeacherListApi(json).then(res => {
this.teacherList = res.list; this.teacherList = res.list;
...@@ -395,7 +402,7 @@ export default { ...@@ -395,7 +402,7 @@ export default {
// } // }
}, },
handleItemChange(val) { handleItemChange(val) {
getPeriodsApi({ goods_id: val[0], limit: 100 }).then(res => { getPeriodsApi({goods_id: val[0], limit: 100}).then(res => {
res.list.forEach(i => { res.list.forEach(i => {
i.name = i.title; i.name = i.title;
}); });
...@@ -469,9 +476,9 @@ export default { ...@@ -469,9 +476,9 @@ export default {
}); });
}, },
getPeriodsOtherList() { getPeriodsOtherList() {
let json = { limit: 1000,page:1,max_watch_num:20 }; let json = {limit: 1000, page: 1, max_watch_num: 20};
getPeriodsOtherListApi(json).then(res => { getPeriodsOtherListApi(json).then(res => {
res.list.forEach(val=>{ res.list.forEach(val => {
val.label = `【${val.goods_id}${val.title}${val.watch_num}课时(${val.start_at.slice(5).replace('-', '')})-d${val.has_watch_num}` val.label = `【${val.goods_id}${val.title}${val.watch_num}课时(${val.start_at.slice(5).replace('-', '')})-d${val.has_watch_num}`
}) })
this.periodList = res.list; this.periodList = res.list;
...@@ -487,7 +494,7 @@ export default { ...@@ -487,7 +494,7 @@ export default {
if (this.searchFrom.invite_type) { if (this.searchFrom.invite_type) {
json.invite_type = this.searchFrom.invite_type; json.invite_type = this.searchFrom.invite_type;
} }
if(this.searchFrom.sort_value){ if (this.searchFrom.sort_value) {
json.sort_value = this.searchFrom.sort_value; json.sort_value = this.searchFrom.sort_value;
json.sort_key = this.searchFrom.sort_key; json.sort_key = this.searchFrom.sort_key;
} }
...@@ -503,7 +510,7 @@ export default { ...@@ -503,7 +510,7 @@ export default {
if (this.searchFrom.teacher_id) { if (this.searchFrom.teacher_id) {
json.teacher_id = this.searchFrom.teacher_id; json.teacher_id = this.searchFrom.teacher_id;
} }
if (this.searchFrom.payTime&&this.searchFrom.payTime.length > 0) { if (this.searchFrom.payTime && this.searchFrom.payTime.length > 0) {
if ( if (
this.searchFrom.payTime[0] && this.searchFrom.payTime[0] &&
this.searchFrom.payTime[0].length > 0 this.searchFrom.payTime[0].length > 0
...@@ -519,7 +526,7 @@ export default { ...@@ -519,7 +526,7 @@ export default {
json.end_at = this.searchFrom.end_at; json.end_at = this.searchFrom.end_at;
} }
} }
if (this.searchFrom.classTime&&this.searchFrom.classTime.length > 0) { if (this.searchFrom.classTime && this.searchFrom.classTime.length > 0) {
console.log(this.searchFrom.classTime) console.log(this.searchFrom.classTime)
if ( if (
this.searchFrom.classTime[0] && this.searchFrom.classTime[0] &&
...@@ -600,12 +607,12 @@ export default { ...@@ -600,12 +607,12 @@ export default {
this.getTeacherList(); this.getTeacherList();
this.getUpdateTime() this.getUpdateTime()
} }
}; };
</script> </script>
<style lang="less" scope> <style lang="less" scope>
.channel-trans-list { .channel-trans-list {
padding: 20px 0; padding: 20px 0;
} }
</style> </style>
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
:style="{width: width+'px'}" :style="{width: width+'px'}"
fixed fixed
> >
<el-table-column prop="out_trade_no" label="订单号" ></el-table-column> <el-table-column prop="out_trade_no" label="订单号"></el-table-column>
<el-table-column <el-table-column
label="购买人" label="购买人"
className="f-c" className="f-c"
...@@ -105,8 +105,8 @@ ...@@ -105,8 +105,8 @@
<img class="avatar" :src="scope.row.user_avatar"/> {{scope.row.user_nickname}}<br>(ID:{{scope.row.user_id}})<br>手机:{{scope.row.user_mobile}} <img class="avatar" :src="scope.row.user_avatar"/> {{scope.row.user_nickname}}<br>(ID:{{scope.row.user_id}})<br>手机:{{scope.row.user_mobile}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goods_name" label="商品名称" ></el-table-column> <el-table-column prop="goods_name" label="商品名称"></el-table-column>
<el-table-column prop="periods_title" label="期数标题" ></el-table-column> <el-table-column prop="periods_title" label="期数标题"></el-table-column>
<el-table-column <el-table-column
prop="duration_over_at" prop="duration_over_at"
label="开课看课时间" label="开课看课时间"
...@@ -151,10 +151,10 @@ ...@@ -151,10 +151,10 @@
<img class="avatar" :src="scope.row.class_invite_user_avatar"/> {{scope.row.class_invite_user_nickname}}<br>(ID:{{scope.row.class_invite_user_id}})<br>手机:{{scope.row.class_invite_user_mobile}} <img class="avatar" :src="scope.row.class_invite_user_avatar"/> {{scope.row.class_invite_user_nickname}}<br>(ID:{{scope.row.class_invite_user_id}})<br>手机:{{scope.row.class_invite_user_mobile}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="money" label="实付金额" ></el-table-column> <el-table-column prop="money" label="实付金额"></el-table-column>
<el-table-column prop="pay_at" label="支付时间" ></el-table-column> <el-table-column prop="pay_at" label="支付时间"></el-table-column>
<el-table-column prop="in_class_at" label="进班时间" ></el-table-column> <el-table-column prop="in_class_at" label="进班时间"></el-table-column>
<el-table-column prop="status" label="支付状态" > <el-table-column prop="status" label="支付状态">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.status|orderFilter}} {{scope.row.status|orderFilter}}
</template> </template>
...@@ -170,11 +170,18 @@ ...@@ -170,11 +170,18 @@
</div> </div>
</template> </template>
<script> <script>
import { getPeriodsConversionListApi, getSourceConversionListApi, getGoodsListApi, getPeriodsOtherListApi, getTeacherListApi } from "../../service/api"; import {
import page from "../framework/page"; getPeriodsConversionListApi,
import { GOODSTYPE, CLASSSOURCE,ORDERSTATUS } from "../../util/wordbook"; getSourceConversionListApi,
import { tipArr3 } from "../../util/tipArr"; getGoodsListApi,
export default { getPeriodsOtherListApi,
getTeacherListApi
} from "../../service/api";
import page from "../framework/page";
import {GOODSTYPE, CLASSSOURCE, ORDERSTATUS} from "../../util/wordbook";
import {tipArr3} from "../../util/tipArr";
export default {
name: "periodsConversionList", name: "periodsConversionList",
data() { data() {
return { return {
...@@ -278,7 +285,7 @@ export default { ...@@ -278,7 +285,7 @@ export default {
contentSpanArr: [], contentSpanArr: [],
searchFrom: { searchFrom: {
payTime: [], payTime: [],
classTime:[], classTime: [],
start_at: "", start_at: "",
end_at: "", end_at: "",
invite_type: "", invite_type: "",
...@@ -290,16 +297,16 @@ export default { ...@@ -290,16 +297,16 @@ export default {
periods_title: "" periods_title: ""
}, },
watchList: [ watchList: [
{ id: 0, title: 5 }, {id: 0, title: 5},
{ id: 1, title: 6 }, {id: 1, title: 6},
{ id: 2, title: 10 }, {id: 2, title: 10},
{ id: 3, title: 20 } {id: 3, title: 20}
], ],
goodList: [] goodList: []
}; };
}, },
filters:{ filters: {
orderFilter(val){ orderFilter(val) {
return ORDERSTATUS[val] return ORDERSTATUS[val]
}, },
filterGoods(val) { filterGoods(val) {
...@@ -317,7 +324,7 @@ export default { ...@@ -317,7 +324,7 @@ export default {
); );
} }
}, },
components: { page }, components: {page},
methods: { methods: {
getGoodsOption() { getGoodsOption() {
let json = { let json = {
...@@ -330,7 +337,7 @@ export default { ...@@ -330,7 +337,7 @@ export default {
console.log(this.goodList, 176); console.log(this.goodList, 176);
}); });
}, },
rendertip(h, { column }) { rendertip(h, {column}) {
// console.log(h) // console.log(h)
return h("span", [ return h("span", [
h("span", column.label), h("span", column.label),
...@@ -352,11 +359,11 @@ export default { ...@@ -352,11 +359,11 @@ export default {
) )
]); ]);
}, },
sortMethod(data){ sortMethod(data) {
this.searchFrom.sort_key = data.prop this.searchFrom.sort_key = data.prop
if(data.order=='ascending'){ if (data.order == 'ascending') {
this.searchFrom.sort_value = 'asc' this.searchFrom.sort_value = 'asc'
}else{ } else {
this.searchFrom.sort_value = 'desc' this.searchFrom.sort_value = 'desc'
} }
this.getChannelTransList() this.getChannelTransList()
...@@ -364,7 +371,7 @@ export default { ...@@ -364,7 +371,7 @@ export default {
getTeacherList() { getTeacherList() {
let json = { let json = {
page: 1, page: 1,
limit: 200 limit: 500
}; };
getTeacherListApi(json).then(res => { getTeacherListApi(json).then(res => {
this.teacherList = res.list; this.teacherList = res.list;
...@@ -389,7 +396,7 @@ export default { ...@@ -389,7 +396,7 @@ export default {
objectSpanMethod(data) { objectSpanMethod(data) {
}, },
handleItemChange(val) { handleItemChange(val) {
getPeriodsApi({ goods_id: val[0], limit: 100 }).then(res => { getPeriodsApi({goods_id: val[0], limit: 100}).then(res => {
res.list.forEach(i => { res.list.forEach(i => {
i.name = i.title; i.name = i.title;
}); });
...@@ -463,9 +470,9 @@ export default { ...@@ -463,9 +470,9 @@ export default {
}); });
}, },
getPeriodsOtherList() { getPeriodsOtherList() {
let json = { limit: 1000,page:1,max_watch_num:20 }; let json = {limit: 1000, page: 1, max_watch_num: 20};
getPeriodsOtherListApi(json).then(res => { getPeriodsOtherListApi(json).then(res => {
res.list.forEach(val=>{ res.list.forEach(val => {
val.label = `【${val.goods_id}${val.title}${val.watch_num}课时(${val.start_at.slice(5).replace('-', '')})-d${val.has_watch_num}` val.label = `【${val.goods_id}${val.title}${val.watch_num}课时(${val.start_at.slice(5).replace('-', '')})-d${val.has_watch_num}`
}) })
this.periodList = res.list; this.periodList = res.list;
...@@ -484,7 +491,7 @@ export default { ...@@ -484,7 +491,7 @@ export default {
if (this.searchFrom.goods_id) { if (this.searchFrom.goods_id) {
json.goods_id = this.searchFrom.goods_id; json.goods_id = this.searchFrom.goods_id;
} }
if(this.searchFrom.sort_value){ if (this.searchFrom.sort_value) {
json.sort_value = this.searchFrom.sort_value; json.sort_value = this.searchFrom.sort_value;
json.sort_key = this.searchFrom.sort_key; json.sort_key = this.searchFrom.sort_key;
} }
...@@ -506,7 +513,7 @@ export default { ...@@ -506,7 +513,7 @@ export default {
if (this.searchFrom.user_id) { if (this.searchFrom.user_id) {
json.user_id = this.searchFrom.user_id; json.user_id = this.searchFrom.user_id;
} }
if (this.searchFrom.payTime&&this.searchFrom.payTime.length > 0) { if (this.searchFrom.payTime && this.searchFrom.payTime.length > 0) {
if ( if (
this.searchFrom.payTime[0] && this.searchFrom.payTime[0] &&
this.searchFrom.payTime[0].length > 0 this.searchFrom.payTime[0].length > 0
...@@ -522,7 +529,7 @@ export default { ...@@ -522,7 +529,7 @@ export default {
json.pay_over_at = this.searchFrom.end_at; json.pay_over_at = this.searchFrom.end_at;
} }
} }
if (this.searchFrom.classTime&&this.searchFrom.classTime.length > 0) { if (this.searchFrom.classTime && this.searchFrom.classTime.length > 0) {
console.log(this.searchFrom.classTime) console.log(this.searchFrom.classTime)
if ( if (
this.searchFrom.classTime[0] && this.searchFrom.classTime[0] &&
...@@ -596,12 +603,12 @@ export default { ...@@ -596,12 +603,12 @@ export default {
this.getTeacherList() this.getTeacherList()
this.getGoodsOption() this.getGoodsOption()
} }
}; };
</script> </script>
<style lang="less" scope> <style lang="less" scope>
.channel-trans-list { .channel-trans-list {
padding: 20px 0; padding: 20px 0;
} }
</style> </style>
...@@ -151,17 +151,18 @@ ...@@ -151,17 +151,18 @@
</div> </div>
</template> </template>
<script> <script>
import { import {
getTeacherPeriodsConversionListApi, getTeacherPeriodsConversionListApi,
getGoodsListApi, getGoodsListApi,
getPeriodsOtherListApi, getPeriodsOtherListApi,
getTeacherListApi, getTeacherListApi,
getUpdateTimeApi getUpdateTimeApi
} from "../../service/api"; } from "../../service/api";
import page from "../framework/page"; import page from "../framework/page";
import { GOODSTYPE, CLASSSOURCE } from "../../util/wordbook"; import {GOODSTYPE, CLASSSOURCE} from "../../util/wordbook";
import { tipArr3 } from "../../util/tipArr"; import {tipArr3} from "../../util/tipArr";
export default {
export default {
name: "teacherPeriodsConversionList", name: "teacherPeriodsConversionList",
data() { data() {
return { return {
...@@ -268,7 +269,7 @@ export default { ...@@ -268,7 +269,7 @@ export default {
spanArr: [], spanArr: [],
contentSpanArr: [], contentSpanArr: [],
searchFrom: { searchFrom: {
classTime:[], classTime: [],
payTime: [], payTime: [],
start_at: "", start_at: "",
end_at: "", end_at: "",
...@@ -282,14 +283,14 @@ export default { ...@@ -282,14 +283,14 @@ export default {
}, },
propertyList: [], propertyList: [],
watchList: [ watchList: [
{ id: 0, title: 5 }, {id: 0, title: 5},
{ id: 1, title: 6 }, {id: 1, title: 6},
{ id: 2, title: 10 }, {id: 2, title: 10},
{ id: 3, title: 20 } {id: 3, title: 20}
] ]
}; };
}, },
components: { page }, components: {page},
methods: { methods: {
periodName(val) { periodName(val) {
let str = ''; let str = '';
...@@ -314,7 +315,7 @@ export default { ...@@ -314,7 +315,7 @@ export default {
} }
return str return str
}, },
rendertip(h, { column }) { rendertip(h, {column}) {
// console.log(h) // console.log(h)
return h("span", [ return h("span", [
h("span", column.label), h("span", column.label),
...@@ -336,11 +337,11 @@ export default { ...@@ -336,11 +337,11 @@ export default {
) )
]); ]);
}, },
sortMethod(data){ sortMethod(data) {
this.searchFrom.sort_key = data.prop this.searchFrom.sort_key = data.prop
if(data.order=='ascending'){ if (data.order == 'ascending') {
this.searchFrom.sort_value = 'asc' this.searchFrom.sort_value = 'asc'
}else{ } else {
this.searchFrom.sort_value = 'desc' this.searchFrom.sort_value = 'desc'
} }
this.getChannelTransList() this.getChannelTransList()
...@@ -348,7 +349,7 @@ export default { ...@@ -348,7 +349,7 @@ export default {
getTeacherList() { getTeacherList() {
let json = { let json = {
page: 1, page: 1,
limit: 200 limit: 500
}; };
getTeacherListApi(json).then(res => { getTeacherListApi(json).then(res => {
this.teacherList = res.list; this.teacherList = res.list;
...@@ -413,7 +414,7 @@ export default { ...@@ -413,7 +414,7 @@ export default {
// } // }
}, },
handleItemChange(val) { handleItemChange(val) {
getPeriodsApi({ goods_id: val[0], limit: 100 }).then(res => { getPeriodsApi({goods_id: val[0], limit: 100}).then(res => {
res.list.forEach(i => { res.list.forEach(i => {
i.name = i.title; i.name = i.title;
}); });
...@@ -487,9 +488,9 @@ export default { ...@@ -487,9 +488,9 @@ export default {
}); });
}, },
getPeriodsOtherList() { getPeriodsOtherList() {
let json = { limit: 1000,page:1,max_watch_num:20 }; let json = {limit: 1000, page: 1, max_watch_num: 20};
getPeriodsOtherListApi(json).then(res => { getPeriodsOtherListApi(json).then(res => {
res.list.forEach(val=>{ res.list.forEach(val => {
val.label = `【${val.goods_id}${val.title}${val.watch_num}课时(${val.start_at.slice(5).replace('-', '')})-d${val.has_watch_num}` val.label = `【${val.goods_id}${val.title}${val.watch_num}课时(${val.start_at.slice(5).replace('-', '')})-d${val.has_watch_num}`
}) })
this.periodList = res.list; this.periodList = res.list;
...@@ -504,7 +505,7 @@ export default { ...@@ -504,7 +505,7 @@ export default {
if (this.searchFrom.invite_type) { if (this.searchFrom.invite_type) {
json.invite_type = this.searchFrom.invite_type; json.invite_type = this.searchFrom.invite_type;
} }
if(this.searchFrom.sort_value){ if (this.searchFrom.sort_value) {
json.sort_value = this.searchFrom.sort_value; json.sort_value = this.searchFrom.sort_value;
json.sort_key = this.searchFrom.sort_key; json.sort_key = this.searchFrom.sort_key;
} }
...@@ -520,7 +521,7 @@ export default { ...@@ -520,7 +521,7 @@ export default {
if (this.searchFrom.teacher_id) { if (this.searchFrom.teacher_id) {
json.teacher_id = this.searchFrom.teacher_id; json.teacher_id = this.searchFrom.teacher_id;
} }
if (this.searchFrom.payTime&&this.searchFrom.payTime.length > 0) { if (this.searchFrom.payTime && this.searchFrom.payTime.length > 0) {
if ( if (
this.searchFrom.payTime[0] && this.searchFrom.payTime[0] &&
this.searchFrom.payTime[0].length > 0 this.searchFrom.payTime[0].length > 0
...@@ -536,7 +537,7 @@ export default { ...@@ -536,7 +537,7 @@ export default {
json.end_at = this.searchFrom.end_at; json.end_at = this.searchFrom.end_at;
} }
} }
if (this.searchFrom.classTime&&this.searchFrom.classTime.length > 0) { if (this.searchFrom.classTime && this.searchFrom.classTime.length > 0) {
console.log(this.searchFrom.classTime) console.log(this.searchFrom.classTime)
if ( if (
this.searchFrom.classTime[0] && this.searchFrom.classTime[0] &&
...@@ -616,12 +617,12 @@ export default { ...@@ -616,12 +617,12 @@ export default {
this.getTeacherList(); this.getTeacherList();
this.getUpdateTime(); this.getUpdateTime();
} }
}; };
</script> </script>
<style lang="less" scope> <style lang="less" scope>
.channel-trans-list { .channel-trans-list {
padding: 20px 0; padding: 20px 0;
} }
</style> </style>
...@@ -121,8 +121,8 @@ ...@@ -121,8 +121,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="nickname" label="领取人"> <el-table-column prop="nickname" label="领取人">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if='scope.row.user_id !== 0' > <div v-if='scope.row.user_id !== 0'>
<img class="avatar" :src="scope.row.avatar" /> <img class="avatar" :src="scope.row.avatar"/>
<div>{{scope.row.nickname}}<br>(ID:{{scope.row.user_id}})</div> <div>{{scope.row.nickname}}<br>(ID:{{scope.row.user_id}})</div>
</div> </div>
<div v-if='scope.row.user_id === 0'> <div v-if='scope.row.user_id === 0'>
...@@ -193,64 +193,72 @@ ...@@ -193,64 +193,72 @@
<script> <script>
import page from '../framework/page' import page from '../framework/page'
import CommonJs from '../../util/common'; import CommonJs from '../../util/common';
import {getAdsInnerListApi,updateAdsInnerApi,updateAdsInnerPlApi,getTeacherListApi,getGoodsListApi,adsTeacherApi} from "../../service/api"; import {
getAdsInnerListApi,
updateAdsInnerApi,
updateAdsInnerPlApi,
getTeacherListApi,
getGoodsListApi,
adsTeacherApi
} from "../../service/api";
import { import {
GOODSTYPE, GOODSTYPE,
externalLaunchStatusParams externalLaunchStatusParams
} from "../../util/wordbook"; } from "../../util/wordbook";
export default { export default {
name: "index", name: "index",
components:{ components: {
page page
}, },
data(){ data() {
return { return {
today:{ today: {
text:'今天', text: '今天',
onClick:(vm)=>{ onClick: (vm) => {
vm.$emit('pick', [this.formatTime(new Date())+' 00:00:00',this.formatTime(new Date())+' 23:59:59']) vm.$emit('pick', [this.formatTime(new Date()) + ' 00:00:00', this.formatTime(new Date()) + ' 23:59:59'])
} }
}, },
yesterday:{ yesterday: {
text:'昨天', text: '昨天',
onClick:(vm)=>{ onClick: (vm) => {
let preDate = this.formatTime(new Date(new Date().getTime() - 24*60*60*1000)); let preDate = this.formatTime(new Date(new Date().getTime() - 24 * 60 * 60 * 1000));
vm.$emit('pick', [preDate+' 00:00:00',preDate+' 23:59:59']) vm.$emit('pick', [preDate + ' 00:00:00', preDate + ' 23:59:59'])
} }
}, },
last30Day:{ last30Day: {
text:'过去30天', text: '过去30天',
onClick:(vm)=>{ onClick: (vm) => {
let preDate = this.formatTime(new Date(new Date().getTime() - 30*24*60*60*1000)); let preDate = this.formatTime(new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000));
vm.$emit('pick', [preDate+' 00:00:00',this.formatTime(new Date())+' 23:59:59']); vm.$emit('pick', [preDate + ' 00:00:00', this.formatTime(new Date()) + ' 23:59:59']);
} }
}, },
last7Day:{ last7Day: {
text:'过去7天', text: '过去7天',
onClick:(vm)=>{ onClick: (vm) => {
let preDate = this.formatTime(new Date(new Date().getTime() - 7*24*60*60*1000)); let preDate = this.formatTime(new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000));
vm.$emit('pick', [preDate+' 00:00:00',this.formatTime(new Date())+' 23:59:59']); vm.$emit('pick', [preDate + ' 00:00:00', this.formatTime(new Date()) + ' 23:59:59']);
} }
}, },
teacherId:null, teacherId: null,
secId:[], secId: [],
total:0, total: 0,
nowPage:1, nowPage: 1,
limit: 10, limit: 10,
searchFrom: { searchFrom: {
source:'', source: '',
course_type:'-1', course_type: '-1',
}, },
tableData:[], tableData: [],
commentForm: {}, commentForm: {},
showCommentDialog: false, showCommentDialog: false,
teacherList:[], teacherList: [],
goodList: [], goodList: [],
} }
}, },
filters: { filters: {
filterStatus: function(value) { filterStatus: function (value) {
let msg = ""; let msg = "";
if (value === 0) { if (value === 0) {
msg = "未绑定"; msg = "未绑定";
...@@ -274,49 +282,49 @@ ...@@ -274,49 +282,49 @@
); );
} }
}, },
created(){ created() {
this.initPage() this.initPage()
this.getGoodsOption(); this.getGoodsOption();
this.getTeacherList() this.getTeacherList()
}, },
methods:{ methods: {
externalLaunchStatus(row){ externalLaunchStatus(row) {
return externalLaunchStatusParams[row.status] return externalLaunchStatusParams[row.status]
}, },
formatTime(date){ formatTime(date) {
console.log(date) console.log(date)
let year = date.getFullYear(); let year = date.getFullYear();
let Month = date.getMonth()+1; let Month = date.getMonth() + 1;
if(Month < 10){ if (Month < 10) {
Month = `0${Month}` Month = `0${Month}`
} }
let Day = date.getDate(); let Day = date.getDate();
if(Day<10)Day = `0${Day}`; if (Day < 10) Day = `0${Day}`;
return `${year}-${Month}-${Day}`; return `${year}-${Month}-${Day}`;
}, },
getGoodsOption() { getGoodsOption() {
let json = { let json = {
page: 1, page: 1,
limit: 100, limit: 100,
goods_type:'1,2' goods_type: '1,2'
}; };
getGoodsListApi(json).then(res => { getGoodsListApi(json).then(res => {
this.goodList = res.list; this.goodList = res.list;
}); });
}, },
pullAll(){ pullAll() {
if(this.secId.length < 1){ if (this.secId.length < 1) {
this.$message('请选择订单'); this.$message('请选择订单');
return false; return false;
} }
if(!this.teacherId){ if (!this.teacherId) {
this.$message('请选择老师'); this.$message('请选择老师');
return false; return false;
} }
let json = { let json = {
order_ids:[] order_ids: []
}; };
this.secId.forEach(i=>{ this.secId.forEach(i => {
json.order_ids.push(i) json.order_ids.push(i)
}); });
this.$confirm(`是否确定将这${json.order_ids.length}笔订单分配给该老师?`, '提示', { this.$confirm(`是否确定将这${json.order_ids.length}笔订单分配给该老师?`, '提示', {
...@@ -324,7 +332,7 @@ ...@@ -324,7 +332,7 @@
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
adsTeacherApi(this.teacherId,{ids:json.order_ids.join(',')}).then(res=>{ adsTeacherApi(this.teacherId, {ids: json.order_ids.join(',')}).then(res => {
// this.secId = []; // this.secId = [];
this.$message({ this.$message({
message: '提交成功', message: '提交成功',
...@@ -338,20 +346,20 @@ ...@@ -338,20 +346,20 @@
getTeacherList() { getTeacherList() {
let json = { let json = {
page: 1, page: 1,
limit: 200 limit: 500
}; };
getTeacherListApi(json).then(res => { getTeacherListApi(json).then(res => {
this.teacherList = res.list; this.teacherList = res.list;
}); });
}, },
handleSelectionChange(val){ handleSelectionChange(val) {
this.secId = [] this.secId = []
val.forEach(element => { val.forEach(element => {
this.secId.push(element.id) this.secId.push(element.id)
}); });
// console.log(this.secId) // console.log(this.secId)
}, },
initPage(){ initPage() {
let json = { let json = {
limit: this.limit, limit: this.limit,
page: this.nowPage page: this.nowPage
...@@ -393,90 +401,90 @@ ...@@ -393,90 +401,90 @@
if (this.searchFrom.goods_id) { if (this.searchFrom.goods_id) {
json.goods_id = this.searchFrom.goods_id; json.goods_id = this.searchFrom.goods_id;
} }
if(this.searchFrom.time && this.searchFrom.time.length ==2 ){ if (this.searchFrom.time && this.searchFrom.time.length == 2) {
json.start_at = this.searchFrom.time[0]; json.start_at = this.searchFrom.time[0];
json.end_at = this.searchFrom.time[1] json.end_at = this.searchFrom.time[1]
} }
if(this.searchFrom.active_time && this.searchFrom.active_time.length ==2 ){ if (this.searchFrom.active_time && this.searchFrom.active_time.length == 2) {
json.active_start_at = this.searchFrom.active_time[0]; json.active_start_at = this.searchFrom.active_time[0];
json.active_end_at =this.searchFrom.active_time[1] json.active_end_at = this.searchFrom.active_time[1]
} }
getAdsInnerListApi(json).then((res)=>{ getAdsInnerListApi(json).then((res) => {
this.tableData = res.list; this.tableData = res.list;
this.total = res.total this.total = res.total
}) })
}, },
onPageChange(val){ onPageChange(val) {
this.nowPage = val this.nowPage = val
this.initPage() this.initPage()
}, },
onSizeChange(val){ onSizeChange(val) {
this.nowPage = 1 this.nowPage = 1
this.limit = val this.limit = val
this.initPage() this.initPage()
}, },
doExport(){ doExport() {
let query = `?type=export`; let query = `?type=export`;
if(this.searchFrom.source){ if (this.searchFrom.source) {
query = query + '&source=' + this.searchFrom.source query = query + '&source=' + this.searchFrom.source
} }
if(this.searchFrom.mobile){ if (this.searchFrom.mobile) {
query = query + '&mobile=' + this.searchFrom.mobile query = query + '&mobile=' + this.searchFrom.mobile
} }
if(this.searchFrom.status){ if (this.searchFrom.status) {
query = query + '&status=' + this.searchFrom.status query = query + '&status=' + this.searchFrom.status
} }
if(this.searchFrom.course_type !== '-1'){ if (this.searchFrom.course_type !== '-1') {
query = query + '&course_type=' + this.searchFrom.course_type query = query + '&course_type=' + this.searchFrom.course_type
} }
if(this.searchFrom.user_buy !== '-1'){ if (this.searchFrom.user_buy !== '-1') {
query = query + '&user_buy=' + this.searchFrom.user_buy query = query + '&user_buy=' + this.searchFrom.user_buy
} }
if(this.searchFrom.nickname){ if (this.searchFrom.nickname) {
query = query + '&nickname=' + this.searchFrom.nickname query = query + '&nickname=' + this.searchFrom.nickname
} }
if(this.searchFrom.user_id){ if (this.searchFrom.user_id) {
query = query + '&user_id=' + this.searchFrom.user_id query = query + '&user_id=' + this.searchFrom.user_id
} }
if(this.searchFrom.teacher_id){ if (this.searchFrom.teacher_id) {
query = query + '&teacher_id=' + this.searchFrom.teacher_id query = query + '&teacher_id=' + this.searchFrom.teacher_id
} }
if(this.searchFrom.goods_name){ if (this.searchFrom.goods_name) {
query = query + '&goods_name=' + this.searchFrom.goods_name query = query + '&goods_name=' + this.searchFrom.goods_name
} }
if(this.searchFrom.order_id){ if (this.searchFrom.order_id) {
query = query + '&order_id=' + this.searchFrom.order_id query = query + '&order_id=' + this.searchFrom.order_id
} }
if(this.searchFrom.goods_id){ if (this.searchFrom.goods_id) {
query = query + '&goods_id=' + this.searchFrom.goods_id query = query + '&goods_id=' + this.searchFrom.goods_id
} }
if(this.searchFrom.time && this.searchFrom.time.length ==2){ if (this.searchFrom.time && this.searchFrom.time.length == 2) {
query = query + '&start_at=' + this.searchFrom.time[0]; query = query + '&start_at=' + this.searchFrom.time[0];
query = query + '&end_at=' + this.searchFrom.time[1] query = query + '&end_at=' + this.searchFrom.time[1]
} }
if(this.searchFrom.active_time && this.searchFrom.active_time.length ==2){ if (this.searchFrom.active_time && this.searchFrom.active_time.length == 2) {
query = query + '&active_start_at=' + this.searchFrom.active_time[0]; query = query + '&active_start_at=' + this.searchFrom.active_time[0];
query = query + '&active_end_at=' + this.searchFrom.active_time[1] query = query + '&active_end_at=' + this.searchFrom.active_time[1]
} }
window.open(`/api/admin/ads/export/all${query}`) window.open(`/api/admin/ads/export/all${query}`)
}, },
saveComment(){ saveComment() {
// let id = this.commentForm.id; // let id = this.commentForm.id;
let id let id
if(this.commentForm.id){ if (this.commentForm.id) {
id = this.commentForm.id id = this.commentForm.id
}else{ } else {
id = this.secId.join(',') id = this.secId.join(',')
} }
let desc = this.commentForm.desc ? this.commentForm.desc : ''; let desc = this.commentForm.desc ? this.commentForm.desc : '';
if(!desc) return; if (!desc) return;
this.$confirm('确认编辑备注', '提示', { this.$confirm('确认编辑备注', '提示', {
confirmButtonText: '继续', confirmButtonText: '继续',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
updateAdsInnerPlApi({ids:id,desc:desc}).then(res=>{ updateAdsInnerPlApi({ids: id, desc: desc}).then(res => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '编辑备注成功' message: '编辑备注成功'
...@@ -486,7 +494,7 @@ ...@@ -486,7 +494,7 @@
}); });
}) })
}, },
editNote(id, desc){ editNote(id, desc) {
this.showCommentDialog = true; this.showCommentDialog = true;
this.commentForm = { this.commentForm = {
id: id, id: id,
...@@ -494,13 +502,13 @@ ...@@ -494,13 +502,13 @@
}; };
}, },
editComment(id, desc) { editComment(id, desc) {
if(this.secId.length>0){ if (this.secId.length > 0) {
this.showCommentDialog = true; this.showCommentDialog = true;
// this.commentForm = { // this.commentForm = {
// id: id, // id: id,
// desc: desc // desc: desc
// }; // };
}else{ } else {
this.$message({ this.$message({
type: 'warning', type: 'warning',
message: '请选择' message: '请选择'
...@@ -516,15 +524,17 @@ ...@@ -516,15 +524,17 @@
.index { .index {
padding: 20px 0; padding: 20px 0;
} }
.sms { .sms {
padding: 20px 0; padding: 20px 0;
} }
.avatar {
.avatar {
width: 50px; width: 50px;
min-width: 50px; min-width: 50px;
margin-right: 10px; margin-right: 10px;
height: 50px; height: 50px;
border-radius: 50%; border-radius: 50%;
} }
</style> </style>
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
&::-webkit-scrollbar { &::-webkit-scrollbar {
background-color: #333333; /* or add it to the track */ background-color: #333333; /* or add it to the track */
&:hover { &:hover {
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
background-color: #999; background-color: #999;
......
...@@ -401,7 +401,7 @@ ...@@ -401,7 +401,7 @@
show: false, show: false,
nowPage: 1, nowPage: 1,
total: 0, total: 0,
limit: 100, limit: 500,
teacher_id: '' teacher_id: ''
}, },
teacherList: [], teacherList: [],
......
...@@ -153,94 +153,101 @@ ...@@ -153,94 +153,101 @@
</template> </template>
<script> <script>
import {getGoodsListApi,setOrderApi,getPeriodsApi,getTeacherListApi,getUserListApi,getOrderTypeApi} from "../../service/api" import {
getGoodsListApi,
setOrderApi,
getPeriodsApi,
getTeacherListApi,
getUserListApi,
getOrderTypeApi
} from "../../service/api"
import vueAddress from '../framework/address-picker/Address' import vueAddress from '../framework/address-picker/Address'
import AddressArray from '../framework/address-picker/addr' import AddressArray from '../framework/address-picker/addr'
import {ORDERSTATUS,BUYWay,GOODSTYPE} from "../../util/wordbook" import {ORDERSTATUS, BUYWay, GOODSTYPE} from "../../util/wordbook"
import CommonJs from '../../util/common'; import CommonJs from '../../util/common';
import page from '../framework/page' import page from '../framework/page'
export default { export default {
name: "newdialogObj", name: "newdialogObj",
props:[ props: [
'newdialogObj' 'newdialogObj'
], ],
data(){ data() {
return{ return {
rules:{ rules: {
periods_id: [ periods_id: [
{ required: true, message: '请输入期数名称', trigger: 'change' } {required: true, message: '请输入期数名称', trigger: 'change'}
], ],
goods_id: [ goods_id: [
{ required: true, message: '请输入商品名称', trigger: 'change' } {required: true, message: '请输入商品名称', trigger: 'change'}
], ],
money: [ money: [
{ required: true, message: '请输入金额', trigger: 'blur' } {required: true, message: '请输入金额', trigger: 'blur'}
], ],
user_id: [ user_id: [
{ required: true, message: '请输入用户ID', trigger: 'blur' } {required: true, message: '请输入用户ID', trigger: 'blur'}
], ],
pay_at: [ pay_at: [
{ required: true, message: '请选择日期', trigger: 'change' } {required: true, message: '请选择日期', trigger: 'change'}
], ],
order_type:[ order_type: [
{ required: true, message: '请选择支付类型', trigger: 'change' } {required: true, message: '请选择支付类型', trigger: 'change'}
], ],
out_trade_no:[ out_trade_no: [
{ required: true, message: '请填写订单号', trigger: 'change' } {required: true, message: '请填写订单号', trigger: 'change'}
], ],
}, },
nowPage: 1, nowPage: 1,
limit: 200, limit: 200,
total:0, total: 0,
form:{ form: {
periods_id:"", periods_id: "",
goods_id:"", goods_id: "",
user_id:"", user_id: "",
money:"", money: "",
buy_type:"", buy_type: "",
invite_id:"", invite_id: "",
desc:"", desc: "",
province_name:"", province_name: "",
city:"", city: "",
area:"", area: "",
city_name:"", city_name: "",
district_name:"", district_name: "",
district:"", district: "",
province:"", province: "",
address:"", address: "",
receive_mobile:"", receive_mobile: "",
receive_name:"", receive_name: "",
order_type:"", order_type: "",
pay_at:"", pay_at: "",
}, },
goodsList:[], goodsList: [],
periodsList:[], periodsList: [],
pickerOptions1:'', pickerOptions1: '',
buyWayOptioms:[], buyWayOptioms: [],
teacherList: [], teacherList: [],
addShow:false, addShow: false,
searchFrom:{ searchFrom: {},
},
userList: [], userList: [],
multipleSelection: [], multipleSelection: [],
} }
}, },
components:{ components: {
vueAddress, vueAddress,
page, page,
}, },
filters:{ filters: {
filterGoods(val){ filterGoods(val) {
return '[' + GOODSTYPE[val.goods_type] + ']' + '[' +val.current_price / 100 + '元]' + val.name return '[' + GOODSTYPE[val.goods_type] + ']' + '[' + val.current_price / 100 + '元]' + val.name
} }
}, },
methods:{ methods: {
onPageChange(val){ onPageChange(val) {
this.nowPage = val this.nowPage = val
this.getUser() this.getUser()
}, },
onSizeChange(val){ onSizeChange(val) {
this.limit = val this.limit = val
this.nowPage = 1; this.nowPage = 1;
this.getUser() this.getUser()
...@@ -248,7 +255,7 @@ import {getGoodsListApi,setOrderApi,getPeriodsApi,getTeacherListApi,getUserListA ...@@ -248,7 +255,7 @@ import {getGoodsListApi,setOrderApi,getPeriodsApi,getTeacherListApi,getUserListA
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
getUser(){ getUser() {
let json = { let json = {
page: this.nowPage, page: this.nowPage,
limit: 5 limit: 5
...@@ -262,55 +269,55 @@ import {getGoodsListApi,setOrderApi,getPeriodsApi,getTeacherListApi,getUserListA ...@@ -262,55 +269,55 @@ import {getGoodsListApi,setOrderApi,getPeriodsApi,getTeacherListApi,getUserListA
if (this.searchFrom.mobile) { if (this.searchFrom.mobile) {
json.mobile = this.searchFrom.mobile json.mobile = this.searchFrom.mobile
} }
getUserListApi(json).then(res=>{ getUserListApi(json).then(res => {
this.userList = res.list; this.userList = res.list;
this.total = res.total; this.total = res.total;
}) })
}, },
saveAddOrder(data){ saveAddOrder(data) {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
let json={ let json = {
periods_id:data.periods_id, periods_id: data.periods_id,
goods_id:data.goods_id, goods_id: data.goods_id,
user_id:data.user_id, user_id: data.user_id,
money:data.money, money: data.money,
province_name:data.province_name, province_name: data.province_name,
city_id:data.city, city_id: data.city,
city:data.city_name, city: data.city_name,
area:data.district_name, area: data.district_name,
area_id:data.district, area_id: data.district,
province_id:data.province, province_id: data.province,
address:data.address, address: data.address,
receive_mobile:data.receive_mobile, receive_mobile: data.receive_mobile,
receive_name:data.receive_name, receive_name: data.receive_name,
order_type:data.order_type, order_type: data.order_type,
} }
// 元转分 // 元转分
json.money=json.money; json.money = json.money;
if(data.pay_at){ if (data.pay_at) {
json.pay_at = CommonJs.dateFmt( data.pay_at,"yyyy-MM-dd hh:mm:ss"); json.pay_at = CommonJs.dateFmt(data.pay_at, "yyyy-MM-dd hh:mm:ss");
} }
if(this.form.invite_id){ if (this.form.invite_id) {
json.invite_id = this.form.invite_id json.invite_id = this.form.invite_id
} }
if(this.form.desc){ if (this.form.desc) {
json.desc = this.form.desc json.desc = this.form.desc
} }
if(this.form.out_trade_no){ if (this.form.out_trade_no) {
json.out_trade_no = this.form.out_trade_no json.out_trade_no = this.form.out_trade_no
} }
json.invite_type="TEACHER"; json.invite_type = "TEACHER";
if(json.province_name && json.address && json.receive_mobile && json.receive_name){ if (json.province_name && json.address && json.receive_mobile && json.receive_name) {
setOrderApi(json).then(res=>{ setOrderApi(json).then(res => {
this.newdialogObj.show=false this.newdialogObj.show = false
this.$emit("reflash"); this.$emit("reflash");
this.$message({ this.$message({
message: '添加成功', message: '添加成功',
type: 'success' type: 'success'
}); });
}) })
}else{ } else {
this.$message({ this.$message({
message: "缺少必填项", message: "缺少必填项",
type: "warning" type: "warning"
...@@ -322,8 +329,8 @@ import {getGoodsListApi,setOrderApi,getPeriodsApi,getTeacherListApi,getUserListA ...@@ -322,8 +329,8 @@ import {getGoodsListApi,setOrderApi,getPeriodsApi,getTeacherListApi,getUserListA
} }
}); });
}, },
handlerAddressChange(val){ handlerAddressChange(val) {
if(!val.province || !val.city || !val.district){ if (!val.province || !val.city || !val.district) {
return return
} }
console.log(val) console.log(val)
...@@ -346,34 +353,34 @@ import {getGoodsListApi,setOrderApi,getPeriodsApi,getTeacherListApi,getUserListA ...@@ -346,34 +353,34 @@ import {getGoodsListApi,setOrderApi,getPeriodsApi,getTeacherListApi,getUserListA
this.form.district_name = districtObj.length > 0 ? districtObj[0].label : cityObj[0].children[0].label; this.form.district_name = districtObj.length > 0 ? districtObj[0].label : cityObj[0].children[0].label;
this.form.district = districtObj.length > 0 ? districtObj[0].value : cityObj[0].children[0].value; this.form.district = districtObj.length > 0 ? districtObj[0].value : cityObj[0].children[0].value;
}, },
getGoodsOption(){ getGoodsOption() {
let json = { let json = {
page: 1, page: 1,
limit: 200, limit: 200,
course_type:0, course_type: 0,
}; };
getGoodsListApi(json).then(res=>{ getGoodsListApi(json).then(res => {
this.goodsList = res.list; this.goodsList = res.list;
}) })
}, },
onOptionChange(id){ onOptionChange(id) {
this.form.periods_id=""; this.form.periods_id = "";
getPeriodsApi({goods_id:id}).then((res) => { getPeriodsApi({goods_id: id}).then((res) => {
this.periodsList=res.list this.periodsList = res.list
}) })
}, },
getTeacherList(name){ getTeacherList(name) {
let json = { let json = {
limit: 100, limit: 500,
page: 1 page: 1
}; };
if(name) { if (name) {
json.name = name json.name = name
} }
getTeacherListApi(json).then(res=>{ getTeacherListApi(json).then(res => {
this.teacherList = res.list this.teacherList = res.list
}); });
getOrderTypeApi().then(res =>{ getOrderTypeApi().then(res => {
this.buyWayOptioms = res this.buyWayOptioms = res
}) })
}, },
...@@ -384,31 +391,31 @@ import {getGoodsListApi,setOrderApi,getPeriodsApi,getTeacherListApi,getUserListA ...@@ -384,31 +391,31 @@ import {getGoodsListApi,setOrderApi,getPeriodsApi,getTeacherListApi,getUserListA
this.getTeacherList(); this.getTeacherList();
} }
}, },
onAddUser(){ onAddUser() {
this.addShow = true; this.addShow = true;
this.getUser(); this.getUser();
}, },
onAdd(){ onAdd() {
if(this.multipleSelection.length === 0) { if (this.multipleSelection.length === 0) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '请选择用户!' message: '请选择用户!'
}); });
return return
} else if (this.multipleSelection.length !== 1){ } else if (this.multipleSelection.length !== 1) {
this.$message({ this.$message({
type: 'error', type: 'error',
message: '只能选择一个用户!' message: '只能选择一个用户!'
}); });
return return
} }
this.form.user_id=this.multipleSelection[0].user_id; this.form.user_id = this.multipleSelection[0].user_id;
this.addShow = false; this.addShow = false;
}, },
}, },
watch:{ watch: {
'newdialogObj.show'(val){ 'newdialogObj.show'(val) {
if(val){ if (val) {
this.getGoodsOption(); this.getGoodsOption();
this.getTeacherList(); this.getTeacherList();
// this.form={ // this.form={
...@@ -435,13 +442,13 @@ import {getGoodsListApi,setOrderApi,getPeriodsApi,getTeacherListApi,getUserListA ...@@ -435,13 +442,13 @@ import {getGoodsListApi,setOrderApi,getPeriodsApi,getTeacherListApi,getUserListA
} }
} }
}, },
mounted(){ mounted() {
}, },
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.dialog-footer{ .dialog-footer {
display: block; display: block;
text-align: center; text-align: center;
} }
......
...@@ -244,37 +244,37 @@ ...@@ -244,37 +244,37 @@
} from "../../util/wordbook"; } from "../../util/wordbook";
import CommonJs from "../../util/common"; import CommonJs from "../../util/common";
export default { export default {
name: "index", name: "index",
data() { data() {
return { return {
nowPage: 1, nowPage: 1,
total: 0, total: 0,
today:{ today: {
text:'今天', text: '今天',
onClick:()=>{ onClick: () => {
this.searchFrom.payTime = [this.formatTime(new Date())+' 00:00:00',this.formatTime(new Date())+' 23:59:59']; this.searchFrom.payTime = [this.formatTime(new Date()) + ' 00:00:00', this.formatTime(new Date()) + ' 23:59:59'];
} }
}, },
yesterday:{ yesterday: {
text:'昨天', text: '昨天',
onClick:()=>{ onClick: () => {
let preDate = this.formatTime(new Date(new Date().getTime() - 24*60*60*1000)); let preDate = this.formatTime(new Date(new Date().getTime() - 24 * 60 * 60 * 1000));
this.searchFrom.payTime = [preDate+' 00:00:00',preDate+' 23:59:59']; this.searchFrom.payTime = [preDate + ' 00:00:00', preDate + ' 23:59:59'];
} }
}, },
last30Day:{ last30Day: {
text:'过去30天', text: '过去30天',
onClick:()=>{ onClick: () => {
let preDate = this.formatTime(new Date(new Date().getTime() - 30*24*60*60*1000)); let preDate = this.formatTime(new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000));
this.searchFrom.payTime = [preDate+' 00:00:00',this.formatTime(new Date())+' 23:59:59']; this.searchFrom.payTime = [preDate + ' 00:00:00', this.formatTime(new Date()) + ' 23:59:59'];
} }
}, },
last7Day:{ last7Day: {
text:'过去7天', text: '过去7天',
onClick:()=>{ onClick: () => {
let preDate = this.formatTime(new Date(new Date().getTime() - 7*24*60*60*1000)); let preDate = this.formatTime(new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000));
this.searchFrom.payTime = [preDate+' 00:00:00',this.formatTime(new Date())+' 23:59:59']; this.searchFrom.payTime = [preDate + ' 00:00:00', this.formatTime(new Date()) + ' 23:59:59'];
} }
}, },
sourceDialog: { sourceDialog: {
...@@ -292,7 +292,7 @@ export default { ...@@ -292,7 +292,7 @@ export default {
limit: 10, limit: 10,
searchFrom: { searchFrom: {
nickname: "", nickname: "",
wait_into_course:'', wait_into_course: '',
user_id: "", user_id: "",
invite_type: "", invite_type: "",
invite_id: "", invite_id: "",
...@@ -302,7 +302,7 @@ export default { ...@@ -302,7 +302,7 @@ export default {
out_trade_no: "", out_trade_no: "",
payTime: [], payTime: [],
order_group_id: "", order_group_id: "",
is_captain:"", is_captain: "",
}, },
tableData: [], tableData: [],
dialogObj: { dialogObj: {
...@@ -323,18 +323,18 @@ export default { ...@@ -323,18 +323,18 @@ export default {
buyTypeOption: BUYTYPEOPTION, buyTypeOption: BUYTYPEOPTION,
inviteSearchPlaceholder: "", inviteSearchPlaceholder: "",
rules: { rules: {
value: [{ required: true, message: "请输入备注", trigger: "change" }] value: [{required: true, message: "请输入备注", trigger: "change"}]
}, },
promoterDialog: { promoterDialog: {
show: false, show: false,
nowPage: 1, nowPage: 1,
total: 0, total: 0,
limit: 100, limit: 500,
teacher_id: "" teacher_id: ""
}, },
teacherList: [], teacherList: [],
loading: false, loading: false,
isLeaderOption:ISLEADEROPTION, isLeaderOption: ISLEADEROPTION,
}; };
}, },
methods: { methods: {
...@@ -361,14 +361,14 @@ export default { ...@@ -361,14 +361,14 @@ export default {
} }
return str return str
}, },
formatTime(date){ formatTime(date) {
let year = date.getFullYear(); let year = date.getFullYear();
let Month = date.getMonth()+1; let Month = date.getMonth() + 1;
if(Month < 10){ if (Month < 10) {
Month = `0${Month}` Month = `0${Month}`
} }
let Day = date.getDate(); let Day = date.getDate();
if(Day<10)Day = `0${Day}`; if (Day < 10) Day = `0${Day}`;
return `${year}-${Month}-${Day}`; return `${year}-${Month}-${Day}`;
}, },
showRef(data) { showRef(data) {
...@@ -385,7 +385,7 @@ export default { ...@@ -385,7 +385,7 @@ export default {
}, },
changeRow(data, b) { changeRow(data, b) {
if (b.indexOf(data) > -1) { if (b.indexOf(data) > -1) {
getRefundListApi({ out_trade_no: data.out_trade_no }).then(res => { getRefundListApi({out_trade_no: data.out_trade_no}).then(res => {
data.refundList = res.list; data.refundList = res.list;
}); });
} }
...@@ -436,14 +436,14 @@ export default { ...@@ -436,14 +436,14 @@ export default {
json.wait_into_course = this.searchFrom.wait_into_course json.wait_into_course = this.searchFrom.wait_into_course
} }
json.course_type = 1; //日课 json.course_type = 1; //日课
exportExcelApi("/api/admin/order/export", json,'日课订单列表'); exportExcelApi("/api/admin/order/export", json, '日课订单列表');
}, },
getGoodsOption() { getGoodsOption() {
let json = { let json = {
page: 1, page: 1,
limit: 100, limit: 100,
course_type:1, course_type: 1,
status:"1,2" status: "1,2"
}; };
getGoodsListApi(json).then(res => { getGoodsListApi(json).then(res => {
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
placeholder="选择日期"> placeholder="选择日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="带班老师" prop="teacherList" v-if = "!form.id"> <el-form-item label="带班老师" prop="teacherList" v-if="!form.id">
<el-select v-model="form.teacherList" placeholder="请选择" @change="onTeacher1Change" filterable multiple> <el-select v-model="form.teacherList" placeholder="请选择" @change="onTeacher1Change" filterable multiple>
<el-option <el-option
v-for="item in teacher1Options" v-for="item in teacher1Options"
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="观摩老师" prop="viewTeacher" v-if = "!form.id"> <el-form-item label="观摩老师" prop="viewTeacher" v-if="!form.id">
<el-select v-model="form.viewTeacher" placeholder="请选择" @change="onTeacher2Change" filterable> <el-select v-model="form.viewTeacher" placeholder="请选择" @change="onTeacher2Change" filterable>
<el-option <el-option
v-for="item in teacher2Options" v-for="item in teacher2Options"
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="将带班老师加入观摩班" v-if = "!form.id" label-width="200"> <el-form-item label="将带班老师加入观摩班" v-if="!form.id" label-width="200">
<el-switch <el-switch
v-model="form.is_add_teacher_to_class" v-model="form.is_add_teacher_to_class"
active-color="#13ce66" active-color="#13ce66"
...@@ -90,23 +90,31 @@ ...@@ -90,23 +90,31 @@
</template> </template>
<script> <script>
import {getGoodsListApi,getAddPeriodsApi,getTeacherListApi,getEditPeriodsApi,getLessonDetailApi,getPeriodsApi} from "../../service/api"; import {
import {ISORNOT,GOODSTYPE,LESSONTYPE,GOODSSTATUS} from "../../util/wordbook"; getGoodsListApi,
getAddPeriodsApi,
getTeacherListApi,
getEditPeriodsApi,
getLessonDetailApi,
getPeriodsApi
} from "../../service/api";
import {ISORNOT, GOODSTYPE, LESSONTYPE, GOODSSTATUS} from "../../util/wordbook";
import goodDialog from './dialog' import goodDialog from './dialog'
export default { export default {
props:[ props: [
'dialogObj' 'dialogObj'
], ],
data(){ data() {
return{ return {
loading: false, loading: false,
form: { form: {
is_add_teacher_to_class: false, is_add_teacher_to_class: false,
teacherList:[], teacherList: [],
viewTeacher:'', viewTeacher: '',
rest_week_day:[], rest_week_day: [],
title:"", title: "",
goods_id:"", goods_id: "",
}, },
show: false, show: false,
viewTeacher: '', viewTeacher: '',
...@@ -150,71 +158,71 @@ ...@@ -150,71 +158,71 @@
teacher2Options: [], teacher2Options: [],
goodList: [], goodList: [],
itemOptions: [], itemOptions: [],
rules:{ rules: {
title:[ title: [
{ required: true, message: '请输入名称', trigger: 'change' } {required: true, message: '请输入名称', trigger: 'change'}
], ],
startNum:[ startNum: [
{ required: true, message: '请输入开始主题', trigger: 'change' } {required: true, message: '请输入开始主题', trigger: 'change'}
], ],
start_at:[ start_at: [
{ required: true, message: '请选择开始上课时间', trigger: 'change' } {required: true, message: '请选择开始上课时间', trigger: 'change'}
], ],
rest_week_day:[ rest_week_day: [
{ required: true, message: '请选择周几不上课', trigger: 'change' } {required: true, message: '请选择周几不上课', trigger: 'change'}
], ],
teacher_ids:[ teacher_ids: [
{ required: true, message: '请选择老师ID', trigger: 'change' } {required: true, message: '请选择老师ID', trigger: 'change'}
], ],
goods_id: [ goods_id: [
{ required: true, message: '商品ID不能为空', trigger: 'change' } {required: true, message: '商品ID不能为空', trigger: 'change'}
], ],
teacherList: [ teacherList: [
{ required: true, message: '带班老师不能为空', trigger: 'change' } {required: true, message: '带班老师不能为空', trigger: 'change'}
], ],
viewTeacher: [ viewTeacher: [
{ required: true, message: '观摩老师不能为空', trigger: 'change' } {required: true, message: '观摩老师不能为空', trigger: 'change'}
] ]
}, },
periodsList:[], periodsList: [],
selectedGoods:[], selectedGoods: [],
} }
}, },
components:{ components: {
goodDialog goodDialog
}, },
watch:{ watch: {
'dialogObj.show'(val){ 'dialogObj.show'(val) {
if(val){ if (val) {
this.getTeachers(); this.getTeachers();
this.getGoodsOption(); this.getGoodsOption();
} }
}, },
show(value){ show(value) {
this.$emit("changeShow",value); this.$emit("changeShow", value);
} }
}, },
filters: { filters: {
isOrNot(value){ isOrNot(value) {
return ISORNOT[value] return ISORNOT[value]
}, },
goodsType(value){ goodsType(value) {
return GOODSTYPE[value] return GOODSTYPE[value]
}, },
lessonType(value){ lessonType(value) {
return LESSONTYPE[value] return LESSONTYPE[value]
}, },
goodsStatus(value){ goodsStatus(value) {
return GOODSSTATUS[value] return GOODSSTATUS[value]
}, },
filterGoods(val){ filterGoods(val) {
return '['+val.id+'][' + GOODSTYPE[val.goods_type] + ']' + '【' +val.current_price / 100 + '元】' + val.name return '[' + val.id + '][' + GOODSTYPE[val.goods_type] + ']' + '【' + val.current_price / 100 + '元】' + val.name
} }
}, },
methods:{ methods: {
sub(){ sub() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if(valid){ if (valid) {
let _id = this.form.goods_id; let _id = this.form.goods_id;
let json = { let json = {
title: this.form.title, title: this.form.title,
...@@ -224,7 +232,7 @@ ...@@ -224,7 +232,7 @@
} }
json.is_add_teacher_to_class = this.form.is_add_teacher_to_class ? 1 : 0; json.is_add_teacher_to_class = this.form.is_add_teacher_to_class ? 1 : 0;
if (this.form.id) { if (this.form.id) {
getEditPeriodsApi(this.form.id,json).then(res=>{ getEditPeriodsApi(this.form.id, json).then(res => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '编辑成功!' message: '编辑成功!'
...@@ -234,7 +242,7 @@ ...@@ -234,7 +242,7 @@
} else { } else {
json.teacher_ids = this.form.teacherList.join(','); json.teacher_ids = this.form.teacherList.join(',');
json.view_teacher_id = parseInt(this.form.viewTeacher); json.view_teacher_id = parseInt(this.form.viewTeacher);
getAddPeriodsApi(_id,json).then(res=>{ getAddPeriodsApi(_id, json).then(res => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '添加成功!' message: '添加成功!'
...@@ -242,26 +250,26 @@ ...@@ -242,26 +250,26 @@
this.$emit("reflash"); this.$emit("reflash");
}) })
} }
this.show=false; this.show = false;
} }
}); });
}, },
getTeachers(){ getTeachers() {
let json1 = { let json1 = {
page: 1, page: 1,
limit: 100, limit: 500,
status:0 status: 0
}; };
getTeacherListApi(json1).then((res)=>{ getTeacherListApi(json1).then((res) => {
this.teacherOptions = res.list; this.teacherOptions = res.list;
this.teacher1Options = res.list; this.teacher1Options = res.list;
this.teacher2Options = res.list; this.teacher2Options = res.list;
}) })
}, },
findDifferentArray(array1, array2){ findDifferentArray(array1, array2) {
let newArray = [] let newArray = []
array1.forEach((val)=>{ array1.forEach((val) => {
let index = array1.findIndex((item)=>{ let index = array1.findIndex((item) => {
return val.id == item return val.id == item
}) })
if (index === -1) { if (index === -1) {
...@@ -270,67 +278,73 @@ ...@@ -270,67 +278,73 @@
}) })
return newArray return newArray
}, },
onTeacher1Change(ids){ onTeacher1Change(ids) {
if(ids){ if (ids) {
this.teacher2Options = this.findDifferentArray(this.teacherOptions, ids) this.teacher2Options = this.findDifferentArray(this.teacherOptions, ids)
} else { } else {
this.teacher2Options = this.teacherOptions this.teacher2Options = this.teacherOptions
} }
}, },
onTeacher2Change(id){ onTeacher2Change(id) {
if(id){ if (id) {
this.teacher1Options = this.findDifferentArray(this.teacherOptions, [id]) this.teacher1Options = this.findDifferentArray(this.teacherOptions, [id])
} else { } else {
this.teacher1Options = this.teacherOptions this.teacher1Options = this.teacherOptions
} }
}, },
onOptionChange(id){ onOptionChange(id) {
let index = this.goodList.findIndex((val)=>{ return val.id === id}); let index = this.goodList.findIndex((val) => {
if(index >-1){ return val.id === id
});
if (index > -1) {
this.getLessonDetail(this.goodList[index].course_id); this.getLessonDetail(this.goodList[index].course_id);
} }
delete this.form.startNum delete this.form.startNum
}, },
getLessonDetail(id){ getLessonDetail(id) {
getLessonDetailApi(id,{}).then((res) => { getLessonDetailApi(id, {}).then((res) => {
this.itemOptions = res.detail[res.type] this.itemOptions = res.detail[res.type]
}) })
}, },
getGoodsOption(){ getGoodsOption() {
let json = { let json = {
page: 1, page: 1,
goods_type:'1,2', goods_type: '1,2',
limit: 100, limit: 100,
}; };
getGoodsListApi(json).then(res=>{ getGoodsListApi(json).then(res => {
this.goodList = res.list; this.goodList = res.list;
if (this.dialogObj.form.id){ if (this.dialogObj.form.id) {
this.form = this.dialogObj.form; this.form = this.dialogObj.form;
} else { } else {
this.form = { this.form = {
rest_week_day:[], rest_week_day: [],
is_add_teacher_to_class: false, is_add_teacher_to_class: false,
teacherList:[], teacherList: [],
viewTeacher:'', viewTeacher: '',
title:"", title: "",
goods_id:"", goods_id: "",
}; };
} }
if(this.dialogObj.form.course_id){ if (this.dialogObj.form.course_id) {
this.getLessonDetail(this.dialogObj.form.course_id); this.getLessonDetail(this.dialogObj.form.course_id);
} }
this.show = this.dialogObj.show this.show = this.dialogObj.show
}) })
}, },
changePeriods(data){ changePeriods(data) {
if(data.length>1){ if (data.length > 1) {
this.form.title=String(data[1]); this.form.title = String(data[1]);
} }
}, },
handleItemChange(val){ handleItemChange(val) {
getPeriodsApi({goods_id:val[0]}).then(res=>{ getPeriodsApi({goods_id: val[0]}).then(res => {
res.list.forEach(i=>{i.name = i.title}); res.list.forEach(i => {
this.periodsList.find(i=>{return i.id === val[0]}).children = res.list i.name = i.title
});
this.periodsList.find(i => {
return i.id === val[0]
}).children = res.list
}) })
}, },
}, },
......
...@@ -59,7 +59,8 @@ ...@@ -59,7 +59,8 @@
</el-card> </el-card>
<!--添加回访信息--> <!--添加回访信息-->
<el-card shadow="never" v-if="callbackObj.teacher_id && !$store.state.readonly" class="callback-item callback-input"> <!--<el-card shadow="never" v-if="callbackObj.teacher_id && !$store.state.readonly" class="callback-item callback-input">-->
<el-card shadow="never" v-if="callbackObj.teacher_id" class="callback-item callback-input">
<el-form size="small" inline> <el-form size="small" inline>
<el-form-item required> <el-form-item required>
<el-select v-model="add.method" placeholder="回访方式" style="width: 140px;"> <el-select v-model="add.method" placeholder="回访方式" style="width: 140px;">
...@@ -186,7 +187,8 @@ ...@@ -186,7 +187,8 @@
props: { props: {
callbackObj: { // user_id、teacher_id、timestamp callbackObj: { // user_id、teacher_id、timestamp
type: Object, type: Object,
default: () => {} default: () => {
}
}, },
hasUserInfo: { // 是否传过来用户信息,传来用户信息就不调接口请求用户新,否则请求(防止同时请求用户信息接口报错) hasUserInfo: { // 是否传过来用户信息,传来用户信息就不调接口请求用户新,否则请求(防止同时请求用户信息接口报错)
type: Boolean, type: Boolean,
...@@ -482,6 +484,7 @@ ...@@ -482,6 +484,7 @@
<style lang="less"> <style lang="less">
.callback-container { .callback-container {
border: none; border: none;
.el-divider--horizontal { .el-divider--horizontal {
margin: 20px 0; margin: 20px 0;
} }
......
...@@ -24,27 +24,28 @@ ...@@ -24,27 +24,28 @@
</template> </template>
<script> <script>
import {getTeacherListApi,addRelatedTeacherApi} from "../../service/api"; import {getTeacherListApi, addRelatedTeacherApi} from "../../service/api";
export default { export default {
props:[ props: [
'dialogObj' 'dialogObj'
], ],
data(){ data() {
return{ return {
form:{ form: {
id: '', id: '',
teacher_id:'', teacher_id: '',
}, },
teacherList:[], teacherList: [],
} }
}, },
methods:{ methods: {
initPage(){ initPage() {
let json ={ let json = {
page:1, page: 1,
limit:200 limit: 500
} }
getTeacherListApi(json).then(res=>{ getTeacherListApi(json).then(res => {
this.teacherList = res.list; this.teacherList = res.list;
}); });
this.form = { this.form = {
...@@ -52,7 +53,7 @@ ...@@ -52,7 +53,7 @@
teacher_id: this.dialogObj.teacher_id ? this.dialogObj.teacher_id : '' teacher_id: this.dialogObj.teacher_id ? this.dialogObj.teacher_id : ''
}; };
}, },
onSave(){ onSave() {
let json = { let json = {
teacher_id: this.form.teacher_id ? this.form.teacher_id : 0 teacher_id: this.form.teacher_id ? this.form.teacher_id : 0
}; };
...@@ -66,9 +67,9 @@ ...@@ -66,9 +67,9 @@
}) })
} }
}, },
watch:{ watch: {
'dialogObj.show'(value){ 'dialogObj.show'(value) {
if(value){ if (value) {
this.initPage() this.initPage()
} }
} }
......
...@@ -25,27 +25,28 @@ ...@@ -25,27 +25,28 @@
</template> </template>
<script> <script>
import {getTeacherListApi,bindTeacherApi} from "../../service/api"; import {getTeacherListApi, bindTeacherApi} from "../../service/api";
export default { export default {
props:[ props: [
'dialogObj' 'dialogObj'
], ],
data(){ data() {
return{ return {
form:{ form: {
id: '', id: '',
teacher_id:'', teacher_id: '',
}, },
teacherList:[], teacherList: [],
} }
}, },
methods:{ methods: {
initPage(){ initPage() {
let json ={ let json = {
page:1, page: 1,
limit:200 limit: 500
} }
getTeacherListApi(json).then(res=>{ getTeacherListApi(json).then(res => {
this.teacherList = res.list; this.teacherList = res.list;
}); });
this.form = { this.form = {
...@@ -53,9 +54,9 @@ ...@@ -53,9 +54,9 @@
teacher_id: this.dialogObj.teacher_id ? this.dialogObj.teacher_id : '' teacher_id: this.dialogObj.teacher_id ? this.dialogObj.teacher_id : ''
}; };
}, },
onSave(){ onSave() {
let teacher_id=this.form.teacher_id ? this.form.teacher_id : 0 let teacher_id = this.form.teacher_id ? this.form.teacher_id : 0
bindTeacherApi(this.form.id,teacher_id).then(res => { bindTeacherApi(this.form.id, teacher_id).then(res => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '绑定成功!' message: '绑定成功!'
...@@ -64,8 +65,8 @@ ...@@ -64,8 +65,8 @@
}) })
} }
}, },
watch:{ watch: {
'dialogObj'(value){ 'dialogObj'(value) {
this.initPage() this.initPage()
} }
} }
......
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
@change="getList"> @change="getList">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item > <el-form-item>
<el-button type="primary" @click="getList">搜索</el-button> <el-button type="primary" @click="getList">搜索</el-button>
<el-button type="primary" plain @click="exportTable(list)" v-if="$store.state.export">导出</el-button> <el-button type="primary" plain @click="exportTable(list)" v-if="$store.state.export">导出</el-button>
<el-button type="primary" plain @click="importDialog=true" v-if="$store.state.import">导入</el-button> <el-button type="primary" plain @click="importDialog=true" v-if="$store.state.import">导入</el-button>
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
<el-table-column prop="nickname" label="购买人"> <el-table-column prop="nickname" label="购买人">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if='scope.row.user_id !== 0'> <div v-if='scope.row.user_id !== 0'>
<img class="avatar" :src="scope.row.avatar" /> <img class="avatar" :src="scope.row.avatar"/>
<div>{{scope.row.nickname}}<br>(ID:{{scope.row.user_id}})</div> <div>{{scope.row.nickname}}<br>(ID:{{scope.row.user_id}})</div>
</div> </div>
<div v-if='scope.row.user_id === 0'>用户未绑定</div> <div v-if='scope.row.user_id === 0'>用户未绑定</div>
...@@ -211,14 +211,14 @@ ...@@ -211,14 +211,14 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<page :nowPage="nowPage" :total="total" @pageChange="onPageChange" @sizeChange="onSizeChange" /> <page :nowPage="nowPage" :total="total" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
<refund-dialog :dialogObj="refundDialogObj" @reflash="onAfterRefund" @changeShow="changeShow"></refund-dialog> <refund-dialog :dialogObj="refundDialogObj" @reflash="onAfterRefund" @changeShow="changeShow"></refund-dialog>
<refund-detail :dialogObj="refundDetail"/> <refund-detail :dialogObj="refundDetail"/>
<el-dialog :title="classObj.title" :visible.sync="classObj.show" center width="800px"> <el-dialog :title="classObj.title" :visible.sync="classObj.show" center width="800px">
<div style="margin:10px;color: #888888"> <div style="margin:10px;color: #888888">
最新同步时间:{{last_pull_time}} 最新同步时间:{{last_pull_time}}
</div> </div>
<el-table :data="classList" > <el-table :data="classList">
<el-table-column prop="teacher_name" label="班级老师"> <el-table-column prop="teacher_name" label="班级老师">
</el-table-column> </el-table-column>
<el-table-column prop="num" label="预计入班人数"> <el-table-column prop="num" label="预计入班人数">
...@@ -253,8 +253,8 @@ ...@@ -253,8 +253,8 @@
</el-dialog> </el-dialog>
<el-dialog title="手动创建外部订单" :visible.sync="postOtherOrderDialog" center width="800px"> <el-dialog title="手动创建外部订单" :visible.sync="postOtherOrderDialog" center width="800px">
<el-form ref="searchFrom" size="small" :model="postOtherOrderData" label-width="125px"> <el-form ref="searchFrom" size="small" :model="postOtherOrderData" label-width="125px">
<el-form-item label="订单ID" required="" style="width: 400px" > <el-form-item label="订单ID" required="" style="width: 400px">
<el-input v-model="postOtherOrderData.order_id" ></el-input> <el-input v-model="postOtherOrderData.order_id"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="商品名称" required=""> <el-form-item label="商品名称" required="">
<el-select v-model="postOtherOrderData.goods_id" placeholder="请选择" filterable style="width: 150px" clearable> <el-select v-model="postOtherOrderData.goods_id" placeholder="请选择" filterable style="width: 150px" clearable>
...@@ -265,23 +265,23 @@ ...@@ -265,23 +265,23 @@
<!-- <el-form-item style="width: 400px" label="商品ID"> <!-- <el-form-item style="width: 400px" label="商品ID">
<el-input v-model="postOtherOrderData.goods_id" ></el-input> <el-input v-model="postOtherOrderData.goods_id" ></el-input>
</el-form-item> --> </el-form-item> -->
<el-form-item label="收件人姓名" required="" label-width="125px" style="width: 400px" > <el-form-item label="收件人姓名" required="" label-width="125px" style="width: 400px">
<el-input v-model="postOtherOrderData.receiver_name" ></el-input> <el-input v-model="postOtherOrderData.receiver_name"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="收件人手机号" required="" label-width="125px" style="width: 400px" > <el-form-item label="收件人手机号" required="" label-width="125px" style="width: 400px">
<el-input v-model="postOtherOrderData.receiver_mobile" ></el-input> <el-input v-model="postOtherOrderData.receiver_mobile"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="省名称" required="" label-width="125px" style="width: 400px" > <el-form-item label="省名称" required="" label-width="125px" style="width: 400px">
<el-input v-model="postOtherOrderData.receiver_province" ></el-input> <el-input v-model="postOtherOrderData.receiver_province"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="市名称" required="" label-width="125px" style="width: 400px" > <el-form-item label="市名称" required="" label-width="125px" style="width: 400px">
<el-input v-model="postOtherOrderData.receiver_city" ></el-input> <el-input v-model="postOtherOrderData.receiver_city"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="区名称" required="" label-width="125px" style="width: 400px" > <el-form-item label="区名称" required="" label-width="125px" style="width: 400px">
<el-input v-model="postOtherOrderData.receiver_area" ></el-input> <el-input v-model="postOtherOrderData.receiver_area"></el-input>
</el-form-item> </el-form-item>
<el-form-item label-width="125px" required="" style="width: 400px" left label="详细地址"> <el-form-item label-width="125px" required="" style="width: 400px" left label="详细地址">
<el-input type="textarea" v-model="postOtherOrderData.receiver_address" ></el-input> <el-input type="textarea" v-model="postOtherOrderData.receiver_address"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="活动方案" required=""> <el-form-item label="活动方案" required="">
<el-select v-model="postOtherOrderData.class_source" placeholder="请选择" filterable> <el-select v-model="postOtherOrderData.class_source" placeholder="请选择" filterable>
...@@ -289,12 +289,12 @@ ...@@ -289,12 +289,12 @@
v-for="(data,index) in classSource" v-for="(data,index) in classSource"
:key="index" :key="index"
:label="data.label" :label="data.label"
:value="data.value" > :value="data.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item > </el-form-item>
<el-form-item label-width="125px" required="" style="width: 400px" left label="备注"> <el-form-item label-width="125px" required="" style="width: 400px" left label="备注">
<el-input type="textarea" v-model="postOtherOrderData.desc" ></el-input> <el-input type="textarea" v-model="postOtherOrderData.desc"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -304,23 +304,23 @@ ...@@ -304,23 +304,23 @@
</el-dialog> </el-dialog>
<el-dialog title="编辑地址" :visible.sync="adressDialog" left width="500px"> <el-dialog title="编辑地址" :visible.sync="adressDialog" left width="500px">
<el-form ref="searchFrom" size="small" :model="adressData" label-width="125px"> <el-form ref="searchFrom" size="small" :model="adressData" label-width="125px">
<el-form-item label="用户姓名" style="width: 400px" > <el-form-item label="用户姓名" style="width: 400px">
<el-input v-model="adressData.receiver_name" ></el-input> <el-input v-model="adressData.receiver_name"></el-input>
</el-form-item> </el-form-item>
<el-form-item label-width="125px" style="width: 400px" label="收货人手机号"> <el-form-item label-width="125px" style="width: 400px" label="收货人手机号">
<el-input v-model="adressData.receiver_mobile" ></el-input> <el-input v-model="adressData.receiver_mobile"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="收货人省" label-width="125px" style="width: 400px" > <el-form-item label="收货人省" label-width="125px" style="width: 400px">
<el-input v-model="adressData.receiver_province" ></el-input> <el-input v-model="adressData.receiver_province"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="收货人市" label-width="125px" style="width: 400px" > <el-form-item label="收货人市" label-width="125px" style="width: 400px">
<el-input v-model="adressData.receiver_city" ></el-input> <el-input v-model="adressData.receiver_city"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="收货人区" label-width="125px" style="width: 400px" > <el-form-item label="收货人区" label-width="125px" style="width: 400px">
<el-input v-model="adressData.receiver_area" ></el-input> <el-input v-model="adressData.receiver_area"></el-input>
</el-form-item> </el-form-item>
<el-form-item label-width="125px" style="width: 400px" left label="收货人详细地址"> <el-form-item label-width="125px" style="width: 400px" left label="收货人详细地址">
<el-input type="textarea" v-model="adressData.receiver_address" ></el-input> <el-input type="textarea" v-model="adressData.receiver_address"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer" style="text-align:center;"> <span slot="footer" class="dialog-footer" style="text-align:center;">
...@@ -332,13 +332,13 @@ ...@@ -332,13 +332,13 @@
</template> </template>
<script> <script>
import page from "../framework/page"; import page from "../framework/page";
import md5 from 'js-md5'; import md5 from 'js-md5';
import refundDialog from "../order/refundDialog"; import refundDialog from "../order/refundDialog";
import refundDetail from "../order/refundDetail"; import refundDetail from "../order/refundDetail";
import CommonJs from '../../util/common'; import CommonJs from '../../util/common';
import Cookie from '../../util/cookie' import Cookie from '../../util/cookie'
import { import {
getyunjiApi, getyunjiApi,
yunjiOrderTeacherApi, yunjiOrderTeacherApi,
getGoodsListApi, getGoodsListApi,
...@@ -349,17 +349,18 @@ import { ...@@ -349,17 +349,18 @@ import {
postOtherOrderApi, postOtherOrderApi,
postClearOtherOrderApi, postClearOtherOrderApi,
getSourceStudentApi getSourceStudentApi
} from "../../service/api"; } from "../../service/api";
import { import {
ORDERSTATUS, ORDERSTATUS,
GOODSTYPE, GOODSTYPE,
ORDERSTATUSOPTION, ORDERSTATUSOPTION,
USERSTATUS, USERSTATUS,
USERSTATUSFORMATER, USERSTATUSFORMATER,
CLASSSOURCE CLASSSOURCE
} from "../../util/wordbook"; } from "../../util/wordbook";
let studentSource = {}
export default { let studentSource = {}
export default {
name: "smsRecord", name: "smsRecord",
components: { components: {
page, page,
...@@ -371,54 +372,54 @@ export default { ...@@ -371,54 +372,54 @@ export default {
sing: "singsingenglish21000" sing: "singsingenglish21000"
}; };
return { return {
importDialog:false, importDialog: false,
activityPlan: [], activityPlan: [],
adressDialog:false, adressDialog: false,
postOtherOrderDialog:false, postOtherOrderDialog: false,
postOtherOrderData:{}, postOtherOrderData: {},
classSource:[{ classSource: [{
label:"系统订单随机", label: "系统订单随机",
value:2 value: 2
}, },
{ {
label:"渠道1订单随机", label: "渠道1订单随机",
value:3 value: 3
}, },
{ {
label:"渠道2订单随机", label: "渠道2订单随机",
value:4 value: 4
}], }],
adressData:{}, adressData: {},
USERSTATUS:USERSTATUS, USERSTATUS: USERSTATUS,
today:{ today: {
text:'今天', text: '今天',
onClick:(vm)=>{ onClick: (vm) => {
vm.$emit('pick', [this.formatTime(new Date())+' 00:00:00',this.formatTime(new Date())+' 23:59:59']) vm.$emit('pick', [this.formatTime(new Date()) + ' 00:00:00', this.formatTime(new Date()) + ' 23:59:59'])
} }
}, },
yesterday:{ yesterday: {
text:'昨天', text: '昨天',
onClick:(vm)=>{ onClick: (vm) => {
let preDate = this.formatTime(new Date(new Date().getTime() - 24*60*60*1000)); let preDate = this.formatTime(new Date(new Date().getTime() - 24 * 60 * 60 * 1000));
vm.$emit('pick', [preDate+' 00:00:00',preDate+' 23:59:59']) vm.$emit('pick', [preDate + ' 00:00:00', preDate + ' 23:59:59'])
} }
}, },
last30Day:{ last30Day: {
text:'过去30天', text: '过去30天',
onClick:(vm)=>{ onClick: (vm) => {
let preDate = this.formatTime(new Date(new Date().getTime() - 30*24*60*60*1000)); let preDate = this.formatTime(new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000));
vm.$emit('pick', [preDate+' 00:00:00',this.formatTime(new Date())+' 23:59:59']); vm.$emit('pick', [preDate + ' 00:00:00', this.formatTime(new Date()) + ' 23:59:59']);
} }
}, },
last7Day:{ last7Day: {
text:'过去7天', text: '过去7天',
onClick:(vm)=>{ onClick: (vm) => {
let preDate = this.formatTime(new Date(new Date().getTime() - 7*24*60*60*1000)); let preDate = this.formatTime(new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000));
vm.$emit('pick', [preDate+' 00:00:00',this.formatTime(new Date())+' 23:59:59']); vm.$emit('pick', [preDate + ' 00:00:00', this.formatTime(new Date()) + ' 23:59:59']);
} }
}, },
uploadHeader:{token:Cookie.get('cc_token')}, uploadHeader: {token: Cookie.get('cc_token')},
param_token:CommonJs.md5Code(), param_token: CommonJs.md5Code(),
nowPage: 1, nowPage: 1,
total: 0, total: 0,
limit: 10, limit: 10,
...@@ -433,23 +434,23 @@ export default { ...@@ -433,23 +434,23 @@ export default {
class_source: '', class_source: '',
goods_id: "", goods_id: "",
mobile: "", mobile: "",
active_at:[], active_at: [],
invite_type:'', invite_type: '',
status: [1], status: [1],
createTime:[], createTime: [],
course_type:'-1', course_type: '-1',
pullTime:[], pullTime: [],
order_id: "", order_id: "",
teacher_id: "", teacher_id: "",
user_id:"", user_id: "",
nickname:"", nickname: "",
user_status:[], user_status: [],
sub_order_id:"" sub_order_id: ""
}, },
refundDialogObj: { refundDialogObj: {
show: false, show: false,
id: "", id: "",
order_type:' other', order_type: ' other',
money: 0 money: 0
}, },
orderStatusOption: ORDERSTATUSOPTION, orderStatusOption: ORDERSTATUSOPTION,
...@@ -460,21 +461,21 @@ export default { ...@@ -460,21 +461,21 @@ export default {
show: false, show: false,
out_trade_no: "" out_trade_no: ""
}, },
teacherId:null, teacherId: null,
classObj:{ classObj: {
show: false, show: false,
title: "当前同步进度", title: "当前同步进度",
order_id: 0, order_id: 0,
teacher_id: 0 teacher_id: 0
}, },
multipleSelection:[], multipleSelection: [],
classList:[], classList: [],
last_pull_time:"无", last_pull_time: "无",
studentSource:{} studentSource: {}
}; };
}, },
filters: { filters: {
filterStatus: function(value) { filterStatus: function (value) {
let msg = ""; let msg = "";
if (value === 0) { if (value === 0) {
msg = "未绑定"; msg = "未绑定";
...@@ -500,7 +501,7 @@ export default { ...@@ -500,7 +501,7 @@ export default {
val.name val.name
); );
}, },
classType(val){ classType(val) {
// return CLASSSOURCE[val] // return CLASSSOURCE[val]
return studentSource[val] return studentSource[val]
} }
...@@ -509,11 +510,11 @@ export default { ...@@ -509,11 +510,11 @@ export default {
this.getGoodsOption(); this.getGoodsOption();
this.getTeacherList(); this.getTeacherList();
getSourceStudentApi().then(res=>{ getSourceStudentApi().then(res => {
this.activityPlan = res; this.activityPlan = res;
let obj = {} let obj = {}
res.forEach((item,index)=>{ res.forEach((item, index) => {
obj[item.type]=item.name obj[item.type] = item.name
}) })
studentSource = obj studentSource = obj
// console.log(obj) // console.log(obj)
...@@ -544,13 +545,13 @@ export default { ...@@ -544,13 +545,13 @@ export default {
} }
return str return str
}, },
initClearOtherOrder(id){ initClearOtherOrder(id) {
this.$confirm('确认清除?', '提示', { this.$confirm('确认清除?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
postClearOtherOrderApi(id).then(res=>{ postClearOtherOrderApi(id).then(res => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '清除成功!' message: '清除成功!'
...@@ -558,101 +559,101 @@ export default { ...@@ -558,101 +559,101 @@ export default {
}) })
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type:'info', type: 'info',
message: '已取消' message: '已取消'
}); });
}); });
}, },
postOtherOrderFn(){ postOtherOrderFn() {
let json={} let json = {}
if(this.postOtherOrderData.order_id){ if (this.postOtherOrderData.order_id) {
json.order_id = this.postOtherOrderData.order_id json.order_id = this.postOtherOrderData.order_id
} }
if(this.postOtherOrderData.goods_id){ if (this.postOtherOrderData.goods_id) {
json.goods_id = this.postOtherOrderData.goods_id json.goods_id = this.postOtherOrderData.goods_id
} }
if(this.postOtherOrderData.receiver_name){ if (this.postOtherOrderData.receiver_name) {
json.receiver_name = this.postOtherOrderData.receiver_name json.receiver_name = this.postOtherOrderData.receiver_name
} }
if(this.postOtherOrderData.receiver_mobile){ if (this.postOtherOrderData.receiver_mobile) {
json.receiver_mobile = this.postOtherOrderData.receiver_mobile json.receiver_mobile = this.postOtherOrderData.receiver_mobile
} }
if(this.postOtherOrderData.receiver_province){ if (this.postOtherOrderData.receiver_province) {
json.receiver_province = this.postOtherOrderData.receiver_province json.receiver_province = this.postOtherOrderData.receiver_province
} }
if(this.postOtherOrderData.receiver_city){ if (this.postOtherOrderData.receiver_city) {
json.receiver_city = this.postOtherOrderData.receiver_city json.receiver_city = this.postOtherOrderData.receiver_city
} }
if(this.postOtherOrderData.receiver_area){ if (this.postOtherOrderData.receiver_area) {
json.receiver_area = this.postOtherOrderData.receiver_area json.receiver_area = this.postOtherOrderData.receiver_area
} }
if(this.postOtherOrderData.receiver_address){ if (this.postOtherOrderData.receiver_address) {
json.receiver_address = this.postOtherOrderData.receiver_address json.receiver_address = this.postOtherOrderData.receiver_address
} }
if(this.postOtherOrderData.class_source){ if (this.postOtherOrderData.class_source) {
json.class_source = this.postOtherOrderData.class_source json.class_source = this.postOtherOrderData.class_source
} }
if(this.postOtherOrderData.desc){ if (this.postOtherOrderData.desc) {
json.desc = this.postOtherOrderData.desc json.desc = this.postOtherOrderData.desc
} }
console.log(this.postOtherOrderData) console.log(this.postOtherOrderData)
postOtherOrderApi(json).then(res =>{ postOtherOrderApi(json).then(res => {
this.$message('发送成功'); this.$message('发送成功');
this.postOtherOrderDialog = false this.postOtherOrderDialog = false
this.getList(); this.getList();
}) })
}, },
initOeder(){ initOeder() {
this.postOtherOrderDialog = true this.postOtherOrderDialog = true
this.postOtherOrderData = { this.postOtherOrderData = {
order_id:'', order_id: '',
goods_id:'', goods_id: '',
receiver_name:"", receiver_name: "",
receiver_mobile:'', receiver_mobile: '',
receiver_province:'', receiver_province: '',
receiver_city:'', receiver_city: '',
receiver_area:'', receiver_area: '',
receiver_address:'', receiver_address: '',
class_source:'', class_source: '',
desc:'' desc: ''
} }
}, },
editAdress(row){ editAdress(row) {
// editOrderAdressApi // editOrderAdressApi
this.adressDialog = true this.adressDialog = true
this.adressData ={ this.adressData = {
receiver_name:row.receiver_name, receiver_name: row.receiver_name,
receiver_mobile:row.receiver_mobile, receiver_mobile: row.receiver_mobile,
receiver_province:row.receiver_province, receiver_province: row.receiver_province,
receiver_city:row.receiver_city, receiver_city: row.receiver_city,
receiver_area:row.receiver_area, receiver_area: row.receiver_area,
receiver_address:row.receiver_address, receiver_address: row.receiver_address,
id:row.id, id: row.id,
} }
}, },
editAdressCf(){ editAdressCf() {
editOrderAdressApi(this.adressData.id,this.adressData).then(res => { editOrderAdressApi(this.adressData.id, this.adressData).then(res => {
this.getList(); this.getList();
this.$message('修改成功'); this.$message('修改成功');
this.adressDialog = false; this.adressDialog = false;
}); });
}, },
userStatusFormatter(val){ userStatusFormatter(val) {
return(USERSTATUSFORMATER[val.user_status]) return (USERSTATUSFORMATER[val.user_status])
}, },
pullAll(){ pullAll() {
if(this.multipleSelection.length < 1){ if (this.multipleSelection.length < 1) {
this.$message('请选择订单'); this.$message('请选择订单');
return false; return false;
} }
if(!this.teacherId){ if (!this.teacherId) {
this.$message('请选择老师'); this.$message('请选择老师');
return false; return false;
} }
let json = { let json = {
order_ids:[] order_ids: []
}; };
this.multipleSelection.forEach(i=>{ this.multipleSelection.forEach(i => {
json.order_ids.push(i.id) json.order_ids.push(i.id)
}); });
this.$confirm(`是否确定将这${json.order_ids.length}笔订单分配给该老师?`, '提示', { this.$confirm(`是否确定将这${json.order_ids.length}笔订单分配给该老师?`, '提示', {
...@@ -660,7 +661,7 @@ export default { ...@@ -660,7 +661,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
yunjiOrderTeacherApi(this.teacherId,{order_ids:json.order_ids.join(',')}).then(res=>{ yunjiOrderTeacherApi(this.teacherId, {order_ids: json.order_ids.join(',')}).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
this.$message({ this.$message({
message: '提交成功', message: '提交成功',
...@@ -672,7 +673,7 @@ export default { ...@@ -672,7 +673,7 @@ export default {
}); });
}, },
selectedFlag(row){ selectedFlag(row) {
return row.user_id === 0 return row.user_id === 0
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
...@@ -695,34 +696,34 @@ export default { ...@@ -695,34 +696,34 @@ export default {
this.refundDialogObj.show = true; this.refundDialogObj.show = true;
}, },
formatTime(date){ formatTime(date) {
let year = date.getFullYear(); let year = date.getFullYear();
let Month = date.getMonth()+1; let Month = date.getMonth() + 1;
if(Month < 10){ if (Month < 10) {
Month = `0${Month}` Month = `0${Month}`
} }
let Day = date.getDate(); let Day = date.getDate();
if(Day<10)Day = `0${Day}`; if (Day < 10) Day = `0${Day}`;
return `${year}-${Month}-${Day}`; return `${year}-${Month}-${Day}`;
}, },
fileSuccess(res){ fileSuccess(res) {
console.log(res) console.log(res)
if(res.code==200){ if (res.code == 200) {
this.$message({ this.$message({
message: res.data, message: res.data,
type: 'success' type: 'success'
}); });
}else{ } else {
this.$message({ this.$message({
message: res.msg.replace(/\n/g,'</br>'), message: res.msg.replace(/\n/g, '</br>'),
type:'error', type: 'error',
duration:0, duration: 0,
showClose:true, showClose: true,
dangerouslyUseHTMLString: true dangerouslyUseHTMLString: true
}); });
} }
}, },
downLoad(){ downLoad() {
window.open('/static/外部订单模板.xlsx') window.open('/static/外部订单模板.xlsx')
}, },
onPageChange(val) { onPageChange(val) {
...@@ -732,7 +733,7 @@ export default { ...@@ -732,7 +733,7 @@ export default {
getTeacherList() { getTeacherList() {
let json = { let json = {
page: 1, page: 1,
limit: 200 limit: 500
}; };
getTeacherListApi(json).then(res => { getTeacherListApi(json).then(res => {
this.teacherList = res.list; this.teacherList = res.list;
...@@ -787,11 +788,11 @@ export default { ...@@ -787,11 +788,11 @@ export default {
if (this.searchFrom.invite_type) { if (this.searchFrom.invite_type) {
json.invite_type = this.searchFrom.invite_type; json.invite_type = this.searchFrom.invite_type;
} }
if (this.searchFrom.createTime && this.searchFrom.createTime.length === 2){ if (this.searchFrom.createTime && this.searchFrom.createTime.length === 2) {
json.start_at = this.searchFrom.createTime[0]; json.start_at = this.searchFrom.createTime[0];
json.end_at = this.searchFrom.createTime[1] json.end_at = this.searchFrom.createTime[1]
} }
if (this.searchFrom.active_at&&this.searchFrom.active_at.length === 2){ if (this.searchFrom.active_at && this.searchFrom.active_at.length === 2) {
json.active_start_at = this.searchFrom.active_at[0]; json.active_start_at = this.searchFrom.active_at[0];
json.active_end_at = this.searchFrom.active_at[1] json.active_end_at = this.searchFrom.active_at[1]
} }
...@@ -820,13 +821,13 @@ export default { ...@@ -820,13 +821,13 @@ export default {
cancelButtonText: "取消", cancelButtonText: "取消",
inputType: "textarea", inputType: "textarea",
inputValue: desc || "" inputValue: desc || ""
}).then(({ value }) => { }).then(({value}) => {
this.$confirm("确定保存?", "提示", { this.$confirm("确定保存?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(() => { }).then(() => {
orderDescApi({ desc: value }, id).then(res => { orderDescApi({desc: value}, id).then(res => {
this.$message({ this.$message({
type: "success", type: "success",
message: "编辑备注成功" message: "编辑备注成功"
...@@ -872,63 +873,73 @@ export default { ...@@ -872,63 +873,73 @@ export default {
if (this.searchFrom.invite_type) { if (this.searchFrom.invite_type) {
json.invite_type = this.searchFrom.invite_type; json.invite_type = this.searchFrom.invite_type;
} }
if (this.searchFrom.createTime && this.searchFrom.createTime.length === 2){ if (this.searchFrom.createTime && this.searchFrom.createTime.length === 2) {
json.start_at = this.searchFrom.createTime[0]; json.start_at = this.searchFrom.createTime[0];
json.end_at = this.searchFrom.createTime[1] json.end_at = this.searchFrom.createTime[1]
} }
if (this.searchFrom.active_at&&this.searchFrom.active_at.length === 2){ if (this.searchFrom.active_at && this.searchFrom.active_at.length === 2) {
json.active_start_at = this.searchFrom.active_at[0]; json.active_start_at = this.searchFrom.active_at[0];
json.active_end_at = this.searchFrom.active_at[1] json.active_end_at = this.searchFrom.active_at[1]
} }
if (this.searchFrom.pullTime&&this.searchFrom.pullTime.length === 2){ if (this.searchFrom.pullTime && this.searchFrom.pullTime.length === 2) {
json.pay_start_at = this.searchFrom.pullTime[0]; json.pay_start_at = this.searchFrom.pullTime[0];
json.pay_end_at = this.searchFrom.pullTime[1]; json.pay_end_at = this.searchFrom.pullTime[1];
} }
console.log(json) console.log(json)
exportExcelApi(`api/admin/yunji/order/export`, json,'外部订单列表'); exportExcelApi(`api/admin/yunji/order/export`, json, '外部订单列表');
} }
}, },
classListOption() { classListOption() {
this.classObj.show=true; this.classObj.show = true;
getyunjiApi({ page: 1,limit: 200}).then(res => { getyunjiApi({page: 1, limit: 200}).then(res => {
this.classList=res.teacher; this.classList = res.teacher;
if(res.last_pull_time){ if (res.last_pull_time) {
this.last_pull_time=res.last_pull_time; this.last_pull_time = res.last_pull_time;
} }
}); });
} }
} }
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.sms { .sms {
padding: 20px 0; padding: 20px 0;
} }
.el-table { .el-table {
.el-button + .el-button { .el-button + .el-button {
margin-left: 0; margin-left: 0;
margin-top: 10px; margin-top: 10px;
} }
} }
.avatar { .avatar {
width: 50px; width: 50px;
min-width: 50px; min-width: 50px;
margin-right: 10px; margin-right: 10px;
height: 50px; height: 50px;
border-radius: 50%; border-radius: 50%;
} }
.el-form-item__content{height:32px;}
.import{top: 20vh;} .el-form-item__content {
.import .item{display:inline-block;margin-left: 110px} height: 32px;
}
.import {
top: 20vh;
}
.import .item {
display: inline-block;
margin-left: 110px
}
</style> </style>
<style> <style>
.userInfo > div { .userInfo > div {
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
} }
</style> </style>
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