feature_0521
郑皇 6 years ago
parent ba02ce7252
commit c432ef5d34

@ -1,25 +1,24 @@
<template> <template>
<div class="activity_code"> <div class="activity_code">
<Table :loading="loading" <Table :loading="loading" border :columns="columns" :data="data"></Table>
border <Page
:columns="columns" :total="totalSize"
:data="data"></Table> :current="pageNum"
<Page :total="totalSize" :page-size="pageSize"
:current="pageNum" show-elevator
:page-size="pageSize" show-total
show-elevator placement="top"
show-total @on-change="handlePage"
placement="top" class-name="ks-page"
@on-change="handlePage" ></Page>
class-name="ks-page"></Page>
</div> </div>
</template> </template>
<script> <script>
import { activityCodeList } from '../../services/ActivityManager/ActivityManager'; import { activityCodeList } from "../../services/ActivityManager/ActivityManager";
export default { export default {
name: "ActivityCode", name: "ActivityCode",
data () { data() {
let _this = this; let _this = this;
return { return {
loading: false, loading: false,
@ -38,65 +37,69 @@ export default {
{ {
title: "所属零售公司", title: "所属零售公司",
key: "organizational.name", key: "organizational.name",
render (h, params) { render(h, params) {
return h("span", params.row["organizational"]["name"]); return h("span", params.row["organizational"]["name"]);
}, },
}, },
{ {
title: "零售公司编号", title: "零售公司编号",
key: "organizational.code", key: "organizational.code",
render (h, params) { render(h, params) {
return h("span", params.row["organizational"]["code"]); return h("span", params.row["organizational"]["code"]);
}, },
}, },
{ {
title: "店铺名称", title: "店铺名称",
key: "store.name", key: "store.name",
render (h, params) { render(h, params) {
return h("span", params.row["store"]["name"]); return h("span", params.row["store"]["name"]);
}, },
}, },
{ {
title: "店铺编号", title: "店铺编号",
key: "store.code", key: "store.code",
render (h, params) { render(h, params) {
return h("span", params.row["store"]["code"]); return h("span", params.row["store"]["code"]);
}, },
}, },
{ {
title: "推广码", title: "推广码",
key: "qrCode", key: "qrCode",
render (h, params) { render(h, params) {
return h("div", { return h(
class: "qrcode" }, [ "div",
h( {
"Button", class: "qrcode",
{ },
props: { type: "primary", size: "small" }, [
style: { marginRight: "8px" },
on: { "mouseover.native": () => _this.showQrcode(params.row) }
},
"二维码"
),
h(
"div",
{
class: "qrcodeBox",
style: { display: "none" }
}, [
h( h(
"img", "Button",
{ attrs: { src: params.row.qrCode } } {
)] props: { type: "primary", size: "small" },
) style: { marginRight: "8px" },
]); on: {
"mouseover.native": () => _this.showQrcode(params.row),
},
},
"二维码"
),
h(
"div",
{
class: "qrcodeBox",
style: { display: "none" },
},
[h("img", { attrs: { src: params.row.qrCode } })]
),
]
);
}, },
}, },
{ {
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",
@ -108,40 +111,39 @@ export default {
}, },
}, },
"查看导购码" "查看导购码"
) ),
]); ]);
}, },
}, },
] ],
}; };
}, },
created () { created() {
this.instanceId = this.$route.query.instanceId; this.instanceId = this.$route.query.instanceId;
this.load(); this.load();
}, },
methods: { methods: {
handlePage (value) { handlePage(value) {
this.pageNum = value; this.pageNum = value;
this.load(); this.load();
}, },
showQrcode (row) { showQrcode(row) {
console.log(row) console.log(row);
}, },
load (params = {}) { load(params = {}) {
let _this = this; let _this = this;
this.loading = true; this.loading = true;
params.pageSize = this.pageSize; params.pageSize = this.pageSize;
params.pageNum = this.pageNum; params.pageNum = this.pageNum;
params.instanceId = this.instanceId; params.instanceId = this.instanceId;
activityCodeList(params, res => { activityCodeList(params, (res) => {
_this.data = res.data.results.this.records _this.data = res.data.results.this.records;
_this.totalSize = res.data.results.this.total _this.totalSize = res.data.results.this.total;
_this.loading = false; _this.loading = false;
}) });
} },
} },
}; };
</script> </script>
<style> <style></style>
</style>

