Commit 679acb14 authored by 王's avatar

期数bug&&盒子列表bug

parent ec73e610
...@@ -59,8 +59,8 @@ ...@@ -59,8 +59,8 @@
methods: { methods: {
getBoxTypeList(){ getBoxTypeList(){
getBoxTypeListApi().then(res=>{ getBoxTypeListApi().then(res=>{
this.list = res; this.list = res ? res : [];
if(this.nowId === '') { if(this.nowId === '' && res) {
this.changeCateGory(res[0].id) this.changeCateGory(res[0].id)
} }
}) })
......
...@@ -174,11 +174,11 @@ ...@@ -174,11 +174,11 @@
this.getClassList() this.getClassList()
}) })
} else { } else {
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]
}) // })
} }
}, },
initPage(){ initPage(){
...@@ -221,6 +221,7 @@ ...@@ -221,6 +221,7 @@
this.getClassList(); this.getClassList();
}, },
getClassList(){ getClassList(){
console.log('getClassList this.periods', this.periods)
if (!this.periods) return; if (!this.periods) return;
this.getTeacher(); this.getTeacher();
let json = { let json = {
......
...@@ -173,6 +173,10 @@ ...@@ -173,6 +173,10 @@
page page
}, },
methods: { methods: {
dateCompare(val){
let nowDate = CommonJs.dateFmt(new Date(),"yyyy-MM-dd");
return ((new Date(nowDate.replace(/-/g,"\/"))) > (new Date(val.replace(/-/g,"\/"))));
},
onPageChange(val){ onPageChange(val){
this.nowPage = val this.nowPage = val
this.onSearch() this.onSearch()
...@@ -216,7 +220,13 @@ ...@@ -216,7 +220,13 @@
this.newDialog.show = true; this.newDialog.show = true;
}, },
onEdit(row){ onEdit(row){
console.log('onEdit', row); if (this.dateCompare(row.start_at)) {
this.$message({
type: 'error',
message: '期数已开始,不能编辑!'
});
return;
}
let weekList = []; let weekList = [];
if(row.rest_week_day){ if(row.rest_week_day){
row.rest_week_day.split(',').forEach((val)=>{ row.rest_week_day.split(',').forEach((val)=>{
......
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