diff --git a/src/pages/activity/ActivityPlan.vue b/src/pages/activity/ActivityPlan.vue index 3ff5dde..8bece92 100644 --- a/src/pages/activity/ActivityPlan.vue +++ b/src/pages/activity/ActivityPlan.vue @@ -1,107 +1,105 @@ @@ -120,7 +118,7 @@ export default { useTable, planDetail }, - data() { + data () { const _this = this; return { loading: false, @@ -141,11 +139,11 @@ export default { organizationId: null, storeId: null, status: 2, - startDate:null, - endDate:null, + startDate: null, + endDate: null, }, - startDateOptions:{}, - endDateOptions:{}, + startDateOptions: {}, + endDateOptions: {}, activityData: [ { activityStatus: "进行中" @@ -177,7 +175,7 @@ export default { width: 60, align: "center", title: "序号", - render(h, params) { + render (h, params) { let num = parseInt(params.index) + 1; console.log(_this.pageSize); if (_this.pageSize > 1) { @@ -193,7 +191,7 @@ export default { { title: "活动类型", key: "scheduleVO.name", - render(h, params) { + render (h, params) { return h("span", params.row["params"][0]["name"]); } }, @@ -201,54 +199,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", { @@ -262,7 +260,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", "进行中"); @@ -274,7 +272,7 @@ export default { title: "操作", key: "action", width: 200, - render(h, p) { + render (h, p) { let r = [ h( "Button", @@ -305,30 +303,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({ @@ -338,18 +336,18 @@ 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, scheduleId: null }; - ActivityManager.getShop(data, function(data) { + ActivityManager.getShop(data, function (data) { that.shopList = []; data.data.results.forEach(element => { that.shopList.push({ @@ -359,11 +357,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: "您确认要终止?", @@ -382,10 +380,10 @@ export default { } ); }, - onCancel: () => {} + onCancel: () => { } }); }, - getDetail(instanceId) { + getDetail (instanceId) { return new Promise((resolve, reject) => { ActivityManager.instanceDetail( { @@ -397,7 +395,7 @@ export default { ); }); }, - modify(instance) { + modify (instance) { let _this = this; this.getDetail(instance.id).then(res => { store.commit("SET_useData", res); @@ -405,20 +403,20 @@ 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.startDate !== "") { + if (this.formValidate.startDate) { this.formValidate.startDate = formatDate(this.formValidate.startDate); } else { this.formValidate.startDate = undefined; } - if (!!this.formValidate.endDate) { + if (this.formValidate.endDate) { this.formValidate.endDate = formatDate(this.formValidate.endDate); } else { this.formValidate.endDate = undefined; @@ -438,24 +436,24 @@ export default { this.loading = false; }); }, - startDateChange:function(e){ - //设置开始时间 - this.endDateOptions = { - disabledDate:date =>{ - let startTime = this.formValidate.startDate ? new Date(this.formValidate.startDate).valueOf() : ''; - return date && (date.valueOf() < startTime) - } - } - }, - endDateChange:function(e){ - //设置结束时间 - let endTime = this.formValidate.endDate ? new Date( this.formValidate.endDate ).valueOf()-1*24*60*60*1000 :''; - this.startDateOptions = { - disabledDate:date =>{ - return date && (date.valueOf() >endTime); - } - } + startDateChange: function (e) { + //设置开始时间 + this.endDateOptions = { + disabledDate: date => { + let startTime = this.formValidate.startDate ? new Date(this.formValidate.startDate).valueOf() : ''; + return date && (date.valueOf() < startTime) + } + } + }, + endDateChange: function (e) { + //设置结束时间 + let endTime = this.formValidate.endDate ? new Date(this.formValidate.endDate).valueOf() - 1 * 24 * 60 * 60 * 1000 : ''; + this.startDateOptions = { + disabledDate: date => { + return date && (date.valueOf() > endTime); + } } + } } }; diff --git a/src/pages/activity/addActivity.vue b/src/pages/activity/addActivity.vue index 92a256d..0642da9 100644 --- a/src/pages/activity/addActivity.vue +++ b/src/pages/activity/addActivity.vue @@ -1,10 +1,8 @@