Commit 1ba673b5 by 杨明

fixed

1 parent d4569c06
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-06-29 16:16:03 * @Date: 2023-06-29 16:16:03
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-07 14:33:25 * @LastEditTime: 2023-07-07 18:22:38
* @FilePath: \scrm-micro-link\src\api\modules\marketing.js * @FilePath: \scrm-micro-link\src\api\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
*/ */
...@@ -75,6 +75,34 @@ const findMerchantStaffList = params => { ...@@ -75,6 +75,34 @@ const findMerchantStaffList = params => {
sign: true sign: true
}) })
} }
//创建超级营销
const createSuperMarketing = params => {
params.method = 'marketing.api.supermarket.createSuperMarketing'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
const findActivityInfo = params => {
params.method = 'marketing.api.supermarket.findActivityInfo'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
const activityDetail = params => {
params.method = 'scrm.api.shopmall.activity.detail'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
viewData, viewData,
getChatGPTList, getChatGPTList,
...@@ -82,5 +110,8 @@ export default { ...@@ -82,5 +110,8 @@ export default {
calendarDetail, calendarDetail,
importCustomer, importCustomer,
getRobotList, getRobotList,
findMerchantStaffList findMerchantStaffList,
createSuperMarketing,
activityDetail,
findActivityInfo
} }
...@@ -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-07 12:16:23 * @LastEditTime: 2023-07-07 18:23:30
* @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
*/ */
...@@ -16,13 +16,19 @@ export default { ...@@ -16,13 +16,19 @@ export default {
subscribe: null, subscribe: null,
keywords: null, keywords: null,
GPTList: null, GPTList: null,
packageList: {} packageList: {},
process: { 0: false, 1: false, 2: false },
activityInfo: {}
}, },
mutations: { mutations: {
// 设置场景值 // 设置场景值
SET_SUBSCRIBE(state, data) { SET_SUBSCRIBE(state, data) {
state.subscribe = data state.subscribe = data
}, },
// 设置活动信息
SET_ACTIVITY_INFO(state, data) {
state.activityInfo = data
},
SET_KET_WORDs(state, data) { SET_KET_WORDs(state, data) {
state.keywords = data state.keywords = data
}, },
...@@ -31,6 +37,9 @@ export default { ...@@ -31,6 +37,9 @@ export default {
}, },
SET_PACKAGE_LIST(state, data) { SET_PACKAGE_LIST(state, data) {
state.packageList = Object.assign({}, data) state.packageList = Object.assign({}, data)
},
SET_PROCESS(state, data) {
state.process = Object.assign(state.process, data)
} }
}, },
actions: { actions: {
...@@ -45,9 +54,29 @@ export default { ...@@ -45,9 +54,29 @@ export default {
} }
}) })
}, },
//活动活动详情
getActivityInfo({ commit }, data) {
let { id, subscribe } = data,
param = {
activityId: id
},
activityAPi = 'findActivityInfo'
if (subscribe != 8) {
param = {
id
}
activityAPi = 'activityDetail'
}
apis.marketing[activityAPi](param).then(res => {
commit('SET_ACTIVITY_INFO', res)
})
},
setPackage({ commit }, data) { setPackage({ commit }, data) {
commit('SET_PACKAGE_LIST', data) commit('SET_PACKAGE_LIST', data)
}, },
setProcess({ commit }, data) {
commit('SET_PROCESS', data)
},
setSubscribe({ commit, dispatch }, data) { setSubscribe({ commit, dispatch }, data) {
commit('SET_SUBSCRIBE', data) commit('SET_SUBSCRIBE', data)
dispatch('setKeyWords', subscribeData[data]) dispatch('setKeyWords', subscribeData[data])
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
import marketingTask from './MarketingTask' import marketingTask from './MarketingTask'
import marketingGift from './MarketingGift' import marketingGift from './MarketingGift'
import marketingContent from './MarketingContent' import marketingContent from './MarketingContent'
import { mapActions } from 'vuex'
export default { export default {
components: { components: {
marketingTask, marketingTask,
...@@ -115,6 +116,7 @@ export default { ...@@ -115,6 +116,7 @@ export default {
} }
}, },
methods: { methods: {
...mapActions('marketing', ['getActivityInfo']),
//数据看板 //数据看板
handleJump(row) { handleJump(row) {
this.$router.push({ this.$router.push({
...@@ -126,7 +128,10 @@ export default { ...@@ -126,7 +128,10 @@ export default {
}) })
}, },
//引用 //引用
handleUse(row) {}, handleUse(row) {
this.caseVisible = false
this.getActivityInfo(row)
},
//预览 //预览
handleView(row) {}, handleView(row) {},
tabClick(index) { tabClick(index) {
......
...@@ -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-07 16:04:21 * @LastEditTime: 2023-07-07 18:29:33
* @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
--> -->
...@@ -28,13 +28,16 @@ ...@@ -28,13 +28,16 @@
</div> </div>
</template> </template>
</glsx-combi-form> </glsx-combi-form>
<div class="panel-footer">
<el-button type="primary" @click="handleSave" size="medium">保存营销内容</el-button>
</div>
<select-insure :modelVisible="modelVisible" v-if="modelVisible" @handleClose="handleClose" @handleSure="handleSure"></select-insure> <select-insure :modelVisible="modelVisible" v-if="modelVisible" @handleClose="handleClose" @handleSure="handleSure"></select-insure>
</div> </div>
</template> </template>
<script> <script>
import selectInsure from './SelectInsure.vue' import selectInsure from './SelectInsure.vue'
import { mapState } from 'vuex' import { mapState, mapActions } from 'vuex'
export default { export default {
components: { components: {
selectInsure selectInsure
...@@ -211,12 +214,38 @@ export default { ...@@ -211,12 +214,38 @@ export default {
this.editRule.detailImage[0].required = true this.editRule.detailImage[0].required = true
this.editFormData[0].isHide = true this.editFormData[0].isHide = true
} }
},
activityInfo: {
handler(info) {
this.editForm = this.$common.utils.deepClone(info)
if (info.activityName) {
this.$set(this.editForm, 'marketingTitle', info.activityName)
}
if (info.starttime) {
this.$set(this.editForm, 'activityTime', [info.starttime.replace(/-/g, '/'), info.endtime.replace(/-/g, '/')])
}
if (info.startTime) {
this.$set(this.editForm, 'activityTime', [info.startTime.replace(/-/g, '/'), info.endTime.replace(/-/g, '/')])
}
if (info.merchantName) {
this.$set(this.editForm, 'merchantname', info.merchantName)
}
// 地图
if (info.activityAddressProvinceName || info.activityAddressCityName) {
this.$refs.editFormRef.$refs.provinceForm[0].init(info.activityAddressProvinceName, info.activityAddressCityName)
}
if (info.activityPrice) {
this.$set(this.editForm, 'activityPrice', info.activityPrice / 100)
}
},
deep: true
} }
}, },
computed: { computed: {
...mapState('marketing', ['GPTList', 'subscribe']) ...mapState('marketing', ['GPTList', 'subscribe', 'activityInfo'])
}, },
methods: { methods: {
...mapActions('marketing', ['setProcess']),
handleSure(val) { handleSure(val) {
this.modelVisible = false this.modelVisible = false
this.getTemplateInfo(val.id) this.getTemplateInfo(val.id)
...@@ -233,6 +262,24 @@ export default { ...@@ -233,6 +262,24 @@ export default {
this.editForm.activityTime = [startTime + ' 00:00:00', endTime + ' 00:00:00'] this.editForm.activityTime = [startTime + ' 00:00:00', endTime + ' 00:00:00']
}) })
}, },
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]
}
delete param.createdTime
return param
},
handleSave() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
this.setProcess({ 2: this.getCouponInfoParams() })
}
})
},
handleClose() { handleClose() {
this.modelVisible = false this.modelVisible = false
}, },
...@@ -268,6 +315,10 @@ export default { ...@@ -268,6 +315,10 @@ export default {
} }
} }
} }
.panel-footer {
text-align: center;
margin-top: 30px;
}
</style> </style>
<style lang="scss"> <style lang="scss">
#merchantAddress { #merchantAddress {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div class="gift-table"> <div class="gift-table">
<div class="goods-panel"> <div class="goods-panel">
<div v-show="currentIndex == 1" class="car-table"> <div v-show="currentIndex == 1" class="car-table">
<GLTable :hasPage="false" v-loading="loading" ref="carRef" :tableData="carList" :tableParams="carTableParams" @refreshTable="getCarList" @selectionTable="handleSelectionCarTable"> <GLTable :hasPage="false" v-loading="loading" ref="carRef" :tableData="carList" :tableParams="carTableParams" @refreshTable="getCarList" @select="handleSelectionCarTable">
<template slot="price" slot-scope="scope"> <template slot="price" slot-scope="scope">
<el-input v-model="scope.scope.price" placeholder="请输入"></el-input> <el-input v-model="scope.scope.price" placeholder="请输入"></el-input>
</template> </template>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<div class="tab-border" :style="{ left: (goodsIndex - 1) * 61 + 2 + 'px' }"></div> <div class="tab-border" :style="{ left: (goodsIndex - 1) * 61 + 2 + 'px' }"></div>
</div> </div>
<div v-for="(item, index) in goodsTabList" :key="index"> <div v-for="(item, index) in goodsTabList" :key="index">
<GLTable v-loading="loading" v-show="goodsIndex == item.type" :ref="'goodsRef' + item.type" :tableData="goodsList" :tableParams="goodsTableParams" @refreshTable="getGoodsList" @selectionTable="handleSelectionGoodsTable"></GLTable> <GLTable v-loading="loading" v-show="goodsIndex == item.type" :ref="'goodsRef' + item.type" :tableData="goodsList" :tableParams="goodsTableParams" @refreshTable="getGoodsList" @select="handleSelectionGoodsTable"></GLTable>
</div> </div>
</div> </div>
<div v-show="currentIndex == 3"> <div v-show="currentIndex == 3">
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<div class="tab-border" :style="{ left: (serviceIndex == 7 ? 0 : serviceIndex - 1) * 88 + 2 + 'px' }"></div> <div class="tab-border" :style="{ left: (serviceIndex == 7 ? 0 : serviceIndex - 1) * 88 + 2 + 'px' }"></div>
</div> </div>
<div v-for="(item, index) in serviceTabList" :key="index"> <div v-for="(item, index) in serviceTabList" :key="index">
<GLTable :hasPage="false" v-loading="loading" v-show="serviceIndex == item.type" :ref="'serviceRef' + item.type" :tableData="serviceList" :tableParams="serviceTableParams" @refreshTable="getServiceList" @selectionTable="handleSelectionServiceTable"> <GLTable :hasPage="false" v-loading="loading" v-show="serviceIndex == item.type" :ref="'serviceRef' + item.type" :tableData="serviceList" :tableParams="serviceTableParams" @refreshTable="getServiceList" @select="handleSelectionServiceTable">
<span slot="effectiveType" slot-scope="scope"> <span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span> <span>{{ toLabelText(scope.scope) }}</span>
</span> </span>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</glsx-combi-form> </glsx-combi-form>
<div class="gift-footer"> <div class="gift-footer">
<el-button @click="handleSave" size="medium">保存为套餐</el-button> <el-button @click="handleSave" size="medium">保存为套餐</el-button>
<el-button type="primary" @click="handleConfirm" size="medium">保存为礼包</el-button> <el-button type="primary" @click="handleSaveGift" size="medium">保存为礼包</el-button>
</div> </div>
<GLDialog class="qr-dialog" title="保存礼包" mode="mid" :visible.sync="giftVisible" @onOk="handleConfirm" @onCancel="giftVisible = false"> <GLDialog class="qr-dialog" title="保存礼包" mode="mid" :visible.sync="giftVisible" @onOk="handleConfirm" @onCancel="giftVisible = false">
<div class="gl-form-page gl-form-min"> <div class="gl-form-page gl-form-min">
...@@ -117,13 +117,30 @@ export default { ...@@ -117,13 +117,30 @@ export default {
}, },
serviceIndex() { serviceIndex() {
this.getList() this.getList()
},
activityInfo: {
handler(info) {
if (info.serviceMerchantPackageConfigDTOList && info.serviceMerchantPackageConfigDTOList.length) {
this.selectedCarList = info.serviceMerchantPackageConfigDTOList
let activityCoupon = info.activityCouponBaseInfoDTOS || info.couponList
if (activityCoupon && activityCoupon.length) {
activityCoupon.forEach(item => {
item.id = item.couponId
item.denomination = item.couponAnticipatedCost
})
this.selectedGoodsList = activityCoupon.filter(i => i.discountType == 8)
this.selectedServiceList = activityCoupon.filter(i => i.discountType != 8)
}
}
},
deep: true
} }
}, },
computed: { computed: {
...mapState('marketing', ['packageList', 'subscribe']) ...mapState('marketing', ['packageList', 'subscribe', 'activityInfo'])
}, },
methods: { methods: {
...mapActions('marketing', ['setPackage']), ...mapActions('marketing', ['setPackage', 'setProcess']),
getGiftList(val) { getGiftList(val) {
const { merchantId } = this const { merchantId } = this
let params = { let params = {
...@@ -134,6 +151,9 @@ export default { ...@@ -134,6 +151,9 @@ export default {
this.giftList = res || [] this.giftList = res || []
}) })
}, },
handleSaveGift() {
this.setProcess({ 1: true })
},
handleSave() { handleSave() {
this.giftVisible = true this.giftVisible = true
this.giftName = '' this.giftName = ''
...@@ -160,20 +180,58 @@ export default { ...@@ -160,20 +180,58 @@ export default {
} }
}) })
}, },
//添加选中
addRows(selectedItems, rows, val) {
rows.forEach(row => {
//过滤,当selectedItems有此条数据时,则直接返回,不执行添加
if (selectedItems.find(item => item[val] == row[val])) {
return
}
selectedItems.push(row)
})
// return selectedItems
},
//取消选中
deleteRows(selectedItems, rows, val) {
//当selectedItems为空数组时,不执行删除
if (selectedItems.length == 0) {
return
}
rows.forEach(row => {
selectedItems = selectedItems.filter(item => item[val] == row[val])
})
// return selectedItems
},
// 选择/取消 门店服务 // 选择/取消 门店服务
handleSelectionServiceTable(val) { handleSelectionServiceTable(selection, val) {
this.selectedServiceList = val if (selection && selection.find(item => item && item.id == row.id)) {
this.setPackage(Object.assign(this.packageList, { selectedServiceList: val })) this.addRows(this.selectedServiceList, [row])
} else {
this.deleteRows(this.selectedServiceList, [row])
}
console.log(this.selectedServiceList)
// this.selectedServiceList = val
this.setPackage(Object.assign(this.packageList, { selectedServiceList: this.selectedServiceList }))
}, },
// 选择/取消 生活权益 // 选择/取消 生活权益
handleSelectionGoodsTable(val) { handleSelectionGoodsTable(selection, row) {
this.selectedGoodsList = val if (selection && selection.find(item => item && item.id == row.id)) {
this.setPackage(Object.assign(this.packageList, { selectedGoodsList: val })) this.addRows(this.selectedGoodsList, [row], 'id')
} else {
this.deleteRows(this.selectedGoodsList, [row], 'id')
}
console.log(this.selectedGoodsList)
this.setPackage(Object.assign(this.packageList, { selectedGoodsList: this.selectedGoodsList }))
}, },
// 选择/取消 用车权益 // 选择/取消 用车权益
handleSelectionCarTable(val) { handleSelectionCarTable(selection, row) {
this.selectedCarList = val if (selection && selection.find(item => item && item.id == row.id)) {
this.setPackage(Object.assign(this.packageList, { selectedCarList: val })) this.addRows(this.selectedCarList, [row], 'packageCode')
} else {
this.deleteRows(this.selectedCarList, [row], 'packageCode')
}
console.log(this.selectedCarList)
this.setPackage(Object.assign(this.packageList, { selectedCarList: this.selectedCarList }))
}, },
getList() { getList() {
switch (+this.currentIndex) { switch (+this.currentIndex) {
...@@ -246,12 +304,32 @@ export default { ...@@ -246,12 +304,32 @@ export default {
this.goodsList = res.list this.goodsList = res.list
// this.fnCallBack = true // this.fnCallBack = true
this.$refs['goodsRef' + this.goodsIndex][0].tableTotal = res.total this.$refs['goodsRef' + this.goodsIndex][0].tableTotal = res.total
this.selectedPreExisting(this.selectedGoodsList, this.goodsList, 'id', this.$refs['goodsRef' + this.goodsIndex][0])
}) })
.finally(() => { .finally(() => {
this.loading = false this.loading = false
}) })
}, },
//门店服务 //选中table已有数据
selectedPreExisting(rows, list, val, refTabel) {
refTabel.$refs['listMutiTable'].clearSelection()
if (rows.length > 0) {
//这里使用this.$nextTick是防止表格未渲染完成就执行,导致无法添加选中效果
this.$nextTick(() => {
rows.forEach(row => {
//判断row是存在当前tableData
list.forEach(i => {
if (i[val] == row[val]) {
console.log(i)
refTabel.$refs['listMutiTable'].toggleRowSelection(i, true)
}
})
})
})
} else {
refTabel.$refs['listMutiTable'].clearSelection()
}
},
getServiceList() { getServiceList() {
var params = { var params = {
...this.searchForm, ...this.searchForm,
...@@ -270,6 +348,7 @@ export default { ...@@ -270,6 +348,7 @@ export default {
this.serviceList = res.list this.serviceList = res.list
// this.fnCallBack = true // this.fnCallBack = true
this.$refs['serviceRef' + this.serviceIndex][0].tableTotal = res.total this.$refs['serviceRef' + this.serviceIndex][0].tableTotal = res.total
this.selectedPreExisting(this.selectedServiceList, this.serviceList, 'id', this.$refs['goodsRef' + this.serviceIndex][0])
}) })
.finally(() => { .finally(() => {
this.loading = false this.loading = false
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<div class="task-num-item flex"> <div class="task-num-item flex">
<label>选择跟进人:</label> <label>选择跟进人:</label>
<div class="task-border"> <div class="task-border">
<div class="flow-emp" v-for="(v, k) in item.selectArr" :key="k">{{ v.staffName }}</div> <div class="flow-emp" v-for="(v, k) in item.selectArr" :key="k">{{ v.staffName }}({{ v.lastCustomerNum }}人)</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<div class="task-box-num">导入客户</div> <div class="task-box-num">导入客户</div>
<div class="task-num-item flex-column-center"> <div class="task-num-item flex-column-center">
<label>分配方式:</label> <label>分配方式:</label>
<el-radio-group v-model="item.taskType"> <el-radio-group v-model="item.taskType" @change="handleChange(item)">
<el-radio :label="1">平均分配</el-radio> <el-radio :label="1">平均分配</el-radio>
<el-radio :label="2">上次跟进人</el-radio> <el-radio :label="2">上次跟进人</el-radio>
</el-radio-group> </el-radio-group>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="260"> <el-table-column label="操作" width="260">
<div class="config-panel flex" slot-scope="scope"> <div class="config-panel flex" slot-scope="scope">
<div class="config-msg" v-if="taskType == 2" @click="showRegister">邀请人员注册</div> <div class="config-msg" v-if="item.taskType == 2" @click="showRegister">邀请人员注册</div>
<div class="config-msg" @click="handleConfig(scope.row)">配置话术 / 短信</div> <div class="config-msg" @click="handleConfig(scope.row)">配置话术 / 短信</div>
</div> </div>
</el-table-column> </el-table-column>
...@@ -113,7 +113,8 @@ ...@@ -113,7 +113,8 @@
</template> </template>
<script> <script>
const taskData = { expand: true, taskType: '1', customerNumTotal: 0, lastFollowStaffList: [], selectArr: [], excelUrl: '', isFinish: true } const taskData = { expand: true, taskType: 1, customerNumTotal: 0, lastFollowStaffList: [], selectArr: [], excelUrl: '', isFinish: false }
import { mapActions } from 'vuex'
export default { export default {
data() { data() {
return { return {
...@@ -131,6 +132,7 @@ export default { ...@@ -131,6 +132,7 @@ export default {
this.findMerchantStaffList() this.findMerchantStaffList()
}, },
methods: { methods: {
...mapActions('marketing', ['setProcess']),
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'
...@@ -168,6 +170,16 @@ export default { ...@@ -168,6 +170,16 @@ export default {
this.tableData = res || [] this.tableData = res || []
}) })
}, },
handleChange(item) {
if (item.taskType == 2) {
const staffPhone = item.lastFollowStaffList.map(item => item.staffPhone)
this.tableData.forEach(i => {
if (staffPhone.includes(i.staffPhone)) {
this.$refs['form' + item.order].toggleRowSelection(i)
}
})
}
},
//营销任务-导入客户 //营销任务-导入客户
importCustomer(url, item) { importCustomer(url, item) {
console.log(this.customerKeys) console.log(this.customerKeys)
...@@ -179,6 +191,7 @@ export default { ...@@ -179,6 +191,7 @@ export default {
this.$apis.marketing.importCustomer(param).then(res => { this.$apis.marketing.importCustomer(param).then(res => {
item.excelUrl = url item.excelUrl = url
item.lastFollowStaffList = res.lastFollowStaffList item.lastFollowStaffList = res.lastFollowStaffList
item.customerNumTotal = res.customerNumTotal
this.customerKey.push(res.customerKey) this.customerKey.push(res.customerKey)
}) })
}, },
...@@ -202,6 +215,9 @@ export default { ...@@ -202,6 +215,9 @@ export default {
handleCancelConfirm() { handleCancelConfirm() {
this.configVisible = false this.configVisible = false
}, },
handleCancel() {
this.setProcess({ 0: true })
},
addTask() { addTask() {
let len = this.taskList.length let len = this.taskList.length
if (len == 10) { if (len == 10) {
...@@ -213,7 +229,14 @@ export default { ...@@ -213,7 +229,14 @@ export default {
task.isFinish = true task.isFinish = true
if (task.taskType == 1) { if (task.taskType == 1) {
const customerNumTotal = task.customerNumTotal const customerNumTotal = task.customerNumTotal
task.selectArr.forEach(item => {}) const length = task.selectArr.length
let avag = Math.ceil(customerNumTotal / length)
let residue = customerNumTotal
task.selectArr.forEach(item => {
this.$set(item, 'lastCustomerNum', residue > avag ? avag : residue)
residue = residue - avag
})
console.log(task.selectArr)
} }
this.taskList.push({ this.taskList.push({
order: ++len, order: ++len,
...@@ -289,11 +312,25 @@ export default { ...@@ -289,11 +312,25 @@ export default {
margin-left: 45px; margin-left: 45px;
.task-border { .task-border {
min-height: 79px; min-height: 79px;
width: calc(100% - 100px); width: calc(100% - 150px);
padding: 8px;
margin-bottom: 20px; margin-bottom: 20px;
background: #ffffff; background: #ffffff;
border: 1px solid #e5e5e5; border: 1px solid #e5e5e5;
border-radius: 4px; border-radius: 4px;
display: flex;
.flow-emp {
background: #f4f6fc;
border: 1px solid #e8e8ea;
border-radius: 4px;
padding: 0px 8px;
height: 30px;
line-height: 30px;
font-size: 14px;
color: #666666;
margin-right: 8px;
margin-bottom: 8px;
}
} }
&:last-child { &:last-child {
margin-bottom: 20px; margin-bottom: 20px;
......
<template> <template>
<div class="marketing-view"> <div class="marketing-view" v-loading="loading">
<div class="case-step"> <div class="case-step">
<div class="case-item" v-for="(item, index) in caseList" :key="index"> <div class="case-item" v-for="(item, index) in caseList" :key="index">
<i class="el-icon-success" v-if="item.isFinish"></i> <i class="el-icon-success" v-if="item.isFinish"></i>
<i class="el-icon-error" v-if="!item.isFinish"></i> <i class="el-icon-error" v-if="!item.isFinish"></i>
<span>{{ item.label }}</span> <span>{{ item.label }}</span>
</div> </div>
<div class="case-result">执行营销方案</div> <div class="case-result" @click="handleSave">执行营销方案</div>
</div> </div>
<div class="case-container"> <div class="case-container">
<div class="case-container-title">预览营销方案</div> <div class="case-container-title">预览营销方案</div>
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex'
import phoneView from './PhoneView' import phoneView from './PhoneView'
export default { export default {
components: { components: {
...@@ -23,12 +24,52 @@ export default { ...@@ -23,12 +24,52 @@ export default {
}, },
data() { data() {
return { return {
loading: false,
caseList: [ caseList: [
{ label: '请导入营销任务客群', isFinish: true }, { label: '请导入营销任务客群', isFinish: true },
{ label: '请配置营销礼包', isFinish: false }, { label: '请配置营销礼包', isFinish: false },
{ label: '请配置营销内容', isFinish: true } { label: '请配置营销内容', isFinish: true }
] ]
} }
},
watch: {
process: {
handler(val) {
for (let k in val) {
this.caseList[k].isFinish = val[k] ? true : false
}
},
deep: true,
immediate: true
}
},
methods: {
handleSave() {
let params = {}
console.log(this.process)
for (let k in this.process) {
console.log(this.process[k])
if (!this.process[k]) {
this.$message.error(this.caseList[k].label)
return
}
}
// this.loading = true
// this.$apis.marketing
// .createSuperMarketing(params)
// .then(res => {
// if (res) {
// this.init()
// this.$message.success('操作成功')
// }
// })
// .finally(() => {
// this.loading = false
// })
}
},
computed: {
...mapState('marketing', ['process'])
} }
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!