- 全选
-
+ 全选
+
-
+
加载中...
-
-
-
+
+
+
{{ item.label }}
-
+
@@ -44,7 +32,7 @@ import ActivityManager from "../../services/ActivityManager/ActivityManager";
import store from "../../store/index";
export default {
name: "useActivityStepTwo",
- data () {
+ data() {
return {
indeterminate: false,
allSelect: false,
@@ -52,29 +40,33 @@ export default {
companyListdata: [],
checkCompanys: [],
orginCompanyList: [],
- loading: false,
+ loading: false
};
},
- mounted () {
+ mounted() {
let _this = this;
console.log(111, store.getters.useData);
- if (store.getters.useData.company) {
- store.getters.useData.company.forEach((item) => {
+ if (
+ store.getters.useData.company &&
+ store.getters.useData.company.length > 0
+ ) {
+ store.getters.useData.company.forEach(item => {
if (_this.checkCompanys.indexOf(item.id) == -1) {
_this.checkCompanys.push(item.id);
}
});
} else if (store.getters.useData.stores) {
- store.getters.useData.stores.forEach((item) => {
+ store.getters.useData.stores.forEach(item => {
+ console.log(112221, item.parentId);
if (item.parentId && _this.checkCompanys.indexOf(item.parentId) == -1) {
_this.checkCompanys.push(item.parentId);
}
});
}
- this.getCompanyInfo()
+ this.getCompanyInfo();
},
methods: {
- onChange (data) {
+ onChange(data) {
let _this = this;
if (data.length === this.companyList.length) {
this.indeterminate = false;
@@ -87,58 +79,58 @@ export default {
this.allSelect = false;
}
store.getters.useData.company = [];
- data.forEach((item) => {
- const c = _this._.find(
- _this.companyListdata,
- (shop) => shop.id == item
- );
+ data.forEach(item => {
+ const c = _this._.find(_this.companyListdata, shop => shop.id == item);
if (c) {
store.getters.useData.company.push(c);
}
});
},
- doSearch (e) {
+ doSearch(e) {
const keyword = e.target.value;
let that = this;
if (keyword.length > 0) {
- that.companyList.forEach((item) => {
+ that.companyList.forEach(item => {
if (item.label.indexOf(keyword) == -1) {
item.hide = true;
}
});
} else {
- that.companyList.forEach((item) => {
- item.hide = false
+ that.companyList.forEach(item => {
+ item.hide = false;
});
}
this.$forceUpdate();
- console.log(1, that.companyList)
+ console.log(1, that.companyList);
},
- getCompanyInfo () {
+ getCompanyInfo() {
let that = this;
let data = {
- userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
+ userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId
};
this.loading = true;
- ActivityManager.getCompany(data, function (data) {
+ ActivityManager.getCompany(data, function(data) {
that.companyList = [];
that.companyListdata = data.data.results;
- if (store.getters.useData.company && store.getters.useData.company.length == that.companyListdata.length) {
+ if (
+ store.getters.useData.company &&
+ store.getters.useData.company.length == that.companyListdata.length
+ ) {
that.allSelect = true;
}
- data.data.results.forEach((element) => {
+ data.data.results.forEach(element => {
that.companyList.push({
label: element.name,
- value: element.id,
+ value: element.id
});
that.orginCompanyList = that.companyList;
});
store.getters.useData.company = [];
- console.log(123, that.checkCompanys, that.companyListdata)
- that.checkCompanys.forEach((item) => {
+ console.log(123, that.checkCompanys, that.companyListdata);
+ that.checkCompanys.forEach(item => {
const c = that._.find(
that.companyListdata,
- (company) => company.id == item
+ company => company.id == item
);
if (c) {
store.getters.useData.company.push(c);
@@ -147,7 +139,7 @@ export default {
that.loading = false;
});
},
- handleCheckAll () {
+ handleCheckAll() {
let _this = this;
if (this.indeterminate) {
this.allSelect = false;
@@ -158,24 +150,24 @@ export default {
if (this.allSelect) {
this.checkCompanys = [];
- this.companyList.forEach((item) => {
+ this.companyList.forEach(item => {
this.checkCompanys.push(item.value);
});
} else {
this.checkCompanys = [];
}
store.getters.useData.company = [];
- this.checkCompanys.forEach((item) => {
+ this.checkCompanys.forEach(item => {
const c = _this._.find(
_this.companyListdata,
- (company) => company.id == item
+ company => company.id == item
);
if (c) {
store.getters.useData.company.push(c);
}
});
- },
- },
+ }
+ }
};
diff --git a/src/pages/shop/IncreaseWelcomeEdit.vue b/src/pages/shop/IncreaseWelcomeEdit.vue
index 16285a3..db8d3b4 100644
--- a/src/pages/shop/IncreaseWelcomeEdit.vue
+++ b/src/pages/shop/IncreaseWelcomeEdit.vue
@@ -107,7 +107,7 @@
-