Commit 916004df by 黑潮

update: 复制新建

parent 2e52acba
......@@ -26,7 +26,7 @@
<!-- <script src="//web-1251519181.file.myqcloud.com/components/card.2.0.19.js"></script>卡券选择器 -->
<script src="//web-1251519181.file.myqcloud.com/components/store.2.0.01.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/member-group.2.2.30.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/member-group.2.2.31.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/store-card.2.0.30.js"></script><!-- 门店选择器 -->
<script src="//web-1251519181.file.myqcloud.com/components/store-new.2.0.71.js"></script><!-- 新版门店选择器 -->
<script src="//web-1251519181.file.myqcloud.com/components/confirm-people.2.0.06.js"></script>
......@@ -42,6 +42,6 @@
<script src="//web-1251519181.file.myqcloud.com/components/card.2.0.20.js"></script><!-- 卡券弹窗 -->
<script src="//web-1251519181.file.myqcloud.com/components/radio-transfer.1.0.13.js"></script><!-- 单选穿梭框 -->
<script src="//web-1251519181.file.myqcloud.com/components/steps.1.0.1.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/material.1.0.4.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/material.1.0.5.js"></script>
</body>
</html>
......@@ -14,6 +14,14 @@ export default {
}
},
{
path: 'copy/:id',
name: '智能营销新增',
component: () => import(/* webpackChunkName: "ecm" */ '../../views/ecm/form.vue'),
meta: {
path: '/ecm/list'
}
},
{
path: 'list',
name: '智能营销',
component: () => import(/* webpackChunkName: "ecm" */ '../../views/ecm/list.vue'),
......
......@@ -116,9 +116,10 @@ export default {
// execDate: { validator: checkExecDate, required: true, message: '执行日期填写不完整', trigger: 'change' }
},
isEdit: this.$route.meta.type === 'edit',
isAdd: this.$route.meta.type === 'add',
isAdd: this.$route.meta.type === 'add' || this.$route.meta.type === 'copy',
isInfo: this.$route.meta.type === 'info',
isCopy: this.$route.meta.copy === 'copy',
isInit: this.$route.meta.type === 'add',
// 人群筛选器可传参数
sceneValue: 'member', // 场景值
useId: '', // 模板id
......@@ -235,7 +236,7 @@ export default {
return this.$store.state.marketing.asideShow;
},
storeParams() {
return !this.isAdd ? { creatorId: this.creatorId } : {};
return !this.isInit ? { creatorId: this.creatorId } : {};
},
marketingTimesTips() {
let tips = '';
......@@ -294,7 +295,7 @@ export default {
// 获取ecm信息
async getEcmInfo(isResetTemplate = false) {
this.loading = true;
let res = await getEcmInfo({ ecmPlanId: this.$route.params.id });
let res = await getEcmInfo({ ecmPlanId: this.$route.params.id, copy: this.isCopy ? 1 : undefined });
this.loading = false;
// 如果是模板重置不需要重置基本信息
if (!isResetTemplate) {
......@@ -303,7 +304,7 @@ export default {
const consumTrigger = res.result.consumTrigger;
this.enabledMessageState = res.result.enabledMessageState || 0;
this.xxSysp.goodsEnable = res.result.goodsEnable || false; // 是否支持商品选择器
if (result && !this.isAdd) {
if (result && !this.isInit) {
this.onlineStatus = result.onlineStatus;
this.creatorId = res.result.ecmDTO.creatorId;
this.ecmPlanId = this.form.ecmPlanId = result.ecmPlanId || '';
......@@ -363,7 +364,7 @@ export default {
this.checked = ['lastCost_day'];
}
}
} else if (this.isAdd) {
} else if (this.isInit) {
this.ecmPlanId = res.result.templateEcmPlanId || '';
}
this.form.templateUseEnable = res.result.templateUseEnable;
......@@ -436,7 +437,7 @@ export default {
if (!this.form.templateUseEnable) return;
let template = null;
this.templateOptions = res.result.marketingTemplateList || [];
if (!this.isAdd) {
if (!this.isInit) {
template = res.result.customMarketingTemplate || res.result.marketingTemplateList[0];
} else {
template = res.result.marketingTemplateList[0];
......@@ -447,9 +448,23 @@ export default {
this.templateInit(template);
}
// 新增给消费触发增加默认最小值
if (this.isAdd) {
if (this.isInit) {
this.form.lowest_cost = 1;
}
if (this.isCopy) {
this.form.ecmPlanName = '';
this.form.execTime = '';
this.form.beginDate = '';
this.form.endDate = '';
this.form.effectTime = 0;
this.analyseConfig = {
open_flag: '',
crowd_flag: 0,
crowd_send: 4,
crowd_no_send: 1,
marke_days: 14
};
}
},
// 模板消息初始化
templateInit(template) {
......@@ -692,6 +707,17 @@ export default {
return;
}
}
if (this.isCopy) {
if (this.form.memberType === 1 && this.form.memberGroupIds.some(el => 'effectiveStatus' in el && el.effectiveStatus === 0)) {
return this.$tips({ type: 'warning', message: '所选的会员分组中,有失效的会员分组,请先将失效分组删除后再保存。' });
}
if (this.$refs.marketingEvent.hasDeleted) {
return this.$tips({ type: 'warning', message: '所选的营销事件中,存在已失效或被删除模板的营销事件,请先将失效的营销事件删除后再保存!' });
}
if (this.$refs.marketingEvent.hasMaterialDeleted) {
return this.$tips({ type: 'warning', message: '所选的群发消息中,存在已失效或被删除的营销素材,请先将失效的营销素材删除后再保存!' });
}
}
this.$refs[formName].validate(valid => {
if (valid) {
let params = {
......@@ -983,7 +1009,8 @@ export default {
// 初始化门店左侧数据
initStoreCardLeft() {
if (this.consumeChecked.store) {
if (this.isAdd) {
if (this.isInit) {
// TODO: 可能会有问题
// 这里新增的情况下也要初始化 门店组件
this.$nextTick(_ => {
this.$refs.storeCard.init();
......
......@@ -54,7 +54,7 @@
<el-dropdown-item :command="1">记录</el-dropdown-item>
<el-dropdown-item v-if="scope.row.effectType !== 2 && scope.row.onlineStatus === 1 && scope.row.canEdit !== false" @confirm="offlineEcmPlan(scope.row)" :command="2">下线</el-dropdown-item>
<el-dropdown-item v-if="xsxsFlag && isOpenFlag(scope.row.analyseJson)" :command="3">触达效果</el-dropdown-item>
<el-dropdown-item :command="3">复制新建</el-dropdown-item>
<el-dropdown-item :command="4">复制新建</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
......@@ -245,6 +245,10 @@ export default {
this.loading = false;
},
//编辑
copyData(row) {
this.$router.push('/ecm/copy/' + row.ecmPlanId);
},
//编辑
editData(row) {
this.$router.push('/ecm/edit/' + row.ecmPlanId);
},
......@@ -320,6 +324,8 @@ export default {
this.offlineEcmPlan(row);
} else if (command == 3) {
this.toTouch(row);
} else if (command == 4) {
this.copyData(row);
}
}
},
......
......@@ -39,7 +39,14 @@ export default {
6: '小程序'
};
let res = JSON.parse(this.item.qfxx.chatContent || '[]');
return [...new Set(res.map(el => el.type))].map(el => mapName[el]);
const item = res.find(el => el.statusFlag == 0);
return [...new Set(res.map(el => el.type))].map(el => {
if (item && item.type == el) {
return `${mapName[el]} (已失效)`;
} else {
return mapName[el];
}
});
}
}
};
......
......@@ -42,7 +42,7 @@
<div style="font-size:12px;color:#6B6D71;margin-bottom:10px">建议以文本+其他类型组合创建群发内容;文本内容最多只能添加 1 个</div>
<div style="margin-bottom:16px;display:flex;flex-wrap:wrap;margin-top:12px">
<material-item class="card-item" v-for="item in materials" :key="item.relation_id" :item="item" @delete="onDeleteMaterial" :read-only="readOnly"></material-item>
<div v-show="materials.length < 5 && !readOnly" class="chat-item card-item" @click="openMaterialDialog">
<div v-show="materials.length < 3 && !readOnly" class="chat-item card-item" @click="openMaterialDialog">
<i class="el-icon-plus"></i>
<span class="add-text">添加素材 (最多3个)</span>
</div>
......@@ -54,7 +54,7 @@
<el-button style="width:74px" type="primary" @click="addItem">确定</el-button>
</template>
</el-dialog>
<dm-material :visible.sync="materialVisible" @select="onSelectMaterial" :wx-enterprise-id="this.form.qfxxEnterpriseId" projectName="marketing" :material-ids="materials.map(el => el.relation_id)" :disableTypes="disableTypes"></dm-material>
<dm-material :visible.sync="materialVisible" :types="[1, 2, 3, 4, 6]" @select="onSelectMaterial" :wx-enterprise-id="this.form.qfxxEnterpriseId" projectName="marketing" :material-ids="materials.map(el => el.relation_id)" :disableTypes="disableTypes"></dm-material>
</div>
</template>
......
......@@ -146,7 +146,7 @@
</template>
</el-dialog>
<template-dialog ref="template-dialog" @sendItem="onInsertTemplate"></template-dialog>
<dm-material :visible.sync="materialVisible" @select="onSelectMaterial" :wx-enterprise-id="this.form.qywxEnterpriseId" projectName="marketing" :material-ids="materials.map(el => el.relation_id)"></dm-material>
<dm-material :visible.sync="materialVisible" :types="[1, 2, 3, 4, 5]" @select="onSelectMaterial" :wx-enterprise-id="this.form.qywxEnterpriseId" projectName="marketing" :material-ids="materials.map(el => el.relation_id)"></dm-material>
</div>
</template>
......
......@@ -288,6 +288,16 @@ export default {
this.list = [];
let result = res.result.typeRelationList || [];
let brandInfo = res.result.enterprise || {};
if (result.some(el => el.status === 0)) {
this.hasDeleted = true;
} else {
result
.filter(el => el.marketingType == 'qfxx')
.some(el => {
let item = JSON.parse(el.qfxx.chatContent);
return item.statusFlag == 0;
}) && (this.hasMaterialDeleted = true);
}
// 八种类型 处理
result.map(v => {
switch (v.marketingType) {
......
......@@ -7,7 +7,9 @@
<el-date-picker v-model="dateRange" value-format="yyyy-MM-dd" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="onSearch"></el-date-picker>
</el-row>
<el-table class="mt20" :data="tableList">
<el-table-column prop="operatorName" label="操作人"></el-table-column>
<el-table-column prop="operatorName" label="操作人">
<template slot-scope="{ row }">{{ row.operatorPhone }}-{{ row.operatorName }}{{ row.superAdmin ? '-超管' : '' }}</template>
</el-table-column>
<el-table-column prop="ecmPlanName" label="操作对象"></el-table-column>
<el-table-column label="操作时间">
<template slot-scope="{ row }">
......@@ -44,6 +46,11 @@ export default {
};
},
mounted() {
this.$store.commit('mutations_breadcrumb', [
{ name: '营销管理', path: '' },
{ name: '智能营销', path: '/ecm' },
{ name: '操作日志', path: '' }
]);
this.getList();
},
methods: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment