feature_0521
zhenghuang 5 years ago
parent fe0480eb22
commit ab777874ef

@ -1,18 +1,18 @@
<template> <template>
<div class="activityManager"> <div class="activityManager">
<Spin v-show="loading" fix>加载中...</Spin> <Spin v-show="loading"
fix>加载中...</Spin>
<Row> <Row>
<i-col <i-col class="activityListClass"
class="activityListClass" v-for="(item, index) in activityList"
v-for="(item, index) in activityList" :key="index"
:key="index" span="7"
span="7" offset="1">
offset="1"
>
<Card> <Card>
<div class="operateAndThemeItem"> <div class="operateAndThemeItem">
<div class="ThemeItem"> <div class="ThemeItem">
<img class="img" :src="'/kiisoo-ic' + item.logo" /> <img class="img"
:src="'/kiisoo-ic' + item.logo" />
<div class="tipItem"> <div class="tipItem">
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
<span>{{ item.description }}</span> <span>{{ item.description }}</span>
@ -27,24 +27,22 @@
</i-col> </i-col>
</Row> </Row>
<Row> <Row>
<i-col span="7" offset="1"> <i-col span="7"
<div @click="dispalyAddActivity('')" class="addactivity"> offset="1">
<div @click="dispalyAddActivity('')"
class="addactivity">
<span>+</span> <span>+</span>
<span>添加活动</span> <span>添加活动</span>
</div> </div>
</i-col> </i-col>
</Row> </Row>
<useTable <useTable ref="useTable"
ref="useTable" @doShow="doShow"
@doShow="doShow" :show="showUse"
:show="showUse" :schedule="useSchedule"></useTable>
:schedule="useSchedule" <addActivity @dispalyAddActivityModal="dispalyAddActivityModal"
></useTable> :addActivityModal="addActivityModal"
<addActivity :id="id"></addActivity>
@dispalyAddActivityModal="dispalyAddActivityModal"
:addActivityModal="addActivityModal"
:id="id"
></addActivity>
</div> </div>
</template> </template>
@ -61,7 +59,7 @@ export default {
addActivity, addActivity,
}, },
inject: ["setMenuName"], inject: ["setMenuName"],
data() { data () {
return { return {
showUse: false, showUse: false,
addActivityModal: false, addActivityModal: false,
@ -72,21 +70,21 @@ export default {
loading: false, loading: false,
}; };
}, },
mounted() { mounted () {
this.setMenuName("活动管理", "活动池"); this.setMenuName("活动管理", "活动池");
this.getActivityTable(); this.getActivityTable();
}, },
methods: { methods: {
doShow(show) { doShow (show) {
this.showUse = show; this.showUse = show;
}, },
getActivityData(id) { getActivityData (id) {
let that = this; let that = this;
let data = { let data = {
instanceId: id, instanceId: id,
}; };
that.loading = true; that.loading = true;
ActivityManager.getActivityInfo(data, function(data) { ActivityManager.getActivityInfo(data, function (data) {
that.inputActivityList = []; that.inputActivityList = [];
data.data.results.params.forEach((item) => { data.data.results.params.forEach((item) => {
that.inputActivityList.push({ that.inputActivityList.push({
@ -98,35 +96,36 @@ export default {
that.loading = false; that.loading = false;
}); });
}, },
getActivityTable() { getActivityTable () {
let that = this; let that = this;
ActivityManager.getActivityList({}, function(data) { ActivityManager.getActivityList({}, function (data) {
that.activityList = data.data.results; that.activityList = data.data.results;
}); });
}, },
disPlayUseTable(item) { disPlayUseTable (item) {
let that = this; let that = this;
let data = { let data = {
id: item.id, id: item.id,
}; };
// let data = new FormData() // let data = new FormData()
// data.append('instanceId', item.id) // data.append('instanceId', item.id)
ActivityManager.getActivityInfo(data, function(data) { ActivityManager.getActivityInfo(data, function (data) {
that.useSchedule = data.data.results; that.useSchedule = data.data.results;
that.showUse = true; that.showUse = true;
that.$forceUpdate()
}); });
}, },
dispalyAddActivity(id) { dispalyAddActivity (id) {
this.addActivityModal = true; this.addActivityModal = true;
this.id = id.toString(); this.id = id.toString();
}, },
dispalyuseModal(displayModalFlag, isCancle) { dispalyuseModal (displayModalFlag, isCancle) {
this.useModal = displayModalFlag; this.useModal = displayModalFlag;
if (isCancle === true) { if (isCancle === true) {
this.getActivityTable(); this.getActivityTable();
} }
}, },
dispalyAddActivityModal(displayModalFlag, isCancle) { dispalyAddActivityModal (displayModalFlag, isCancle) {
this.addActivityModal = displayModalFlag; this.addActivityModal = displayModalFlag;
if (isCancle === true) { if (isCancle === true) {
this.getActivityTable(); this.getActivityTable();

@ -1,93 +1,83 @@
<template> <template>
<div> <div>
<Spin v-if="saving" fix>加载中...</Spin> <Spin v-if="saving"
<Form ref="formValidate" :model="formValidate" :label-width="80"> fix>加载中...</Spin>
<Form ref="formValidate"
:model="formValidate"
:label-width="80">
<Row> <Row>
<i-col span="7">
<FormItem label="选择日期"
prop="">
<Date-picker v-model="formValidate.date"
type="daterange"
placement="bottom-end"
placeholder="选择日期区间"></Date-picker>
</FormItem>
</i-col>
<i-col span="6"> <i-col span="6">
<FormItem label="零售公司" prop=""> <FormItem label="零售公司"
<Select prop="">
v-model="formValidate.organizationId" <Select v-model="formValidate.organizationId"
filterable filterable
placeholder="全部" placeholder="全部"
clearable clearable>
> <Option v-for="(item, index) in companyList"
<Option :key="index"
v-for="(item, index) in companyList" :value="item.value">{{ item.label }}
:key="index"
:value="item.value"
>{{ item.label }}
</Option> </Option>
</Select> </Select>
</FormItem> </FormItem>
</i-col> </i-col>
<i-col span="6"> <i-col span="6">
<FormItem label="店铺" prop=""> <FormItem label="店铺"
<Select prop="">
v-model="formValidate.storeId" <Select v-model="formValidate.storeId"
filterable filterable
placeholder="全部" placeholder="全部"
clearable clearable>
> <Option v-for="(item, index) in shopList"
<Option :key="index"
v-for="(item, index) in shopList" :value="item.value">{{ item.label }}
:key="index"
:value="item.value"
>{{ item.label }}
</Option> </Option>
</Select> </Select>
</FormItem> </FormItem>
</i-col> </i-col>
<i-col span="4"> <i-col span="4">
<FormItem label="活动状态" prop=""> <FormItem label="活动状态"
prop="">
<Select v-model="formValidate.status"> <Select v-model="formValidate.status">
<Option <Option v-for="(item, index) in activityStatusList"
v-for="(item, index) in activityStatusList" :key="index"
:key="index" :value="item.value">{{ item.label }}
:value="item.value"
>{{ item.label }}
</Option> </Option>
</Select> </Select>
</FormItem> </FormItem>
</i-col> </i-col>
<i-col span="7">
<FormItem label="选择日期" prop="">
<Date-picker
v-model="formValidate.date"
type="daterange"
placement="bottom-end"
placeholder="选择日期区间"
></Date-picker>
</FormItem>
</i-col>
<i-col span="1"> <i-col span="1">
<Button type="primary" @click="searchTable"></Button> <Button type="primary"
@click="searchTable">查询</Button>
</i-col> </i-col>
</Row> </Row>
<Row style="margin-top:50px"> <Row style="margin-top:50px">
<Table <Table :loading="loading"
:loading="loading" border
border :columns="columns1"
:columns="columns1" :data="data"></Table>
:data="data" <Page :total="totalSize"
></Table> :current="pageNum"
<Page :page-size="pageSize"
:total="totalSize" show-elevator
:current="pageNum" show-total
:page-size="pageSize" placement="top"
show-elevator @on-change="handlePage"
show-total class-name="ks-page"></Page>
placement="top"
@on-change="handlePage"
class-name="ks-page"
></Page>
</Row> </Row>
</Form> </Form>
<useTable <useTable ref="useTable"
ref="useTable" @doShow="doShow"
@doShow="doShow" :show="showUse"
:show="showUse" :schedule="activityInstance.scheduleVO"></useTable>
:schedule="activityInstance.scheduleVO"
></useTable>
</div> </div>
</template> </template>
@ -104,7 +94,7 @@ export default {
components: { components: {
useTable, useTable,
}, },
data() { data () {
const _this = this; const _this = this;
return { return {
loading: false, loading: false,
@ -166,47 +156,43 @@ export default {
{ {
title: "活动类型", title: "活动类型",
key: "scheduleVO.name", key: "scheduleVO.name",
render(h, params) { render (h, params) {
return h("span", params.row["scheduleVO"]["name"]); return h("span", params.row["params"][0]["defaultVal"]);
}, },
}, },
{ {
title: "活动开始时间", title: "活动时间",
key: "beginTime", key: "beginTime",
width: 230,
render (h, params) {
return h("span", (params.row.beginTime) + " - " + (params.row.endTime));
},
}, },
{
title: "活动结束时间",
key: "endTime",
},
// {
// title: '',
// key: 'company'
// },
{ {
title: "店铺", title: "店铺",
key: "shop", key: "shop",
render(h, params) { render (h, params) {
return h("span", (params.row.stores.length || 0) + "家"); return h("span", (params.row.stores[0].abbreviation) + "等" + (params.row.stores.length || 0) + "家");
}, },
}, },
{ {
title: "添加好友数", title: "添加好友数",
key: "addFriendNum", key: "addFriendNum",
render(h, params) { render (h, params) {
return h("span", (params.row.friends || 0) + "人"); return h("span", (params.row.friends || 0) + "人");
}, },
}, },
{ {
title: "参与活动客户数", title: "参与活动客户数",
key: "joinActivityClientNum", key: "joinActivityClientNum",
render(h, params) { render (h, params) {
return h("span", (params.row.friends || 0) + "人"); return h("span", (params.row.friends || 0) + "人");
}, },
}, },
{ {
title: "活动码", title: "活动码",
key: "activityCode", key: "activityCode",
render(h, p) { render (h, p) {
return h( return h(
"Button", "Button",
{ {
@ -220,7 +206,7 @@ export default {
{ {
title: "活动状态", title: "活动状态",
key: "status", key: "status",
render(h, p) { render (h, p) {
const status = p.row.status; const status = p.row.status;
if (status === 1) return h("span", "未开始"); if (status === 1) return h("span", "未开始");
if (status === 2) return h("span", "进行中"); if (status === 2) return h("span", "进行中");
@ -232,7 +218,7 @@ export default {
title: "操作", title: "操作",
key: "action", key: "action",
width: 200, width: 200,
render(h, p) { render (h, p) {
return h("div", [ return h("div", [
h( h(
"Button", "Button",
@ -259,22 +245,22 @@ export default {
], ],
}; };
}, },
mounted() { mounted () {
this.setMenuName("活动管理", "活动计划"); this.setMenuName("活动管理", "活动计划");
this.getCompanyInfo(); this.getCompanyInfo();
this.getShopInfo(); this.getShopInfo();
this.searchTable(); this.searchTable();
}, },
methods: { methods: {
doShow(show) { doShow (show) {
this.showUse = show; this.showUse = show;
}, },
getCompanyInfo() { getCompanyInfo () {
let that = this; let that = this;
let data = { let data = {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId, userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
}; };
ActivityManager.getCompany(data, function(data) { ActivityManager.getCompany(data, function (data) {
that.companyList = []; that.companyList = [];
data.data.results.forEach((element) => { data.data.results.forEach((element) => {
that.companyList.push({ that.companyList.push({
@ -284,12 +270,12 @@ export default {
}); });
}); });
}, },
getShopInfo() { getShopInfo () {
let that = this; let that = this;
let data = { let data = {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId, userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
}; };
ActivityManager.getShop(data, function(data) { ActivityManager.getShop(data, function (data) {
that.shopList = []; that.shopList = [];
data.data.results.forEach((element) => { data.data.results.forEach((element) => {
that.shopList.push({ that.shopList.push({
@ -299,34 +285,43 @@ export default {
}); });
}); });
}, },
handlePage: function(value) { handlePage: function (value) {
this.pageNum = value; this.pageNum = value;
this.searchTable(); this.searchTable();
}, },
stop(instance) { stop (instance) {
this.saving = true;
let _this = this; let _this = this;
ActivityManager.instanceTerminate({ instanceId: instance.id }, (res) => { this.$Modal.confirm({
_this.saving = false; title: '您确认要终止?',
if (res.success == undefined || !res.success) { content: '终止之后不可恢复',
that.$Message.error("终止失败!"); onOk: () => {
} else { this.saving = true;
_this.searchTable(); ActivityManager.instanceTerminate({ instanceId: instance.id }, (res) => {
_this.saving = false;
if (res.data.success == undefined || !res.data.success) {
_this.$Message.error("终止失败!");
} else {
_this.searchTable();
}
});
},
onCancel: () => {
} }
}); });
}, },
modify(instance) { modify (instance) {
this.activityInstance = instance; this.activityInstance = instance;
this.showUse = true; this.showUse = true;
store.commit("SET_useData", instance); store.commit("SET_useData", Object.assign({}, instance));
}, },
navigateCode(instance) { navigateCode (instance) {
this.$router.push({ this.$router.push({
path: "/activity/plan/code", path: "/activity/plan/code",
query: { instanceId: instance.id }, query: { instanceId: instance.id },
}); });
}, },
searchTable(params = {}) { searchTable (params = {}) {
this.loading = true; this.loading = true;
if ( if (
this.formValidate.date !== null && this.formValidate.date !== null &&

@ -117,7 +117,7 @@ export default {
ActivityManager.getCompany(data, function (data) { ActivityManager.getCompany(data, function (data) {
that.companyList = []; that.companyList = [];
that.companyListdata = data.data.results; that.companyListdata = data.data.results;
if (store.getters.useData.company.length == that.companyListdata.length) { if (store.getters.useData.company && store.getters.useData.company.length == that.companyListdata.length) {
that.allSelect = true; that.allSelect = true;
} }
data.data.results.forEach((element) => { data.data.results.forEach((element) => {

Loading…
Cancel
Save