<template>
|
<div class="f-container">
|
<div class="log-cont">
|
<keep-alive>
|
<component
|
:is="componentsName"
|
:id="id"
|
:crm-type="crmType"/>
|
</keep-alive>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import MixAdd from '../../components/MixAdd'
|
import RecordLog from '../../components/followLog/RecordLog' // 跟进记录
|
import JournalLog from '../../components/followLog/JournalLog' // 日志列表
|
import ExamineLog from '../../components/followLog/ExamineLog' // 审批列表
|
import TaskLog from '../../components/followLog/TaskLog' // 任务日志列表
|
import ScheduleLog from '../../components/followLog/ScheduleLog' // 日程日志列表
|
import FollowRecordTable from '../../components/followLog/components/FollowRecordTable' // 跟进记录
|
import { AddFollowRecord, MakeFollowRecordCompleted } from '@/api/customermanagement/customerManage'
|
import followLogType from '@/views/clients/mixins/followLogType'
|
|
export default {
|
/** 客户管理 的 客户详情 的 跟进记录 */
|
name: 'CustomerFollow',
|
components: {
|
MixAdd,
|
RecordLog,
|
JournalLog,
|
ExamineLog,
|
TaskLog,
|
ScheduleLog,
|
FollowRecordTable
|
},
|
mixins: [followLogType],
|
props: {
|
/** 模块ID */
|
id: [String, Number],
|
/** 没有值就是全部类型 有值就是当个类型 */
|
crmType: {
|
type: String,
|
default: ''
|
},
|
/** 是公海 默认是客户 */
|
isSeas: {
|
type: Boolean,
|
default: false
|
}
|
},
|
data () {
|
return {
|
sendLoading: false,
|
logType: 'record'
|
}
|
},
|
computed: {
|
logTypes () {
|
return [
|
{ type: 'record', name: '跟进记录' }
|
]
|
},
|
|
componentsName () {
|
return 'FollowRecordTable'
|
}
|
},
|
watch: {
|
id: function (val) {}
|
},
|
mounted () {},
|
activated: function () {},
|
deactivated: function () {},
|
methods: {
|
/** 发布 时候的类型选择 */
|
logTabsClick (item, index) {
|
this.logType = item.type
|
},
|
/** 告诉mixad 返回数据 */
|
// sendInfo () {
|
// this.$refs.mixadd.$emit('submit-info')
|
// },
|
/** 快捷添加框内 返回的数据用于上传 */
|
submitInfo (data) {
|
console.log(data)
|
if (data.isEvent && !data.nextTime) {
|
this.$message.error('请选择下次联系时间')
|
return
|
} else if (!data.content) {
|
this.$message.error('请输入跟进内容')
|
return
|
}
|
|
var params = {}
|
params.SourceId = this.id
|
params.Title = data.title
|
params.Content = data.content
|
params.FollowType = data.followTypeId
|
params.FollowWay = data.wayTypeId
|
// var businessIds = data.business.map(function (element, index, array) {
|
// return element.businessId
|
// })
|
// var contactsIds = data.contacts.map(function (element, index, array) {
|
// return element.contactsId
|
// })
|
|
// params.batchId = data.batchId
|
// params.businessIds = businessIds.join(',')
|
// params.contactsIds = contactsIds.join(',')
|
|
params.IsCompleted = data.isEvent
|
params.FollowTime = data.nextTime || ''
|
|
this.sendLoading = true
|
if (data.isEvent) {
|
MakeFollowRecordCompleted({'Id': this.id}).then(res => {
|
this.$message.success('完成跟进')
|
})
|
}
|
AddFollowRecord(params)
|
.then(res => {
|
this.sendLoading = false
|
this.$message.success('发布成功')
|
// 重置页面
|
this.$refs.mixadd.resetInfo()
|
// this.isEvent = false
|
// this.nextTime = ''
|
// 刷新数据
|
this.$bus.emit('follow-log-refresh', { type: 'follow-record-table' })
|
})
|
.catch(() => {
|
this.sendLoading = false
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import '../../styles/followlog.scss';
|
</style>
|