对接部分接口
This commit is contained in:
+195
-35
@@ -3,36 +3,62 @@
|
||||
<uni-nav-bar leftText=" " :fixed="true" :border="false" leftIcon="back" @clickLeft="leftClick" color="#000000" backgroundColor="#fff" :statusBar="true" title="客户资料"></uni-nav-bar>
|
||||
<view class="content">
|
||||
<view class="cell">
|
||||
<view>客户称呼</view>
|
||||
<view class="right">
|
||||
<input placeholder="输入称呼" v-model="form.contacts" />
|
||||
<view>渠道</view>
|
||||
<view class="right select" @click="showchannel = true">
|
||||
<input placeholder="选择渠道" disabled v-model="channel_name" />
|
||||
<u-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="showchannel" @cancel="cancel('showchannel')" :columns="channelList" keyName="name" @confirm="channelChange"></u-picker>
|
||||
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<u-divider text=""></u-divider>
|
||||
<u-line></u-line>
|
||||
<view class="cell">
|
||||
<view>客户商机</view>
|
||||
<view class="right select" @click="showmagnitude = true">
|
||||
<input placeholder="选择客户商机" disabled v-model="magnitude_name" />
|
||||
<u-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="showmagnitude" @cancel="cancel('showmagnitude')" :columns="magnitudeList" keyName="name" @confirm="magnitudeChange"></u-picker>
|
||||
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<u-line></u-line>
|
||||
<view class="cell">
|
||||
<view>客户名称 <text class="red">*</text></view>
|
||||
<view class="right">
|
||||
<input placeholder="输入名称" v-model="form.contacts" />
|
||||
</view>
|
||||
</view>
|
||||
<u-line></u-line>
|
||||
<view class="cell">
|
||||
<view>性别</view>
|
||||
<view class="right">
|
||||
<u-radio-group v-model="form.gender">
|
||||
<u-radio name="男">男</u-radio>
|
||||
<u-radio name="女">女</u-radio>
|
||||
<u-radio-group v-model="form.sex">
|
||||
<u-radio name="0">未知</u-radio>
|
||||
<u-radio name="1">男</u-radio>
|
||||
<u-radio name="2">女</u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<u-divider text=""></u-divider>
|
||||
<u-line></u-line>
|
||||
<view class="cell">
|
||||
<view>联系方式 <text class="red">*</text></view>
|
||||
<view class="right">
|
||||
<input placeholder="输入联系方式" v-model="form.phone" />
|
||||
</view>
|
||||
</view>
|
||||
<u-divider text=""></u-divider>
|
||||
<u-line></u-line>
|
||||
<view class="cell">
|
||||
<view>Email</view>
|
||||
<view class="right">
|
||||
<input placeholder="输入Email" v-model="form.email" />
|
||||
</view>
|
||||
</view>
|
||||
<u-divider text=""></u-divider>
|
||||
<u-line></u-line>
|
||||
<view class="cell">
|
||||
<view>WhatsApp</view>
|
||||
<view class="right">
|
||||
<input placeholder="输入WhatsApp" v-model="form.WhatsApp" />
|
||||
</view>
|
||||
</view>
|
||||
<u-line></u-line>
|
||||
<view class="cell">
|
||||
<view>客户偏好</view>
|
||||
<view class="right select" @click="showcartype = true">
|
||||
@@ -41,78 +67,133 @@
|
||||
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<u-divider text=""></u-divider>
|
||||
<u-line></u-line>
|
||||
<view class="cell">
|
||||
<view>客户等级</view>
|
||||
<view>客户分级</view>
|
||||
<view class="right select" @click="showgrade = true">
|
||||
<input placeholder="选择客户等级" disabled v-model="grade_name" />
|
||||
<input placeholder="选择客户分级" disabled v-model="grade_name" />
|
||||
<u-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="showgrade" @cancel="cancel('showgrade')" :columns="getGradeList" keyName="name" @confirm="gradeHandler"></u-picker>
|
||||
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<u-divider text=""></u-divider>
|
||||
<u-line></u-line>
|
||||
<view class="cell">
|
||||
<view>国家地区</view>
|
||||
<view class="right select" @click="showenergy = true">
|
||||
<input placeholder="选择国家地区" disabled v-model="country_name" />
|
||||
<u-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="showenergy" @cancel="cancel('showenergy')" :columns="areaList" keyName="name" @confirm="areaChange"></u-picker>
|
||||
<view>国家</view>
|
||||
<view class="right select" @click="showarea = true">
|
||||
<input placeholder="选择国家" disabled v-model="country_name" />
|
||||
<u-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="showarea" @cancel="cancel('showarea')" :columns="areaList" keyName="name" @confirm="areaChange"></u-picker>
|
||||
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<u-divider text=""></u-divider>
|
||||
<u-line></u-line>
|
||||
<view class="cell">
|
||||
<view>公司</view>
|
||||
<view class="right select" @click="showmap = true">
|
||||
<input placeholder="去定位" type="text" disabled v-model="form.address"/>
|
||||
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <u-line></u-line>
|
||||
<view class="cell">
|
||||
<view>首次跟进</view>
|
||||
<view class="right">
|
||||
<input placeholder="首次跟进" type="digit" v-model="form.mileage"/>
|
||||
<input placeholder="首次跟进" type="text" v-model="form.mileage"/>
|
||||
</view>
|
||||
</view>
|
||||
<u-divider text=""></u-divider>
|
||||
</view> -->
|
||||
<u-line></u-line>
|
||||
<view class="cell1">
|
||||
<view>详细情况</view>
|
||||
<view>备注(非必填)</view>
|
||||
<view class="">
|
||||
<textarea auto-height v-model="form.describe" placeholder="详细情况..."/>
|
||||
<textarea auto-height v-model="form.describe" placeholder="请输入备注内容~"/>
|
||||
</view>
|
||||
</view>
|
||||
<u-gap height="100" bgColor="#fff"></u-gap>
|
||||
</view>
|
||||
<view class="foot">
|
||||
<button class="btn" @click="nextFn">提交</button>
|
||||
<button class="btn" @click="saveFn">提交</button>
|
||||
</view>
|
||||
|
||||
<u-popup :show="showmap" :round="10" mode="bottom" @close="mapclose">
|
||||
<view class="mapcont">
|
||||
<view class="header">
|
||||
<view class="cancel" @click="mapclose">取消</view>
|
||||
<view class="title">地图位置</view>
|
||||
<view class="confirm" @click="mapconfirm">确定</view>
|
||||
</view>
|
||||
<view class="map">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { request,showToast } from '@/api/apiT.js'
|
||||
// import ldSelect from '@/components/ld-select/ld-select.vue'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showmap: false,
|
||||
showmagnitude: false,
|
||||
showgrade: false,
|
||||
showcartype: false,
|
||||
showenergy: false,
|
||||
showchannel: false,
|
||||
showarea: false,
|
||||
getGradeList:[],
|
||||
carTypeList:[],
|
||||
channelList:[],
|
||||
magnitudeList:[],
|
||||
areaList:[],
|
||||
grade_name:'',
|
||||
car_type_name:'',
|
||||
country_name:'',
|
||||
channel_name:'',
|
||||
magnitude_name:'',
|
||||
form: {
|
||||
contacts: '',
|
||||
gender: '男',
|
||||
sex: '0',
|
||||
phone: '',
|
||||
email: '',
|
||||
describe: '',
|
||||
grade:'',
|
||||
country_id:'',
|
||||
car_type_id:''
|
||||
car_type_id:'',
|
||||
channel_id:'',
|
||||
magnitude:'',
|
||||
address:'',
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getChannel()
|
||||
this.getMagnitude()
|
||||
this.getGrade()
|
||||
this.carType()
|
||||
this.area()
|
||||
},
|
||||
methods: {
|
||||
leftClick(){
|
||||
uni.navigateBack({})
|
||||
},
|
||||
mapclose(){
|
||||
this.showmap = false
|
||||
},
|
||||
mapconfirm(){
|
||||
this.showmap = false
|
||||
},
|
||||
//渠道
|
||||
getChannel(){
|
||||
request({
|
||||
url:'customer/getChannel',
|
||||
method:'get',
|
||||
}).then(res => {
|
||||
var list = res.data.data
|
||||
this.channelList = [list]
|
||||
})
|
||||
},
|
||||
//客户等级
|
||||
getGrade(){
|
||||
request({
|
||||
url:'customer/getGrade',
|
||||
@@ -122,6 +203,7 @@
|
||||
this.getGradeList = [list]
|
||||
})
|
||||
},
|
||||
//偏好
|
||||
carType(){
|
||||
request({
|
||||
url:'carType/getAll',
|
||||
@@ -131,33 +213,93 @@
|
||||
this.carTypeList = [list]
|
||||
})
|
||||
},
|
||||
//国家
|
||||
area(){
|
||||
request({
|
||||
url:'area/getAll',
|
||||
url:'area/getCountry',
|
||||
method:'get',
|
||||
}).then(res => {
|
||||
var list = res.data.data
|
||||
this.areaList = [list]
|
||||
})
|
||||
},
|
||||
//商机
|
||||
getMagnitude(){
|
||||
request({
|
||||
url:'customer/getMagnitude',
|
||||
method:'get',
|
||||
}).then(res => {
|
||||
var list = res.data.data
|
||||
this.magnitudeList = [list]
|
||||
})
|
||||
},
|
||||
//商机切换事件
|
||||
magnitudeChange(val){
|
||||
this.form.magnitude = val.value[0].id
|
||||
this.magnitude_name = val.value[0].name
|
||||
this.showmagnitude = false
|
||||
},
|
||||
//通道切换事件
|
||||
channelChange(val){
|
||||
this.form.channel_id = val.value[0].id
|
||||
this.channel_name = val.value[0].name
|
||||
this.showchannel = false
|
||||
},
|
||||
//客户等级切换事件
|
||||
gradeHandler(val){
|
||||
this.form.grade = val.value[0].brand_id
|
||||
this.form.grade = val.value[0].id
|
||||
this.grade_name = val.value[0].name
|
||||
this.showgrade = false
|
||||
},
|
||||
//国家切换事件
|
||||
areaChange(val){
|
||||
this.form.country_id = val.value[0].energy_id
|
||||
this.form.country_id = val.value[0].id
|
||||
this.country_name = val.value[0].name
|
||||
this.showarea = false
|
||||
},
|
||||
//偏好切换事件
|
||||
cartypesChange(val){
|
||||
this.form.car_type_id = val.value[0].energy_id
|
||||
this.form.car_type_id = val.value[0].id
|
||||
this.car_type_name = val.value[0].name
|
||||
this.showcartype = false
|
||||
},
|
||||
cancel(val){
|
||||
this[val] = false
|
||||
},
|
||||
//提交保存
|
||||
saveFn(){
|
||||
if(this.form.contacts==''){
|
||||
uni.showToast({
|
||||
title:'客户名称不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false
|
||||
}
|
||||
if(this.form.phone==''){
|
||||
uni.showToast({
|
||||
title:'联系方式不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false
|
||||
}
|
||||
request({
|
||||
url:'customer/save',
|
||||
method:'post',
|
||||
data:this.form
|
||||
}).then(res => {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
icon: 'none'
|
||||
});
|
||||
if(res.data.code ==0){
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/customer',// 替换为你要跳转的页面路径
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -182,8 +324,6 @@
|
||||
}
|
||||
.content{
|
||||
padding-top: 10px;
|
||||
background: #FFFFFF;
|
||||
height: calc(100vh - 44px);
|
||||
}
|
||||
.cell{
|
||||
position: relative;
|
||||
@@ -231,4 +371,24 @@
|
||||
margin-bottom: 40px;
|
||||
margin: 15px 4%;
|
||||
}
|
||||
.mapcont{
|
||||
.header{
|
||||
line-height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
text-align: center;
|
||||
.cancel{
|
||||
width: 20%;
|
||||
color: #999999;
|
||||
}
|
||||
.confirm{
|
||||
width: 20%;
|
||||
color: #3471FF;
|
||||
}
|
||||
}
|
||||
.map{
|
||||
height: 350px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user