|
@@ -61,7 +61,7 @@
|
|
|
<view style="display: flex;align-items: center;">
|
|
<view style="display: flex;align-items: center;">
|
|
|
<u-checkbox
|
|
<u-checkbox
|
|
|
:disabled="item.disabled"
|
|
:disabled="item.disabled"
|
|
|
- @change="checkboxChange"
|
|
|
|
|
|
|
+ @change="checkboxChange(item)"
|
|
|
shape="circle"
|
|
shape="circle"
|
|
|
active-color="#32467B"
|
|
active-color="#32467B"
|
|
|
v-model="item.checked"
|
|
v-model="item.checked"
|
|
@@ -156,6 +156,7 @@ export default {
|
|
|
onShow() {},
|
|
onShow() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
resultForm() {
|
|
resultForm() {
|
|
|
|
|
+ var self = this
|
|
|
if (this.list.length == 0) {
|
|
if (this.list.length == 0) {
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
title: '提示',
|
|
@@ -218,8 +219,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ }else{
|
|
|
|
|
+ self.$method.showToast(result.data.msg,'error')
|
|
|
}
|
|
}
|
|
|
- console.log(result);
|
|
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
getMyCourse() {
|
|
getMyCourse() {
|
|
@@ -253,7 +255,7 @@ export default {
|
|
|
this.form.time = res.data.data[0].reminderTime;
|
|
this.form.time = res.data.data[0].reminderTime;
|
|
|
this.form.startDate = this.$method.timestampToTime(res.data.data[0].startTime);
|
|
this.form.startDate = this.$method.timestampToTime(res.data.data[0].startTime);
|
|
|
this.form.endDate = this.$method.timestampToTime(res.data.data[0].endTime);
|
|
this.form.endDate = this.$method.timestampToTime(res.data.data[0].endTime);
|
|
|
- this.index_review = res.data.data[0].studyDay;
|
|
|
|
|
|
|
+ this.index_review = res.data.data[0].studyDay - 1;
|
|
|
this.form.week = res.data.data[0].studyCount;
|
|
this.form.week = res.data.data[0].studyCount;
|
|
|
this.form.category = res.data.data[0].coursePlanVo[0].categoryName;
|
|
this.form.category = res.data.data[0].coursePlanVo[0].categoryName;
|
|
|
this.list = res.data.data[0].coursePlanVo;
|
|
this.list = res.data.data[0].coursePlanVo;
|
|
@@ -335,26 +337,79 @@ export default {
|
|
|
},
|
|
},
|
|
|
submit() {
|
|
submit() {
|
|
|
let that = this;
|
|
let that = this;
|
|
|
|
|
+ var arrays = [];
|
|
|
this.list2.map(val => {
|
|
this.list2.map(val => {
|
|
|
if (val.checked) {
|
|
if (val.checked) {
|
|
|
- that.list.push(val);
|
|
|
|
|
|
|
+ arrays.push(val);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- this.checkSameItem();
|
|
|
|
|
|
|
+ this.list = arrays;
|
|
|
this.show = false;
|
|
this.show = false;
|
|
|
- this.form.category = this.list[0].categoryName;
|
|
|
|
|
|
|
+ if (arrays.length !== 0) {
|
|
|
|
|
+ this.form.category = this.list[0].categoryName;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.form.category = '';
|
|
|
|
|
+ }
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // this.list2.map(val => {
|
|
|
|
|
+ // if (val.checked) {
|
|
|
|
|
+ // that.list.push(val);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ // this.checkSameItem();
|
|
|
|
|
+ // this.show = false;
|
|
|
|
|
+ // this.form.category = this.list[0].categoryName;
|
|
|
|
|
+ },
|
|
|
|
|
+ checkboxChange(item) {
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+ this.$nextTick(function() {
|
|
|
|
|
+ if (item.checked) {
|
|
|
|
|
+ self.list2.forEach((items, indexs) => {
|
|
|
|
|
+ if (items.categoryId !== item.categoryId) {
|
|
|
|
|
+ items.disabled = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ var astatus = false;
|
|
|
|
|
+ self.list2.forEach((items, indexs) => {
|
|
|
|
|
+ if (items.checked) {
|
|
|
|
|
+ astatus = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ if (!astatus) {
|
|
|
|
|
+ self.list2.map((items, indexs) => {
|
|
|
|
|
+ items.disabled = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // this.list2.map(val => {
|
|
|
|
|
+ // if (val.categoryId !== item.categoryId) {
|
|
|
|
|
+ // val.disabled = true;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // });
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
- checkboxChange(e) {},
|
|
|
|
|
checkSameItem() {
|
|
checkSameItem() {
|
|
|
- this.list2.map(val => {
|
|
|
|
|
- val.disabled = false;
|
|
|
|
|
- this.list.map(val1 => {
|
|
|
|
|
- if (val.id == val1.id) {
|
|
|
|
|
- val.disabled = true;
|
|
|
|
|
|
|
+ var self = this;
|
|
|
|
|
+ this.list2.map((item, index) => {
|
|
|
|
|
+ self.list.map(val => {
|
|
|
|
|
+ if (item.courseId === val.courseId) {
|
|
|
|
|
+ item.checked = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (item.categoryId !== val.categoryId) {
|
|
|
|
|
+ item.disabled = true;
|
|
|
}
|
|
}
|
|
|
- val.checked = false;
|
|
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
+ // this.list2.map(val => {
|
|
|
|
|
+ // val.disabled = false;
|
|
|
|
|
+ // self.list.map(val1 => {
|
|
|
|
|
+ // if (val.courseId == val1.courseId || val.categoryId !== val1.categoryId) {
|
|
|
|
|
+ // val.disabled = true;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // val.checked = false;
|
|
|
|
|
+ // });
|
|
|
|
|
+ // });
|
|
|
},
|
|
},
|
|
|
delItem(index) {
|
|
delItem(index) {
|
|
|
this.list.splice(index, 1);
|
|
this.list.splice(index, 1);
|
|
@@ -366,6 +421,10 @@ export default {
|
|
|
},
|
|
},
|
|
|
openSel() {
|
|
openSel() {
|
|
|
this.show = true;
|
|
this.show = true;
|
|
|
|
|
+ this.list2.forEach((item, index) => {
|
|
|
|
|
+ item.checked = false;
|
|
|
|
|
+ item.disabled = false;
|
|
|
|
|
+ });
|
|
|
this.checkSameItem();
|
|
this.checkSameItem();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|