From c6f4005bfce6631e8dca321fb6c1aebd1d2d28c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=83=91=E7=9A=87?= <236220500@qq.com>
Date: Sat, 23 May 2020 20:29:29 +0800
Subject: [PATCH] 1
---
src/pages/activity/ActivityPlan.vue | 54 +++++++++++++++++--
src/pages/activity/useActivityStepOne.vue | 4 +-
src/pages/activity/useTable.vue | 4 +-
.../ActivityManager/ActivityManager.js | 14 +++++
4 files changed, 67 insertions(+), 9 deletions(-)
diff --git a/src/pages/activity/ActivityPlan.vue b/src/pages/activity/ActivityPlan.vue
index 0438529..fff0ccb 100644
--- a/src/pages/activity/ActivityPlan.vue
+++ b/src/pages/activity/ActivityPlan.vue
@@ -1,5 +1,6 @@
@@ -85,6 +96,7 @@ import ActivityManager from "../../services/ActivityManager/ActivityManager";
import useTable from "./useTable";
import http from "../../services/CommonHttp";
import { formatDate } from "../../utils/Common";
+import store from "../../store";
export default {
name: "ActivityPlan",
@@ -93,13 +105,18 @@ export default {
useTable,
},
data() {
+ const _this = this;
return {
+ loading: false,
totalSize: 0,
pageNum: 1,
pageSize: 10,
+ saving: false,
data: [],
companyList: [],
shopList: [],
+ showUse: false,
+ activityInstance: {},
formValidate: {
date: null,
organizationId: null,
@@ -131,6 +148,10 @@ export default {
label: "已结束",
value: 3,
},
+ {
+ label: "已终止",
+ value: 4,
+ },
],
columns1: [
{
@@ -215,7 +236,9 @@ export default {
{
props: { type: "primary", size: "small" },
style: { marginRight: "8px" },
- on: { click: () => this.stop(p.row) },
+ on: {
+ click: () => _this.stop(p.row),
+ },
},
"终止"
),
@@ -223,7 +246,7 @@ export default {
"Button",
{
props: { type: "primary", size: "small" },
- on: { click: () => this.modify(p.row) },
+ on: { click: () => _this.modify(p.row) },
},
"修改"
),
@@ -240,6 +263,9 @@ export default {
this.searchTable();
},
methods: {
+ doShow(show) {
+ this.showUse = show;
+ },
getCompanyInfo() {
let that = this;
let data = {
@@ -274,8 +300,25 @@ export default {
this.pageNum = value;
this.searchTable();
},
+ stop(instance) {
+ this.saving = true;
+ let _this = this;
+ ActivityManager.instanceTerminate({ instanceId: instance.id }, (res) => {
+ _this.saving = false;
+ if (res.success == undefined || !res.success) {
+ that.$Message.error("终止失败!");
+ } else {
+ _this.searchTable();
+ }
+ });
+ },
+ modify(instance) {
+ this.activityInstance = instance;
+ this.showUse = true;
+ store.commit("SET_useData", instance);
+ },
searchTable(params = {}) {
- console.log(this.formValidate.date);
+ this.loading = true;
if (
this.formValidate.date !== null &&
this.formValidate.date.length > 0
@@ -302,6 +345,7 @@ export default {
const data = res.data.results.this || {};
this.data = data.list || [];
this.totalSize = data.total || 0;
+ this.loading = false;
});
},
},
diff --git a/src/pages/activity/useActivityStepOne.vue b/src/pages/activity/useActivityStepOne.vue
index 98434cb..7b5bbd6 100644
--- a/src/pages/activity/useActivityStepOne.vue
+++ b/src/pages/activity/useActivityStepOne.vue
@@ -23,7 +23,7 @@