Commit 4d32b7ea authored by chenfenglei's avatar chenfenglei

云集优化

parent 385617c9
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<el-button type="primary" @click="searchList">搜索</el-button> <el-button type="primary" @click="searchList">搜索</el-button>
<el-button type="success" @click="changeClass" v-if="!$store.state.readonly">切换班级</el-button> <el-button type="success" @click="changeClass" v-if="!$store.state.readonly">切换班级</el-button>
<el-button type="success" @click="onAddUser(false)" v-if="!$store.state.readonly">+添加用户</el-button> <el-button type="success" @click="onAddUser(false)" v-if="!$store.state.readonly">+添加用户</el-button>
<el-button type="primary" @click="exportTable">导出</el-button> <el-button type="primary" @click="exportTable(userTable)">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
...@@ -897,8 +897,9 @@ ...@@ -897,8 +897,9 @@
}); });
}); });
}, },
exportTable(){ exportTable(data){
let json = {}; if(data.length>0){
let json = {};
if (this.searchFrom.user_id) { if (this.searchFrom.user_id) {
json.user_id = this.searchFrom.user_id json.user_id = this.searchFrom.user_id
} }
...@@ -913,6 +914,8 @@ ...@@ -913,6 +914,8 @@
json.pay_end_at =this.timeLang[1] json.pay_end_at =this.timeLang[1]
} }
exportExcelApi(`api/admin/class/user/export/${this.userObj.classId}`,json); exportExcelApi(`api/admin/class/user/export/${this.userObj.classId}`,json);
}
}, },
}, },
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<el-form-item> <el-form-item>
<div class="search-btn-block"> <div class="search-btn-block">
<el-button type="primary" plain @click="getUser(searchFrom)">确定</el-button> <el-button type="primary" plain @click="getUser(searchFrom)">确定</el-button>
<el-button type="primary" plain @click="getLink1()">复制链接</el-button> <el-button type="primary" plain @click="copyUrl(link1)">复制链接</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<el-form-item> <el-form-item>
<div class="search-btn-block"> <div class="search-btn-block">
<el-button type="primary" plain @click="getUser(searchFrom2)">确定</el-button> <el-button type="primary" plain @click="getUser(searchFrom2)">确定</el-button>
<el-button type="primary" plain @click="getLink2()">复制链接</el-button> <el-button type="primary" plain @click="copyUrl(link2)">复制链接</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -64,15 +64,17 @@ ...@@ -64,15 +64,17 @@
activeName: 'first', activeName: 'first',
searchFrom:{ searchFrom:{
key:'goods_receive_course ', key:'goods_receive_course ',
desc: '', desc: '商品',
value: '', value: '',
}, },
searchFrom2:{ searchFrom2:{
key:'periods_receive_course', key:'periods_receive_course',
desc: '', desc: '期数',
value: '', value: '',
}, },
selectedGoods:[], selectedGoods:[],
link1:"",
link2:"",
} }
}, },
mounted(){ mounted(){
...@@ -86,10 +88,8 @@ ...@@ -86,10 +88,8 @@
initPage(){ initPage(){
getConfigListApi({key:this.searchFrom.key}).then(res=>{ getConfigListApi({key:this.searchFrom.key}).then(res=>{
if(res.list && res.list.length>0){ if(res.list && res.list.length>0){
this.searchFrom.desc = res.list[0].desc;
this.searchFrom.value = res.list[0].value; this.searchFrom.value = res.list[0].value;
}else{ }else{
this.searchFrom.desc = '';
this.searchFrom.value = ''; this.searchFrom.value = '';
} }
}); });
...@@ -99,23 +99,12 @@ ...@@ -99,23 +99,12 @@
// this.selectedGoods = [parseInt(res.goods_id),parseInt(res.list[0].value)]; // this.selectedGoods = [parseInt(res.goods_id),parseInt(res.list[0].value)];
// console.log(res.list) // console.log(res.list)
}else{ }else{
this.searchFrom2.desc = '';
this.searchFrom2.value = ''; this.searchFrom2.value = '';
} }
this.searchFrom2.desc = '';
this.searchFrom2.value = ''; this.searchFrom2.value = '';
})
},
getPeriodsList(){
let json1={
limit: 2000,
page: 1
}
getPeriodsApi(json1).then(res=>{
console.log(res.list)
this.periodsList = res.list;
}); });
this.linkContent1();
this.linkContent2();
}, },
getGoodsList(){ getGoodsList(){
let json = { let json = {
...@@ -134,12 +123,11 @@ ...@@ -134,12 +123,11 @@
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
console.log(data);
let json ={ let json ={
value:data.value,
desc:data.desc,
key:data.key
} }
json.value=data.value;
json.key=data.key;
json.desc="2";
putConfigApi(json).then(res=>{ putConfigApi(json).then(res=>{
this.$message({ this.$message({
type: 'success', type: 'success',
...@@ -166,7 +154,7 @@ ...@@ -166,7 +154,7 @@
}) })
}, },
initPage1(){ getPeriodsList(){
let json = { let json = {
page: 1, page: 1,
limit: 100, limit: 100,
...@@ -179,44 +167,42 @@ ...@@ -179,44 +167,42 @@
this.periodsList = res.list; this.periodsList = res.list;
}); });
}, },
getLink1(){ copyUrl(data){
let json={ let url = data;
let oInput = document.createElement('input');
oInput.value = url;
document.body.appendChild(oInput);
oInput.select(); // 选择对象;
document.execCommand("Copy"); // 执行浏览器复制命令
this.$message({
message: '已成功复制到剪切板',
type: 'success'
});
oInput.remove()
},
linkContent1(){
let json={
} }
json.url="https://wechat.changchangenglish.com/api/client/login?goods_id=1%26redirect_url=https://wechat.changchangenglish.com" json.url="https://wechat.changchangenglish.com/api/client/login?goods_id=1%26redirect_url=https://wechat.changchangenglish.com"
getLinkApi(json).then(res => { getLinkApi(json).then(res => {
this.copyUrl(res.url); this.link1=res.url;
}); });
}, },
getLink2(){ linkContent2(){
let json={ let json={
} }
json.url="https://wechat.changchangenglish.com/api/client/login?goods_id=1%26redirect_url=https://wechat.changchangenglish.com" json.url="https://wechat.changchangenglish.com/api/client/login?goods_id=1%26redirect_url=https://wechat.changchangenglish.com"
getLinkApi(json).then(res => { getLinkApi(json).then(res => {
this.copyUrl(res.url); this.link2=res.url;
}); });
}, }
copyUrl(data) {
let url = data;
let oInput = document.createElement("input");
oInput.value = url;
document.body.appendChild(oInput);
oInput.select(); // 选择对象
document.execCommand("Copy"); // 执行浏览器复制命令
this.$message({
message: "已成功复制到剪切板",
type: "success"
});
oInput.remove();
}
}, },
watch:{ watch:{
'entranceObj.show':function(a){ 'entranceObj.show':function(a){
if(a){ if(a){
this.initPage1();
this.initPage()
this.getPeriodsList(); this.getPeriodsList();
this.initPage()
this.getGoodsList(); this.getGoodsList();
} }
} }
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<img class="avatar" :src="scope.row.avatar"/> {{scope.row.nickname}}<br>(ID:{{scope.row.user_id}}) <img class="avatar" :src="scope.row.avatar"/> {{scope.row.nickname}}<br>(ID:{{scope.row.user_id}})
</div> </div>
<div v-else> <div v-else>
用户暂未 用户暂未
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -140,8 +140,10 @@ ...@@ -140,8 +140,10 @@
let msg = ''; let msg = '';
if(value === 40){ if(value === 40){
msg = '待发货' msg = '待发货'
}else{ }else if(value==50){
msg = '已发货' msg = '已发货'
}else{
msg= ""
} }
return msg; return msg;
}, },
......
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