From 683ef7da597de68391dcf8e175a172504b930d9b Mon Sep 17 00:00:00 2001 From: zhenghuang <236220500@qq.com> Date: Wed, 27 May 2020 11:08:53 +0800 Subject: [PATCH] 1 --- src/pages/activity/ActivityManager.vue | 2 +- src/pages/activity/ActivityPlan.vue | 197 ++++++++++---------- src/pages/activity/useActivityStepThree.vue | 2 +- 3 files changed, 96 insertions(+), 105 deletions(-) diff --git a/src/pages/activity/ActivityManager.vue b/src/pages/activity/ActivityManager.vue index 77e688a..a950432 100644 --- a/src/pages/activity/ActivityManager.vue +++ b/src/pages/activity/ActivityManager.vue @@ -27,7 +27,7 @@ - +
- 加载中... -
+ 加载中... + - - + + - - + - - + - + - + -
- +
+
- - - + + +
@@ -116,7 +105,7 @@ export default { useTable, planDetail, }, - data() { + data () { const _this = this; return { loading: false, @@ -178,7 +167,7 @@ export default { { title: "活动类型", key: "scheduleVO.name", - render(h, params) { + render (h, params) { return h("span", params.row["params"][0]["defaultVal"]); }, }, @@ -186,54 +175,54 @@ export default { title: "活动时间", key: "beginTime", width: 230, - render(h, params) { + render (h, params) { return h("span", params.row.beginTime + " - " + params.row.endTime); }, }, { title: "零售公司", key: "shop", - render(h, params) { + render (h, params) { return h( "span", params.row.companyName + - "等" + - (params.row.companyCount || 0) + - "家公司" + "等" + + (params.row.companyCount || 0) + + "家公司" ); }, }, { title: "店铺", key: "shop", - render(h, params) { + render (h, params) { return h( "span", params.row.storeName + - "等" + - (params.row.storeCount || 0) + - "家店铺" + "等" + + (params.row.storeCount || 0) + + "家店铺" ); }, }, { title: "添加好友数", key: "addFriendNum", - render(h, params) { + render (h, params) { return h("span", (params.row.friends || 0) + "人"); }, }, { title: "参与活动客户数", key: "joinActivityClientNum", - render(h, params) { + render (h, params) { return h("span", (params.row.friends || 0) + "人"); }, }, { title: "活动码", key: "activityCode", - render(h, p) { + render (h, p) { return h( "Button", { @@ -247,7 +236,7 @@ export default { { title: "活动状态", key: "status", - render(h, p) { + render (h, p) { const status = p.row.status; if (status === 1) return h("span", "未开始"); if (status === 2) return h("span", "进行中"); @@ -259,7 +248,7 @@ export default { title: "操作", key: "action", width: 200, - render(h, p) { + render (h, p) { return h("div", [ h( "Button", @@ -286,29 +275,30 @@ export default { ], }; }, - mounted() { + mounted () { this.setMenuName("活动管理", "活动计划"); this.getCompanyInfo(); this.getShopInfo(); this.searchTable(); }, methods: { - doShow(show) { + doShow (show) { this.showUse = show; + this.searchTable(); }, - showDetail(detail) { + showDetail (detail) { let _this = this; this.getDetail(detail.id).then((res) => { _this.detail = res; _this.isShowDetail = true; }); }, - getCompanyInfo() { + getCompanyInfo () { let that = this; let data = { userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId, }; - ActivityManager.getCompany(data, function(data) { + ActivityManager.getCompany(data, function (data) { that.companyList = []; data.data.results.forEach((element) => { that.companyList.push({ @@ -318,17 +308,17 @@ export default { }); }); }, - selectCompany(value) { + selectCompany (value) { this.customerId = value; this.getShopInfo(); }, - getShopInfo() { + getShopInfo () { let that = this; let data = { userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId, customerIds: this.customerId, }; - ActivityManager.getShop(data, function(data) { + ActivityManager.getShop(data, function (data) { that.shopList = []; data.data.results.forEach((element) => { that.shopList.push({ @@ -338,11 +328,11 @@ export default { }); }); }, - handlePage: function(value) { + handlePage: function (value) { this.pageNum = value; this.searchTable(); }, - stop(instance) { + stop (instance) { let _this = this; this.$Modal.confirm({ title: "您确认要终止?", @@ -361,10 +351,10 @@ export default { } ); }, - onCancel: () => {}, + onCancel: () => { }, }); }, - getDetail(instanceId) { + getDetail (instanceId) { return new Promise((resolve, reject) => { ActivityManager.instanceDetail( { @@ -376,7 +366,7 @@ export default { ); }); }, - modify(instance) { + modify (instance) { let _this = this; this.getDetail(instance.id).then((res) => { store.commit("SET_useData", res); @@ -384,13 +374,13 @@ export default { _this.showUse = true; }); }, - navigateCode(instance) { + navigateCode (instance) { this.$router.push({ path: "/activity/plan/code", query: { instanceId: instance.id }, }); }, - searchTable(params = {}) { + searchTable (params = {}) { this.loading = true; if ( this.formValidate.date !== null && @@ -410,6 +400,7 @@ export default { params.pageNum = this.pageNum; params.pageSize = this.pageSize; params = { ...params, ...this.formValidate }; + params.userId = JSON.parse(sessionStorage.getItem("loginInfo")).userId; if (params.status == 0) { params.status = undefined; } diff --git a/src/pages/activity/useActivityStepThree.vue b/src/pages/activity/useActivityStepThree.vue index e72c700..5f3394a 100644 --- a/src/pages/activity/useActivityStepThree.vue +++ b/src/pages/activity/useActivityStepThree.vue @@ -119,7 +119,6 @@ export default { }); } this.isSelect = this._.filter(this.isSelect, item => item) - console.log(that.shopList) }, onChange (data) { let _this = this; @@ -153,6 +152,7 @@ export default { let data = { userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId, customerIds: companyIds.join(","), + scheduleId: store.getters.useData.scheduleId }; that.loading = true; ActivityManager.getShop(data, function (data) {