Commit f9ff2a96 by 杨明

fixed

1 parent 1ba673b5
...@@ -264,7 +264,6 @@ export default { ...@@ -264,7 +264,6 @@ export default {
}, },
getCouponInfoParams() { getCouponInfoParams() {
var param = this.$common.utils.deepClone(this.editForm) var param = this.$common.utils.deepClone(this.editForm)
param.activityPrice = (param.activityPrice * 100).toFixed(0) //存的分,需乘100
const d = param.activityTime const d = param.activityTime
if (d && d.length > 0) { if (d && d.length > 0) {
param.starttime = d[0] param.starttime = d[0]
......
...@@ -152,7 +152,28 @@ export default { ...@@ -152,7 +152,28 @@ export default {
}) })
}, },
handleSaveGift() { handleSaveGift() {
this.setProcess({ 1: true }) if (this.selectedGoodsList.length + this.selectedServiceList.length + this.selectedCarList.length == 0) {
this.$message.error('权益服务、平台优惠、门店优惠券至少选一项')
return
}
const params = {}
const selectedGoodsList = [this.selectedGoodsList, this.selectedServiceList].map(item => {
return {
couponId: item.id,
couponAmount: item.couponAmount,
couponAnticipatedCost: item.denomination
}
})
const equityServices = this.selectedCarList.map(i => i.packageCode)
params.equityServices = equityServices.join(',')
params.activityPrice = (this.editForm.activityPrice * 100).toFixed(0)
params.superMarketingCouponRelRequestList = selectedGoodsList || []
this.setProcess({
1: {
...params
}
})
}, },
handleSave() { handleSave() {
this.giftVisible = true this.giftVisible = true
...@@ -203,7 +224,7 @@ export default { ...@@ -203,7 +224,7 @@ export default {
// return selectedItems // return selectedItems
}, },
// 选择/取消 门店服务 // 选择/取消 门店服务
handleSelectionServiceTable(selection, val) { handleSelectionServiceTable(selection, row) {
if (selection && selection.find(item => item && item.id == row.id)) { if (selection && selection.find(item => item && item.id == row.id)) {
this.addRows(this.selectedServiceList, [row]) this.addRows(this.selectedServiceList, [row])
} else { } else {
......
<template> <template>
<div class="task-view"> <div class="task-view">
<div class="task-container"> <div class="task-container">
<div class="task-item" v-for="item in taskList" :key="item.order"> <div class="task-item" v-for="item in taskList" :key="item.batchNo">
<div class="task-title"> <div class="task-title">
<label>营销任务{{ taskList.length == 1 ? '' : item.order }}</label> <label>营销任务{{ taskList.length == 1 ? '' : item.batchNo }}</label>
<div class="task-operate" v-show="item.expand" @click="handleExpand(item)"> <div class="task-operate" v-show="item.expand" @click="handleExpand(item)">
收起 收起
<i class="el-icon-arrow-up"></i> <i class="el-icon-arrow-up"></i>
...@@ -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 }}({{ v.lastCustomerNum }}人)</div> <div class="flow-emp" v-for="(v, k) in item.staffList" :key="k">{{ v.staffName }}({{ v.customerNum }}人)</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</div> </div>
<div class="task-num-item flex"> <div class="task-num-item flex">
<label>选择跟进人:</label> <label>选择跟进人:</label>
<el-table class="task-tabel" :ref="'form' + item.order" :data="tableData" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange($event, item)"> <el-table class="task-tabel" :ref="'form' + item.batchNo" :data="item.taskType == 1 ? tableData : tableData.concat(item.LastFollowStaff)" tooltip-effect="dark" style="width: 100%" @selection-change="handleSelectionChange($event, item)">
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="跟进人" width="220"> <el-table-column label="跟进人" width="220">
<template slot-scope="scope">{{ scope.row.staffName }} {{ scope.row.staffPhone }}</template> <template slot-scope="scope">{{ scope.row.staffName }} {{ scope.row.staffPhone }}</template>
...@@ -98,13 +98,13 @@ ...@@ -98,13 +98,13 @@
<div class="config-body"> <div class="config-body">
<el-form ref="configForm" :model="configForm" label-width="200px"> <el-form ref="configForm" :model="configForm" label-width="200px">
<el-form-item label="AI人工智能外呼:" :size="size"> <el-form-item label="AI人工智能外呼:" :size="size">
<el-select v-model="configForm.region" placeholder="请选择"> <el-select v-model="configForm.talkId" placeholder="请选择">
<el-option label="区域一" value="shanghai"></el-option> <el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option> <el-option label="区域二" value="beijing"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="营销短信:" :size="size"> <el-form-item label="营销短信:" :size="size">
<el-input v-model="configForm.name" type="textarea"></el-input> <el-input v-model="configForm.messageContent" type="textarea"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -113,13 +113,14 @@ ...@@ -113,13 +113,14 @@
</template> </template>
<script> <script>
const taskData = { expand: true, taskType: 1, customerNumTotal: 0, lastFollowStaffList: [], selectArr: [], excelUrl: '', isFinish: false } const taskData = { expand: true, taskType: 1, customerNumTotal: 0, lastFollowStaffList: [], staffList: [], excelUrl: '', isFinish: false }
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
export default { export default {
data() { data() {
return { return {
taskList: [{ order: 1, ...taskData }], taskList: [{ batchNo: 1, ...taskData }],
customerKey: [], customerKey: [],
selectEmp: {},
qrCodeUrl: '', qrCodeUrl: '',
linkUrl: '', linkUrl: '',
isQrcodeVisible: false, isQrcodeVisible: false,
...@@ -175,7 +176,7 @@ export default { ...@@ -175,7 +176,7 @@ export default {
const staffPhone = item.lastFollowStaffList.map(item => item.staffPhone) const staffPhone = item.lastFollowStaffList.map(item => item.staffPhone)
this.tableData.forEach(i => { this.tableData.forEach(i => {
if (staffPhone.includes(i.staffPhone)) { if (staffPhone.includes(i.staffPhone)) {
this.$refs['form' + item.order].toggleRowSelection(i) this.$refs['form' + item.batchNo].toggleRowSelection(i)
} }
}) })
} }
...@@ -190,6 +191,7 @@ export default { ...@@ -190,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.key = res.customerKey
item.lastFollowStaffList = res.lastFollowStaffList item.lastFollowStaffList = res.lastFollowStaffList
item.customerNumTotal = res.customerNumTotal item.customerNumTotal = res.customerNumTotal
this.customerKey.push(res.customerKey) this.customerKey.push(res.customerKey)
...@@ -199,25 +201,37 @@ export default { ...@@ -199,25 +201,37 @@ export default {
item.expand = !item.expand item.expand = !item.expand
}, },
handleSelectionChange(val, item) { handleSelectionChange(val, item) {
item.selectArr = val item.staffList = val
item.staffList.forEach(item => {
if (item.registerStatus !== 0) {
item.registerStatus = 1
}
})
}, },
//邀请人员注册 //邀请人员注册
showRegister() { showRegister() {
this.isQrcodeVisible = true this.isQrcodeVisible = true
}, },
//话术配置 //话术配置
handleConfig() { handleConfig(row) {
this.configVisible = true this.configVisible = true
this.selectEmp = row
this.$apis.marketing.getRobotList({}).then(res => { this.$apis.marketing.getRobotList({}).then(res => {
console.log(res) console.log(res)
}) })
}, },
handleCancelConfirm() { handleCancelConfirm() {
this.configVisible = false this.configVisible = false
this.selectEmp.talkId = this.configForm.talkId
this.selectEmp.messageContent = this.configForm.messageContent
}, },
handleCancel() { handleCancel() {
this.setProcess({ 0: true }) this.setProcess({ 0: true })
}, },
handleConfirm() {
console.log(this.taskList)
this.setProcess({ 0: { customerRequestList: this.taskList } })
},
addTask() { addTask() {
let len = this.taskList.length let len = this.taskList.length
if (len == 10) { if (len == 10) {
...@@ -225,21 +239,21 @@ export default { ...@@ -225,21 +239,21 @@ export default {
return return
} }
const task = this.taskList[len - 1] const task = this.taskList[len - 1]
if (task.excelUrl && task.selectArr.length) { if (task.excelUrl && task.staffList.length) {
task.isFinish = true task.isFinish = true
if (task.taskType == 1) { if (task.taskType == 1) {
const customerNumTotal = task.customerNumTotal const customerNumTotal = task.customerNumTotal
const length = task.selectArr.length const length = task.staffList.length
let avag = Math.ceil(customerNumTotal / length) let avag = Math.ceil(customerNumTotal / length)
let residue = customerNumTotal let residue = customerNumTotal
task.selectArr.forEach(item => { task.staffList.forEach(item => {
this.$set(item, 'lastCustomerNum', residue > avag ? avag : residue) this.$set(item, 'customerNum', residue > avag ? avag : residue)
residue = residue - avag residue = residue - avag
}) })
console.log(task.selectArr) console.log(task.staffList)
} }
this.taskList.push({ this.taskList.push({
order: ++len, batchNo: ++len,
...taskData ...taskData
}) })
} }
......
...@@ -45,27 +45,26 @@ export default { ...@@ -45,27 +45,26 @@ export default {
}, },
methods: { methods: {
handleSave() { handleSave() {
let params = {} let params = { merchantId: this.$globalState.session.merchantId }
console.log(this.process)
for (let k in this.process) { for (let k in this.process) {
console.log(this.process[k])
if (!this.process[k]) { if (!this.process[k]) {
this.$message.error(this.caseList[k].label) this.$message.error(this.caseList[k].label)
return return
} }
params = { ...params, ...this.process[k] }
} }
// this.loading = true this.loading = true
// this.$apis.marketing this.$apis.marketing
// .createSuperMarketing(params) .createSuperMarketing(params)
// .then(res => { .then(res => {
// if (res) { if (res) {
// this.init() this.init()
// this.$message.success('操作成功') this.$message.success('操作成功')
// } }
// }) })
// .finally(() => { .finally(() => {
// this.loading = false this.loading = false
// }) })
} }
}, },
computed: { computed: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!