feature_0521
郑皇 5 years ago
parent a5d7e15f06
commit c6f4005bfc

@ -1,5 +1,6 @@
<template> <template>
<div> <div>
<Spin v-if="saving" fix>加载中...</Spin>
<Form ref="formValidate" :model="formValidate" :label-width="80"> <Form ref="formValidate" :model="formValidate" :label-width="80">
<Row> <Row>
<i-col span="6"> <i-col span="6">
@ -63,7 +64,12 @@
</i-col> </i-col>
</Row> </Row>
<Row style="margin-top:50px"> <Row style="margin-top:50px">
<Table border :columns="columns1" :data="data"></Table> <Table
:loading="loading"
border
:columns="columns1"
:data="data"
></Table>
<Page <Page
:total="totalSize" :total="totalSize"
:current="pageNum" :current="pageNum"
@ -76,7 +82,12 @@
></Page> ></Page>
</Row> </Row>
</Form> </Form>
<!-- <useTable @dispalyuseModal="dispalyuseModal" :useModal="useModal" :id="id"></useTable>--> <useTable
ref="useTable"
@doShow="doShow"
:show="showUse"
:schedule="activityInstance.scheduleVO"
></useTable>
</div> </div>
</template> </template>
@ -85,6 +96,7 @@ import ActivityManager from "../../services/ActivityManager/ActivityManager";
import useTable from "./useTable"; import useTable from "./useTable";
import http from "../../services/CommonHttp"; import http from "../../services/CommonHttp";
import { formatDate } from "../../utils/Common"; import { formatDate } from "../../utils/Common";
import store from "../../store";
export default { export default {
name: "ActivityPlan", name: "ActivityPlan",
@ -93,13 +105,18 @@ export default {
useTable, useTable,
}, },
data() { data() {
const _this = this;
return { return {
loading: false,
totalSize: 0, totalSize: 0,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
saving: false,
data: [], data: [],
companyList: [], companyList: [],
shopList: [], shopList: [],
showUse: false,
activityInstance: {},
formValidate: { formValidate: {
date: null, date: null,
organizationId: null, organizationId: null,
@ -131,6 +148,10 @@ export default {
label: "已结束", label: "已结束",
value: 3, value: 3,
}, },
{
label: "已终止",
value: 4,
},
], ],
columns1: [ columns1: [
{ {
@ -215,7 +236,9 @@ export default {
{ {
props: { type: "primary", size: "small" }, props: { type: "primary", size: "small" },
style: { marginRight: "8px" }, style: { marginRight: "8px" },
on: { click: () => this.stop(p.row) }, on: {
click: () => _this.stop(p.row),
},
}, },
"终止" "终止"
), ),
@ -223,7 +246,7 @@ export default {
"Button", "Button",
{ {
props: { type: "primary", size: "small" }, 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(); this.searchTable();
}, },
methods: { methods: {
doShow(show) {
this.showUse = show;
},
getCompanyInfo() { getCompanyInfo() {
let that = this; let that = this;
let data = { let data = {
@ -274,8 +300,25 @@ export default {
this.pageNum = value; this.pageNum = value;
this.searchTable(); 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 = {}) { searchTable(params = {}) {
console.log(this.formValidate.date); this.loading = true;
if ( if (
this.formValidate.date !== null && this.formValidate.date !== null &&
this.formValidate.date.length > 0 this.formValidate.date.length > 0
@ -302,6 +345,7 @@ export default {
const data = res.data.results.this || {}; const data = res.data.results.this || {};
this.data = data.list || []; this.data = data.list || [];
this.totalSize = data.total || 0; this.totalSize = data.total || 0;
this.loading = false;
}); });
}, },
}, },

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

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

@ -65,6 +65,18 @@ export function getActivityTableData(params, call) {
return http.get("activity/instance/list", params).then(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 { export default {
getActivityList, getActivityList,
addOreditActivity, addOreditActivity,
@ -74,4 +86,6 @@ export default {
getShop, getShop,
getActivityTableData, getActivityTableData,
saveActivityData, saveActivityData,
instanceTerminate,
instanceDetail,
}; };

Loading…
Cancel
Save