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

@ -1,19 +1,20 @@
<template>
<div class="activityManager">
<Spin v-show="loading"
fix>加载中...</Spin>
<Spin v-show="loading" fix>加载中...</Spin>
<Row>
<i-col class="activityListClass"
<i-col
class="activityListClass"
v-for="(item, index) in activityList"
:key="index"
span="7"
offset="1">
offset="1"
>
<Card>
<div class="operateAndThemeItem">
<div class="ThemeItem">
<div class="schedule-image"><img class="img"
:src="'/kiisoo-ic' + item.logo"
alt /></div>
<div class="schedule-image">
<img class="img" :src="'/kiisoo-ic' + item.logo" alt />
</div>
<div class="tipItem">
<span>{{ item.name }}</span>
<span>{{ item.description }}</span>
@ -21,30 +22,26 @@
</div>
<div class="operateItem">
<div @click="disPlayUseTable(item)">使</div>
<div v-show="roleCode === 'GLY-ADMIN'"
@click="dispalyAddActivity(item.id)">配置</div>
<div v-show="roleCode === 'GLY-ADMIN'" @click="dispalyAddActivity(item.id)"></div>
</div>
</div>
</Card>
</i-col>
</Row>
<Row v-show="roleCode === 'GLY-ADMIN'">
<i-col span="7"
offset="1">
<div @click="dispalyAddActivity('')"
class="addactivity">
<i-col span="7" offset="1">
<div @click="dispalyAddActivity('')" class="addactivity">
<span>+</span>
<span>添加活动</span>
</div>
</i-col>
</Row>
<useTable ref="useTable"
@doShow="doShow"
:show="showUse"
:schedule="useSchedule"></useTable>
<addActivity @dispalyAddActivityModal="dispalyAddActivityModal"
<useTable ref="useTable" @doShow="doShow" :show="showUse" :schedule="useSchedule"></useTable>
<addActivity
@dispalyAddActivityModal="dispalyAddActivityModal"
:addActivityModal="addActivityModal"
:id="id"></addActivity>
:id="id"
></addActivity>
</div>
</template>
@ -52,13 +49,13 @@
import useTable from "./useTable";
import addActivity from "./addActivity";
import ActivityManager from "../../services/ActivityManager/ActivityManager";
import store from '../../store';
import store from "../../store";
export default {
name: "ActivityManager",
components: {
useTable,
addActivity,
addActivity
},
inject: ["setMenuName"],
data() {
@ -74,7 +71,7 @@ export default {
};
},
created() {
store.commit("RSET_useData")
store.commit("RSET_useData");
},
mounted() {
this.setMenuName("活动管理", "活动池");
@ -88,15 +85,15 @@ export default {
getActivityData(id) {
let that = this;
let data = {
instanceId: id,
instanceId: id
};
that.loading = true;
ActivityManager.getActivityInfo(data, function(data) {
that.inputActivityList = [];
data.data.results.params.forEach((item) => {
data.data.results.params.forEach(item => {
that.inputActivityList.push({
value1: item.name,
value2: item.description,
value2: item.description
});
});
this.useModal = true;
@ -105,21 +102,24 @@ export default {
},
getActivityTable() {
let that = this;
ActivityManager.getActivityList({ categoryCode: "promotion" }, function (data) {
ActivityManager.getActivityList({ categoryCode: "promotion" }, function(
data
) {
that.activityList = data.data.results;
});
},
disPlayUseTable(item) {
console.log("disPlayUseTable");
let that = this;
let data = {
id: item.id,
id: item.id
};
// let data = new FormData()
// data.append('instanceId', item.id)
ActivityManager.getActivityInfo(data, function(data) {
that.useSchedule = data.data.results;
that.showUse = true;
that.$forceUpdate()
that.$forceUpdate();
});
},
dispalyAddActivity(id) {
@ -137,8 +137,8 @@ export default {
if (isCancle === true) {
this.getActivityTable();
}
},
},
}
}
};
</script>

@ -1,129 +1,128 @@
<template>
<div>
<Spin v-if="saving"
fix>加载中...</Spin>
<Form ref="formValidate"
:model="formValidate"
:label-width="80">
<Spin v-if="saving" fix>加载中...</Spin>
<Form ref="formValidate" :model="formValidate" :label-width="80">
<Row :gutter="10">
<i-col span="6">
<FormItem label="选择日期"
prop="">
<Date-picker style="width: 100%"
<FormItem label="选择日期" prop>
<Date-picker
style="width: 100%"
v-model="formValidate.date"
type="daterange"
placement="bottom-end"
placeholder="选择日期区间"></Date-picker>
placeholder="选择日期区间"
></Date-picker>
</FormItem>
</i-col>
<i-col span="6">
<FormItem label="零售公司"
prop>
<Select v-model="formValidate.organizationId"
<FormItem label="零售公司" prop>
<Select
v-model="formValidate.organizationId"
filterable
@on-change="selectCompany"
placeholder="全部"
clearable>
<Option v-for="(item, index) in companyList"
clearable
>
<Option
v-for="(item, index) in companyList"
:key="index"
:value="item.value">{{ item.label }}</Option>
:value="item.value"
>{{ item.label }}</Option>
</Select>
</FormItem>
</i-col>
<i-col span="6">
<FormItem label="店铺"
prop>
<Select v-model="formValidate.storeId"
filterable
placeholder="全部"
clearable>
<Option v-for="(item, index) in shopList"
<FormItem label="店铺" prop>
<Select v-model="formValidate.storeId" filterable placeholder="全部" clearable>
<Option
v-for="(item, index) in shopList"
:key="index"
:value="item.value">{{ item.label }}</Option>
:value="item.value"
>{{ item.label }}</Option>
</Select>
</FormItem>
</i-col>
<i-col span="3">
<FormItem label="活动状态"
prop>
<FormItem label="活动状态" prop>
<Select v-model="formValidate.status">
<Option v-for="(item, index) in activityStatusList"
<Option
v-for="(item, index) in activityStatusList"
:key="index"
:value="item.value">{{ item.label }}</Option>
:value="item.value"
>{{ item.label }}</Option>
</Select>
</FormItem>
</i-col>
<i-col span="3">
<Button type="primary"
@click="() => {pageNum = 1;searchTable()}">查询</Button>
<Button type="primary" @click="() => {pageNum = 1;searchTable()}">查询</Button>
</i-col>
</Row>
<Row style="margin-top:50px">
<Table :loading="loading"
<Table
:loading="loading"
border
@on-row-dblclick="showDetail"
:columns="columns1"
:data="data">
<template slot-scope="{row}"
slot="qrCodeAction">
<img :src="require('../../../static/img/qrCode-init.png')"
:data="data"
>
<template slot-scope="{row}" slot="qrCodeAction">
<img
:src="require('../../../static/img/qrCode-init.png')"
@click="navigateCode(row)"
class="table-img-qr-code" />
class="table-img-qr-code"
/>
</template>
<template slot="action"
slot-scope="{row}">
<template slot="action" slot-scope="{row}">
<i-col span="12">
<Button ghost
class="router-btn"
@click="() => {stop(row)}">终止</Button>
<Button
ghost
:class="row.status > 2 ? 'router-btn disable' : 'router-btn'"
@click="() => {stop(row)}"
>终止</Button>
</i-col>
<i-col span="12">
<Button ghost
class="router-btn"
@click="() => {modify(row)}">修改</Button>
<Button ghost class="router-btn" @click="() => {modify(row)}">修改</Button>
</i-col>
</template>
</Table>
<Page :total="totalSize"
<Page
:total="totalSize"
:current="pageNum"
:page-size="pageSize"
show-elevator
show-total
placement="top"
@on-change="handlePage"
class-name="ks-page"></Page>
class-name="ks-page"
></Page>
</Row>
</Form>
<useTable ref="useTable"
<useTable
ref="useTable"
@doShow="doShow"
:show="showUse"
:isModify="true"
:schedule="activityInstance.scheduleVO"></useTable>
<Modal v-model="isShowDetail"
title="活动计划详情"
width="70%"
:footer-hide="true">
<planDetail v-if="isShowDetail"
:detail="detail"></planDetail>
:schedule="activityInstance.scheduleVO"
></useTable>
<Modal v-model="isShowDetail" title="活动计划详情" width="70%" :footer-hide="true">
<planDetail v-if="isShowDetail" :detail="detail"></planDetail>
</Modal>
<!-- 预览二维码 -->
<Modal v-model="isShow"
<Modal
v-model="isShow"
:title="showStoreName"
:footer-hide="true"
width="230"
class-name="vertical-center-modal"
@on-ok="ok">
@on-ok="ok"
>
<div slot="header">
<p></p>
</div>
<p>{{this.showStoreName}}</p>
<img :src="qrCodeImage"
style="width:200px;height:200px;" />
<img :src="qrCodeImage" style="width:200px;height:200px;" />
<div style="text-align: center;">
<Button ghost
type="primary"
@click="download(rowData)">下载</Button>
<Button ghost type="primary" @click="download(rowData)"></Button>
</div>
</Modal>
</div>
@ -162,14 +161,14 @@ export default {
shopList: [],
showUse: false,
activityInstance: {},
qrCodeImage: '',
qrCodeImage: "",
formValidate: {
date: null,
organizationId: null,
storeId: null,
status: 2,
startDate: null,
endDate: null,
endDate: null
},
startDateOptions: {},
endDateOptions: {},
@ -274,8 +273,8 @@ export default {
},
{
title: "活动码",
slot: 'qrCodeAction',
className: 'table-width-80',
slot: "qrCodeAction",
className: "table-width-80"
// render (h, p) {
// return h(
// "Button",
@ -300,8 +299,8 @@ export default {
},
{
title: "操作",
slot: 'action',
width: 200,
slot: "action",
width: 200
// render (h, p) {
// let r = [
// h(
@ -392,6 +391,9 @@ export default {
this.searchTable();
},
stop(instance) {
if (instance.status > 2) {
return;
}
let _this = this;
this.$Modal.confirm({
title: "您确认要终止?",
@ -434,6 +436,7 @@ export default {
});
},
navigateCode(instance) {
return;
this.$router.push({
path: "/activity/plan/code",
query: { instanceId: instance.id }
@ -463,7 +466,7 @@ export default {
if (params.status == 0) {
params.status = undefined;
}
params.categoryCode = "promotion"
params.categoryCode = "promotion";
params.date = undefined;
http.get("/activity/instance/list", params).then(res => {
const data = res.data.results.this || {};
@ -476,19 +479,24 @@ export default {
//
this.endDateOptions = {
disabledDate: date => {
let startTime = this.formValidate.startDate ? new Date(this.formValidate.startDate).valueOf() : '';
return date && (date.valueOf() < startTime)
}
let startTime = this.formValidate.startDate
? new Date(this.formValidate.startDate).valueOf()
: "";
return date && date.valueOf() < startTime;
}
};
},
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 = {
disabledDate: date => {
return date && (date.valueOf() > endTime);
}
return date && date.valueOf() > endTime;
}
};
},
show: function(index) {
this.isShow = true;
@ -501,17 +509,19 @@ export default {
},
//
download: function(index) {
debugger
debugger;
let fileName = index.name + "-门店码";
http.downloadImg({
http.downloadImg(
{
url: index.qrCodeAction
}, fileName, function (/*data*/) {
})
},
fileName,
function(/*data*/) {}
);
},
ok: function() {
this.isShow = false;
},
}
}
};
</script>
@ -528,6 +538,9 @@ export default {
color: #3496eb !important;
margin-left: -15px;
}
.router-btn.disable {
color: #999 !important;
}
.table-img-qr-code {
margin-left: 5px;
margin-top: 5px;

@ -1,5 +1,12 @@
<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">
<span>配置活动</span>
</p>
@ -176,6 +183,11 @@ export default {
this.formValidate.params.splice(index, 1);
this.$forceUpdate();
},
visibleChange(show) {
if (!show) {
this.$emit("dispalyAddActivityModal", false, false);
}
},
cancel() {
this.$emit("dispalyAddActivityModal", false, false);
},

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

@ -85,7 +85,7 @@
</Row>
<Modal v-model="showMessageTypes" title="添加图片/网页/小程序消息" :footer-hide="true">
<Row :gutter="24">
<i-col :span="8">
<i-col :span="8" v-if="imageFilter()">
<Upload
ref="upload"
:show-upload-list="false"
@ -105,10 +105,10 @@
</Upload>
</i-col>
<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 :span="8">
<Button long @click="doShowMini" type="primary">小程</Button>
<Button long @click="doShowMini" v-if="miniFilter()" type="primary"></Button>
</i-col>
</Row>
</Modal>
@ -260,6 +260,21 @@ export default {
selectStoreStep
},
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() {
this.showStoreCheck = false;
this.welcome = store.getters.useData;
@ -423,6 +438,39 @@ export default {
_this.loading = 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 => {
if (valid) {
let data = _this.welcome;

Loading…
Cancel
Save