Commit 7645e206 authored by MyName's avatar MyName

跟进记录

parent e1d3a6e3
...@@ -34,3 +34,25 @@ export function getFollowList(param) { ...@@ -34,3 +34,25 @@ export function getFollowList(param) {
params: param params: param
}) })
} }
//新增跟进记录
export function addFollowRecord(param) {
return request({
url: '/customer/follow/record/',
method: 'POST',
data: param
})
}
//获取个人客户(关联客户)
export function getUserList() {
return request({
url: '/customer/user/list',
method: 'get',
})
}
//删除跟进记录
export function delFollowRecord(param) {
return request({
url: '/customer/follow/record/'+param,
method: 'delete',
})
}
...@@ -1010,3 +1010,9 @@ ...@@ -1010,3 +1010,9 @@
} }
} }
} }
.el-input__inner{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding-right: 10px;
}
...@@ -11,100 +11,77 @@ ...@@ -11,100 +11,77 @@
<div class="writting" v-if="isEdit == true"> <div class="writting" v-if="isEdit == true">
<div class="wri_top"> <div class="wri_top">
<img src="@/assets/images/project/add_3.png"> <img src="@/assets/images/project/add_3.png">
<el-input placeholder="新建一条跟进记录,如:周五上午预约客户上门拜访"></el-input> <el-input v-model="addParam.content" placeholder="新建一条跟进记录,如:周五上午预约客户上门拜访"></el-input>
</div> </div>
<div class="wr_bot"> <div class="wr_bot">
<el-select v-model="value" class="w128" placeholder="拜访方式"> <el-select v-model="addParam.visitMode" class="w128" placeholder="拜访方式">
<i slot="prefix" class="el-input__icon"><img src="@/assets/images/project/ico_1.png"></i> <i slot="prefix" class="el-input__icon"><img src="@/assets/images/project/ico_1.png"></i>
<el-option label="cccc" value="11"></el-option> <el-option v-for="(item,index) in bffslist" :key="index" :label="item.dictLabel" :value="item.dictValue"></el-option>
<el-option label="cccc" value="121"></el-option>
</el-select> </el-select>
<el-select v-if="showtype == 'gjdt'" v-model="value" class="w128" placeholder="关联企业"> <el-select v-if="showtype == 'gjdt'" v-model="addParam.customerId" class="w128" placeholder="关联企业">
<i slot="prefix" class="el-input__icon"><img src="@/assets/images/project/ico_1.png"></i> <i slot="prefix" class="el-input__icon"><img src="@/assets/images/project/ico_1.png"></i>
<el-option label="cccc" value="11"></el-option> <el-option v-for="(item,index) in glqylist" :key="index" :label="item.companyName" :value="item.customerId"></el-option>
<el-option label="cccc" value="121"></el-option>
</el-select> </el-select>
<el-input v-model="value" placeholder="拜访对象" style="width: 100px;"> <el-input v-model="addParam.name" placeholder="拜访对象" style="width: 100px;">
<i slot="prefix" class="el-input__icon"><img src="@/assets/images/project/ico_2.png"></i> <i slot="prefix" class="el-input__icon"><img src="@/assets/images/project/ico_2.png"></i>
</el-input> </el-input>
<el-input v-model="value" placeholder="客户职位" style="width: 100px;"> <el-input v-model="addParam.position" placeholder="客户职位" style="width: 100px;">
<i slot="prefix" class="el-input__icon"><img src="@/assets/images/project/ico_3.png"></i> <i slot="prefix" class="el-input__icon"><img src="@/assets/images/project/ico_3.png"></i>
</el-input> </el-input>
<div class="times"><img src="@/assets/images/project/ico_4.png"> <div class="times"><img src="@/assets/images/project/ico_4.png">
<el-date-picker class="w128" <el-date-picker class="w128"
v-model="value" v-model="addParam.nextVisitTime"
type="date" type="date"
placeholder="下次拜访时间"> placeholder="下次拜访时间">
</el-date-picker> </el-date-picker>
</div> </div>
<div class="btn btn_primary h32 wc" :class="{'btn_disabled':value == ''}">完成</div> <div class="btn btn_primary h32 wc" @click="addFollow" :class="{'btn_disabled':addParam.content == ''}">完成</div>
</div> </div>
</div> </div>
</div> </div>
<div class="recordlist"> <div class="recordlist">
<div class="rec_detail"> <div class="rec_detail" v-for="(item,index) in recordlist.rows">
<div class="rec_time"> <div class="rec_time">
<i class="el-icon-time"></i> <i class="el-icon-time"></i>
<div>2018-04-03 10:20</div> <div>{{item.createTime && item.createTime.slice(0, 16)}}</div>
<div class="operate"> <div class="operate">
<!--<img src="@/assets/images/edit.png">第一期不做编辑--> <!--<img src="@/assets/images/edit.png">第一期不做编辑-->
<img src="@/assets/images/delete.png"> <img @click="delRecord(item.id)" src="@/assets/images/delete.png">
</div> </div>
</div> </div>
<div class="rec_con"> <div class="rec_con">
<div><strong>李力</strong> <span>(线下拜访)</span></div> <div><strong>{{name}}</strong> <span v-if="item.visitMode">({{item.visitMode}})</span></div>
<div><span>上门拜访了交通局杨科长,客户对公司认可度很高,希望做进一步的高层对话。</span></div> <div><span>{{item.content}}</span></div>
<div class="rec_text"> <div class="rec_text">
<span>拜访对象:杨洋</span> <span>拜访对象:{{item.name||'--'}}</span>
<span>职位:科长</span> <span>职位:{{item.position||'--'}}</span>
<span>拜访时间:2008-12-08</span> <span>拜访时间:{{item.createTime && item.createTime.slice(0, 10)}}</span>
<span>下次拜访时间:2008-12-08</span> <span>下次拜访时间:{{item.nextVisitTime == null?'--': item.createTime.slice(0, 10)}}</span>
</div> </div>
</div> </div>
</div> </div>
<div class="rec_detail">
<div class="rec_time"> </div>
<i class="el-icon-time"></i> <div class="tables" v-if="recordlist.total>0">
<div>2018-04-03 10:20</div> <div class="bottems">
<div class="operate"> <el-pagination
<!--<img src="@/assets/images/edit.png">第一期不做编辑--> background
<img src="@/assets/images/delete.png"> :page-size="pageSize"
</div> :current-page="pageNum"
</div> @current-change="handleCurrentChange"
<div class="rec_con"> layout="prev, pager, next"
<div><strong>李力</strong> <span>(线下拜访)</span></div> :total="recordlist.total">
<div><span>上门拜访了交通局杨科长,客户对公司认可度很高,希望做进一步的高层对话。</span></div> </el-pagination>
<div class="rec_text">
<span>拜访对象:杨洋</span>
<span>职位:科长</span>
<span>拜访时间:2008-12-08</span>
<span>下次拜访时间:2008-12-08</span>
</div>
</div>
</div>
<div class="tables">
<div class="bottems">
<el-pagination
background
:page-size="pageSize"
:current-page="pageNum"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="1000">
</el-pagination>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="delform"> <div class="delform" v-if="isdel">
<div class="words">是否删除该条记录</div> <div class="words">是否删除该条记录</div>
<div> <div>
<div class="btnsmall btn_primary h28">确定</div> <div class="btnsmall btn_primary h28" @click="delele">确定</div>
<div class="btnsmall btn_cancel h28">取消</div> <div class="btnsmall btn_cancel h28" @click="isdel=false">取消</div>
</div> </div>
</div> </div>
</el-card> </el-card>
...@@ -112,8 +89,10 @@ ...@@ -112,8 +89,10 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
import "@/assets/styles/project.scss" import "@/assets/styles/project.scss"
import {getFollowList} from '@/api/custom/custom' import {getFollowList,addFollowRecord,getUserList,delFollowRecord} from '@/api/custom/custom'
import {getEnterprise,getDictType,} from '@/api/main'
export default { export default {
props:{ props:{
types: { //当前组件展示类型 types: { //当前组件展示类型
...@@ -130,17 +109,73 @@ ...@@ -130,17 +109,73 @@
value:'', value:'',
pageNum:1,//页码 pageNum:1,//页码
pageSize:20, pageSize:20,
bffslist:[],//拜访方式
glqylist:[],//关联企业
addParam:{
customerId:'', //客户id
visitMode:'',//拜访方式
nextVisitTime:'',//下次拜访时间
name:'',//拜访对象姓名
position:'',//拜访对象职务
content:'',//拜访内容
},
recordlist:[],//列表数据源
isdel:false,
delID:'',//删除记录的ID
} }
}, },
computed: {
...mapGetters([
'name'
])
},
created(){ created(){
//获取拜访方式
getDictType('visit_mode_type').then(result=>{
this.bffslist = result.code == 200 ? result.data:[]
})
this.showtype = this.types this.showtype = this.types
//客户管理跟进动态 //客户管理跟进动态
if(this.showtype == 'gjdt'){ if(this.showtype == 'gjdt'){
getUserList().then(result=>{
this.glqylist = result.data
})
this.getGJDTlist() this.getGJDTlist()
} }
console.log(this.types) console.log(this.types)
}, },
methods:{ methods:{
//添加跟进动态
addFollow(){
if(this.types == 'gjdt'){
addFollowRecord(this.addParam).then(result=>{
if(result.code == 200){
this.$message.success(result.msg)
this.handleCurrentChange(1)
this.isEdit = false
}else{
this.$message.error(result.msg)
}
})
}
},
//删除跟进动态
delRecord(id){
this.isdel = true
this.delID = id
},
delele(){
if(this.types == 'gjdt') {
delFollowRecord(this.delID).then(result => {
if (result.code == 200) {
this.handleCurrentChange(1)
this.$message.success('删除成功')
this.isdel = false
}
})
}
},
//跟进动态列表 //跟进动态列表
getGJDTlist(){ getGJDTlist(){
let param = { let param = {
...@@ -148,7 +183,12 @@ ...@@ -148,7 +183,12 @@
pageSize:this.pageSize, pageSize:this.pageSize,
} }
getFollowList(param).then(result=>{ getFollowList(param).then(result=>{
this.recordlist = result.code == 200?result:[]
this.recordlist.rows.forEach(item=>{
item.createTime = this.gettime(item.createTime)
item.nextVisitTime = this.gettime(item.nextVisitTime)
console.log(item.nextVisitTime )
})
}) })
}, },
handleCurrentChange(val){ handleCurrentChange(val){
...@@ -160,7 +200,29 @@ ...@@ -160,7 +200,29 @@
getEdit(){ getEdit(){
this.isEdit = true; this.isEdit = true;
this.value = "" this.value = ""
this.addParam={
customerId:'', //客户id
visitMode:'',//拜访方式
nextVisitTime:'',//下次拜访时间
name:'',//拜访对象姓名
position:'',//拜访对象职务
content:'',//拜访内容
}
}, },
gettime(time){
if(time == null || time == "")
return null
let times = new Date(time)
let year = times.getFullYear()
let month = times.getMonth()+1
month = month<10?"0"+month:month
let day = times.getDate()
day = day<10?"0"+day:day
let hour = times.getHours()
let minute = times.getMinutes()
let second = times.getSeconds()
return year+'-'+month+'-'+day+' '+hour+":"+minute+":"+second
}
} }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment