Commit fe2a815b by 杨明

fixed

1 parent 7e694747
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script>
var obj = {
x: 1,
get y() {
console.log(888)
return 3
}
}
var newObj = Object.assign(obj, {})
console.log(newObj)
</script>
</body>
</html>
......@@ -99,7 +99,7 @@
</template>
<slot name="footer"></slot>
</el-form>
<GLDialog bigTitle="选择地址" mode="big" :visible.sync="dialogMapVisible" @onOk="getAddress" @onCancel="dialogMapVisible = false">
<GLDialog :appendToBody="true" bigTitle="选择地址" mode="big" :visible.sync="dialogMapVisible" @onOk="getAddress" @onCancel="dialogMapVisible = false">
<map-view v-if="dialogMapVisible" ref="mapForm"></map-view>
<!-- <span slot="footer" class="dialog-footer">
<el-button @click="">取 消</el-button>
......
......@@ -4,9 +4,14 @@ export default {
activityInfo: {},
activityId: '',
activityDate: '',
activityProject: {}
activityProject: {},
customDetail: {}
},
mutations: {
// 设置客户信息
SET_CUSTOM_DETAIL(state, data) {
state.customDetail = data
},
// 设置活动信息
SET_ACTIVITY_INFO(state, data) {
state.activityInfo = data
......@@ -25,6 +30,9 @@ export default {
}
},
actions: {
setCustomDetail({ commit }, data) {
commit('SET_CUSTOM_DETAIL', data)
},
setActivityInfo({ commit }, data) {
commit('SET_ACTIVITY_INFO', data)
},
......
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-17 16:07:55
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-18 09:58:54
* @FilePath: \scrm-micro-home\src\utils\drawing.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
class Drawing {
constructor(canvasParams, list = [], fn) {
this.count = 0
this.fn = fn
this.list = list
this.canvasId = document.createElement('canvas')
const { width, height } = canvasParams
this.canvasId.width = width
this.canvasId.height = height
this.ctx = this.canvasId.getContext('2d')
}
drawImages(fn) {
const { imgSrc, x, y, width, height } = this.list[this.count]
let image = this.createImage()
image.src = imgSrc
this.count++
image.onload = () => {
this.ctx.drawImage(image, x, y, width, height)
console.log(this.count, this.list.length)
if (this.count === this.list.length) {
this.fn(this.canvasId.toDataURL('image/png'))
} else {
this.drawImages()
}
}
}
createImage() {
let image = new Image()
image.setAttribute('crossOrigin', 'Anonymous')
return image
}
}
export default Drawing
// 获取该月的天数
export const getDaysInMonth = (year, month) => {
const day = new Date(year, month + 1, 0).getDate()
// console.log("获取当前年", month, "当前月", month, "的天数", day);
return day
}
// 创建日期 yyyy-MM-dd 格式, 用于创建非当前月的日期
export const handleCrateDate = (year, month, start, end, type) => {
const arr = []
if (type === 'prev') {
// 上一月
if (start === end) return []
const daysInLastMonth = getDaysInMonth(year, month - 1) // 获取上一个月有多少天
// console.log(`当前月是${month + 1}月, 上一月${month}月的天数是${daysInLastMonth}天`)
for (let i = daysInLastMonth - end + 2; i <= daysInLastMonth; i++) {
arr.push({
// date: `${month === 0 ? year - 1 : year}-${(month + 1) < 10 ? month === 0 ? 12 : `0${month}` : month}-${i < 10 ? `0${i}` : i}`,
date: parseTime(new Date(year, month - 1, i)),
isCurMonth: false,
isSelected: false,
isRangeSelected: false
})
}
} else if (type === 'rear') {
// 下一月
for (let i = start; i <= end; i++) {
arr.push({
// date: `${month === 11 ? year + 1 : year}-${(month + 1) < 9 ? `0${month + 2}` : month + 2 <= 12 ? month + 2 : (month + 2) % 12 < 10 ? `0${(month + 2) % 12}` : (month + 2) % 12}-${i < 10 ? `0${i}` : i}`,
date: parseTime(new Date(year, month + 1, i)),
isCurMonth: false,
isSelected: false,
isRangeSelected: false
})
}
} else {
// 本月
for (let i = start; i <= end; i++) {
arr.push({
// date: `${year}-${(month + 1) < 10 ? `0${month + 1}` : month + 1}-${i < 10 ? `0${i}` : i}`,
date: parseTime(new Date(year, month, i)),
isCurMonth: true,
isSelected: false,
isRangeSelected: false
})
}
}
// console.log(arr)
return arr
}
// 创建年月时间 函数
export const handleCreateDatePicker = () => {
const years = []
const months = []
for (let i = 1970; i <= 2099; i++) {
years.push({
label: `${i}年`,
value: i
})
}
for (let i = 0; i <= 11; i++) {
months.push({
label: `${i + 1}月`,
value: i
})
}
return {
years,
months
}
}
/**
* Parse the time to string
* @param {(Object|string|number)} time
* @param {string} cFormat
* @returns {string | null}
*/
export function parseTime(time, cFormat) {
if (arguments.length === 0 || !time) {
return null
}
const format = cFormat || '{y}-{m}-{d}'
let date
if (typeof time === 'object') {
date = time
} else {
if (typeof time === 'string') {
if (/^[0-9]+$/.test(time)) {
// support "1548221490638"
time = parseInt(time)
} else {
// support safari
// https://stackoverflow.com/questions/4310953/invalid-date-in-safari
time = time.replace(new RegExp(/-/gm), '/')
}
}
if (typeof time === 'number' && time.toString().length === 10) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
const value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value]
}
return value.toString().padStart(2, '0')
})
return time_str
}
......@@ -105,14 +105,16 @@ util.isShowBtn = function(value, permissions) {
.split('/')
.slice(-2)
.join('/') &&
itm.meta && itm.meta.permissions.includes(permissions)
){isShowStatus = true}
if (itm.children) {
menuLevel(itm.children)
}
itm.meta &&
itm.meta.permissions.includes(permissions)
) {
isShowStatus = true
}
if (itm.children) {
menuLevel(itm.children)
}
})
}
return isShowStatus
}
export default util
......@@ -2,13 +2,21 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-16 10:20:01
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-16 16:37:59
* @LastEditTime: 2023-05-18 11:41:48
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\ChatGPT.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="gpt-box">
<div class="gpt-header" v-if="importNum == 0">
<div class="gpt-header" v-if="query.purchaseCustomerCount">
<div class="import-base">
<div class="import-item" v-for="(item, index) in importItem" :key="index">
{{ item.title }}:
<span>{{ query[item.name] }}</span>
</div>
</div>
</div>
<div class="gpt-header" v-else>
<div class="import-panel">
<el-button type="primary" size="small" icon="el-icon-download">导入企微魔方</el-button>
</div>
......@@ -16,14 +24,7 @@
当前门店基盘客户为空,请通过企微魔方导入门店基盘客户数据。
</div>
</div>
<div class="gpt-header" v-else>
<div class="import-base">
<div class="import-item" v-for="(item, index) in importItem" :key="index">
{{ item.title }}:
<span>9</span>
</div>
</div>
</div>
<div class="gpt-body">
<div class="error-tips flex-center" v-if="isError">
<i class="el-icon-error"></i>
......@@ -59,7 +60,7 @@ export default {
return {
isError: false,
phrasesShow: false,
importNum: 1,
query: {},
contentHtml: '',
phrases: ['创建一个<span>端午节</span>的营销活动,活动时间为<span>6月份</span>', '我需要一个<span>立夏</span>的节日关怀营销活动', '建立一个<span>父亲节</span>的节日关怀活动'],
chatItem: [
......@@ -74,13 +75,16 @@ export default {
],
importItem: [
{
title: '基盘总客户数'
title: '基盘总客户数',
name: 'purchaseCustomerCount'
},
{
title: '企微客户数'
title: '企微客户数',
name: 'entmicroAddCustomerCount'
},
{
title: '未加企微客户数'
title: '未加企微客户数',
name: 'entmicroNotAddCustomerCount'
}
]
}
......@@ -121,6 +125,8 @@ export default {
},
mounted() {
document.addEventListener('click', this.bodyCloseMenus)
this.query = this.$route.query || {}
console.log(this.$route.query)
},
beforeDestroy() {
document.removeEventListener('click', this.bodyCloseMenus)
......
......@@ -2,17 +2,33 @@
<div>
<div class="main-box">
<div class="main-title">本次营销模型解析</div>
<div class="inport-result" v-if="importNum">
本次导入客户解析:客户数:
<span>{{ importNum }}人</span>
正在匹配中…
<span>
重新导入
<input type="file" style="opacity: 0" ref="file" accept="*" @change="uploadFile" />
</span>
</div>
<div class="inport-result" v-else>
待导入客户数据后解析
<span>
导入
<input type="file" style="opacity: 0" ref="file" accept="*" @change="uploadFile" />
</span>
</div>
<glsx-combi-form class="edit-form-container" :isBlock="true" ref="editFormRef" formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="activityTimeHtml">
<div class="activity-time-container" :style="{ 'margin-left': defaultLabelWidth }">
<el-date-picker v-model="editForm.activityTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy/MM/dd"></el-date-picker>
<el-date-picker v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy/MM/dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']" @change="e => handleTimeChange(e, scope.scope)"></el-date-picker>
</div>
</template>
<div slot="selectGiftBtn">
<el-button type="default" class="el-icon-plus" @click="handleGiftAdd">选择服务</el-button>
</div>
<div class="gift-panel" slot="couponListBlock" style="width: 700px" :style="{ 'margin-left': defaultLabelWidth }" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-panel" slot="superMarketingCouponRelRequestListBlock" style="width: 700px" :style="{ 'margin-left': defaultLabelWidth }" v-show="editForm.superMarketingCouponRelRequestList && editForm.superMarketingCouponRelRequestList.length != 0">
<div class="gift-block">
<div v-for="(item, index) in orderShow" :key="index">
<div class="gift-box" v-show="couponObj[item].list.length">
......@@ -69,7 +85,7 @@
<div slot="selectEquityBtn">
<el-button type="default" class="el-icon-plus" @click="handleEquityAdd">选择服务</el-button>
</div>
<div class="gift-panel" slot="equityListBlock" style="width: 700px" :style="{ 'margin-left': defaultLabelWidth }" v-show="editForm.couponList && editForm.couponList.length != 0">
<div class="gift-panel" slot="equityListBlock" style="width: 700px" :style="{ 'margin-left': defaultLabelWidth }" v-show="editForm.superMarketingCouponRelRequestList && editForm.superMarketingCouponRelRequestList.length != 0">
<div class="gift-block">
<div class="gift-title">
本次权益服务选择共
......@@ -158,12 +174,15 @@ const numToGoods = {
2: 'recharge'
}
const orderShow = ['service', 'cash', 'discount', 'exchange']
import selectGiftDialog from './selectGiftDialog.vue'
import selectGoodsDialog from './selectGoodsDialog.vue'
import selectEquityDialog from './selectEquityDialog.vue'
import selectGiftDialog from './selectGiftDialog'
import selectGoodsDialog from './selectGoodsDialog'
import selectEquityDialog from './selectEquityDialog'
import Drawing from '@/utils/drawing'
export default {
data() {
return {
editChildRef: 'editChildRef',
importNum: 0,
couponTemplateList: [],
orderShow,
choseItemList: [],
......@@ -178,18 +197,21 @@ export default {
isSelectGoodsVisible: false,
isSelectEquityVisible: false,
editForm: {
couponList: []
superMarketingCouponRelRequestList: [],
backgroundImage: '',
detailImage: '',
merchantLog: ''
},
editFormData: [
{
label: '营销标题',
name: 'title',
name: 'marketingTitle',
type: 'input',
maxlength: 12
},
{
label: '营销副标题',
name: 'subTitle',
name: 'marketingSubtitle',
type: 'input',
maxlength: 20
},
......@@ -201,14 +223,14 @@ export default {
},
{
label: '主题背景图',
name: 'activityBigImg',
name: 'backgroundImage',
type: 'upload',
width: '320px',
mark: '建议尺寸:最大5M,宽度750px,长度≤600px',
style: 'color: #999999;',
limitSize: 5,
maxPhotoNum: 1,
suffixSlot: 'activityBigImg',
suffixSlot: 'backgroundImage',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
......@@ -217,7 +239,7 @@ export default {
.pictureUpload({ file: base64, fileType: 'image' })
.then(res => {
this.editForm[targetItem.name] = res
this.$refs.configEditFormRef.$refs[this.editChildRef].validateField(targetItem.name)
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
.finally(() => {
this.loading = false
......@@ -226,14 +248,14 @@ export default {
},
{
label: '内容图',
name: 'activityBigImg',
name: 'detailImage',
type: 'upload',
width: '320px',
mark: '建议尺寸:最大10M,宽度750px,长度不限',
style: 'color: #999999;',
limitSize: 5,
maxPhotoNum: 1,
suffixSlot: 'activityBigImg',
suffixSlot: 'detailImage',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
......@@ -242,7 +264,7 @@ export default {
.pictureUpload({ file: base64, fileType: 'image' })
.then(res => {
this.editForm[targetItem.name] = res
this.$refs.configEditFormRef.$refs[this.editChildRef].validateField(targetItem.name)
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
.finally(() => {
this.loading = false
......@@ -266,34 +288,34 @@ export default {
},
{
label: '门店优惠券',
name: 'couponList',
name: 'superMarketingCouponRelRequestList',
addHtml: 'selectGiftBtn'
},
{
label: '',
name: 'couponListBlock',
name: 'superMarketingCouponRelRequestListBlock',
isHide: true,
addHtml: 'couponListBlock'
addHtml: 'superMarketingCouponRelRequestListBlock'
},
{
label: '活动参与价格/元',
name: 'platformBenefits',
name: 'activityPrice',
type: 'input'
},
{
label: '库存',
name: 'platformBenefits',
name: 'goodsStock',
type: 'InputNumber',
min: 0
},
{
label: '门店名称',
name: 'platformBenefits',
name: 'merchantname',
type: 'input'
},
{
label: '门店地址',
name: 'activityAddressDetailName',
name: 'merchantAddress',
type: 'map',
isReadonly: false,
provinceView: false,
......@@ -304,17 +326,17 @@ export default {
cityCode: 'activityAddressCityCode',
lat: 'activityAddressLat',
lng: 'activityAddressLng',
fullAddress: 'activityAddressDetailName'
fullAddress: 'merchantAddress'
}
},
{
label: '服务热线',
name: 'platformBenefits',
name: 'serviceHotline',
type: 'input'
},
{
label: '门店Logo',
name: 'activityBigImg',
name: 'merchantLog',
type: 'upload',
width: '320px',
tips: '进入活动页的图片',
......@@ -322,7 +344,7 @@ export default {
style: 'color: #999999;',
limitSize: 5,
maxPhotoNum: 1,
suffixSlot: 'activityBigImg',
suffixSlot: 'merchantLog',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
......@@ -331,7 +353,7 @@ export default {
.pictureUpload({ file: base64, fileType: 'image' })
.then(res => {
this.editForm[targetItem.name] = res
this.$refs.configEditFormRef.$refs[this.editChildRef].validateField(targetItem.name)
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
.finally(() => {
this.loading = false
......@@ -340,8 +362,33 @@ export default {
}
],
editRule: {
title: [{ required: true, message: '请输入活动名称', trigger: 'input' }],
goodsList: [{ required: true, message: '请选择平台福利', trigger: 'change' }]
marketingTitle: [{ required: true, message: '请输入营销标题', trigger: 'input' }],
marketingSubtitle: [{ required: true, message: '请输入营销副标题', trigger: 'input' }],
activityTime: [{ required: true, message: '请选择活动时间', trigger: 'input' }],
backgroundImage: [{ required: true, message: '请选择主题背景图', trigger: 'change' }],
detailImage: [{ required: true, message: '请选择内容图', trigger: 'change' }],
activityPrice: [{ required: true, message: '请输入活动参与价格/元:', trigger: 'input' }],
goodsStock: [{ required: true, message: '请输入库存', trigger: 'input' }],
merchantname: [{ required: true, message: '请输入门店名称', trigger: 'input' }],
merchantAddress: [{ required: true, message: '请选择门店地址', trigger: 'input' }],
serviceHotline: [{ required: true, message: '请输入服务热线', trigger: 'input' }],
merchantLog: [{ required: true, message: '请选择门店Logo', trigger: 'change' }]
}
}
},
computed: {
mergeStr() {
const { backgroundImage, detailImage, merchantLog } = this.editForm
if (!backgroundImage || !detailImage || !merchantLog) return
return backgroundImage + detailImage + merchantLog
}
},
watch: {
mergeStr(val) {
if (val) {
this.getMergeImgs()
} else {
this.bigImage = null
}
}
},
......@@ -357,6 +404,36 @@ export default {
this.couponTemplateList = res.list || []
})
},
uploadFile(e) {
const file = e.srcElement.files[0]
let AllImgExt = '.xls|.xlsx' //文件格式判断
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const fileName = file.name.split('.')
//fileUrl: 文件名 + @ + base64拼接
const fileUrl = fileName.pop() + '@' + arrBase64[1]
//this.$apis.common.pictureUpload 调用接口api
this.$apis.common.pictureUpload({ file: fileUrl }).then(res => {
this.exportUrl = res
this.$refs.file.value = ''
this.handleSaveImport()
})
}
},
handleSaveImport() {
const { exportUrl } = this
this.$apis.activity.exportCustomer({ exportUrl }).then(res => {
this.importNum = res || 0
})
},
changeCouponTemplate(tab, event) {
this.$refs.editFormRef.$refs[this.editChildRef].clearValidate('goodsList')
const templateId = tab.name
......@@ -373,6 +450,65 @@ export default {
this.goodsLoading = false
})
},
//获取图片宽度高度
getImgWH(src) {
return new Promise(resolve => {
const img = new Image()
img.src = src
img.onload = () => {
resolve({ dw: img.width, dh: img.height, src })
}
})
},
uploadImg(imgFile) {
const base64 = 'png' + '@' + imgFile.split(',')[1]
this.loading = true
this.$apis.common.pictureUpload({ file: base64, fileType: 'image' }).then(res => {
this.bigImage = res
})
},
async getMergeImgs() {
const { backgroundImage, detailImage, merchantLog } = this.editForm
try {
const res = await Promise.all([this.getImgWH(backgroundImage), this.getImgWH(detailImage), this.getImgWH(merchantLog)])
const h = (res[0].dh / res[0].dw) * 375 + (res[1].dh / res[1].dw) * 375
const draw = new Drawing(
{
width: 375,
height: h
},
[
{
imgSrc: backgroundImage,
x: 0,
y: 0,
width: 375,
height: (res[0].dh / res[0].dw) * 375
},
{
imgSrc: detailImage,
x: 0,
y: (res[0].dh / res[0].dw) * 375,
width: 375,
height: (res[1].dh / res[1].dw) * 375
},
{
imgSrc: merchantLog,
x: 375 - res[2].dw - 20,
y: 20,
width: res[2].dw,
height: res[2].dh
}
],
base64 => {
this.uploadImg(base64)
}
)
draw.drawImages()
} catch (e) {
console.log(e)
}
},
//选择门店优惠券
handleGiftAdd() {
this.selectedMealList = JSON.parse(JSON.stringify(this.couponObj))
......@@ -397,7 +533,7 @@ export default {
this.isSelectEquityVisible = !this.isSelectEquityVisible
},
handleGiftConfirm(selectedData) {
this.$refs.editFormRef.$refs[this.editChildRef].clearValidate('couponList')
this.$refs.editFormRef.$refs[this.editChildRef].clearValidate('superMarketingCouponRelRequestList')
this.handleGiftClose()
this.couponObj = selectedData
this.recoveryTotalPrice()
......@@ -421,15 +557,15 @@ export default {
// this.setNameHide('goodsListBlock')
},
hasCouponBlock(isValidate = true) {
var idx = this.projuctEditFormData.findIndex(item => item.name == 'couponListBlock')
this.projuctEditFormData[idx].isHide = !this.editForm.couponList.length
var idx = this.projuctEditFormData.findIndex(item => item.name == 'superMarketingCouponRelRequestListBlock')
this.projuctEditFormData[idx].isHide = !this.editForm.superMarketingCouponRelRequestList.length
},
// 礼包
recoveryGiftList() {
this.editForm.couponList = []
this.editForm.superMarketingCouponRelRequestList = []
this.orderShow.forEach(item => {
this.couponObj[item].list.forEach(k => {
this.editForm.couponList.push(k)
this.editForm.superMarketingCouponRelRequestList.push(k)
})
})
this.hasCouponBlock()
......@@ -443,14 +579,14 @@ export default {
this.orderShow.forEach(item => {
this.couponObj[item].list = []
})
this.editForm.couponList.forEach(item => {
this.editForm.superMarketingCouponRelRequestList.forEach(item => {
console.log(this.numToCoupon[item.discountType])
if (this.numToCoupon[item.discountType]) {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item)
}
})
// console.log(this.couponObj, 'this.couponObj')
// this.currentCoupons = this.$common.utils.deepClone(this.editForm.couponList)
// this.currentCoupons = this.$common.utils.deepClone(this.editForm.superMarketingCouponRelRequestList)
this.hasCouponBlock(false)
},
// 计算预估成本
......@@ -482,10 +618,118 @@ export default {
this[formName][idx][attrName] = attrValue
}
})
},
getCouponInfoParams() {
var param = this.$common.utils.deepClone(this.editForm)
param.activityPrice = (param.activityPrice * 100).toFixed(0) //存的分,需乘100
const d = param.activityTime
if (d && d.length > 0) {
param.starttime = d[0]
param.endtime = d[1]
}
const couponList = this.$common.utils.deepClone(param.superMarketingCouponRelRequestList) || []
const couponLists = couponList.map(item => {
return {
couponId: item.couponId ? item.couponId : item.id,
couponAmount: item.couponAmount,
couponAnticipatedCost: item.couponAnticipatedCost
}
})
const selectedGoodsList = this.selectedGoodsList.map(item => {
return {
couponId: item.id,
couponAmount: item.couponAmount,
couponAnticipatedCost: item.denomination
}
})
param.importCustomersUrl = this.exportUrl
param.bigImage = this.bigImage
param.merchantId = 44211227 //this.$globalState.session.merchantId
param.superMarketingCouponRelRequestList = couponLists.concat(selectedGoodsList) || []
return param
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
this.addOrUpdate()
}
})
},
addOrUpdate() {
this.loading = true
var params = this.getCouponInfoParams()
this.$apis.activity
.createSuperMarketing(params)
.then(res => {
if (res) {
this.$message.success('操作成功')
}
})
.finally(() => {
this.loading = false
})
},
getInfo() {
this.loading = true
this.reportFlag = '1'
this.$apis.activity
.getActivityDetailApi({ id: this.routeInfo.id })
.then(res => {
var info = res
this.editForm = this.$common.utils.deepClone(res)
this.activityInfo = info
if (info.startTime) {
this.$set(this.editForm, 'activityTime', [info.startTime, info.endTime])
}
// this.routeInfo.addOrEdit == 'edit' && this.getGoodInfo(info.goodsId)
// if (info.activityPrice != null && info.goodsStock != null) {
// this.editForm.activityPrice = (info.activityPrice / 100).toFixed(2)
// this.editForm.goodsStock = info.goodsStock + ''
// }
if (info.crowdFundingPrice != null) {
this.editForm.crowdFundingPrice = (info.crowdFundingPrice / 100).toFixed(2)
}
// 地图
if (info.activityAddressProvinceName || info.activityAddressCityName) {
this.$refs.configEditFormRef.$refs.provinceForm[0].init(info.activityAddressProvinceName, info.activityAddressCityName)
}
if (info.activityPrice) {
this.editForm.activityPrice = info.activityPrice / 100
}
if (this.editForm.superMarketingCouponRelRequestList && this.editForm.superMarketingCouponRelRequestList.length) {
this.editForm.superMarketingCouponRelRequestList.forEach(item => {
item.id = item.couponId
item.anticipatedCost = item.couponAnticipatedCost
item.denomination = item.couponAnticipatedCost
})
this.selectedGoodsList = this.editForm.superMarketingCouponRelRequestList.filter(i => i.discountType == 8)
this.editForm.superMarketingCouponRelRequestList = this.editForm.superMarketingCouponRelRequestList.filter(i => i.discountType != 8)
this.recoveryCoupon()
this.recoveryTotalPrice()
} else {
this.editForm.superMarketingCouponRelRequestList = []
}
})
.finally(() => {
this.loading = false
})
},
confirmMsg() {
this.$confirm('新建营销方案,将放弃保存当前正在创建中的方案,是否新建营销方案?', '提示', {
// distinguishCancelAndClose: true,
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
})
.then(() => {
this.getInfo()
})
.catch(() => {})
}
},
mounted() {
this.couponTemplate()
// this.confirmMsg()
}
}
</script>
......@@ -509,6 +753,32 @@ export default {
line-height: 28px;
border-bottom: 1px solid #f0f1f7;
}
.inport-result {
margin: 10px;
line-height: 22px;
background: #ffefda;
border-radius: 4px;
padding: 9px 16px;
font-size: 14px;
color: #333333;
span {
color: #5850ff;
margin-right: 20px;
&:last-child {
cursor: pointer;
position: relative;
input {
cursor: pointer;
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
font-size: 0px;
}
}
}
}
.edit-form-container {
padding: 8px 50px;
}
......
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-16 18:53:17
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-05-16 18:54:01
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\components\ScheduleCalendar\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div>
<WorkCalendar ref="workCalendarTemplate" :options="calendarOptions"/>
<WorkCalendar ref="workCalendarTemplate" :options="calendarOptions" />
</div>
</template>
<script>
import WorkCalendar from 'work-calendar';
// import WorkCalendar from 'work-calendar';
export default {
components: {
WorkCalendar
},
// components: {
// WorkCalendar
// },
data() {
return {
calendarOptions: {
......@@ -44,14 +52,14 @@ export default {
Holiday: [
{ date: '2021/4/3', name: '清明节' },
{ date: '2021/4/4', name: '清明节' },
{ date: '2021/4/5', name: '清明节' },
{ date: '2021/4/5', name: '清明节' }
],
Workday: [
{ date: '2021/4/25', name: '补劳动节的班' },
{ date: '2021/5/8', name: '补劳动节的班' },
{ date: '2021/5/8', name: '补劳动节的班' }
]
},
}
}
}
}
</script>
\ No newline at end of file
</script>
......@@ -96,6 +96,7 @@
</template>
<script>
import { mapActions } from 'vuex'
export default {
name: 'homeStep',
data() {
......@@ -113,6 +114,7 @@ export default {
}
},
methods: {
...mapActions('marketing', ['setCustomDetail']),
jumpUrl(url) {
this.$history.push(url)
},
......@@ -121,6 +123,7 @@ export default {
this.$apis.home.viewData({}).then(res => {
this.loading = false
if (res) {
this.setCustomDetail(res)
const { purchaseCustomerCount, waitMatchCustomerAddCount, purchaseCustomerAddCount, purchaseCustomerAddPercent, waitMatchPercent, entmicroAddCustomerCount, customerCount } = res
this.purchaseCustomerCount = purchaseCustomerCount
this.waitMatchCustomerAddCount = waitMatchCustomerAddCount
......
......@@ -35,120 +35,6 @@
<div class="close" @click="scanningHandle(item)">+</div>
</div>
</div>
<!-- <div class="home-use-item">
<div :class="[isrenewal ? 'blur' : '']">
<div class="use-item-icon"><img src="@/assets/img/home/renewal.png" alt="" /></div>
<div class="use-item-title">续保招揽</div>
<div class="use-item-content">平台可将店内续保套餐线上化,链接化。员工可通过企微、微信等渠道的分发。并提供了二次线索跟进功能,进一步提高对意向客户的跟进能力。</div>
<div class="use-item-config">
<div class="use-config-item">
<i class="el-icon-check"></i>
续保线索二次跟进
</div>
<div class="use-config-item">
<i class="el-icon-check"></i>
续保套餐线上化
</div>
<div class="use-config-item">
<i class="el-icon-check"></i>
套餐灵活打包
</div>
</div>
<div class="use-flex">
<div class="use-operation" @click="useHandle(5)">立即使用</div>
<div class="use-operation bgf" @click="scanningHandle('renewal')">扫码体验</div>
</div>
</div>
<div class="mask" v-show="isrenewal">
<div>
<p>门店端</p>
<img :src="this.$scene.renewal[0]" alt="" />
<p class="share-text">分享活动链接</p>
</div>
<div>
<p>车主端</p>
<img :src="this.$scene.renewal[1]" alt="" />
<p class="share-text">浏览并参与活动</p>
</div>
<div class="close" @click="scanningHandle('renewal')">+</div>
</div>
</div>
<div class="home-use-item">
<div :class="[isbail ? 'blur' : '']">
<div class="use-item-icon"><img src="@/assets/img/home/bail.png" alt="" /></div>
<div class="use-item-title">定保招揽</div>
<div class="use-item-content">基于店内定保业务场景, 平台通过整合第三方的福利卡券,为门店带来异业联盟的新契机,让定保套餐在销售路径上更丰富,提高对消费者的吸引力。</div>
<div class="use-item-config">
<div class="use-config-item">
<i class="el-icon-check"></i>
提高定保场景营销能力
</div>
<div class="use-config-item">
<i class="el-icon-check"></i>
拓宽营销触点
</div>
<div class="use-config-item">
<i class="el-icon-check"></i>
活动效果数据化
</div>
</div>
<div class="use-flex">
<div class="use-operation" @click="useHandle(2)">立即使用</div>
<div class="use-operation bgf" @click="scanningHandle('bail')">扫码体验</div>
</div>
</div>
<div class="mask" v-show="isbail">
<div>
<p>门店端</p>
<img :src="this.$scene.bail[0]" alt="" />
<p class="share-text">分享活动链接</p>
</div>
<div>
<p>车主端</p>
<img :src="this.$scene.bail[1]" alt="" />
<p class="share-text">浏览并参与活动</p>
</div>
<div class="close" @click="scanningHandle('bail')">+</div>
</div>
</div>
<div class="home-use-item">
<div :class="[isfestivals ? 'blur' : '']">
<div class="use-item-icon"><img src="@/assets/img/home/festivals.png" alt="" /></div>
<div class="use-item-title">节假日关怀</div>
<div class="use-item-content">通过节日为契机,推送节日关怀链接并吸引用户购买相关服务。平台将提供贴合节日气氛的活动落地页,门店可根据业务需要整合服务或产品。</div>
<div class="use-item-config">
<div class="use-config-item">
<i class="el-icon-check"></i>
促进门店节假日产值转化
</div>
<div class="use-config-item">
<i class="el-icon-check"></i>
增加客户关怀
</div>
<div class="use-config-item">
<i class="el-icon-check"></i>
实现软性营销
</div>
</div>
<div class="use-flex">
<div class="use-operation" @click="useHandle(6)">立即使用</div>
<div class="use-operation bgf" @click="scanningHandle('festivals')">扫码体验</div>
</div>
</div>
<div class="mask" v-show="isfestivals">
<div>
<p>门店端</p>
<img :src="this.$scene.festivals[0]" alt="" />
<p class="share-text">分享活动链接</p>
</div>
<div>
<p>车主端</p>
<img :src="this.$scene.festivals[1]" alt="" />
<p class="share-text">浏览并参与活动</p>
</div>
<div class="close" @click="scanningHandle('festivals')">+</div>
</div>
</div> -->
</div>
</div>
</template>
......@@ -159,12 +45,16 @@ const sceneData = [
{ title: '定保招揽', content: '基于店内定保业务场景, 平台通过整合第三方的福利卡券,为门店带来异业联盟的新契机,让定保套餐在销售路径上更丰富,提高对消费者的吸引力。', config: [' 提高定保场景营销能力', ' 拓宽营销触点', '活动效果数据化'], icon: 'bail', type: 2, isShow: false },
{ title: '节假日关怀', content: '通过节日为契机,推送节日关怀链接并吸引用户购买相关服务。平台将提供贴合节日气氛的活动落地页,门店可根据业务需要整合服务或产品。', config: [' 促进门店节假日产值转化', '增加客户关怀', '实现软性营销'], icon: 'festivals', type: 5, isShow: false }
]
import { mapGetters } from 'vuex'
export default {
data() {
return {
sceneData
}
},
computed: {
...mapGetters(['marketing'])
},
methods: {
scanningHandle(data) {
data.isShow = !data.isShow
......@@ -173,7 +63,15 @@ export default {
this.$history.push(`/link/activityLink/editActivity?addOrEdit=add&subscribe=${value}&$title=新建活动`)
},
useHandleGPT() {
this.$router.push('/home/marketing')
const { purchaseCustomerCount, entmicroAddCustomerCount, entmicroNotAddCustomerCount } = this.marketing.customDetail
this.$router.push({
path: '/home/marketing',
query: {
purchaseCustomerCount,
entmicroAddCustomerCount,
entmicroNotAddCustomerCount
}
})
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!