Commit f9ff2a96 by 杨明

fixed

1 parent 1ba673b5
......@@ -264,7 +264,6 @@ export default {
},
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]
......
......@@ -152,7 +152,28 @@ export default {
})
},
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() {
this.giftVisible = true
......@@ -203,7 +224,7 @@ export default {
// return selectedItems
},
// 选择/取消 门店服务
handleSelectionServiceTable(selection, val) {
handleSelectionServiceTable(selection, row) {
if (selection && selection.find(item => item && item.id == row.id)) {
this.addRows(this.selectedServiceList, [row])
} else {
......
<template>
<div class="task-view">
<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">
<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)">
收起
<i class="el-icon-arrow-up"></i>
......@@ -28,7 +28,7 @@
<div class="task-num-item flex">
<label>选择跟进人:</label>
<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>
......@@ -56,7 +56,7 @@
</div>
<div class="task-num-item flex">
<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 label="跟进人" width="220">
<template slot-scope="scope">{{ scope.row.staffName }} {{ scope.row.staffPhone }}</template>
......@@ -98,13 +98,13 @@
<div class="config-body">
<el-form ref="configForm" :model="configForm" label-width="200px">
<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="beijing"></el-option>
</el-select>
</el-form-item>
<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>
</div>
......@@ -113,13 +113,14 @@
</template>
<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'
export default {
data() {
return {
taskList: [{ order: 1, ...taskData }],
taskList: [{ batchNo: 1, ...taskData }],
customerKey: [],
selectEmp: {},
qrCodeUrl: '',
linkUrl: '',
isQrcodeVisible: false,
......@@ -175,7 +176,7 @@ export default {
const staffPhone = item.lastFollowStaffList.map(item => item.staffPhone)
this.tableData.forEach(i => {
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 {
}
this.$apis.marketing.importCustomer(param).then(res => {
item.excelUrl = url
item.key = res.customerKey
item.lastFollowStaffList = res.lastFollowStaffList
item.customerNumTotal = res.customerNumTotal
this.customerKey.push(res.customerKey)
......@@ -199,25 +201,37 @@ export default {
item.expand = !item.expand
},
handleSelectionChange(val, item) {
item.selectArr = val
item.staffList = val
item.staffList.forEach(item => {
if (item.registerStatus !== 0) {
item.registerStatus = 1
}
})
},
//邀请人员注册
showRegister() {
this.isQrcodeVisible = true
},
//话术配置
handleConfig() {
handleConfig(row) {
this.configVisible = true
this.selectEmp = row
this.$apis.marketing.getRobotList({}).then(res => {
console.log(res)
})
},
handleCancelConfirm() {
this.configVisible = false
this.selectEmp.talkId = this.configForm.talkId
this.selectEmp.messageContent = this.configForm.messageContent
},
handleCancel() {
this.setProcess({ 0: true })
},
handleConfirm() {
console.log(this.taskList)
this.setProcess({ 0: { customerRequestList: this.taskList } })
},
addTask() {
let len = this.taskList.length
if (len == 10) {
......@@ -225,21 +239,21 @@ export default {
return
}
const task = this.taskList[len - 1]
if (task.excelUrl && task.selectArr.length) {
if (task.excelUrl && task.staffList.length) {
task.isFinish = true
if (task.taskType == 1) {
const customerNumTotal = task.customerNumTotal
const length = task.selectArr.length
const length = task.staffList.length
let avag = Math.ceil(customerNumTotal / length)
let residue = customerNumTotal
task.selectArr.forEach(item => {
this.$set(item, 'lastCustomerNum', residue > avag ? avag : residue)
task.staffList.forEach(item => {
this.$set(item, 'customerNum', residue > avag ? avag : residue)
residue = residue - avag
})
console.log(task.selectArr)
console.log(task.staffList)
}
this.taskList.push({
order: ++len,
batchNo: ++len,
...taskData
})
}
......
......@@ -45,27 +45,26 @@ export default {
},
methods: {
handleSave() {
let params = {}
console.log(this.process)
let params = { merchantId: this.$globalState.session.merchantId }
for (let k in this.process) {
console.log(this.process[k])
if (!this.process[k]) {
this.$message.error(this.caseList[k].label)
return
}
params = { ...params, ...this.process[k] }
}
// this.loading = true
// this.$apis.marketing
// .createSuperMarketing(params)
// .then(res => {
// if (res) {
// this.init()
// this.$message.success('操作成功')
// }
// })
// .finally(() => {
// this.loading = false
// })
this.loading = true
this.$apis.marketing
.createSuperMarketing(params)
.then(res => {
if (res) {
this.init()
this.$message.success('操作成功')
}
})
.finally(() => {
this.loading = false
})
}
},
computed: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!