feature_0521
郑皇 6 years ago
parent ba02ce7252
commit c432ef5d34

@ -1,22 +1,21 @@
<template>
<div class="activity_code">
<Table :loading="loading"
border
:columns="columns"
:data="data"></Table>
<Page :total="totalSize"
<Table :loading="loading" border :columns="columns" :data="data"></Table>
<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>
</div>
</template>
<script>
import { activityCodeList } from '../../services/ActivityManager/ActivityManager';
import { activityCodeList } from "../../services/ActivityManager/ActivityManager";
export default {
name: "ActivityCode",
data() {
@ -67,14 +66,20 @@ export default {
title: "推广码",
key: "qrCode",
render(h, params) {
return h("div", {
class: "qrcode" }, [
return h(
"div",
{
class: "qrcode",
},
[
h(
"Button",
{
props: { type: "primary", size: "small" },
style: { marginRight: "8px" },
on: { "mouseover.native": () => _this.showQrcode(params.row) }
on: {
"mouseover.native": () => _this.showQrcode(params.row),
},
},
"二维码"
),
@ -82,14 +87,12 @@ export default {
"div",
{
class: "qrcodeBox",
style: { display: "none" }
}, [
h(
"img",
{ attrs: { src: params.row.qrCode } }
)]
)
]);
style: { display: "none" },
},
[h("img", { attrs: { src: params.row.qrCode } })]
),
]
);
},
},
{
@ -108,11 +111,11 @@ export default {
},
},
"查看导购码"
)
),
]);
},
},
]
],
};
},
created() {
@ -125,7 +128,7 @@ export default {
this.load();
},
showQrcode(row) {
console.log(row)
console.log(row);
},
load(params = {}) {
let _this = this;
@ -133,15 +136,14 @@ export default {
params.pageSize = this.pageSize;
params.pageNum = this.pageNum;
params.instanceId = this.instanceId;
activityCodeList(params, res => {
_this.data = res.data.results.this.records
_this.totalSize = res.data.results.this.total
activityCodeList(params, (res) => {
_this.data = res.data.results.this.records;
_this.totalSize = res.data.results.this.total;
_this.loading = false;
})
}
}
});
},
},
};
</script>
<style>
</style>
<style></style>

@ -1,92 +1,103 @@
<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="4">
<FormItem label="选择日期"
prop="">
<Date-picker v-model="formValidate.date"
<FormItem label="选择日期" prop="">
<Date-picker
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 }}
:value="item.value"
>{{ item.label }}
</Option>
</Select>
</FormItem>
</i-col>
<i-col span="6">
<FormItem label="店铺"
prop="">
<Select v-model="formValidate.storeId"
<FormItem label="店铺" prop="">
<Select
v-model="formValidate.storeId"
filterable
placeholder="全部"
clearable>
<Option v-for="(item, index) in shopList"
clearable
>
<Option
v-for="(item, index) in shopList"
:key="index"
:value="item.value">{{ item.label }}
:value="item.value"
>{{ item.label }}
</Option>
</Select>
</FormItem>
</i-col>
<i-col span="4">
<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 }}
:value="item.value"
>{{ item.label }}
</Option>
</Select>
</FormItem>
</i-col>
<i-col span="4">
<Button type="primary"
@click="searchTable">查询</Button>
<Button type="primary" @click="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"></Table>
<Page :total="totalSize"
:data="data"
></Table>
<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"
:schedule="activityInstance.scheduleVO"
></useTable>
<Modal
v-model="isShowDetail"
title="活动计划详情"
width="70%"
:footer-hide="true">
<planDetail v-if="isShowDetail"
:detail="detail"></planDetail>
:footer-hide="true"
>
<planDetail v-if="isShowDetail" :detail="detail"></planDetail>
</Modal>
</div>
</template>
@ -97,12 +108,13 @@ import useTable from "./useTable";
import http from "../../services/CommonHttp";
import { formatDate } from "../../utils/Common";
import store from "../../store";
import planDetail from './PlanDetail';
import planDetail from "./PlanDetail";
export default {
name: "ActivityPlan",
inject: ["setMenuName"],
components: {
useTable, planDetail
useTable,
planDetail,
},
data() {
const _this = this;
@ -150,13 +162,14 @@ export default {
{
label: "已结束",
value: 3,
}
},
],
columns1: [
{
type: "index",
width: 60,
align: "center",
title: "序号",
},
{
title: "活动名称",
@ -174,21 +187,33 @@ export default {
key: "beginTime",
width: 230,
render(h, params) {
return h("span", (params.row.beginTime) + " - " + (params.row.endTime));
return h("span", params.row.beginTime + " - " + params.row.endTime);
},
},
{
title: "零售公司",
key: "shop",
render(h, params) {
return h("span", (params.row.companyName) + "等" + (params.row.companyCount || 0) + "家公司");
return h(
"span",
params.row.companyName +
"等" +
(params.row.companyCount || 0) +
"家公司"
);
},
},
{
title: "店铺",
key: "shop",
render(h, params) {
return h("span", (params.row.storeName) + "等" + (params.row.storeCount || 0) + "家店铺");
return h(
"span",
params.row.storeName +
"等" +
(params.row.storeCount || 0) +
"家店铺"
);
},
},
{
@ -273,10 +298,10 @@ export default {
},
showDetail(detail) {
let _this = this;
this.getDetail(detail.id).then(res => {
this.getDetail(detail.id).then((res) => {
_this.detail = res;
_this.isShowDetail = true;
})
});
},
getCompanyInfo() {
let that = this;
@ -301,7 +326,7 @@ export default {
let that = this;
let data = {
userId: JSON.parse(sessionStorage.getItem("loginInfo")).userId,
customerIds: this.customerId
customerIds: this.customerId,
};
ActivityManager.getShop(data, function(data) {
that.shopList = [];
@ -320,40 +345,44 @@ export default {
stop(instance) {
let _this = this;
this.$Modal.confirm({
title: '您确认要终止?',
content: '终止之后不可恢复',
title: "您确认要终止?",
content: "终止之后不可恢复",
onOk: () => {
this.saving = true;
ActivityManager.instanceTerminate({ instanceId: instance.id }, (res) => {
ActivityManager.instanceTerminate(
{ instanceId: instance.id },
(res) => {
_this.saving = false;
if (res.data.success == undefined || !res.data.success) {
_this.$Message.error("终止失败!");
} else {
_this.searchTable();
}
});
},
onCancel: () => {
}
);
},
onCancel: () => {},
});
},
getDetail(instanceId) {
return new Promise((resolve, reject) => {
ActivityManager.instanceDetail({
instanceId
}, res => {
resolve(res.data.results)
ActivityManager.instanceDetail(
{
instanceId,
},
(res) => {
resolve(res.data.results);
}
);
});
})
},
modify(instance) {
let _this = this;
this.getDetail(instance.id).then(res => {
this.getDetail(instance.id).then((res) => {
store.commit("SET_useData", res);
_this.activityInstance = res;
_this.showUse = true;
})
});
},
navigateCode(instance) {
this.$router.push({
@ -398,6 +427,6 @@ export default {
<style>
.ivu-date-picker .ivu-select-dropdown {
left: 0 !important
left: 0 !important;
}
</style>

@ -1,25 +1,27 @@
<template>
<Modal v-model="dispalyModal"
<Modal
v-model="dispalyModal"
width="1000"
:loading="loading"
:mask-closable="false"
@on-cancel="cancel"
@on-ok="save">
<p slot="header"
style="color:#f60;text-align:left">
@on-ok="save"
>
<p slot="header" style="color:#f60;text-align:left">
<span>配置活动</span>
</p>
<div>基本配置</div>
<Form ref="formValidate"
<Form
ref="formValidate"
:model="formValidate"
:rules="ruleValidate"
:label-width="80">
:label-width="80"
>
<Row>
<i-col style="text-align: left;"
span="8">
<FormItem label=""
prop="logo">
<Upload ref="upload"
<i-col style="text-align: left;" span="8">
<FormItem label="" prop="logo">
<Upload
ref="upload"
:show-upload-list="false"
:on-success="uploadImgSuccess"
:format="['jpg', 'jpeg', 'png']"
@ -28,75 +30,90 @@
multiple
type="drag"
action=""
style="display: inline-block;">
style="display: inline-block;"
>
<div style="width: 200px;height:200px;line-height: 200px;">
<span v-if="!formValidate.logo"></span>
<img v-if="formValidate.logo"
<img
v-if="formValidate.logo"
:src="`/kiisoo-ic` + formValidate.logo"
alt=""
style="width: 100%; height: auto" />
style="width: 100%; height: auto"
/>
</div>
</Upload>
</FormItem>
</i-col>
<i-col span="15"
offset="1">
<FormItem label="活动名称"
prop="name">
<i-input type="text"
<i-col span="15" offset="1">
<FormItem label="活动名称" prop="name">
<i-input
type="text"
v-model="formValidate.name"
placeholder="请输入活动名称"></i-input>
placeholder="请输入活动名称"
></i-input>
</FormItem>
<Form-item label="活动描述"
prop="description">
<i-input v-model="formValidate.description"
<Form-item label="活动描述" prop="description">
<i-input
v-model="formValidate.description"
type="textarea"
:autosize="{ minRows: 3 }"
placeholder="请输入活动描述"></i-input>
placeholder="请输入活动描述"
></i-input>
</Form-item>
<FormItem label="APPID"
prop="appId">
<i-input type="text"
<FormItem label="APPID" prop="appId">
<i-input
type="text"
v-model="formValidate.appId"
placeholder="请输入appid"></i-input>
placeholder="请输入appid"
></i-input>
</FormItem>
<FormItem label="URI"
prop="uri">
<i-input type="text"
<FormItem label="URI" prop="uri">
<i-input
type="text"
v-model="formValidate.uri"
placeholder="请输入URI"></i-input>
placeholder="请输入URI"
></i-input>
</FormItem>
</i-col>
</Row>
</Form>
<div class="topic">活动类型</div>
<Row :gutter="10"
<Row
:gutter="10"
class="inputItem"
v-for="(item, index) in formValidate.params"
:key="index">
:key="index"
>
<i-col :span="2"> 类型{{ index + 1 }} </i-col>
<i-col :span="9">
<i-input class="inputClass"
<i-input
class="inputClass"
type="text"
v-model="item.name"
placeholder="请输入活动类型名称"></i-input>
placeholder="请输入活动类型名称"
></i-input>
</i-col>
<i-col :span="9">
<i-input class="inputClass"
<i-input
class="inputClass"
type="text"
style="margin-left: 20px"
v-model="item.defaultVal"
placeholder="请输入参数"></i-input>
placeholder="请输入参数"
></i-input>
</i-col>
<i-col :span="4">
<Button style="margin-left: 20px"
<Button
style="margin-left: 20px"
type="error"
@click="delActivityInput(index)">删除</Button>
@click="delActivityInput(index)"
>删除</Button
>
</i-col>
</Row>
<Button style="margin-top: 10px"
type="primary"
@click="addActivityInput">+添加活动类型</Button>
<Button style="margin-top: 10px" type="primary" @click="addActivityInput"
>+添加活动类型</Button
>
</Modal>
</template>
<script>
@ -224,12 +241,21 @@ export default {
},
save() {
let that = this;
let i = 0;
if (
typeof that.formValidate.logo == "undefined" ||
that.formValidate.logo == "" ||
that.formValidate.logo.length <= 0
) {
that.$Message.error("请上传活动封面!");
that.loading = false;
return false;
}
if (that.formValidate.params.length <= 0) {
that.$Message.error("至少需要填写一个活动类型!");
that.loading = false;
return false;
}
let i = 0;
for (const key in that.formValidate.params) {
i++;
if (that.formValidate.params.hasOwnProperty(key)) {
@ -246,15 +272,6 @@ export default {
}
}
}
if (
typeof that.formValidate.logo == "undefined" ||
that.formValidate.logo == "" ||
that.formValidate.logo.length <= 0
) {
that.$Message.error("请上传活动封面!");
that.loading = false;
return false;
}
this.loading = true;
this.$refs["formValidate"].validate((valid) => {
if (valid) {

Loading…
Cancel
Save