feature_0521
郑皇 5 years ago
parent a5d7e15f06
commit c6f4005bfc

@ -1,5 +1,6 @@
<template>
<div>
<Spin v-if="saving" fix>加载中...</Spin>
<Form ref="formValidate" :model="formValidate" :label-width="80">
<Row>
<i-col span="6">
@ -63,7 +64,12 @@
</i-col>
</Row>
<Row style="margin-top:50px">
<Table border :columns="columns1" :data="data"></Table>
<Table
:loading="loading"
border
:columns="columns1"
:data="data"
></Table>
<Page
:total="totalSize"
:current="pageNum"
@ -76,7 +82,12 @@
></Page>
</Row>
</Form>
<!-- <useTable @dispalyuseModal="dispalyuseModal" :useModal="useModal" :id="id"></useTable>-->
<useTable
ref="useTable"
@doShow="doShow"
:show="showUse"
:schedule="activityInstance.scheduleVO"
></useTable>
</div>
</template>
@ -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;
});
},
},

@ -23,7 +23,7 @@
<Date-picker
@on-change="storeStartDate"
type="date"
v-model="formValidate.activityStartDate"
v-model="formValidate.beginTime"
format="yyyy-MM-dd"
placeholder="请选择开始日期"
style="width: 200px"
@ -34,7 +34,7 @@
<Date-picker
@on-change="storeEndDate"
type="date"
v-model="formValidate.activityEndDate"
v-model="formValidate.endTime"
format="yyyy-MM-dd"
placeholder="请选择结束日期"
style="width: 200px"

@ -16,7 +16,7 @@
</Steps>
<useActivityStepOne
:schedule="schedule"
v-if="currentStep == 0"
v-if="currentStep == 0 && show"
></useActivityStepOne>
<useActivityStepTwo
:schedule="schedule"
@ -83,7 +83,7 @@ export default {
},
props: {
id: String,
schedule: {},
schedule: Object,
show: Boolean,
},
watch: {

@ -65,6 +65,18 @@ export function getActivityTableData(params, call) {
return http.get("activity/instance/list", params).then(call);
}
/**
* 活动实例终止
*/
export function instanceTerminate(params, call) {
return http.post("activity/instance/terminate", params).then(call);
}
/**
* 活动实例详情
*/
export function instanceDetail(params, call) {
return http.post("activity/instance/detail", params).then(call);
}
export default {
getActivityList,
addOreditActivity,
@ -74,4 +86,6 @@ export default {
getShop,
getActivityTableData,
saveActivityData,
instanceTerminate,
instanceDetail,
};

Loading…
Cancel
Save