Commit b6f52280 by 杨明

fixed

1 parent cf9bdfb7
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-16 17:13:33 * @Date: 2023-05-16 17:13:33
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-16 16:27:09 * @LastEditTime: 2023-07-17 15:39:18
* @FilePath: \scrm-micro-home\src\store\modules\marketing.js * @FilePath: \scrm-micro-home\src\store\modules\marketing.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -47,7 +47,6 @@ export default { ...@@ -47,7 +47,6 @@ export default {
// 设置活动信息 // 设置活动信息
SET_ACTIVITY_INFO(state, data) { SET_ACTIVITY_INFO(state, data) {
if (data.activityBigImg) { if (data.activityBigImg) {
data.codeId = null
data.backgroundImage = data.activityBigImg data.backgroundImage = data.activityBigImg
data.merchantAddress = data.activityAddressDetailName data.merchantAddress = data.activityAddressDetailName
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</GLTable> </GLTable>
</GLDialog> </GLDialog>
<el-dialog title="预览" :append-to-body="true" :before-close="handleClose" :visible.sync="dialogVisible" width="30%"> <el-dialog title="预览" :append-to-body="true" :before-close="handleClose" :visible.sync="dialogVisible" width="30%">
<phone-view v-if="dialogVisible" :activityInfo="activityInfo"></phone-view> <phone-view v-if="dialogVisible" :activityDetail="activityInfo"></phone-view>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-06-29 21:24:27 * @Date: 2023-06-29 21:24:27
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-16 16:47:44 * @LastEditTime: 2023-07-17 15:40:36
* @FilePath: \scrm-micro-link\src\views\activityLink\components\MarketingContent.vue * @FilePath: \scrm-micro-link\src\views\activityLink\components\MarketingContent.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -295,7 +295,7 @@ export default { ...@@ -295,7 +295,7 @@ export default {
} }
return return
} }
if (info.codeId) { if (info.codeId && this.routerInfo.addOrEdit == 'add') {
this.setDetail(info) this.setDetail(info)
return return
} }
......
...@@ -85,10 +85,11 @@ ...@@ -85,10 +85,11 @@
<script> <script>
// import addGift from './AddGift' // import addGift from './AddGift'
import gift from '@/mixins/gift' import gift from '@/mixins/gift'
import marketing from '@/mixins/marketing'
import { openTab } from '@/utils/index' import { openTab } from '@/utils/index'
import { mapActions, mapState } from 'vuex' import { mapActions, mapMutations, mapState } from 'vuex'
export default { export default {
mixins: [gift], mixins: [gift, marketing],
// components: { // components: {
// addGift // addGift
// }, // },
...@@ -164,6 +165,11 @@ export default { ...@@ -164,6 +165,11 @@ export default {
if (info.activityPrice) { if (info.activityPrice) {
this.editForm.activityPrice = info.activityPrice / 100 this.editForm.activityPrice = info.activityPrice / 100
} }
setTimeout(() => {
if (this.routerInfo.addOrEdit == 'edit') {
this.handleSaveGift()
}
}, 100)
this.getList() this.getList()
}) })
...@@ -176,6 +182,7 @@ export default { ...@@ -176,6 +182,7 @@ export default {
}, },
methods: { methods: {
...mapActions('marketing', ['setPackage', 'setProcess']), ...mapActions('marketing', ['setPackage', 'setProcess']),
...mapMutations('marketing', ['SET_STEP']),
init() { init() {
this.currentIndex = '1' this.currentIndex = '1'
this.goodsIndex = 1 this.goodsIndex = 1
...@@ -249,7 +256,8 @@ export default { ...@@ -249,7 +256,8 @@ export default {
params.equityServices = equityServices.join(',') params.equityServices = equityServices.join(',')
params.activityPrice = (this.editForm.activityPrice * 100).toFixed(0) params.activityPrice = (this.editForm.activityPrice * 100).toFixed(0)
params.superMarketingCouponRelRequestList = selectedGoodsList || [] params.superMarketingCouponRelRequestList = selectedGoodsList || []
console.log(params) console.log(888)
this.SET_STEP(3)
this.setProcess({ this.setProcess({
1: { 1: {
...params ...params
......
...@@ -76,6 +76,10 @@ ...@@ -76,6 +76,10 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="footer-box">
<el-button @click="handleCancelTask(item)">取消</el-button>
<el-button type="primary" @click="handleConfirmTask()">确定</el-button>
</div>
</div> </div>
</template> </template>
</div> </div>
...@@ -124,7 +128,7 @@ const config = Object.freeze({ ...@@ -124,7 +128,7 @@ const config = Object.freeze({
messageContent: '【广汇汽车】诚邀您参与{0},请尽快点击链接参与,谨防错过哦! {1} 谨防错过退订回T。' messageContent: '【广汇汽车】诚邀您参与{0},请尽快点击链接参与,谨防错过哦! {1} 谨防错过退订回T。'
}) })
const taskData = { tableData: [], expand: true, assignType: 0, customerNumTotal: 0, lastFollowStaffList: [], staffList: [], excelUrl: '', isFinish: false } const taskData = { tableData: [], expand: true, assignType: 0, customerNumTotal: 0, lastFollowStaffList: [], staffList: [], excelUrl: '', isFinish: false }
import { mapActions, mapState } from 'vuex' import { mapActions, mapState, mapMutations } from 'vuex'
export default { export default {
data() { data() {
return { return {
...@@ -173,6 +177,7 @@ export default { ...@@ -173,6 +177,7 @@ export default {
}, },
methods: { methods: {
...mapActions('marketing', ['setProcess']), ...mapActions('marketing', ['setProcess']),
...mapMutations('marketing', ['SET_STEP']),
uploadFile(e, item) { uploadFile(e, item) {
const file = e.srcElement.files[0] const file = e.srcElement.files[0]
let AllImgExt = '.xls|.xlsx' let AllImgExt = '.xls|.xlsx'
...@@ -237,11 +242,10 @@ export default { ...@@ -237,11 +242,10 @@ export default {
}, },
//营销任务-导入客户 //营销任务-导入客户
importCustomer(url, item) { importCustomer(url, item) {
console.log(this.customerKeys)
let param = { let param = {
merchantId: this.$globalState.session.merchantId, merchantId: this.$globalState.session.merchantId,
excelUrl: url, excelUrl: url,
customerKeys: this.customerKey customerKeys: this.customerKey.filter(item => item)
} }
this.$apis.marketing.importCustomer(param).then(res => { this.$apis.marketing.importCustomer(param).then(res => {
if (res.customerNumTotal == 0) { if (res.customerNumTotal == 0) {
...@@ -298,6 +302,18 @@ export default { ...@@ -298,6 +302,18 @@ export default {
this.configVisible = false this.configVisible = false
this.configForm = {} this.configForm = {}
}, },
handleCancelTask(item) {
item.isFinish = false
item.excelUrl = ''
item.key = ''
item.lastFollowStaffList = ''
item.customerNumTotal = ''
this.customerKey[item.batchNo - 1] = ''
console.log(this.customerKey)
},
handleConfirmTask() {
this.vaildTask()
},
handleCancelConfirm() { handleCancelConfirm() {
this.configVisible = false this.configVisible = false
console.log(this.taskList[this.batchNo].tableData) console.log(this.taskList[this.batchNo].tableData)
...@@ -311,10 +327,15 @@ export default { ...@@ -311,10 +327,15 @@ export default {
this.customerKey = [] this.customerKey = []
this.findMerchantStaffList() this.findMerchantStaffList()
this.setProcess({ 0: true }) this.setProcess({ 0: true })
this.SET_STEP(2)
}, },
handleConfirm() { handleConfirm() {
if (this.vaildTask()) { const task = this.getFinisTask()
const customerRequestList = this.$common.utils.deepClone(this.taskList).map(item => { if (task.length == 0) {
this.$message.error('请配置营销任务')
return
}
const customerRequestList = this.$common.utils.deepClone(task).map(item => {
return { return {
batchNo: item.batchNo, batchNo: item.batchNo,
excelUrl: item.excelUrl, excelUrl: item.excelUrl,
...@@ -341,13 +362,12 @@ export default { ...@@ -341,13 +362,12 @@ export default {
return result return result
}, []) }, [])
}) })
console.log(customerRequestList) this.SET_STEP(3)
this.setProcess({ this.setProcess({
0: { 0: {
customerRequestList customerRequestList
} }
}) })
}
}, },
//验证配置任务,及分配人员 //验证配置任务,及分配人员
vaildTask() { vaildTask() {
...@@ -372,6 +392,28 @@ export default { ...@@ -372,6 +392,28 @@ export default {
return false return false
} }
}, },
getFinisTask() {
const len = this.taskList.length
const task = this.taskList[len - 1]
const staffListLength = task.staffList.length
//获取上次跟进人总数
const lastCustomerNum = task.assignType == 0 ? 0 : task.staffList.reduce((total, { lastCustomerNum }) => total + (lastCustomerNum || 0), 0)
if (task.excelUrl && staffListLength) {
task.isFinish = true
let residue = task.customerNumTotal - lastCustomerNum || 0
let avag = Math.ceil(residue / staffListLength)
task.staffList.forEach((item, i) => {
const lastNum = task.assignType == 0 ? 0 : item.lastCustomerNum || 0
this.$set(item, 'customerNum', residue > avag ? lastNum + avag : lastNum + residue)
residue -= avag
avag = Math.ceil(residue / (staffListLength - i - 1))
})
return this.taskList
} else {
return this.taskList.slice(0, len - 1)
}
},
addTask() { addTask() {
let len = this.taskList.length let len = this.taskList.length
if (len == 10) { if (len == 10) {
...@@ -500,6 +542,11 @@ export default { ...@@ -500,6 +542,11 @@ export default {
margin-right: 10px; margin-right: 10px;
} }
} }
.footer-box {
text-align: center;
margin-top: 30px;
padding-bottom: 20px;
}
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-15 15:08:32 * @Date: 2023-05-15 15:08:32
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-16 14:01:44 * @LastEditTime: 2023-07-17 16:29:54
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\MarketingRight.vue * @FilePath: \scrm-micro-home\src\views\home\components\Marketing\MarketingRight.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -107,6 +107,12 @@ ...@@ -107,6 +107,12 @@
</div> </div>
</div> </div>
</div> </div>
<div class="wechat-footer">
<div class="footer-panel">
<div class="wechat-footer-price">¥{{ ((detail.activityPrice || 0) / 100).toFixed(2) }}元</div>
<img src="@/assets/seckillActivity/crowd-footer.png" />
</div>
</div>
</template> </template>
<template v-else-if="isFestival"> <template v-else-if="isFestival">
<img src="@/assets/seckillActivity/phone.png" class="review-phone" /> <img src="@/assets/seckillActivity/phone.png" class="review-phone" />
...@@ -185,13 +191,18 @@ ...@@ -185,13 +191,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="review-footer" v-if="!isNaN(detail.activityPrice)"> <div class="wechat-footer">
<label>¥</label> <div class="footer-panel">
{{ (detail.activityPrice / 100).toFixed(2) }} <div class="wechat-footer-price">¥{{ ((detail.activityPrice || 0) / 100).toFixed(2) }}元</div>
<img src="@/assets/seckillActivity/crowd-footer.png" />
</div>
</div> </div>
</template> </template>
<template v-else-if="activityDetail">
<phone-view-a :editForm="activityDetail"></phone-view-a>
</template>
<template v-else> <template v-else>
<phone-view-a :editForm="activityInfo" v-if="activityInfo"></phone-view-a> <img src="@/assets/seckillActivity/phone.png" class="review-phone" />
</template> </template>
</div> </div>
</template> </template>
...@@ -202,6 +213,7 @@ const RENEWAL = [1, 2, 3, 4, 5, 6, 7, 8] ...@@ -202,6 +213,7 @@ const RENEWAL = [1, 2, 3, 4, 5, 6, 7, 8]
const FESTIVAL = [9, 10] const FESTIVAL = [9, 10]
import PhoneViewA from './PhoneViewA' import PhoneViewA from './PhoneViewA'
import draw from '@/mixins/draw' import draw from '@/mixins/draw'
import marketing from '@/mixins/marketing'
import equityOne from './model/model_1/equity' import equityOne from './model/model_1/equity'
import goodsOne from './model/model_1/goods' import goodsOne from './model/model_1/goods'
import couponOne from './model/model_1/coupon' import couponOne from './model/model_1/coupon'
...@@ -218,7 +230,7 @@ import { mapState } from 'vuex' ...@@ -218,7 +230,7 @@ import { mapState } from 'vuex'
import VueDraggableResizable from '@/components/draggable/vue-draggable-resizable' import VueDraggableResizable from '@/components/draggable/vue-draggable-resizable'
import '@/components/draggable/vue-draggable-resizable.css' import '@/components/draggable/vue-draggable-resizable.css'
export default { export default {
mixins: [draw], mixins: [draw, marketing],
data() { data() {
return { return {
backgroundHeight: 0, backgroundHeight: 0,
...@@ -286,14 +298,14 @@ export default { ...@@ -286,14 +298,14 @@ export default {
couponFour couponFour
}, },
computed: { computed: {
...mapState('marketing', ['packageList', 'process']) ...mapState('marketing', ['packageList', 'process', 'activityInfo'])
}, },
props: { props: {
isSuper: { isSuper: {
type: Boolean, type: Boolean,
default: true default: true
}, },
activityInfo: { activityDetail: {
type: Object, type: Object,
default: () => {} default: () => {}
} }
...@@ -316,19 +328,45 @@ export default { ...@@ -316,19 +328,45 @@ export default {
}) })
}, },
watch: { watch: {
// packageList: { activityInfo: {
// handler(val) { handler(val) {
// console.log(val, 8888) const info = this.$common.utils.deepClone(val)
// this.detail = { ...this.detail, ...val } if (this.routerInfo.addOrEdit == 'edit') {
// }, this.showActivity(info)
// deep: true, }
// immediate: true },
// }, deep: true,
immediate: true
},
process: { process: {
handler(val) { handler(val) {
this.detail = { ...this.detail, ...val[2] } const detail = { ...this.detail, ...val[2] }
detail.activityPrice = val[1].activityPrice
if (this.routerInfo.addOrEdit == 'edit') {
this.showActivity(detail)
} else {
this.validActivity(detail)
}
},
deep: true,
immediate: true
}
},
methods: {
showActivity(detail) {
this.detail = detail
this.detailCoupon = this.$common.utils.deepClone(this.packageList)
if (RENEWAL.includes(this.detail.codeId)) {
this.modelNum = this.detail.codeId
this.isRenewal = true
}
if (FESTIVAL.includes(this.detail.codeId)) {
this.isFestival = true
}
},
validActivity(detail) {
this.detail = detail
this.detailCoupon = this.$common.utils.deepClone(this.packageList) this.detailCoupon = this.$common.utils.deepClone(this.packageList)
console.log(this.detailCoupon)
this.$nextTick(async () => { this.$nextTick(async () => {
this.isFestival = false this.isFestival = false
this.isRenewal = false this.isRenewal = false
...@@ -388,11 +426,6 @@ export default { ...@@ -388,11 +426,6 @@ export default {
} }
}) })
}, },
deep: true,
immediate: true
}
},
methods: {
formatPrice(val) { formatPrice(val) {
return (val / 100).toFixed(2).replace(/\.[0]+$/, '') return (val / 100).toFixed(2).replace(/\.[0]+$/, '')
}, },
...@@ -446,6 +479,24 @@ export default { ...@@ -446,6 +479,24 @@ export default {
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.wechat-footer {
width: 284px;
position: absolute;
top: 538px;
height: 38px;
img {
width: 100%;
}
.footer-panel {
position: relative;
.wechat-footer-price {
position: absolute;
line-height: 38px;
left: 50px;
color: #eb4e4e;
}
}
}
.review-body { .review-body {
margin: 10px auto; margin: 10px auto;
width: 288px; width: 288px;
...@@ -480,7 +531,7 @@ export default { ...@@ -480,7 +531,7 @@ export default {
.review-content { .review-content {
position: absolute; position: absolute;
width: calc(100% - 36px); width: calc(100% - 36px);
height: 504px; height: 475px;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
top: 47px; top: 47px;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</div> </div>
<div class="case-result" @click="handleSave">执行营销方案</div> <div class="case-result" @click="handleSave">执行营销方案</div>
</div> </div>
<div class="case-container" v-show="showPhone"> <div class="case-container">
<div class="case-container-title">预览营销方案</div> <div class="case-container-title">预览营销方案</div>
<phoneView ref="viewForm"></phoneView> <phoneView ref="viewForm"></phoneView>
</div> </div>
...@@ -21,8 +21,10 @@ const FESTIVAL = [9, 10] ...@@ -21,8 +21,10 @@ const FESTIVAL = [9, 10]
import { mapState, mapMutations } from 'vuex' import { mapState, mapMutations } from 'vuex'
import phoneView from './PhoneView' import phoneView from './PhoneView'
import draw from '@/mixins/draw' import draw from '@/mixins/draw'
import marketing from '@/mixins/marketing'
export default { export default {
mixins: [draw], mixins: [draw, marketing],
components: { components: {
phoneView phoneView
}, },
...@@ -40,12 +42,19 @@ export default { ...@@ -40,12 +42,19 @@ export default {
watch: { watch: {
process: { process: {
handler(val) { handler(val) {
this.showPhone = false
for (let k in val) { for (let k in val) {
this.caseList[k].isFinish = val[k] ? true : false this.caseList[k].isFinish = val[k] ? true : false
} }
if (val[2].codeId) { },
this.showPhone = true deep: true,
immediate: true
},
activityInfo: {
handler(val) {
if (this.routerInfo.addOrEdit == 'edit') {
for (let k in this.caseList) {
this.caseList[k].isFinish = true
}
} }
}, },
deep: true, deep: true,
...@@ -74,10 +83,10 @@ export default { ...@@ -74,10 +83,10 @@ export default {
draggableList draggableList
} = this.$refs.viewForm } = this.$refs.viewForm
let url = backgroundImage let url = backgroundImage
if (RENEWAL.includes(params.codeId)) { if (RENEWAL.includes(params.codeId) && !params.id) {
url = await this.createMain(backgroundHeight, backgroundImage, draggableList) //合并主图、文字 url = await this.createMain(backgroundHeight, backgroundImage, draggableList) //合并主图、文字
} }
if (FESTIVAL.includes(params.codeId)) { if (FESTIVAL.includes(params.codeId) && !params.id) {
url = await this.createBig(this.$refs.viewForm.detail, this.logoInfo, JSON.parse(titleStyle), JSON.parse(subTitleStyle)) //合并主图、背景图、logo、文字 url = await this.createBig(this.$refs.viewForm.detail, this.logoInfo, JSON.parse(titleStyle), JSON.parse(subTitleStyle)) //合并主图、背景图、logo、文字
} }
let origin = 'createSuperMarketing' let origin = 'createSuperMarketing'
...@@ -118,7 +127,7 @@ export default { ...@@ -118,7 +127,7 @@ export default {
} }
}, },
computed: { computed: {
...mapState('marketing', ['process', 'subscribe']) ...mapState('marketing', ['process', 'subscribe', 'activityInfo'])
} }
} }
</script> </script>
......
...@@ -124,6 +124,7 @@ export default { ...@@ -124,6 +124,7 @@ export default {
}, },
beforeDestroy() { beforeDestroy() {
this.setSubscribe(null) this.setSubscribe(null)
this.SET_STEP(1)
this.handleAdd() this.handleAdd()
}, },
methods: { methods: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!