feature_0521
郑皇 5 years ago
parent 91db056057
commit 18a18687ef

@ -1,19 +1,20 @@
<template> <template>
<div class="activityManager"> <div class="activityManager">
<Spin v-show="loading" <Spin v-show="loading" fix>加载中...</Spin>
fix>加载中...</Spin>
<Row> <Row>
<i-col class="activityListClass" <i-col
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">
<div class="schedule-image"><img class="img" <div class="schedule-image">
:src="'/kiisoo-ic' + item.logo" <img class="img" :src="'/kiisoo-ic' + item.logo" alt />
alt /></div> </div>
<div class="tipItem"> <div class="tipItem">
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
<span>{{ item.description }}</span> <span>{{ item.description }}</span>
@ -21,30 +22,26 @@
</div> </div>
<div class="operateItem"> <div class="operateItem">
<div @click="disPlayUseTable(item)">使</div> <div @click="disPlayUseTable(item)">使</div>
<div v-show="roleCode === 'GLY-ADMIN'" <div v-show="roleCode === 'GLY-ADMIN'" @click="dispalyAddActivity(item.id)"></div>
@click="dispalyAddActivity(item.id)">配置</div>
</div> </div>
</div> </div>
</Card> </Card>
</i-col> </i-col>
</Row> </Row>
<Row v-show="roleCode === 'GLY-ADMIN'"> <Row v-show="roleCode === 'GLY-ADMIN'">
<i-col span="7" <i-col span="7" offset="1">
offset="1"> <div @click="dispalyAddActivity('')" class="addactivity">
<div @click="dispalyAddActivity('')"
class="addactivity">
<span>+</span> <span>+</span>
<span>添加活动</span> <span>添加活动</span>
</div> </div>
</i-col> </i-col>
</Row> </Row>
<useTable ref="useTable" <useTable ref="useTable" @doShow="doShow" :show="showUse" :schedule="useSchedule"></useTable>
@doShow="doShow" <addActivity
:show="showUse" @dispalyAddActivityModal="dispalyAddActivityModal"
:schedule="useSchedule"></useTable>
<addActivity @dispalyAddActivityModal="dispalyAddActivityModal"
:addActivityModal="addActivityModal" :addActivityModal="addActivityModal"
:id="id"></addActivity> :id="id"
></addActivity>
</div> </div>
</template> </template>
@ -52,16 +49,16 @@
import useTable from "./useTable"; import useTable from "./useTable";
import addActivity from "./addActivity"; import addActivity from "./addActivity";
import ActivityManager from "../../services/ActivityManager/ActivityManager"; import ActivityManager from "../../services/ActivityManager/ActivityManager";
import store from '../../store'; import store from "../../store";
export default { export default {
name: "ActivityManager", name: "ActivityManager",
components: { components: {
useTable, useTable,
addActivity, addActivity
}, },
inject: ["setMenuName"], inject: ["setMenuName"],
data () { data() {
return { return {
showUse: false, showUse: false,
addActivityModal: false, addActivityModal: false,
@ -73,72 +70,75 @@ export default {
roleCode: "" roleCode: ""
}; };
}, },
created () { created() {
store.commit("RSET_useData") store.commit("RSET_useData");
}, },
mounted () { mounted() {
this.setMenuName("活动管理", "活动池"); this.setMenuName("活动管理", "活动池");
this.getActivityTable(); this.getActivityTable();
this.roleCode = sessionStorage.getItem("roleCode"); this.roleCode = sessionStorage.getItem("roleCode");
}, },
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({
value1: item.name, value1: item.name,
value2: item.description, value2: item.description
}); });
}); });
this.useModal = true; this.useModal = true;
that.loading = false; that.loading = false;
}); });
}, },
getActivityTable () { getActivityTable() {
let that = this; let that = this;
ActivityManager.getActivityList({ categoryCode: "promotion" }, function (data) { ActivityManager.getActivityList({ categoryCode: "promotion" }, function(
data
) {
that.activityList = data.data.results; that.activityList = data.data.results;
}); });
}, },
disPlayUseTable (item) { disPlayUseTable(item) {
console.log("disPlayUseTable");
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() 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();
} }
}, }
}, }
}; };
</script> </script>

@ -1,129 +1,128 @@
<template> <template>
<div> <div>
<Spin v-if="saving" <Spin v-if="saving" fix>加载中...</Spin>
fix>加载中...</Spin> <Form ref="formValidate" :model="formValidate" :label-width="80">
<Form ref="formValidate"
:model="formValidate"
:label-width="80">
<Row :gutter="10"> <Row :gutter="10">
<i-col span="6"> <i-col span="6">
<FormItem label="选择日期" <FormItem label="选择日期" prop>
prop=""> <Date-picker
<Date-picker style="width: 100%" style="width: 100%"
v-model="formValidate.date" v-model="formValidate.date"
type="daterange" type="daterange"
placement="bottom-end" placement="bottom-end"
placeholder="选择日期区间"></Date-picker> placeholder="选择日期区间"
></Date-picker>
</FormItem> </FormItem>
</i-col> </i-col>
<i-col span="6"> <i-col span="6">
<FormItem label="零售公司" <FormItem label="零售公司" prop>
prop> <Select
<Select v-model="formValidate.organizationId" v-model="formValidate.organizationId"
filterable filterable
@on-change="selectCompany" @on-change="selectCompany"
placeholder="全部" placeholder="全部"
clearable> clearable
<Option v-for="(item, index) in companyList" >
<Option
v-for="(item, index) in companyList"
:key="index" :key="index"
:value="item.value">{{ item.label }}</Option> :value="item.value"
>{{ item.label }}</Option>
</Select> </Select>
</FormItem> </FormItem>
</i-col> </i-col>
<i-col span="6"> <i-col span="6">
<FormItem label="店铺" <FormItem label="店铺" prop>
prop> <Select v-model="formValidate.storeId" filterable placeholder="全部" clearable>
<Select v-model="formValidate.storeId" <Option
filterable v-for="(item, index) in shopList"
placeholder="全部"
clearable>
<Option v-for="(item, index) in shopList"
:key="index" :key="index"
:value="item.value">{{ item.label }}</Option> :value="item.value"
>{{ item.label }}</Option>
</Select> </Select>
</FormItem> </FormItem>
</i-col> </i-col>
<i-col span="3"> <i-col span="3">
<FormItem label="活动状态" <FormItem label="活动状态" prop>
prop>
<Select v-model="formValidate.status"> <Select v-model="formValidate.status">
<Option v-for="(item, index) in activityStatusList" <Option
v-for="(item, index) in activityStatusList"
:key="index" :key="index"
:value="item.value">{{ item.label }}</Option> :value="item.value"
>{{ item.label }}</Option>
</Select> </Select>
</FormItem> </FormItem>
</i-col> </i-col>
<i-col span="3"> <i-col span="3">
<Button type="primary" <Button type="primary" @click="() => {pageNum = 1;searchTable()}">查询</Button>
@click="() => {pageNum = 1;searchTable()}">查询</Button>
</i-col> </i-col>
</Row> </Row>
<Row style="margin-top:50px"> <Row style="margin-top:50px">
<Table :loading="loading" <Table
:loading="loading"
border border
@on-row-dblclick="showDetail" @on-row-dblclick="showDetail"
:columns="columns1" :columns="columns1"
:data="data"> :data="data"
<template slot-scope="{row}" >
slot="qrCodeAction"> <template slot-scope="{row}" slot="qrCodeAction">
<img :src="require('../../../static/img/qrCode-init.png')" <img
:src="require('../../../static/img/qrCode-init.png')"
@click="navigateCode(row)" @click="navigateCode(row)"
class="table-img-qr-code" /> class="table-img-qr-code"
/>
</template> </template>
<template slot="action" <template slot="action" slot-scope="{row}">
slot-scope="{row}">
<i-col span="12"> <i-col span="12">
<Button ghost <Button
class="router-btn" ghost
@click="() => {stop(row)}">终止</Button> :class="row.status > 2 ? 'router-btn disable' : 'router-btn'"
@click="() => {stop(row)}"
>终止</Button>
</i-col> </i-col>
<i-col span="12"> <i-col span="12">
<Button ghost <Button ghost class="router-btn" @click="() => {modify(row)}">修改</Button>
class="router-btn"
@click="() => {modify(row)}">修改</Button>
</i-col> </i-col>
</template> </template>
</Table> </Table>
<Page :total="totalSize" <Page
:total="totalSize"
:current="pageNum" :current="pageNum"
:page-size="pageSize" :page-size="pageSize"
show-elevator show-elevator
show-total show-total
placement="top" placement="top"
@on-change="handlePage" @on-change="handlePage"
class-name="ks-page"></Page> class-name="ks-page"
></Page>
</Row> </Row>
</Form> </Form>
<useTable ref="useTable" <useTable
ref="useTable"
@doShow="doShow" @doShow="doShow"
:show="showUse" :show="showUse"
:isModify="true" :isModify="true"
:schedule="activityInstance.scheduleVO"></useTable> :schedule="activityInstance.scheduleVO"
<Modal v-model="isShowDetail" ></useTable>
title="活动计划详情" <Modal v-model="isShowDetail" title="活动计划详情" width="70%" :footer-hide="true">
width="70%" <planDetail v-if="isShowDetail" :detail="detail"></planDetail>
:footer-hide="true">
<planDetail v-if="isShowDetail"
:detail="detail"></planDetail>
</Modal> </Modal>
<!-- 预览二维码 --> <!-- 预览二维码 -->
<Modal v-model="isShow" <Modal
v-model="isShow"
:title="showStoreName" :title="showStoreName"
:footer-hide="true" :footer-hide="true"
width="230" width="230"
class-name="vertical-center-modal" class-name="vertical-center-modal"
@on-ok="ok"> @on-ok="ok"
>
<div slot="header"> <div slot="header">
<p></p> <p></p>
</div> </div>
<p>{{this.showStoreName}}</p> <p>{{this.showStoreName}}</p>
<img :src="qrCodeImage" <img :src="qrCodeImage" style="width:200px;height:200px;" />
style="width:200px;height:200px;" />
<div style="text-align: center;"> <div style="text-align: center;">
<Button ghost <Button ghost type="primary" @click="download(rowData)"></Button>
type="primary"
@click="download(rowData)">下载</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
@ -143,7 +142,7 @@ export default {
useTable, useTable,
planDetail planDetail
}, },
data () { data() {
const _this = this; const _this = this;
return { return {
showStoreName: "", showStoreName: "",
@ -162,14 +161,14 @@ export default {
shopList: [], shopList: [],
showUse: false, showUse: false,
activityInstance: {}, activityInstance: {},
qrCodeImage: '', qrCodeImage: "",
formValidate: { formValidate: {
date: null, date: null,
organizationId: null, organizationId: null,
storeId: null, storeId: null,
status: 2, status: 2,
startDate: null, startDate: null,
endDate: null, endDate: null
}, },
startDateOptions: {}, startDateOptions: {},
endDateOptions: {}, endDateOptions: {},
@ -204,7 +203,7 @@ export default {
width: 60, width: 60,
align: "center", align: "center",
title: "序号", title: "序号",
render (h, params) { render(h, params) {
let num = parseInt(params.index) + 1; let num = parseInt(params.index) + 1;
console.log(_this.pageSize); console.log(_this.pageSize);
if (_this.pageSize > 1) { if (_this.pageSize > 1) {
@ -220,7 +219,7 @@ export default {
{ {
title: "活动类型", title: "活动类型",
key: "scheduleVO.name", key: "scheduleVO.name",
render (h, params) { render(h, params) {
return h("span", params.row["params"][0]["name"]); return h("span", params.row["params"][0]["name"]);
} }
}, },
@ -228,14 +227,14 @@ export default {
title: "活动时间", title: "活动时间",
key: "beginTime", key: "beginTime",
width: 230, width: 230,
render (h, params) { render(h, params) {
return h("span", params.row.beginTime + " - " + params.row.endTime); return h("span", params.row.beginTime + " - " + params.row.endTime);
} }
}, },
{ {
title: "零售公司", title: "零售公司",
key: "shop", key: "shop",
render (h, params) { render(h, params) {
return h( return h(
"span", "span",
params.row.companyName + params.row.companyName +
@ -248,7 +247,7 @@ export default {
{ {
title: "店铺", title: "店铺",
key: "shop", key: "shop",
render (h, params) { render(h, params) {
return h( return h(
"span", "span",
params.row.storeName + params.row.storeName +
@ -261,21 +260,21 @@ export default {
{ {
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: "活动码",
slot: 'qrCodeAction', slot: "qrCodeAction",
className: 'table-width-80', className: "table-width-80"
// render (h, p) { // render (h, p) {
// return h( // return h(
// "Button", // "Button",
@ -290,7 +289,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", "进行中");
@ -300,8 +299,8 @@ export default {
}, },
{ {
title: "操作", title: "操作",
slot: 'action', slot: "action",
width: 200, width: 200
// render (h, p) { // render (h, p) {
// let r = [ // let r = [
// h( // h(
@ -333,30 +332,30 @@ 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;
this.searchTable(); this.searchTable();
}, },
showDetail (detail) { showDetail(detail) {
let _this = this; let _this = this;
this.getDetail(detail.id).then(res => { this.getDetail(detail.id).then(res => {
_this.detail = res; _this.detail = res;
_this.isShowDetail = true; _this.isShowDetail = true;
}); });
}, },
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({
@ -366,18 +365,18 @@ export default {
}); });
}); });
}, },
selectCompany (value) { selectCompany(value) {
this.customerId = value; this.customerId = value;
this.getShopInfo(); this.getShopInfo();
}, },
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,
customerIds: this.customerId, customerIds: this.customerId,
scheduleId: null scheduleId: null
}; };
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({
@ -387,11 +386,14 @@ export default {
}); });
}); });
}, },
handlePage: function (value) { handlePage: function(value) {
this.pageNum = value; this.pageNum = value;
this.searchTable(); this.searchTable();
}, },
stop (instance) { stop(instance) {
if (instance.status > 2) {
return;
}
let _this = this; let _this = this;
this.$Modal.confirm({ this.$Modal.confirm({
title: "您确认要终止?", title: "您确认要终止?",
@ -410,10 +412,10 @@ export default {
} }
); );
}, },
onCancel: () => { } onCancel: () => {}
}); });
}, },
getDetail (instanceId) { getDetail(instanceId) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
ActivityManager.instanceDetail( ActivityManager.instanceDetail(
{ {
@ -425,7 +427,7 @@ export default {
); );
}); });
}, },
modify (instance) { modify(instance) {
let _this = this; let _this = this;
this.getDetail(instance.id).then(res => { this.getDetail(instance.id).then(res => {
store.commit("SET_useData", res); store.commit("SET_useData", res);
@ -433,13 +435,14 @@ export default {
_this.showUse = true; _this.showUse = true;
}); });
}, },
navigateCode (instance) { navigateCode(instance) {
return;
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 &&
@ -463,7 +466,7 @@ export default {
if (params.status == 0) { if (params.status == 0) {
params.status = undefined; params.status = undefined;
} }
params.categoryCode = "promotion" params.categoryCode = "promotion";
params.date = undefined; params.date = undefined;
http.get("/activity/instance/list", params).then(res => { http.get("/activity/instance/list", params).then(res => {
const data = res.data.results.this || {}; const data = res.data.results.this || {};
@ -472,46 +475,53 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
startDateChange: function (e) { startDateChange: function(e) {
// //
this.endDateOptions = { this.endDateOptions = {
disabledDate: date => { disabledDate: date => {
let startTime = this.formValidate.startDate ? new Date(this.formValidate.startDate).valueOf() : ''; let startTime = this.formValidate.startDate
return date && (date.valueOf() < startTime) ? new Date(this.formValidate.startDate).valueOf()
} : "";
return date && date.valueOf() < startTime;
} }
};
}, },
endDateChange: function (e) { endDateChange: function(e) {
// //
let endTime = this.formValidate.endDate ? new Date(this.formValidate.endDate).valueOf() - 1 * 24 * 60 * 60 * 1000 : ''; let endTime = this.formValidate.endDate
? new Date(this.formValidate.endDate).valueOf() -
1 * 24 * 60 * 60 * 1000
: "";
this.startDateOptions = { this.startDateOptions = {
disabledDate: date => { disabledDate: date => {
return date && (date.valueOf() > endTime); return date && date.valueOf() > endTime;
}
} }
};
}, },
show: function (index) { show: function(index) {
this.isShow = true; this.isShow = true;
this.showStoreName = index.name; this.showStoreName = index.name;
this.qrCodeImage = index.qrCodeAction; this.qrCodeImage = index.qrCodeAction;
this.rowData = index; this.rowData = index;
}, },
hide: function () { hide: function() {
this.isShow = false; this.isShow = false;
}, },
// //
download: function (index) { download: function(index) {
debugger debugger;
let fileName = index.name + "-门店码"; let fileName = index.name + "-门店码";
http.downloadImg({ http.downloadImg(
{
url: index.qrCodeAction url: index.qrCodeAction
}, fileName, function (/*data*/) {
})
}, },
ok: function () { fileName,
this.isShow = false; function(/*data*/) {}
);
}, },
ok: function() {
this.isShow = false;
}
} }
}; };
</script> </script>
@ -528,6 +538,9 @@ export default {
color: #3496eb !important; color: #3496eb !important;
margin-left: -15px; margin-left: -15px;
} }
.router-btn.disable {
color: #999 !important;
}
.table-img-qr-code { .table-img-qr-code {
margin-left: 5px; margin-left: 5px;
margin-top: 5px; margin-top: 5px;

@ -1,5 +1,12 @@
<template> <template>
<Modal v-model="dispalyModal" width="1000" :loading="true" :mask-closable="false"> <Modal
v-model="dispalyModal"
width="1000"
:loading="true"
:mask-closable="false"
@on-visible-change="visibleChange"
@on-cancel="cancel"
>
<p slot="header" style="color:#f60;text-align:left"> <p slot="header" style="color:#f60;text-align:left">
<span>配置活动</span> <span>配置活动</span>
</p> </p>
@ -176,6 +183,11 @@ export default {
this.formValidate.params.splice(index, 1); this.formValidate.params.splice(index, 1);
this.$forceUpdate(); this.$forceUpdate();
}, },
visibleChange(show) {
if (!show) {
this.$emit("dispalyAddActivityModal", false, false);
}
},
cancel() { cancel() {
this.$emit("dispalyAddActivityModal", false, false); this.$emit("dispalyAddActivityModal", false, false);
}, },

@ -1,49 +1,46 @@
<template> <template>
<div class="use_box"> <div class="use_box">
<Modal :scrollable="false" <Modal
:scrollable="false"
v-model="showUse" v-model="showUse"
title="使用活动" title="使用活动"
@on-cancel="cancel" @on-cancel="cancel"
:loading="true" :loading="true"
width="70%"> width="70%"
<Steps style="padding: 40px;" @on-visible-change="visibleChange"
:current="currentStep"> >
<Steps style="padding: 40px;" :current="currentStep">
<Step title="基本信息"></Step> <Step title="基本信息"></Step>
<Step :title="isModify ? '修改零售公司' : '选择零售公司'" <Step :title="isModify ? '修改零售公司' : '选择零售公司'" content></Step>
content></Step> <Step :title="isModify ? '修改店铺' : '选择店铺'" content></Step>
<Step :title="isModify ? '修改店铺' : '选择店铺'" <Step title="确认信息" content></Step>
content></Step>
<Step title="确认信息"
content></Step>
</Steps> </Steps>
<useActivityStepOne :schedule="schedule" <useActivityStepOne :schedule="schedule" :isModify="isModify" v-if="currentStep == 0 && show"></useActivityStepOne>
:isModify="isModify" <useActivityStepTwo :schedule="schedule" :isModify="isModify" v-if="currentStep == 1"></useActivityStepTwo>
v-if="currentStep == 0 && show"></useActivityStepOne> <useActivityStepThree :schedule="schedule" :isModify="isModify" v-if="currentStep == 2"></useActivityStepThree>
<useActivityStepTwo :schedule="schedule" <useActivityStepFoure :schedule="schedule" :isModify="isModify" v-if="currentStep == 3"></useActivityStepFoure>
:isModify="isModify"
v-if="currentStep == 1"></useActivityStepTwo>
<useActivityStepThree :schedule="schedule"
:isModify="isModify"
v-if="currentStep == 2"></useActivityStepThree>
<useActivityStepFoure :schedule="schedule"
:isModify="isModify"
v-if="currentStep == 3"></useActivityStepFoure>
<div slot="footer"> <div slot="footer">
<Button v-if="currentStep !== 0" <Button
v-if="currentStep !== 0"
type="primary" type="primary"
shape="circle" shape="circle"
:loading="modal_loading" :loading="modal_loading"
@click="back">上一步</Button> @click="back"
<Button v-if="currentStep !== 3" >上一步</Button>
<Button
v-if="currentStep !== 3"
type="primary" type="primary"
shape="circle" shape="circle"
:loading="modal_loading" :loading="modal_loading"
@click="next">下一步</Button> @click="next"
<Button v-if="currentStep == 3" >下一步</Button>
<Button
v-if="currentStep == 3"
type="primary" type="primary"
shape="circle" shape="circle"
:loading="modal_loading" :loading="modal_loading"
@click="finish">完成</Button> @click="finish"
>完成</Button>
</div> </div>
</Modal> </Modal>
</div> </div>
@ -55,20 +52,21 @@ import useActivityStepThree from "./useActivityStepThree";
import useActivityStepFoure from "./useActivityStepFoure"; import useActivityStepFoure from "./useActivityStepFoure";
import ActivityManager from "../../services/ActivityManager/ActivityManager"; import ActivityManager from "../../services/ActivityManager/ActivityManager";
import store from "../../store/index"; import store from "../../store/index";
import { formatDate } from '../../utils/Common'; import { formatDate } from "../../utils/Common";
export default { export default {
name: "useTable", name: "useTable",
components: { components: {
useActivityStepOne, useActivityStepOne,
useActivityStepTwo, useActivityStepTwo,
useActivityStepThree, useActivityStepThree,
useActivityStepFoure, useActivityStepFoure
}, },
data () { inject: ["setMenuName"],
data() {
return { return {
currentStep: 0, currentStep: 0,
modal_loading: false, modal_loading: false,
showUse: false, showUse: false
}; };
}, },
props: { props: {
@ -85,26 +83,27 @@ export default {
} }
}, },
watch: { watch: {
show () { show() {
this.showUse = this.show; this.showUse = this.show;
}, },
schedule () { schedule() {
store.getters.useData.scheduleId = this.schedule.id; store.getters.useData.scheduleId = this.schedule.id;
}
}, },
created() {
this.setMenuName("活动管理", "活动计划");
}, },
mounted () { }, mounted() {},
methods: { methods: {
cancel () { visibleChange(show) {},
this.currentStep = 0; cancel() {
},
cancel () {
store.commit("RSET_useData"); store.commit("RSET_useData");
this.$emit("doShow", false); this.$emit("doShow", false);
this.modal_loading = false; this.modal_loading = false;
this.showUse = false; this.showUse = false;
this.currentStep = 0; this.currentStep = 0;
}, },
next () { next() {
let data = store.getters.useData; let data = store.getters.useData;
data.name = this.schedule.name; data.name = this.schedule.name;
if (this.currentStep === 0) { if (this.currentStep === 0) {
@ -143,19 +142,19 @@ export default {
if (typeof data.endTime == "object") { if (typeof data.endTime == "object") {
data.endTime = formatDate(data.endTime); data.endTime = formatDate(data.endTime);
} }
console.log("data", data) console.log("data", data);
store.commit("SET_useData", data); store.commit("SET_useData", data);
this.currentStep = this.currentStep + 1; this.currentStep = this.currentStep + 1;
}, },
back () { back() {
this.currentStep = this.currentStep - 1; this.currentStep = this.currentStep - 1;
}, },
finish () { finish() {
let that = this; let that = this;
let data = store.getters.useData; let data = store.getters.useData;
data.isGetActivityInfo = true; data.isGetActivityInfo = true;
this.modal_loading = true; this.modal_loading = true;
ActivityManager.saveActivityData(store.getters.useData, function (data) { ActivityManager.saveActivityData(store.getters.useData, function(data) {
store.commit("RSET_useData"); store.commit("RSET_useData");
that.$emit("doShow", false); that.$emit("doShow", false);
that.$router.push("/activity/plan"); that.$router.push("/activity/plan");
@ -163,8 +162,8 @@ export default {
that.modal_loading = false; that.modal_loading = false;
that.showUse = false; that.showUse = false;
}); });
}, }
}, }
}; };
</script> </script>

@ -85,7 +85,7 @@
</Row> </Row>
<Modal v-model="showMessageTypes" title="添加图片/网页/小程序消息" :footer-hide="true"> <Modal v-model="showMessageTypes" title="添加图片/网页/小程序消息" :footer-hide="true">
<Row :gutter="24"> <Row :gutter="24">
<i-col :span="8"> <i-col :span="8" v-if="imageFilter()">
<Upload <Upload
ref="upload" ref="upload"
:show-upload-list="false" :show-upload-list="false"
@ -105,10 +105,10 @@
</Upload> </Upload>
</i-col> </i-col>
<i-col :span="8"> <i-col :span="8">
<Button long @click="doShowWeb" type="primary"></Button> <Button long @click="doShowWeb" v-if="webFilter()" type="primary"></Button>
</i-col> </i-col>
<i-col :span="8"> <i-col :span="8">
<Button long @click="doShowMini" type="primary">小程</Button> <Button long @click="doShowMini" v-if="miniFilter()" type="primary"></Button>
</i-col> </i-col>
</Row> </Row>
</Modal> </Modal>
@ -260,6 +260,21 @@ export default {
selectStoreStep selectStoreStep
}, },
methods: { methods: {
webFilter() {
return (
this._.filter(this.welcome.params, item => item.type == 2).length < 1
);
},
imageFilter() {
return (
this._.filter(this.welcome.params, item => item.type == 1).length < 1
);
},
miniFilter() {
return (
this._.filter(this.welcome.params, item => item.type == 3).length < 1
);
},
doShow() { doShow() {
this.showStoreCheck = false; this.showStoreCheck = false;
this.welcome = store.getters.useData; this.welcome = store.getters.useData;
@ -423,6 +438,39 @@ export default {
_this.loading = false; _this.loading = false;
return false; return false;
} }
// let params = this.welcome.params;
// let imageCount = 0;
// let webCount = 0;
// let miniCount = 0;
// for (const key in params) {
// if (params.hasOwnProperty(key)) {
// const element = params[key];
// if (element.type == 1) {
// imageCount++;
// }
// if (element.type == 2) {
// webCount++;
// }
// if (element.type == 3) {
// miniCount++;
// }
// }
// }
// if (imageCount > 1) {
// _this.loading = false;
// _this.$Message.error("");
// return false;
// }
// if (webCount > 1) {
// _this.loading = false;
// _this.$Message.error("");
// return false;
// }
// if (miniCount > 1) {
// _this.loading = false;
// _this.$Message.error("");
// return false;
// }
this.$refs["welcomeForm"].validate(valid => { this.$refs["welcomeForm"].validate(valid => {
if (valid) { if (valid) {
let data = _this.welcome; let data = _this.welcome;

Loading…
Cancel
Save