|
@@ -797,37 +797,75 @@ export default {
|
|
|
this.handleCheckedCitiesChange();
|
|
|
},
|
|
|
hideHandle() {},
|
|
|
- getDict() {
|
|
|
- this.$api.inquireCourseEducationType({ status: 1 }).then((res) => {
|
|
|
- this.eduTypeOptions = res.rows;
|
|
|
- });
|
|
|
- this.$api.inquirebusinessList({ status: 1 }).then((res) => {
|
|
|
- console.log(this.$methodsTools.getBusinessList().length, "aaa");
|
|
|
- this.courTypeOptions = res.rows;
|
|
|
- let options = [
|
|
|
- {
|
|
|
- label: "最近选择",
|
|
|
- options: [],
|
|
|
- },
|
|
|
- {
|
|
|
- label: "业务层级",
|
|
|
- options: [],
|
|
|
- },
|
|
|
- ];
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param {Bool} status true 全部 false 筛选
|
|
|
+ * @param {Number} id 筛选情况下 教育类型ID
|
|
|
+ */
|
|
|
+ concatList(status, id) {
|
|
|
+ let options = [
|
|
|
+ {
|
|
|
+ label: "最近选择",
|
|
|
+ options: [],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "业务层级",
|
|
|
+ options: [],
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ if (status) {
|
|
|
+ this.$api.inquirebusinessList({ status: 1 }).then((res) => {
|
|
|
+ this.courTypeOptions = res.rows;
|
|
|
+ if (this.$methodsTools.getBusinessList().length) {
|
|
|
+ let arrlist = this.$methodsTools.getBusinessList();
|
|
|
+ res.rows.forEach((item) => {
|
|
|
+ if (arrlist.includes(item.id)) {
|
|
|
+ options[0].options.push(item);
|
|
|
+ } else {
|
|
|
+ options[1].options.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ options[1].options = res.rows;
|
|
|
+ }
|
|
|
+ // let arrs = options.filter((item) => {
|
|
|
+ // if (item.options.length) {
|
|
|
+ // return item;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ this.newCourTypeOptions = options;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ let arr = [];
|
|
|
if (this.$methodsTools.getBusinessList().length) {
|
|
|
let arrlist = this.$methodsTools.getBusinessList();
|
|
|
- res.rows.forEach((item) => {
|
|
|
+ this.courTypeOptions.forEach((item) => {
|
|
|
if (arrlist.includes(item.id)) {
|
|
|
options[0].options.push(item);
|
|
|
- } else {
|
|
|
- options[1].options.push(item);
|
|
|
}
|
|
|
});
|
|
|
+ arr = this.courTypeOptions.filter((item) => {
|
|
|
+ return item.educationId == id && !arrlist.includes(item.id);
|
|
|
+ });
|
|
|
} else {
|
|
|
- options[1].options = res.rows;
|
|
|
+ arr = this.courTypeOptions.filter((item) => {
|
|
|
+ return item.educationId == id;
|
|
|
+ });
|
|
|
}
|
|
|
+ options[1].options = arr;
|
|
|
+ // let arrs = options.filter((item) => {
|
|
|
+ // if (item.options.length) {
|
|
|
+ // return item;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
this.newCourTypeOptions = options;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getDict() {
|
|
|
+ this.$api.inquireCourseEducationType({ status: 1 }).then((res) => {
|
|
|
+ this.eduTypeOptions = res.rows;
|
|
|
});
|
|
|
+ this.concatList(true);
|
|
|
this.$api.inquireCourseSubject({ status: 1 }).then((res) => {
|
|
|
res.rows.map((item, index) => {
|
|
|
var array = [];
|
|
@@ -858,7 +896,9 @@ export default {
|
|
|
this.newSteamUrl2 = newarrays2;
|
|
|
});
|
|
|
},
|
|
|
- changeEduType() {
|
|
|
+ changeEduType(v) {
|
|
|
+ this.concatList(false, v);
|
|
|
+ return;
|
|
|
if (!(this.courType === undefined || this.courType === "")) {
|
|
|
this.courType = "";
|
|
|
}
|