Browse Source

对接跟进记录

devlop
buffeyu 4 years ago
parent
commit
b595cdab84
3 changed files with 184 additions and 23 deletions
  1. 18
      apis/followUpRecords.js
  2. 86
      pages/add-record/index.vue
  3. 103
      pages/follow-up-records/index.vue

18
apis/followUpRecords.js

@ -0,0 +1,18 @@
import http from '../utils/http/index.js'
// 获取拜访记录列表
export function getVisitRecordList(data) {
return http.get(
{
url: '/yyt-uec/get/supplier/visit-record-list',
data
},
{ hideLoading: true }
)
}
// 新增拜访记录
export function createVisitRecord(data) {
return http.post({
url: '/yyt-uec/create/supplier/visit-record',
data
})
}

86
pages/add-record/index.vue

@ -2,7 +2,7 @@
<view class="warpper">
<qnHeader class="header">
<view class="header-title">跟进记录</view>
<view class="right-title">保存</view>
<view class="right-title" @click="saveClick">保存</view>
</qnHeader>
<view class="paper-price">
<view class="">
@ -15,7 +15,7 @@
class="paper-price-textArea bf-height"
:maxlength="200"
:styles="{ disableColor: '#F7F8FA' }"
v-model="form.remark"
v-model="form.respondent"
:inputBorder="false"
type="textarea"
placeholder="请输入拜访对象"
@ -32,7 +32,7 @@
class="paper-price-textArea gt-height"
:maxlength="500"
:styles="{ disableColor: '#F7F8FA' }"
v-model="form.remark"
v-model="form.content"
:inputBorder="false"
type="textarea"
placeholder="请输入与客户的沟通记录"
@ -56,24 +56,84 @@
></qn-easyinput>
<view class="location">
<image class="icon" src="/static/imgs/client-detail/address-icon.png"></image>
<text class="text">广州市天河区</text>
<text class="text">{{form.address}}</text>
<!-- <uni-icons size="16" type="bottom"></uni-icons> -->
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import qnHeader from '@/components/qn-header/qn-header.vue'
import wgs84togcj02 from '@/utils/locationTransform.js'
import { back, uploadImage } from '@/utils/hook.js'
import qnHeader from '@/components/qn-header/qn-header.vue'
import { createVisitRecord } from '@/apis/followUpRecords.js'
const validateFields = [
'content',
'remark',
'respondent'
]
export default {
components: {qnHeader},
components: { qnHeader },
data() {
return {
form: {}
form: {
address: '',
content: '',
customerEnterpriseId: this.$store.state.supplierInfo.id || null,
remark: '',
respondent: ''
}
}
},
onLoad() {
this.locatePosition()
},
methods: {
locatePosition() {
uni.getLocation({
type: 'gcj02',
geocode: true,
// type: 'wgs84',
success: (res) => {
console.log('location success', res)
if(res.address) {
this.form.address = res.address.province + res.address.city + res.address.district + res.address.street
}
// const { lat, lon } = wgs84togcj02(res.latitude, res.longitude)
},
fail: (err) => {
uni.showToast({
icon: 'error',
title: '定位失败:' + err.code
})
}
})
},
//
saveClick() {
for (let i = 0; i < validateFields.length; i++) {
if (this.form[validateFields[i]] === null || this.form[validateFields[i]] === '') {
uni.showToast({
title: '请完善信息',
icon: 'none'
})
return
}
}
createVisitRecord(this.form).then(res => {
if(res) {
uni.showToast({
title: '添加成功',
icon: 'success'
})
setTimeout(() => {
back()
}, 1000)
}
})
}
}
}
@ -93,7 +153,7 @@ export default {
text-align: center;
font-weight: 500;
}
.right-title {
font-size: 28rpx;
color: #007aff;
@ -203,13 +263,13 @@ export default {
margin-right: 10rpx;
}
}
.bf-height{
.bf-height {
height: 155rpx;
}
.gt-height {
height: 210rpx;
}
.location{
.location {
display: flex;
flex-direction: row;
align-items: center;
@ -218,7 +278,7 @@ export default {
width: 32rpx;
height: 32rpx;
}
.text{
.text {
font-size: 26rpx;
color: #888888;
letter-spacing: 0;

103
pages/follow-up-records/index.vue

@ -1,41 +1,43 @@
<template>
<view class="warpper">
<scroll-list ref="list" :option="option" @load="upCallback" @refresh="downCallback" style="background-color: #ffffff">
<timeline>
<timelineItem v-for="(item, index) in 4" :key="index">
<timelineItem v-for="(item, index) in list" :key="index">
<view class="time">
2021年12月28日 12:30:45
{{item.createTime}}
</view>
<view class="tripItem">
<view class="row">
<view class="title">跟进人</view>
<view class="value">贾晓堂 18877799220</view>
<view class="value">{{item.visitorName}}</view>
</view>
<view class="row">
<view class="title">拜访对象</view>
<view class="value">张翼德 18826104989</view>
<view class="value">{{item.respondent}}</view>
</view>
<view class="row">
<view class="title">沟通内容</view>
<view class="value">已经对该供应商进行了需求调研并已经对纸掌柜产品进行推广盘商表示愿意支付使用该产品</view>
<view class="value">{{item.content}}</view>
</view>
<view class="row">
<view class="title">备注信息</view>
<view class="value">客户说希望有特色功能</view>
<view class="value">{{item.remark}}</view>
</view>
<view class="row">
<view class="title"></view>
<view class="value">
<image class="icon" src="/static/imgs/client-detail/address-icon.png"></image>
<text class="location">广州市天河区</text>
<text class="location">{{item.address}}</text>
</view>
</view>
</view>
</timelineItem>
<view class="see-more">
<!-- <view class="see-more">
<text>查看更多</text>
<image class="icon" :src="!seemoreFlag ? '/static/imgs/client-detail/arrow-up-icon.png' : '/static/imgs/client-detail/arrow-down-icon.png'"></image>
</view>
</view> -->
</timeline>
</scroll-list>
<qn-footer fixed height="120rpx">
<view class="button-area">
<!-- <view class="button button__cancel" @click="back">
@ -46,6 +48,7 @@
</view>
</view>
</qn-footer>
</view>
</template>
@ -54,6 +57,7 @@ import timeline from './timeLine.vue'
import timelineItem from './timelineItem.vue'
import qnFooter from '@/components/qn-footer/qn-footer.vue'
import { go2 } from '@/utils/hook.js'
import {getVisitRecordList} from '@/apis/followUpRecords.js'
export default {
components: {
timeline,
@ -61,12 +65,91 @@ export default {
qnFooter
},
data() {
return {}
return {
option: {
size: 10,
auto: true,
height: 0,
emptyText: '暂无数据~',
background: '#F7F8FA',
disabled: false
},
params: {
asc: '',
desc: '',
enterpriseIds : [this.$store.state.supplierInfo.id],
mallSupplierId : this.$store.state.supplierInfo.supplierId || null,
// enterpriseIds : ['651107734133018624'],
// mallSupplierId : '670334117090562048',
},
pagination: {
pageNum: 0, //
pageSize: 10
},
list: [],
}
},
created() {
let that = this
uni.getSystemInfo({
success: function (res) {
// console.log( '', res.statusBarHeight);
that.option.height = (res.windowHeight) * (750/res.windowWidth) - 120
}
});
},
onShow() {
console.log('onShow')
this.getList()
},
methods:{
getList() {
return new Promise((resolve, reject) => {
getVisitRecordList({ ...this.params, ...this.pagination })
.then((res) => {
// console.log('', res)
if (res) {
if (this.pagination.pageNum == 1) {
this.list = res.records
} else {
this.list = this.list.concat(res.records)
}
// this.list = []
// this.list = [...this.list, ...[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]
resolve({ list: this.list, total: res.total })
} else {
reject()
}
})
.catch((err) => {
reject(err)
})
})
},
addTap() {
go2('add-record')
},
downCallback() {
this.pagination.pageNum = 1
this.getList()
.then(({ list, total }) => {
this.$refs.list.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.list.refreshFail()
})
},
upCallback() {
this.pagination.pageNum++
this.getList()
.then(({ list, total }) => {
this.$refs.list.loadSuccess({ list, total })
})
.catch(() => {
this.$refs.list.loadFail()
})
}
}
}
</script>

Loading…
Cancel
Save