@ -1,92 +1,103 @@
<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="4"> <i-col span="4">
<FormItem label="选择日期" <FormItem label="选择日期" prop="">
prop=""> <Date-picker
<Date-picker 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" >
:key="index" <Option
:value="item.value">{{ item.label }} v-for="(item, index) in companyList"
: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="店铺" <FormItem label="店铺" prop="">
prop=""> <Select
<Select v-model="formValidate.storeId" v-model="formValidate.storeId"
filterable filterable
placeholder="全部" placeholder="全部"
clearable> clearable
<Option v-for="(item, index) in shopList" >
:key="index" <Option
:value="item.value">{{ item.label }} v-for="(item, index) in shopList"
: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="活动状态" <FormItem label="活动状态" prop="">
prop="">
<Select v-model="formValidate.status"> <Select v-model="formValidate.status">
<Option v-for="(item, index) in activityStatusList" <Option
:key="index" v-for="(item, index) in activityStatusList"
: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">
<Button type="primary" <Button type="primary" @click="searchTable"></Button>
@click="searchTable">查询</Button>
</i-col> </i-col>
</Row> </Row>
<Row style="margin-top:50px"> <Row style="margin-top:50px">
<Table :loading="loading" <Table
border :loading="loading"
@on-row-dblclick="showDetail" border
:columns="columns1" @on-row-dblclick="showDetail"
:data="data"></Table> :columns="columns1"
<Page :total="totalSize" :data="data"
:current="pageNum" ></Table>
:page-size="pageSize" <Page
show-elevator :total="totalSize"
show-total :current="pageNum"
placement="top" :page-size="pageSize"
@on-change="handlePage" show-elevator
class-name="ks-page"></Page> show-total
placement="top"
@on-change="handlePage"
class-name="ks-page"
></Page>
</Row> </Row>
</Form> </Form>
<useTable ref="useTable" <useTable
@doShow="doShow" ref="useTable"
:show="showUse" @doShow="doShow"
:isModify="true" :show="showUse"
:schedule="activityInstance.scheduleVO"></useTable> :isModify="true"
<Modal v-model="isShowDetail" :schedule="activityInstance.scheduleVO"
title="活动计划详情" ></useTable>
width="70%" <Modal
:footer-hide="true"> v-model="isShowDetail"
<planDetail v-if="isShowDetail" title="活动计划详情"
:detail="detail"></planDetail> width="70%"
:footer-hide="true"
>
<planDetail v-if="isShowDetail" :detail="detail"></planDetail>
</Modal> </Modal>
</div> </div>
</template> </template>
@ -97,14 +108,15 @@ 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"; import store from "../../store";
import planDetail from './PlanDetail'; import planDetail from "./PlanDetail";
export default { export default {
name: "ActivityPlan", name: "ActivityPlan",
inject: ["setMenuName"], inject: ["setMenuName"],
components: { components: {
useTable, planDetail useTable,
planDetail,
}, },
data () { data() {
const _this = this; const _this = this;
return { return {
loading: false, loading: false,
@ -150,13 +162,14 @@ export default {
{ {
label: "已结束", label: "已结束",
value: 3, value: 3,
} },
], ],
columns1: [ columns1: [
{ {
type: "index", type: "index",
width: 60, width: 60,
align: "center", align: "center",
title: "序号",
}, },
{ {
title: "活动名称", title: "活动名称",
@ -165,7 +178,7 @@ export default {
{ {
title: "活动类型", title: "活动类型",
key: "scheduleVO.name", key: "scheduleVO.name",
render (h, params) { render(h, params) {
return h("span", params.row["params"][0]["defaultVal"]); return h("span", params.row["params"][0]["defaultVal"]);
}, },
}, },
@ -173,42 +186,54 @@ 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("span", (params.row.companyName) + "等" + (params.row.companyCount || 0) + "家公司"); return h(
"span",
params.row.companyName +
"等" +
(params.row.companyCount || 0) +
"家公司"
);
}, },
}, },
{ {
title: "店铺", title: "店铺",
key: "shop", key: "shop",
render (h, params) { render(h, params) {
return h("span", (params.row.storeName) + "等" + (params.row.storeCount || 0) + "家店铺"); return h(
"span",
params.row.storeName +
"等" +
(params.row.storeCount || 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",
{ {
@ -222,7 +247,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", "进行中");
@ -234,7 +259,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",
@ -261,29 +286,29 @@ 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;
}, },
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({
@ -293,17 +318,17 @@ 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,
}; };
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({
@ -313,55 +338,59 @@ export default {
}); });
}); });
}, },
handlePage: function (value) { handlePage: function(value) {
this.pageNum = value; this.pageNum = value;
this.searchTable(); this.searchTable();
}, },
stop (instance) { stop(instance) {
let _this = this; let _this = this;
this.$Modal.confirm({ this.$Modal.confirm({
title: '您确认要终止?', title: "您确认要终止?",
content: '终止之后不可恢复', content: "终止之后不可恢复",
onOk: () => { onOk: () => {
this.saving = true; this.saving = true;
ActivityManager.instanceTerminate({ instanceId: instance.id }, (res) => { ActivityManager.instanceTerminate(
_this.saving = false; { instanceId: instance.id },
if (res.data.success == undefined || !res.data.success) { (res) => {
_this.$Message.error("终止失败!"); _this.saving = false;
} else { if (res.data.success == undefined || !res.data.success) {
_this.searchTable(); _this.$Message.error("终止失败!");
} else {
_this.searchTable();
}
} }
}); );
}, },
onCancel: () => { onCancel: () => {},
}
}); });
}, },
getDetail (instanceId) { getDetail(instanceId) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
ActivityManager.instanceDetail({ ActivityManager.instanceDetail(
instanceId {
}, res => { instanceId,
resolve(res.data.results) },
}); (res) => {
}) resolve(res.data.results);
}
);
});
}, },
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);
_this.activityInstance = res; _this.activityInstance = res;
_this.showUse = true; _this.showUse = true;
}) });
}, },
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 &&
@ -398,6 +427,6 @@ export default {
<style> <style>
.ivu-date-picker .ivu-select-dropdown { .ivu-date-picker .ivu-select-dropdown {
left: 0 !important left: 0 !important;
} }
</style> </style>

@ -1,102 +1,119 @@
<template> <template>
<Modal v-model="dispalyModal" <Modal
width="1000" v-model="dispalyModal"
:loading="loading" width="1000"
:mask-closable="false" :loading="loading"
@on-cancel="cancel" :mask-closable="false"
@on-ok="save"> @on-cancel="cancel"
<p slot="header" @on-ok="save"
style="color:#f60;text-align:left"> >
<p slot="header" style="color:#f60;text-align:left">
<span>配置活动</span> <span>配置活动</span>
</p> </p>
<div>基本配置</div> <div>基本配置</div>
<Form ref="formValidate" <Form
:model="formValidate" ref="formValidate"
:rules="ruleValidate" :model="formValidate"
:label-width="80"> :rules="ruleValidate"
:label-width="80"
>
<Row> <Row>
<i-col style="text-align: left;" <i-col style="text-align: left;" span="8">
span="8"> <FormItem label="" prop="logo">
<FormItem label="" <Upload
prop="logo"> ref="upload"
<Upload ref="upload" :show-upload-list="false"
:show-upload-list="false" :on-success="uploadImgSuccess"
:on-success="uploadImgSuccess" :format="['jpg', 'jpeg', 'png']"
:format="['jpg', 'jpeg', 'png']" :max-size="2048"
:max-size="2048" :before-upload="handleBeforeUpload"
:before-upload="handleBeforeUpload" multiple
multiple type="drag"
type="drag" action=""
action="" style="display: inline-block;"
style="display: inline-block;"> >
<div style="width: 200px;height:200px;line-height: 200px;"> <div style="width: 200px;height:200px;line-height: 200px;">
<span v-if="!formValidate.logo"></span> <span v-if="!formValidate.logo"></span>
<img v-if="formValidate.logo" <img
:src="`/kiisoo-ic` + formValidate.logo" v-if="formValidate.logo"
alt="" :src="`/kiisoo-ic` + formValidate.logo"
style="width: 100%; height: auto" /> alt=""
style="width: 100%; height: auto"
/>
</div> </div>
</Upload> </Upload>
</FormItem> </FormItem>
</i-col> </i-col>
<i-col span="15" <i-col span="15" offset="1">
offset="1"> <FormItem label="活动名称" prop="name">
<FormItem label="活动名称" <i-input
prop="name"> type="text"
<i-input type="text" v-model="formValidate.name"
v-model="formValidate.name" placeholder="请输入活动名称"
placeholder="请输入活动名称"></i-input> ></i-input>
</FormItem> </FormItem>
<Form-item label="活动描述" <Form-item label="活动描述" prop="description">
prop="description"> <i-input
<i-input v-model="formValidate.description" v-model="formValidate.description"
type="textarea" type="textarea"
:autosize="{ minRows: 3 }" :autosize="{ minRows: 3 }"
placeholder="请输入活动描述"></i-input> placeholder="请输入活动描述"
></i-input>
</Form-item> </Form-item>
<FormItem label="APPID" <FormItem label="APPID" prop="appId">
prop="appId"> <i-input
<i-input type="text" type="text"
v-model="formValidate.appId" v-model="formValidate.appId"
placeholder="请输入appid"></i-input> placeholder="请输入appid"
></i-input>
</FormItem> </FormItem>
<FormItem label="URI" <FormItem label="URI" prop="uri">
prop="uri"> <i-input
<i-input type="text" type="text"
v-model="formValidate.uri" v-model="formValidate.uri"
placeholder="请输入URI"></i-input> placeholder="请输入URI"
></i-input>
</FormItem> </FormItem>
</i-col> </i-col>
</Row> </Row>
</Form> </Form>
<div class="topic">活动类型</div> <div class="topic">活动类型</div>
<Row :gutter="10" <Row
class="inputItem" :gutter="10"
v-for="(item, index) in formValidate.params" class="inputItem"
:key="index"> v-for="(item, index) in formValidate.params"
:key="index"
>
<i-col :span="2"> 类型{{ index + 1 }} </i-col> <i-col :span="2"> 类型{{ index + 1 }} </i-col>
<i-col :span="9"> <i-col :span="9">
<i-input class="inputClass" <i-input
type="text" class="inputClass"
v-model="item.name" type="text"
placeholder="请输入活动类型名称"></i-input> v-model="item.name"
placeholder="请输入活动类型名称"
></i-input>
</i-col> </i-col>
<i-col :span="9"> <i-col :span="9">
<i-input class="inputClass" <i-input
type="text" class="inputClass"
style="margin-left: 20px" type="text"
v-model="item.defaultVal" style="margin-left: 20px"
placeholder="请输入参数"></i-input> v-model="item.defaultVal"
placeholder="请输入参数"
></i-input>
</i-col> </i-col>
<i-col :span="4"> <i-col :span="4">
<Button style="margin-left: 20px" <Button
type="error" style="margin-left: 20px"
@click="delActivityInput(index)">删除</Button> type="error"
@click="delActivityInput(index)"
>删除</Button
>
</i-col> </i-col>
</Row> </Row>
<Button style="margin-top: 10px" <Button style="margin-top: 10px" type="primary" @click="addActivityInput"
type="primary" >+添加活动类型</Button
@click="addActivityInput">+添加活动类型</Button> >
</Modal> </Modal>
</template> </template>
<script> <script>
@ -104,7 +121,7 @@ import ActivityManager from "../../services/ActivityManager/ActivityManager";
import axios from "axios"; import axios from "axios";
export default { export default {
name: "addActivity", name: "addActivity",
data () { data() {
return { return {
dispalyModal: false, dispalyModal: false,
currentStep: 0, currentStep: 0,
@ -132,7 +149,7 @@ export default {
id: String, id: String,
}, },
watch: { watch: {
addActivityModal (val) { addActivityModal(val) {
console.log(111, val); console.log(111, val);
this.dispalyModal = val; this.dispalyModal = val;
if (val === true && this.id) { if (val === true && this.id) {
@ -161,9 +178,9 @@ export default {
} }
}, },
}, },
mounted () { }, mounted() {},
methods: { methods: {
addActivityInput () { addActivityInput() {
let params = [...this.formValidate.params]; let params = [...this.formValidate.params];
params.push({ params.push({
defaultVal: "", defaultVal: "",
@ -179,7 +196,7 @@ export default {
this.$set(this.formValidate, "params", params); this.$set(this.formValidate, "params", params);
this.$forceUpdate(); this.$forceUpdate();
}, },
delActivityInput (index) { delActivityInput(index) {
if (this.formValidate.params.length <= 1) { if (this.formValidate.params.length <= 1) {
this.$Message.error("至少需要填写一个活动类型!"); this.$Message.error("至少需要填写一个活动类型!");
return; return;
@ -187,22 +204,22 @@ export default {
this.formValidate.params.splice(index, 1); this.formValidate.params.splice(index, 1);
this.$forceUpdate(); this.$forceUpdate();
}, },
cancel () { cancel() {
this.$emit("dispalyAddActivityModal", false, false); this.$emit("dispalyAddActivityModal", false, false);
}, },
getActivityData () { getActivityData() {
let that = this; let that = this;
let data = { let data = {
id: that.id, id: that.id,
}; };
ActivityManager.getActivityInfo(data, function (data) { ActivityManager.getActivityInfo(data, function(data) {
that.formValidate = data.data.results; that.formValidate = data.data.results;
}); });
}, },
uploadImgSuccess (res, file) { uploadImgSuccess(res, file) {
this.imageName = file.name; this.imageName = file.name;
}, },
handleBeforeUpload (res) { handleBeforeUpload(res) {
const me = this; const me = this;
let data = new FormData(); let data = new FormData();
data.append("file", res); data.append("file", res);
@ -213,7 +230,7 @@ export default {
headers: { headers: {
"Content-Type": "multipart/form-data", "Content-Type": "multipart/form-data",
}, },
}).then(function (res) { }).then(function(res) {
if (res.data.success) { if (res.data.success) {
// me.formValidate.logo = res.data.results; // me.formValidate.logo = res.data.results;
me.$set(me.formValidate, "logo", res.data.results); me.$set(me.formValidate, "logo", res.data.results);
@ -222,14 +239,23 @@ export default {
}); });
return false; return false;
}, },
save () { save() {
let that = this; 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) { if (that.formValidate.params.length <= 0) {
that.$Message.error("至少需要填写一个活动类型!"); that.$Message.error("至少需要填写一个活动类型!");
that.loading = false; that.loading = false;
return false; return false;
} }
let i = 0;
for (const key in that.formValidate.params) { for (const key in that.formValidate.params) {
i++; i++;
if (that.formValidate.params.hasOwnProperty(key)) { if (that.formValidate.params.hasOwnProperty(key)) {
@ -246,21 +272,12 @@ 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.loading = true;
this.$refs["formValidate"].validate((valid) => { this.$refs["formValidate"].validate((valid) => {
if (valid) { if (valid) {
// param = JSON.stringify(param) // param = JSON.stringify(param)
let data = { ...that.formValidate, isGetActivityInfo: true }; let data = { ...that.formValidate, isGetActivityInfo: true };
ActivityManager.addOreditActivity(data, function (data) { ActivityManager.addOreditActivity(data, function(data) {
that.addActivityModal = false; that.addActivityModal = false;
that.formValidate = {}; that.formValidate = {};
that.$emit("dispalyAddActivityModal", false, true); that.$emit("dispalyAddActivityModal", false, true);

Loading…
Cancel
Save