选择品牌修改
This commit is contained in:
@@ -20,7 +20,8 @@
|
||||
"pages/distribute/material/index",
|
||||
"pages/distribute/reward/index",
|
||||
"pages/distribute/statistics/index",
|
||||
"pages/distribute/assets/index"
|
||||
"pages/distribute/assets/index",
|
||||
"pages/customer/editCard/index"
|
||||
],
|
||||
"echarts": [
|
||||
{
|
||||
|
||||
@@ -48,6 +48,11 @@ api = {
|
||||
appServicesPackage: "app/services/package", //获取代办包
|
||||
appSeriesInfo: "app/series/info", //获取车辆价格
|
||||
|
||||
appSeriesBrands: "app/series/brands", //获取车型品牌
|
||||
appSeries: "app/series", //获取车型车系
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//远程图片存储地址
|
||||
|
||||
@@ -334,5 +334,19 @@ apiQuery.getAppSeriesInfo = function(params){
|
||||
})
|
||||
}
|
||||
|
||||
//获取车型品牌
|
||||
apiQuery.getAppSeriesBrands = function(params){
|
||||
return new Promise(function (resolve, reject) {
|
||||
HttpRequest(false, Config.api.appSeriesBrands, 2, params, "GET", resolve, reject)
|
||||
})
|
||||
}
|
||||
|
||||
//获取车型车系
|
||||
apiQuery.getAppSeries = function(params){
|
||||
return new Promise(function (resolve, reject) {
|
||||
HttpRequest(false, Config.api.appSeries, 2, params, "GET", resolve, reject)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export default apiQuery;
|
||||
@@ -4,12 +4,14 @@ Page({
|
||||
data: {
|
||||
name:'',//名字
|
||||
mobile:'',//手机号
|
||||
car_id:'',//车型id
|
||||
brand_id:'',//品牌
|
||||
car_id:'',//车系id
|
||||
v_id:'',//车型级别id
|
||||
color_id:'',//颜色id
|
||||
b_s_id:'',//备选车型id
|
||||
buy_time:'',//预计购车时间
|
||||
modelIndex:-1,//品牌车型索引
|
||||
brandIndex:-1,//车辆品牌索引
|
||||
modelIndex:-1,//车型车系索引
|
||||
spareIndex:-1,//备选车型索引
|
||||
colorArray:[],//车型颜色列表
|
||||
levelArray:[],//车型级别列表
|
||||
@@ -27,21 +29,39 @@ Page({
|
||||
[key]: options[key]
|
||||
})
|
||||
}
|
||||
this.getAppSeriesCars()
|
||||
this.getAppSeriesBrands()
|
||||
this.getAppCustomersFilter()
|
||||
},
|
||||
|
||||
//获取车型库
|
||||
getAppSeriesCars(){
|
||||
_.apiQuery.getAppSeriesCars().then(res => {
|
||||
if(res.data.length>0){
|
||||
//获取车型品牌
|
||||
getAppSeriesBrands(){
|
||||
_.apiQuery.getAppSeriesBrands().then(res => {
|
||||
if(res.data.list.length>0){
|
||||
let brandArray = []
|
||||
res.data.list.forEach(item => {
|
||||
brandArray.push(item.name)
|
||||
})
|
||||
this.setData({
|
||||
brandArray:brandArray,
|
||||
brandList:res.data.list,
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//获取车型车系
|
||||
getAppSeries(){
|
||||
let params = {};
|
||||
params['brand_id'] = this.data.brand_id;
|
||||
_.apiQuery.getAppSeries().then(res => {
|
||||
if(res.data.list.length>0){
|
||||
let modelArray = []
|
||||
res.data.forEach(item => {
|
||||
modelArray.push(item.title)
|
||||
res.data.list.forEach(item => {
|
||||
modelArray.push(item.name)
|
||||
})
|
||||
this.setData({
|
||||
modelArray:modelArray,
|
||||
modelList:res.data,
|
||||
modelList:res.data.list,
|
||||
})
|
||||
}
|
||||
});
|
||||
@@ -107,55 +127,82 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
//选择车型
|
||||
changeModel(e) {
|
||||
let car_id = ''
|
||||
if(e.detail.value >= 0){
|
||||
car_id = this.data.modelList[e.detail.value].id
|
||||
//选择品牌
|
||||
changeBrand(e) {
|
||||
if(this.data.brandIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
brand_id:this.data.brandList[e.detail.value].id,
|
||||
brandIndex:e.detail.value,
|
||||
car_id:'',//车系id
|
||||
v_id:'',//车型级别id
|
||||
color_id:'',//车型颜色id
|
||||
incolor_id:'',//内饰颜色id
|
||||
b_s_id:'',//备选车型id
|
||||
modelIndex:-1,//车型车系索引
|
||||
spareIndex:-1,//备选车型索引
|
||||
colorArray:[],//车型颜色列表
|
||||
levelArray:[],//车型级别列表
|
||||
interiorArray:[],//内饰颜色
|
||||
colorIndex:-1,//车型颜色索引
|
||||
levelIndex:-1,//车型级别索引
|
||||
interiorIndex:-1,//内饰颜色索引
|
||||
priceinfo:'',
|
||||
})
|
||||
this.getAppSeries()
|
||||
}
|
||||
this.setData({
|
||||
car_id:car_id,
|
||||
modelIndex:e.detail.value,
|
||||
})
|
||||
if(car_id != ''){
|
||||
},
|
||||
|
||||
//选择车系
|
||||
changeModel(e) {
|
||||
if(this.data.modelIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
car_id:this.data.modelList[e.detail.value].id,
|
||||
modelIndex:e.detail.value,
|
||||
v_id:'',//车型级别id
|
||||
color_id:'',//车型颜色id
|
||||
incolor_id:'',//内饰颜色id
|
||||
b_s_id:'',//备选车型id
|
||||
spareIndex:-1,//备选车型索引
|
||||
colorArray:[],//车型颜色列表
|
||||
levelArray:[],//车型级别列表
|
||||
interiorArray:[],//内饰颜色
|
||||
colorIndex:-1,//车型颜色索引
|
||||
levelIndex:-1,//车型级别索引
|
||||
interiorIndex:-1,//内饰颜色索引
|
||||
priceinfo:'',
|
||||
})
|
||||
this.getAppSeriesAttrs()
|
||||
}
|
||||
},
|
||||
|
||||
//车型级别
|
||||
changeLevel(e) {
|
||||
let v_id = ''
|
||||
if(e.detail.value >= 0){
|
||||
v_id = this.data.levelList[e.detail.value].id
|
||||
if(this.data.levelIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
v_id:this.data.levelList[e.detail.value].id,
|
||||
levelIndex:e.detail.value,
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
v_id:v_id,
|
||||
levelIndex:e.detail.value,
|
||||
})
|
||||
},
|
||||
|
||||
//车型颜色
|
||||
changeColor(e) {
|
||||
let color_id = ''
|
||||
if(e.detail.value >= 0){
|
||||
color_id = this.data.colorList[e.detail.value].id
|
||||
if(this.data.colorIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
color_id:this.data.colorList[e.detail.value].id,
|
||||
colorIndex:e.detail.value,
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
color_id:color_id,
|
||||
colorIndex:e.detail.value,
|
||||
})
|
||||
},
|
||||
|
||||
//备选车型
|
||||
changeSpare(e) {
|
||||
let b_s_id = ''
|
||||
if(e.detail.value >= 0){
|
||||
b_s_id = this.data.modelList[e.detail.value].id
|
||||
if(this.data.spareIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
b_s_id:this.data.modelList[e.detail.value].id,
|
||||
spareIndex:e.detail.value,
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
b_s_id:b_s_id,
|
||||
spareIndex:e.detail.value,
|
||||
})
|
||||
},
|
||||
|
||||
//预计购车时间
|
||||
@@ -181,7 +228,7 @@ Page({
|
||||
})
|
||||
}else if(that.data.car_id == '' ){
|
||||
wx.showToast({
|
||||
title: '请选择品牌车型',
|
||||
title: '请选择车型车系',
|
||||
icon: 'none'
|
||||
})
|
||||
}else if(that.data.v_id == '' ){
|
||||
|
||||
@@ -14,7 +14,17 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">品牌车型</view>
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车辆品牌</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeBrand" value="{{brandIndex}}" range="{{brandArray}}">
|
||||
<text class="color-ccc" wx:if="{{brandIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{brandArray[brandIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{brandIndex != -1}}">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车型车系</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeModel" value="{{modelIndex}}" range="{{modelArray}}">
|
||||
<text class="color-ccc" wx:if="{{modelIndex == -1}}">请选择</text>
|
||||
@@ -23,27 +33,27 @@
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{modelIndex != -1}}">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车型级别</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeLevel" value="{{levelIndex}}" range="{{levelArray}}">
|
||||
<text class="color-ccc" wx:if="{{levelIndex == -1}}">{{colorArray.length == 0?'请先选择品牌车型':'请选择'}}</text>
|
||||
<text class="color-ccc" wx:if="{{levelIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{levelArray[levelIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{modelIndex != -1}}">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车型颜色</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeColor" value="{{colorIndex}}" range="{{colorArray}}">
|
||||
<text class="color-ccc" wx:if="{{colorIndex == -1}}">{{colorArray.length == 0?'请先选择品牌车型':'请选择'}}</text>
|
||||
<text class="color-ccc" wx:if="{{colorIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{colorArray[colorIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<!-- <view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{modelIndex != -1}}">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">备选车型</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeSpare" value="{{spareIndex}}" range="{{modelArray}}">
|
||||
|
||||
+112
-41
@@ -33,12 +33,14 @@ Page({
|
||||
/* 编辑 */
|
||||
name:'',//名字
|
||||
mobile:'',//手机号
|
||||
car_id:'',//车型id
|
||||
brand_id:'',//品牌
|
||||
car_id:'',//车系id
|
||||
v_id:'',//车型级别id
|
||||
color_id:'',//颜色id
|
||||
b_s_id:'',//备选车型id
|
||||
buy_time:'',//预计购车时间
|
||||
modelIndex:-1,//品牌车型索引
|
||||
brandIndex:-1,//车辆品牌索引
|
||||
modelIndex:-1,//车型车系索引
|
||||
spareIndex:-1,//备选车型索引
|
||||
colorArray:[],//车型颜色列表
|
||||
levelArray:[],//车型级别列表
|
||||
@@ -108,7 +110,8 @@ Page({
|
||||
})
|
||||
|
||||
//编辑基础信息使用
|
||||
this.getAppSeriesCars()
|
||||
this.getAppSeriesBrands()
|
||||
this.getAppSeriesedit()
|
||||
this.getAppCustomersFilter()
|
||||
|
||||
})
|
||||
@@ -484,22 +487,53 @@ Page({
|
||||
},
|
||||
|
||||
/*************************** 编辑 **********************************/
|
||||
//获取车型库
|
||||
getAppSeriesCars(){
|
||||
_.apiQuery.getAppSeriesCars().then(res => {
|
||||
if(res.data.length>0){
|
||||
//获取车型品牌
|
||||
getAppSeriesBrands(){
|
||||
_.apiQuery.getAppSeriesBrands().then(res => {
|
||||
if(res.data.list.length>0){
|
||||
let brandArray = []
|
||||
res.data.list.forEach(item => {
|
||||
brandArray.push(item.name)
|
||||
})
|
||||
this.setData({
|
||||
brandArray:brandArray,
|
||||
brandList:res.data.list,
|
||||
brandIndex:-1,
|
||||
})
|
||||
|
||||
if(this.data.baseinfo.brand_id.value != ''){
|
||||
res.data.list.forEach((item,index) => {
|
||||
if(item.id == this.data.baseinfo.brand_id.value){
|
||||
this.setData({
|
||||
brandIndex:index,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//匹配车型车系
|
||||
getAppSeriesedit(){
|
||||
let params = {};
|
||||
params['brand_id'] = this.data.baseinfo.brand_id.value;
|
||||
_.apiQuery.getAppSeries().then(res => {
|
||||
if(res.data.list.length>0){
|
||||
let modelArray = []
|
||||
res.data.forEach(item => {
|
||||
modelArray.push(item.title)
|
||||
res.data.list.forEach(item => {
|
||||
modelArray.push(item.name)
|
||||
})
|
||||
this.setData({
|
||||
modelArray:modelArray,
|
||||
modelList:res.data,
|
||||
modelList:res.data.list,
|
||||
modelIndex:-1,
|
||||
})
|
||||
|
||||
if(this.data.baseinfo.car_id.value != ''){
|
||||
res.data.forEach((item,index) => {
|
||||
res.data.list.forEach((item,index) => {
|
||||
if(item.id == this.data.baseinfo.car_id.value){
|
||||
this.setData({
|
||||
modelIndex:index,
|
||||
@@ -516,6 +550,24 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
//编辑品牌时车型车系
|
||||
getAppSeries(){
|
||||
let params = {};
|
||||
params['brand_id'] = this.data.brand_id;
|
||||
_.apiQuery.getAppSeries().then(res => {
|
||||
if(res.data.list.length>0){
|
||||
let modelArray = []
|
||||
res.data.list.forEach(item => {
|
||||
modelArray.push(item.name)
|
||||
})
|
||||
this.setData({
|
||||
modelArray:modelArray,
|
||||
modelList:res.data.list,
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//获取车型属性 /颜色 /车型级别 ---编辑匹配信息
|
||||
getAppSeriesAttrsedit(){
|
||||
let params1 = {};
|
||||
@@ -647,33 +699,60 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
//选择车型
|
||||
changeModel(e) {
|
||||
if(this.data.modelIndex != e.detail.value){
|
||||
let car_id = ''
|
||||
if(e.detail.value >= 0){
|
||||
car_id = this.data.modelList[e.detail.value].id
|
||||
}
|
||||
//选择品牌
|
||||
changeBrand(e) {
|
||||
if(this.data.brandIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
car_id:car_id,
|
||||
modelIndex:e.detail.value,
|
||||
brand_id:this.data.brandList[e.detail.value].id,
|
||||
brandIndex:e.detail.value,
|
||||
car_id:'',//车系id
|
||||
v_id:'',//车型级别id
|
||||
color_id:'',//车型颜色id
|
||||
incolor_id:'',//内饰颜色id
|
||||
b_s_id:'',//备选车型id
|
||||
modelIndex:-1,//车型车系索引
|
||||
spareIndex:-1,//备选车型索引
|
||||
colorArray:[],//车型颜色列表
|
||||
levelArray:[],//车型级别列表
|
||||
interiorArray:[],//内饰颜色
|
||||
colorIndex:-1,//车型颜色索引
|
||||
levelIndex:-1,//车型级别索引
|
||||
interiorIndex:-1,//内饰颜色索引
|
||||
priceinfo:'',
|
||||
})
|
||||
if(car_id != ''){
|
||||
this.getAppSeriesAttrs()
|
||||
}
|
||||
this.getAppSeries()
|
||||
}
|
||||
},
|
||||
|
||||
//选择车系
|
||||
changeModel(e) {
|
||||
if(this.data.modelIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
car_id:this.data.modelList[e.detail.value].id,
|
||||
modelIndex:e.detail.value,
|
||||
v_id:'',//车型级别id
|
||||
color_id:'',//车型颜色id
|
||||
incolor_id:'',//内饰颜色id
|
||||
b_s_id:'',//备选车型id
|
||||
spareIndex:-1,//备选车型索引
|
||||
colorArray:[],//车型颜色列表
|
||||
levelArray:[],//车型级别列表
|
||||
interiorArray:[],//内饰颜色
|
||||
colorIndex:-1,//车型颜色索引
|
||||
levelIndex:-1,//车型级别索引
|
||||
interiorIndex:-1,//内饰颜色索引
|
||||
priceinfo:'',
|
||||
})
|
||||
this.getAppSeriesAttrs()
|
||||
this.putAppCustomerData()
|
||||
}
|
||||
},
|
||||
|
||||
//车型级别
|
||||
changeLevel(e) {
|
||||
if(this.data.levelIndex != e.detail.value){
|
||||
let v_id = ''
|
||||
if(e.detail.value >= 0){
|
||||
v_id = this.data.levelList[e.detail.value].id
|
||||
}
|
||||
if(this.data.levelIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
v_id:v_id,
|
||||
v_id:this.data.levelList[e.detail.value].id,
|
||||
levelIndex:e.detail.value,
|
||||
})
|
||||
this.putAppCustomerData()
|
||||
@@ -682,13 +761,9 @@ Page({
|
||||
|
||||
//车型颜色
|
||||
changeColor(e) {
|
||||
if(this.data.colorIndex != e.detail.value){
|
||||
let color_id = ''
|
||||
if(e.detail.value >= 0){
|
||||
color_id = this.data.colorList[e.detail.value].id
|
||||
}
|
||||
if(this.data.colorIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
color_id:color_id,
|
||||
color_id:this.data.colorList[e.detail.value].id,
|
||||
colorIndex:e.detail.value,
|
||||
})
|
||||
this.putAppCustomerData()
|
||||
@@ -697,13 +772,9 @@ Page({
|
||||
|
||||
//备选车型
|
||||
changeSpare(e) {
|
||||
if(this.data.spareIndex != e.detail.value){
|
||||
let b_s_id = ''
|
||||
if(e.detail.value >= 0){
|
||||
b_s_id = this.data.modelList[e.detail.value].id
|
||||
}
|
||||
if(this.data.spareIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
b_s_id:b_s_id,
|
||||
b_s_id:this.data.modelList[e.detail.value].id,
|
||||
spareIndex:e.detail.value,
|
||||
})
|
||||
this.putAppCustomerData()
|
||||
|
||||
@@ -46,47 +46,66 @@
|
||||
<i class="iconfont icon-fenqi mr10"></i>
|
||||
<text>分期信息</text>
|
||||
</view> -->
|
||||
<view>
|
||||
<button bindtap="pushLink" data-url="/pages/customer/editCard/index?id={{id}}" class="inline-block btn-36afa2 font-22 color-fff ulib-r10" hover-class="btn-36afa2-hover"><i class="iconfont icon-dengji mr10"></i>编辑</button>
|
||||
</view>
|
||||
<view>
|
||||
<view class="relative bbs-1-eb last-b-none pl140 font-28">
|
||||
<view class="absolute left-0 box-middle">客户姓名</view>
|
||||
<view>
|
||||
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入客户姓名" bindinput='inputTx' bindblur='putAppCustomerData' bindconfirm='putAppCustomerData' data-key="name" name='name' value='{{name}}' />
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
{{name}}
|
||||
<!-- <input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入客户姓名" bindinput='inputTx' bindblur='putAppCustomerData' bindconfirm='putAppCustomerData' data-key="name" name='name' value='{{name}}' /> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb last-b-none pl140 font-28">
|
||||
<view class="absolute left-0 box-middle">手机号码</view>
|
||||
<view>
|
||||
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="number" placeholder="请输入客户手机号" bindinput='inputTx' bindblur='putAppCustomerData' bindconfirm='putAppCustomerData' data-key="mobile" name='mobile' value='{{mobile}}' />
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
{{mobile}}
|
||||
<!-- <input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="number" placeholder="请输入客户手机号" bindinput='inputTx' bindblur='putAppCustomerData' bindconfirm='putAppCustomerData' data-key="mobile" name='mobile' value='{{mobile}}' /> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">品牌车型</view>
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车辆品牌</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeModel" value="{{modelIndex}}" range="{{modelArray}}">
|
||||
{{brandArray[brandIndex]}}
|
||||
<!-- <picker bindchange="changeBrand" value="{{brandIndex}}" range="{{brandArray}}">
|
||||
<text class="color-ccc" wx:if="{{brandIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{brandArray[brandIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车型车系</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
{{modelArray[modelIndex]}}
|
||||
<!-- <picker bindchange="changeModel" value="{{modelIndex}}" range="{{modelArray}}">
|
||||
<text class="color-ccc" wx:if="{{modelIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{modelArray[modelIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</picker> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车型级别</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeLevel" value="{{levelIndex}}" range="{{levelArray}}">
|
||||
<text class="color-ccc" wx:if="{{levelIndex == -1}}">{{colorArray.length == 0?'请先选择品牌车型':'请选择'}}</text>
|
||||
{{levelArray[levelIndex]}}
|
||||
<!-- <picker bindchange="changeLevel" value="{{levelIndex}}" range="{{levelArray}}">
|
||||
<text class="color-ccc" wx:if="{{levelIndex == -1}}">{{colorArray.length == 0?'请先选择车型车系':'请选择'}}</text>
|
||||
<text wx:else>{{levelArray[levelIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</picker> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车型颜色</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeColor" value="{{colorIndex}}" range="{{colorArray}}">
|
||||
<text class="color-ccc" wx:if="{{colorIndex == -1}}">{{colorArray.length == 0?'请先选择品牌车型':'请选择'}}</text>
|
||||
{{colorArray[colorIndex]}}
|
||||
<!-- <picker bindchange="changeColor" value="{{colorIndex}}" range="{{colorArray}}">
|
||||
<text class="color-ccc" wx:if="{{colorIndex == -1}}">{{colorArray.length == 0?'请先选择车型车系':'请选择'}}</text>
|
||||
<text wx:else>{{colorArray[colorIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</picker> -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="relative bbs-1-eb pl190 last-b-none">
|
||||
@@ -101,18 +120,20 @@
|
||||
</view> -->
|
||||
<view class="relative bbs-1-eb last-b-none pl140 font-28">
|
||||
<view class="absolute left-0 box-middle">线索来源</view>
|
||||
<view>
|
||||
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入线索来源" bindinput='inputTx' bindblur='putAppCustomerData' bindconfirm='putAppCustomerData' data-key="cf_clues" name='cf_clues' value='{{cf_clues}}' />
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
{{cf_clues}}
|
||||
<!-- <input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入线索来源" bindinput='inputTx' bindblur='putAppCustomerData' bindconfirm='putAppCustomerData' data-key="cf_clues" name='cf_clues' value='{{cf_clues}}' /> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">预计购车时间</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeTime" value="{{timeIndex}}" range="{{timeArray}}">
|
||||
{{timeArray[timeIndex]}}
|
||||
<!-- <picker bindchange="changeTime" value="{{timeIndex}}" range="{{timeArray}}">
|
||||
<text class="color-ccc" wx:if="{{timeIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{timeArray[timeIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</picker> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -170,7 +191,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="fixed left-0 bottom-0 right-0 bg-fff-op80 pl40 pr40 pt20 pb40 fn-flex">
|
||||
<view class="fixed left-0 bottom-0 right-0 bg-fff-op80 pl40 pr40 pt20 pb40 fn-flex z-index-1">
|
||||
<button class="fn-flex-item bds-2-36afa2 bg-fff mr20 pt10 pb10 text-center font-32 color-36afa2 ulib-r750" bindtap="optShowNote"><i class="iconfont icon-xiaoji mr10"></i>小记</button>
|
||||
<button class="fn-flex-item btn-36afa2 ml20 pt10 pb10 text-center font-32 color-fff ulib-r750" bindtap="showSelectStatus">变更状态</button>
|
||||
</view>
|
||||
|
||||
@@ -0,0 +1,451 @@
|
||||
import _ from '../../../commons/js/commons'
|
||||
const app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
name:'',//名字
|
||||
mobile:'',//手机号
|
||||
brand_id:'',//品牌
|
||||
car_id:'',//车系id
|
||||
v_id:'',//车型级别id
|
||||
color_id:'',//颜色id
|
||||
buy_time:'',//预计购车时间
|
||||
brandIndex:-1,//车辆品牌索引
|
||||
modelIndex:-1,//车型车系索引
|
||||
colorArray:[],//车型颜色列表
|
||||
levelArray:[],//车型级别列表
|
||||
colorIndex:-1,//车型颜色索引
|
||||
levelIndex:-1,//车型级别索引
|
||||
timeArray:[],//预计购车时间列表
|
||||
timeIndex:-1,//预计购车时间索引
|
||||
cf_clues:'',//线索来源
|
||||
submitFlag:false,
|
||||
},
|
||||
//生命周期函数--监听页面加载
|
||||
onLoad: function (options) {
|
||||
for (let key in options) {
|
||||
this.setData({
|
||||
[key]: options[key]
|
||||
})
|
||||
}
|
||||
this.getAppCustomerData()
|
||||
},
|
||||
|
||||
//获取客户详细信息
|
||||
getAppCustomerData(){
|
||||
let params = {};
|
||||
params['id'] = this.data.id;
|
||||
_.apiQuery.getAppCustomerData(params).then(res=>{
|
||||
this.setData({
|
||||
baseinfo:res.data.baseinfo,
|
||||
name:res.data.baseinfo.name.value?res.data.baseinfo.name.value:'',
|
||||
mobile:res.data.baseinfo.mobile.value?res.data.baseinfo.mobile.value:'',
|
||||
cf_clues:res.data.baseinfo.cf_clues.value?res.data.baseinfo.cf_clues.value:'',
|
||||
})
|
||||
|
||||
//编辑基础信息使用
|
||||
this.getAppSeriesBrands()
|
||||
this.getAppSeriesedit()
|
||||
this.getAppCustomersFilter()
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
//获取车型品牌
|
||||
getAppSeriesBrands(){
|
||||
_.apiQuery.getAppSeriesBrands().then(res => {
|
||||
if(res.data.list.length>0){
|
||||
let brandArray = []
|
||||
res.data.list.forEach(item => {
|
||||
brandArray.push(item.name)
|
||||
})
|
||||
this.setData({
|
||||
brandArray:brandArray,
|
||||
brandList:res.data.list,
|
||||
brandIndex:-1,
|
||||
})
|
||||
|
||||
if(this.data.baseinfo.brand_id.value != ''){
|
||||
res.data.list.forEach((item,index) => {
|
||||
if(item.id == this.data.baseinfo.brand_id.value){
|
||||
this.setData({
|
||||
brand_id:this.data.baseinfo.brand_id.value,
|
||||
brandIndex:index,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//匹配车型车系
|
||||
getAppSeriesedit(){
|
||||
let params = {};
|
||||
params['brand_id'] = this.data.baseinfo.brand_id.value;
|
||||
_.apiQuery.getAppSeries().then(res => {
|
||||
if(res.data.list.length>0){
|
||||
let modelArray = []
|
||||
res.data.list.forEach(item => {
|
||||
modelArray.push(item.name)
|
||||
})
|
||||
this.setData({
|
||||
modelArray:modelArray,
|
||||
modelList:res.data.list,
|
||||
modelIndex:-1,
|
||||
})
|
||||
|
||||
if(this.data.baseinfo.car_id.value != ''){
|
||||
res.data.list.forEach((item,index) => {
|
||||
if(item.id == this.data.baseinfo.car_id.value){
|
||||
this.setData({
|
||||
car_id:this.data.baseinfo.car_id.value,
|
||||
modelIndex:index,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
//匹配颜色 车型级别
|
||||
this.getAppSeriesAttrsedit()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//编辑品牌时车型车系
|
||||
getAppSeries(){
|
||||
let params = {};
|
||||
params['brand_id'] = this.data.brand_id;
|
||||
_.apiQuery.getAppSeries().then(res => {
|
||||
if(res.data.list.length>0){
|
||||
let modelArray = []
|
||||
res.data.list.forEach(item => {
|
||||
modelArray.push(item.name)
|
||||
})
|
||||
this.setData({
|
||||
modelArray:modelArray,
|
||||
modelList:res.data.list,
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//获取车型属性 /颜色 /车型级别 ---编辑匹配信息
|
||||
getAppSeriesAttrsedit(){
|
||||
let params1 = {};
|
||||
params1['id'] = this.data.modelList[this.data.modelIndex].id;
|
||||
params1['type'] = 0;
|
||||
_.apiQuery.getAppSeriesAttrs(params1).then(res => {
|
||||
if(res.data.total>0){
|
||||
let colorArray = []
|
||||
res.data.list.forEach(item => {
|
||||
colorArray.push(item.title)
|
||||
})
|
||||
this.setData({
|
||||
colorArray:colorArray,
|
||||
colorList:res.data.list,
|
||||
colorIndex:-1,
|
||||
})
|
||||
|
||||
if(this.data.baseinfo.color_id.value != ''){
|
||||
res.data.list.forEach((item,index) => {
|
||||
if(item.id == this.data.baseinfo.color_id.value){
|
||||
this.setData({
|
||||
color_id:this.data.baseinfo.color_id.value,
|
||||
colorIndex:index,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
let params2 = {};
|
||||
params2['id'] = this.data.modelList[this.data.modelIndex].id;
|
||||
params2['type'] = 1;
|
||||
_.apiQuery.getAppSeriesAttrs(params2).then(res => {
|
||||
if(res.data.total>0){
|
||||
let levelArray = []
|
||||
res.data.list.forEach(item => {
|
||||
levelArray.push(item.title)
|
||||
})
|
||||
this.setData({
|
||||
levelArray:levelArray,
|
||||
levelList:res.data.list,
|
||||
levelIndex:-1,
|
||||
})
|
||||
|
||||
if(this.data.baseinfo.v_id.value != ''){
|
||||
res.data.list.forEach((item,index) => {
|
||||
if(item.id == this.data.baseinfo.v_id.value){
|
||||
this.setData({
|
||||
v_id:this.data.baseinfo.v_id.value,
|
||||
levelIndex:index,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//获取车型属性 /颜色 /车型级别
|
||||
getAppSeriesAttrs(){
|
||||
let params1 = {};
|
||||
params1['id'] = this.data.car_id;
|
||||
params1['type'] = 0;
|
||||
_.apiQuery.getAppSeriesAttrs(params1).then(res => {
|
||||
if(res.data.total>0){
|
||||
let colorArray = []
|
||||
res.data.list.forEach(item => {
|
||||
colorArray.push(item.title)
|
||||
})
|
||||
this.setData({
|
||||
colorArray:colorArray,
|
||||
colorList:res.data.list,
|
||||
colorIndex:-1,
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
let params2 = {};
|
||||
params2['id'] = this.data.car_id;
|
||||
params2['type'] = 1;
|
||||
_.apiQuery.getAppSeriesAttrs(params2).then(res => {
|
||||
if(res.data.total>0){
|
||||
let levelArray = []
|
||||
res.data.list.forEach(item => {
|
||||
levelArray.push(item.title)
|
||||
})
|
||||
this.setData({
|
||||
levelArray:levelArray,
|
||||
levelList:res.data.list,
|
||||
levelIndex:-1,
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//获取列表筛选条件-时间
|
||||
getAppCustomersFilter(){
|
||||
_.apiQuery.getAppCustomersFilter().then(res => {
|
||||
|
||||
let timeArray = []
|
||||
res.data.buy_time.forEach(item => {
|
||||
timeArray.push(item + '天')
|
||||
})
|
||||
this.setData({
|
||||
timeArray:timeArray,
|
||||
timeList:res.data.buy_time,
|
||||
})
|
||||
|
||||
if(this.data.baseinfo.buy_time.value != 0){
|
||||
res.data.buy_time.forEach((item,index) => {
|
||||
if(item == this.data.baseinfo.buy_time.value){
|
||||
this.setData({
|
||||
buy_time:this.data.baseinfo.buy_time.value,
|
||||
timeIndex:index,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
//输入
|
||||
inputTx(e) {
|
||||
this.setData({
|
||||
submitFlag:false,
|
||||
[e.currentTarget.dataset.key]: e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
//选择品牌
|
||||
changeBrand(e) {
|
||||
if(this.data.brandIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
brand_id:this.data.brandList[e.detail.value].id,
|
||||
brandIndex:e.detail.value,
|
||||
car_id:'',//车系id
|
||||
v_id:'',//车型级别id
|
||||
color_id:'',//车型颜色id
|
||||
incolor_id:'',//内饰颜色id
|
||||
modelIndex:-1,//车型车系索引
|
||||
colorArray:[],//车型颜色列表
|
||||
levelArray:[],//车型级别列表
|
||||
interiorArray:[],//内饰颜色
|
||||
colorIndex:-1,//车型颜色索引
|
||||
levelIndex:-1,//车型级别索引
|
||||
interiorIndex:-1,//内饰颜色索引
|
||||
priceinfo:'',
|
||||
})
|
||||
this.getAppSeries()
|
||||
}
|
||||
},
|
||||
|
||||
//选择车系
|
||||
changeModel(e) {
|
||||
if(this.data.modelIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
car_id:this.data.modelList[e.detail.value].id,
|
||||
modelIndex:e.detail.value,
|
||||
v_id:'',//车型级别id
|
||||
color_id:'',//车型颜色id
|
||||
incolor_id:'',//内饰颜色id
|
||||
colorArray:[],//车型颜色列表
|
||||
levelArray:[],//车型级别列表
|
||||
interiorArray:[],//内饰颜色
|
||||
colorIndex:-1,//车型颜色索引
|
||||
levelIndex:-1,//车型级别索引
|
||||
interiorIndex:-1,//内饰颜色索引
|
||||
priceinfo:'',
|
||||
})
|
||||
this.getAppSeriesAttrs()
|
||||
}
|
||||
},
|
||||
|
||||
//车型级别
|
||||
changeLevel(e) {
|
||||
if(this.data.levelIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
v_id:this.data.levelList[e.detail.value].id,
|
||||
levelIndex:e.detail.value,
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
//车型颜色
|
||||
changeColor(e) {
|
||||
if(this.data.colorIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
color_id:this.data.colorList[e.detail.value].id,
|
||||
colorIndex:e.detail.value,
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
//预计购车时间
|
||||
changeTime(e) {
|
||||
this.setData({
|
||||
buy_time:this.data.timeList[e.detail.value],
|
||||
timeIndex:e.detail.value,
|
||||
})
|
||||
},
|
||||
|
||||
//编辑客户
|
||||
putAppCustomerData() {
|
||||
|
||||
let that = this
|
||||
if (that.data.name == '' ) {
|
||||
wx.showToast({
|
||||
title: '请输入客户姓名',
|
||||
icon: 'none'
|
||||
})
|
||||
} else if (that.data.mobile == '' ){
|
||||
wx.showToast({
|
||||
title: '请输入客户手机号',
|
||||
icon: 'none'
|
||||
})
|
||||
}else if(that.data.car_id == '' ){
|
||||
wx.showToast({
|
||||
title: '请选择车型车系',
|
||||
icon: 'none'
|
||||
})
|
||||
}else if(that.data.v_id == '' ){
|
||||
wx.showToast({
|
||||
title: '请选择车型级别',
|
||||
icon: 'none'
|
||||
})
|
||||
}else if(that.data.color_id == '' ){
|
||||
wx.showToast({
|
||||
title: '请选择车型颜色',
|
||||
icon: 'none'
|
||||
})
|
||||
} else if(that.data.name==that.data.baseinfo.name.value&&that.data.mobile==that.data.baseinfo.mobile.value&&that.data.cf_clues==that.data.baseinfo.cf_clues.value&&that.data.car_id==that.data.baseinfo.car_id.value&&that.data.v_id==that.data.baseinfo.v_id.value&&that.data.color_id==that.data.baseinfo.color_id.value&&that.data.buy_time==that.data.baseinfo.buy_time.value){
|
||||
wx.showToast({
|
||||
title: '好像没改什么',
|
||||
icon: 'none'
|
||||
})
|
||||
}else{
|
||||
that.setData({
|
||||
submitFlag: true,
|
||||
})
|
||||
|
||||
let params = {};
|
||||
params['cus_id'] = that.data.id;
|
||||
if(that.data.name != that.data.baseinfo.name.value){
|
||||
params['name'] = that.data.name;
|
||||
}
|
||||
if(that.data.mobile != that.data.baseinfo.mobile.value){
|
||||
params['mobile'] = that.data.mobile;
|
||||
}
|
||||
if(that.data.cf_clues != that.data.baseinfo.cf_clues.value){
|
||||
params['cf_clues'] = that.data.cf_clues;
|
||||
}
|
||||
if(that.data.car_id != that.data.baseinfo.car_id.value){
|
||||
params['car_id'] = that.data.car_id;
|
||||
}
|
||||
if(that.data.v_id != that.data.baseinfo.v_id.value){
|
||||
params['v_id'] = that.data.v_id;
|
||||
}
|
||||
if(that.data.color_id != that.data.baseinfo.color_id.value){
|
||||
params['color_id'] = that.data.color_id;
|
||||
}
|
||||
if(that.data.buy_time != that.data.baseinfo.buy_time.value){
|
||||
params['buy_time'] = that.data.buy_time;
|
||||
}
|
||||
_.apiQuery.putAppCustomerData(params).then(res => {
|
||||
|
||||
//刷新列表页
|
||||
let pages = getCurrentPages();
|
||||
let prevPage1 = null; //上一个页面
|
||||
let prevPage2 = null; //上上一个页面
|
||||
if (pages.length >= 2) {
|
||||
prevPage1 = pages[pages.length - 2]; //上一个页面
|
||||
if(prevPage1.route == 'pages/customer/detail/index'){
|
||||
prevPage1.onPullDownRefresh()
|
||||
}
|
||||
prevPage2 = pages[pages.length - 3]; //上一个页面
|
||||
if(prevPage2.route == 'pages/customer/index'){
|
||||
prevPage2.onPullDownRefresh()
|
||||
}
|
||||
}
|
||||
|
||||
that.setData({
|
||||
submitFlag: false,
|
||||
})
|
||||
|
||||
wx.showModal({
|
||||
title: '编辑成功',
|
||||
content: '',
|
||||
confirmText: "确定",
|
||||
confirmColor: "#36afa2",
|
||||
cancelText: "返回",
|
||||
cancelColor: "#666",
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
that.getAppCustomerData()
|
||||
} else if (res.cancel) {
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}).catch(res=>{
|
||||
that.setData({
|
||||
submitFlag: false,
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
})
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "客户编辑",
|
||||
"usingComponents": {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<view class="container">
|
||||
<view class="inner30">
|
||||
<view class="pl40 pr40 pt10 pb10 relative ulib-r10 box-shadow-000-10-10 overflowhidden">
|
||||
<view class="relative bbs-1-eb last-b-none pl140 font-28">
|
||||
<view class="absolute left-0 box-middle">客户姓名</view>
|
||||
<view>
|
||||
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入客户姓名" bindinput='inputTx' data-key="name" name='name' value='{{name}}' />
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb last-b-none pl140 font-28">
|
||||
<view class="absolute left-0 box-middle">手机号码</view>
|
||||
<view>
|
||||
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="number" placeholder="请输入客户手机号" bindinput='inputTx' data-key="mobile" name='mobile' value='{{mobile}}' />
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车辆品牌</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeBrand" value="{{brandIndex}}" range="{{brandArray}}">
|
||||
<text class="color-ccc" wx:if="{{brandIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{brandArray[brandIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{brandIndex != -1}}">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车型车系</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeModel" value="{{modelIndex}}" range="{{modelArray}}">
|
||||
<text class="color-ccc" wx:if="{{modelIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{modelArray[modelIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{modelIndex != -1}}">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车型级别</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeLevel" value="{{levelIndex}}" range="{{levelArray}}">
|
||||
<text class="color-ccc" wx:if="{{levelIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{levelArray[levelIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{modelIndex != -1}}">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车型颜色</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeColor" value="{{colorIndex}}" range="{{colorArray}}">
|
||||
<text class="color-ccc" wx:if="{{colorIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{colorArray[colorIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb last-b-none pl140 font-28">
|
||||
<view class="absolute left-0 box-middle">线索来源</view>
|
||||
<view>
|
||||
<input class="wp100 height-100 text-right font-28" placeholder-class="color-ccc" type="text" placeholder="请输入线索来源" bindinput='inputTx' data-key="cf_clues" name='cf_clues' value='{{cf_clues}}' />
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">预计购车时间</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeTime" value="{{timeIndex}}" range="{{timeArray}}">
|
||||
<text class="color-ccc" wx:if="{{timeIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{timeArray[timeIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mt60 pl60 pr60">
|
||||
<button class="wp100 btn-36afa2 pt10 pb10 text-center font-32 color-fff ulib-r750" hover-class="btn-36afa2-hover" disabled="{{submitFlag}}" bindtap="putAppCustomerData">确认编辑</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<lcb-footer></lcb-footer>
|
||||
@@ -0,0 +1 @@
|
||||
/* pages/customer/addCard/index.wxss */
|
||||
+52
-16
@@ -15,6 +15,7 @@ Page({
|
||||
e_time:'',//结束时间
|
||||
if_driver:'',//是否试驾
|
||||
level:'',//客户顶级
|
||||
brand_id:'',//品牌
|
||||
s_id:'',//车型id
|
||||
v_id:'',//车型级别id
|
||||
cfrom:'',//客户来源
|
||||
@@ -50,7 +51,8 @@ Page({
|
||||
sortList:['建卡日期','最近联系','特别关注',],//排序数组
|
||||
sortListIndex:0,//排序索引
|
||||
levelIndex:-1,//意向等级索引
|
||||
modelIndex:-1,//品牌车型索引
|
||||
brandIndex:-1,//车辆品牌索引
|
||||
modelIndex:-1,//车型车系索引
|
||||
cfromIndex:-1,//客户来源索引
|
||||
isShowMessage:false,//是否显示短信弹窗
|
||||
content:'',//短信内容
|
||||
@@ -64,7 +66,7 @@ Page({
|
||||
}
|
||||
this.getAppCustomersTabs()
|
||||
this.getAppCustomersFilter()
|
||||
this.getAppSeriesCars()
|
||||
this.getAppSeriesBrands()
|
||||
},
|
||||
|
||||
onShow(){
|
||||
@@ -102,17 +104,35 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
//获取车型库
|
||||
getAppSeriesCars(){
|
||||
_.apiQuery.getAppSeriesCars().then(res => {
|
||||
if(res.data.length>0){
|
||||
//获取车型品牌
|
||||
getAppSeriesBrands(){
|
||||
_.apiQuery.getAppSeriesBrands().then(res => {
|
||||
if(res.data.list.length>0){
|
||||
let brandArray = []
|
||||
res.data.list.forEach(item => {
|
||||
brandArray.push(item.name)
|
||||
})
|
||||
this.setData({
|
||||
brandArray:brandArray,
|
||||
brandList:res.data.list,
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//获取车型车系
|
||||
getAppSeries(){
|
||||
let params = {};
|
||||
params['brand_id'] = this.data.brand_id;
|
||||
_.apiQuery.getAppSeries().then(res => {
|
||||
if(res.data.list.length>0){
|
||||
let modelArray = []
|
||||
res.data.forEach(item => {
|
||||
modelArray.push(item.title)
|
||||
res.data.list.forEach(item => {
|
||||
modelArray.push(item.name)
|
||||
})
|
||||
this.setData({
|
||||
modelArray:modelArray,
|
||||
modelList:res.data,
|
||||
modelList:res.data.list,
|
||||
})
|
||||
}
|
||||
});
|
||||
@@ -140,6 +160,9 @@ Page({
|
||||
if(this.data.level != ''){
|
||||
params['level'] = this.data.level;
|
||||
}
|
||||
if(this.data.brand_id != ''){
|
||||
params['brand_id'] = this.data.brand_id;
|
||||
}
|
||||
if(this.data.s_id != ''){
|
||||
params['s_id'] = this.data.s_id;
|
||||
}
|
||||
@@ -360,16 +383,27 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
//选择品牌
|
||||
changeBrand(e) {
|
||||
if(this.data.brandIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
brand_id:this.data.brandList[e.detail.value].id,
|
||||
brandIndex:e.detail.value,
|
||||
s_id:'',//车系id
|
||||
modelIndex:-1,//车型车系索引
|
||||
})
|
||||
this.getAppSeries()
|
||||
}
|
||||
},
|
||||
|
||||
//选择车型
|
||||
changeModel(e) {
|
||||
let s_id = ''
|
||||
if(e.detail.value >= 0){
|
||||
s_id = this.data.modelList[e.detail.value].id
|
||||
if(this.data.modelIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
s_id:this.data.modelList[e.detail.value].id,
|
||||
modelIndex:e.detail.value,
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
s_id:s_id,
|
||||
modelIndex:e.detail.value,
|
||||
})
|
||||
},
|
||||
|
||||
//客户来源
|
||||
@@ -409,11 +443,13 @@ Page({
|
||||
e_time:'',
|
||||
if_driver:'',
|
||||
level:'',
|
||||
brand_id:'',
|
||||
s_id:'',
|
||||
cfrom:'',
|
||||
timeSlotIndex:-1,
|
||||
testDriveIndex:-1,
|
||||
levelIndex:-1,
|
||||
brandIndex:-1,
|
||||
modelIndex:-1,
|
||||
cfromIndex:-1,
|
||||
})
|
||||
|
||||
@@ -143,7 +143,17 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">品牌车型</view>
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车辆品牌</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeBrand" value="{{brandIndex}}" range="{{brandArray}}">
|
||||
<text class="color-ccc" wx:if="{{brandIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{brandArray[brandIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{brandIndex != -1}}">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车型车系</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeModel" value="{{modelIndex}}" range="{{modelArray}}">
|
||||
<text class="color-ccc" wx:if="{{modelIndex == -1}}">请选择</text>
|
||||
|
||||
@@ -2,13 +2,15 @@ import _ from '../../../commons/js/commons'
|
||||
const app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
car_id:'',//车型id
|
||||
brand_id:'',//品牌
|
||||
car_id:'',//车系id
|
||||
v_id:'',//车型级别id
|
||||
color_id:'',//车型颜色id
|
||||
incolor_id:'',//内饰颜色id
|
||||
b_s_id:'',//备选车型id
|
||||
buy_time:'',//预计购车时间
|
||||
modelIndex:-1,//品牌车型索引
|
||||
brandIndex:-1,//车辆品牌索引
|
||||
modelIndex:-1,//车型车系索引
|
||||
spareIndex:-1,//备选车型索引
|
||||
colorArray:[],//车型颜色列表
|
||||
levelArray:[],//车型级别列表
|
||||
@@ -18,6 +20,7 @@ Page({
|
||||
colorIndex:-1,//车型颜色索引
|
||||
levelIndex:-1,//车型级别索引
|
||||
interiorIndex:-1,//内饰颜色索引
|
||||
priceinfo:'',//车辆价格
|
||||
submitFlag:false,
|
||||
|
||||
customerIndex:-1,
|
||||
@@ -48,7 +51,7 @@ Page({
|
||||
}
|
||||
|
||||
this.getAppCustomersList()
|
||||
this.getAppSeriesCars()
|
||||
this.getAppSeriesBrands()
|
||||
this.getUserInfo()
|
||||
|
||||
},
|
||||
@@ -93,17 +96,35 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
//获取车型库
|
||||
getAppSeriesCars(){
|
||||
_.apiQuery.getAppSeriesCars().then(res => {
|
||||
if(res.data.length>0){
|
||||
//获取车型品牌
|
||||
getAppSeriesBrands(){
|
||||
_.apiQuery.getAppSeriesBrands().then(res => {
|
||||
if(res.data.list.length>0){
|
||||
let brandArray = []
|
||||
res.data.list.forEach(item => {
|
||||
brandArray.push(item.name)
|
||||
})
|
||||
this.setData({
|
||||
brandArray:brandArray,
|
||||
brandList:res.data.list,
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//获取车型车系
|
||||
getAppSeries(){
|
||||
let params = {};
|
||||
params['brand_id'] = this.data.brand_id;
|
||||
_.apiQuery.getAppSeries().then(res => {
|
||||
if(res.data.list.length>0){
|
||||
let modelArray = []
|
||||
res.data.forEach(item => {
|
||||
modelArray.push(item.title)
|
||||
res.data.list.forEach(item => {
|
||||
modelArray.push(item.name)
|
||||
})
|
||||
this.setData({
|
||||
modelArray:modelArray,
|
||||
modelList:res.data,
|
||||
modelList:res.data.list,
|
||||
})
|
||||
}
|
||||
});
|
||||
@@ -184,58 +205,85 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
//选择车型
|
||||
changeModel(e) {
|
||||
let car_id = ''
|
||||
if(e.detail.value >= 0){
|
||||
car_id = this.data.modelList[e.detail.value].id
|
||||
//选择品牌
|
||||
changeBrand(e) {
|
||||
if(this.data.brandIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
brand_id:this.data.brandList[e.detail.value].id,
|
||||
brandIndex:e.detail.value,
|
||||
car_id:'',//车系id
|
||||
v_id:'',//车型级别id
|
||||
color_id:'',//车型颜色id
|
||||
incolor_id:'',//内饰颜色id
|
||||
b_s_id:'',//备选车型id
|
||||
modelIndex:-1,//车型车系索引
|
||||
spareIndex:-1,//备选车型索引
|
||||
colorArray:[],//车型颜色列表
|
||||
levelArray:[],//车型级别列表
|
||||
interiorArray:[],//内饰颜色
|
||||
colorIndex:-1,//车型颜色索引
|
||||
levelIndex:-1,//车型级别索引
|
||||
interiorIndex:-1,//内饰颜色索引
|
||||
priceinfo:'',
|
||||
})
|
||||
this.getAppSeries()
|
||||
}
|
||||
this.setData({
|
||||
car_id:car_id,
|
||||
modelIndex:e.detail.value,
|
||||
})
|
||||
if(car_id != ''){
|
||||
},
|
||||
|
||||
//选择车系
|
||||
changeModel(e) {
|
||||
if(this.data.modelIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
car_id:this.data.modelList[e.detail.value].id,
|
||||
modelIndex:e.detail.value,
|
||||
v_id:'',//车型级别id
|
||||
color_id:'',//车型颜色id
|
||||
incolor_id:'',//内饰颜色id
|
||||
b_s_id:'',//备选车型id
|
||||
spareIndex:-1,//备选车型索引
|
||||
colorArray:[],//车型颜色列表
|
||||
levelArray:[],//车型级别列表
|
||||
interiorArray:[],//内饰颜色
|
||||
colorIndex:-1,//车型颜色索引
|
||||
levelIndex:-1,//车型级别索引
|
||||
interiorIndex:-1,//内饰颜色索引
|
||||
priceinfo:'',
|
||||
})
|
||||
this.getAppSeriesAttrs()
|
||||
}
|
||||
},
|
||||
|
||||
//车型级别
|
||||
changeLevel(e) {
|
||||
let v_id = ''
|
||||
if(e.detail.value >= 0){
|
||||
v_id = this.data.levelList[e.detail.value].id
|
||||
if(this.data.levelIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
v_id:this.data.levelList[e.detail.value].id,
|
||||
levelIndex:e.detail.value,
|
||||
})
|
||||
this.getAppSeriesInfo()
|
||||
}
|
||||
this.setData({
|
||||
v_id:v_id,
|
||||
levelIndex:e.detail.value,
|
||||
})
|
||||
this.getAppSeriesInfo()
|
||||
},
|
||||
|
||||
//车型颜色
|
||||
changeColor(e) {
|
||||
let color_id = ''
|
||||
if(e.detail.value >= 0){
|
||||
color_id = this.data.colorList[e.detail.value].id
|
||||
if(this.data.colorIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
color_id:this.data.colorList[e.detail.value].id,
|
||||
colorIndex:e.detail.value,
|
||||
})
|
||||
this.getAppSeriesInfo()
|
||||
}
|
||||
this.setData({
|
||||
color_id:color_id,
|
||||
colorIndex:e.detail.value,
|
||||
})
|
||||
this.getAppSeriesInfo()
|
||||
},
|
||||
|
||||
//内饰颜色
|
||||
changeInterior(e) {
|
||||
let incolor_id = ''
|
||||
if(e.detail.value >= 0){
|
||||
incolor_id = this.data.interiorList[e.detail.value].id
|
||||
if(this.data.interiorIndex != e.detail.value && e.detail.value >= 0){
|
||||
this.setData({
|
||||
incolor_id:this.data.interiorList[e.detail.value].id,
|
||||
interiorIndex:e.detail.value,
|
||||
})
|
||||
this.getAppSeriesInfo()
|
||||
}
|
||||
this.setData({
|
||||
incolor_id:incolor_id,
|
||||
interiorIndex:e.detail.value,
|
||||
})
|
||||
this.getAppSeriesInfo()
|
||||
},
|
||||
|
||||
//代办包
|
||||
@@ -300,7 +348,7 @@ Page({
|
||||
})
|
||||
}else if(that.data.car_id == '' ){
|
||||
wx.showToast({
|
||||
title: '请选择品牌车型',
|
||||
title: '请选择车型车系',
|
||||
icon: 'none'
|
||||
})
|
||||
}else if(that.data.v_id == '' ){
|
||||
|
||||
@@ -14,7 +14,17 @@
|
||||
</view>
|
||||
<view class="mt40 font-32">车辆信息</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">品牌车型</view>
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车辆品牌</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeBrand" value="{{brandIndex}}" range="{{brandArray}}">
|
||||
<text class="color-ccc" wx:if="{{brandIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{brandArray[brandIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{brandIndex != -1}}">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车型车系</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeModel" value="{{modelIndex}}" range="{{modelArray}}">
|
||||
<text class="color-ccc" wx:if="{{modelIndex == -1}}">请选择</text>
|
||||
@@ -23,46 +33,46 @@
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{modelIndex != -1}}">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车型级别</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeLevel" value="{{levelIndex}}" range="{{levelArray}}">
|
||||
<text class="color-ccc" wx:if="{{levelIndex == -1}}">{{modelIndex == -1?'请先选择品牌车型':'请选择'}}</text>
|
||||
<text class="color-ccc" wx:if="{{levelIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{levelArray[levelIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{modelIndex != -1}}">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车型颜色</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeColor" value="{{colorIndex}}" range="{{colorArray}}">
|
||||
<text class="color-ccc" wx:if="{{colorIndex == -1}}">{{modelIndex == -1?'请先选择品牌车型':'请选择'}}</text>
|
||||
<text class="color-ccc" wx:if="{{colorIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{colorArray[colorIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="relative bbs-1-eb pl190 last-b-none" wx:if="{{modelIndex != -1}}">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">内饰颜色</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666">
|
||||
<picker bindchange="changeInterior" value="{{interiorIndex}}" range="{{interiorArray}}">
|
||||
<text class="color-ccc" wx:if="{{interiorIndex == -1}}">{{modelIndex == -1?'请先选择品牌车型':'请选择'}}</text>
|
||||
<text class="color-ccc" wx:if="{{interiorIndex == -1}}">请选择</text>
|
||||
<text wx:else>{{interiorArray[interiorIndex]}}</text>
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb last-b-none pl140 font-28">
|
||||
<view class="relative bbs-1-eb last-b-none pl140 font-28" wx:if="{{priceinfo.price}}">
|
||||
<view class="absolute left-0 box-middle color-333">车辆合同售价</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666" style="height:38rpx;">
|
||||
<text wx:if="{{priceinfo.price}}">{{priceinfo.price}}元</text>
|
||||
<text>{{priceinfo.price}}元</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb last-b-none pl140 font-28">
|
||||
<view class="relative bbs-1-eb last-b-none pl140 font-28" wx:if="{{priceinfo.deposit}}">
|
||||
<view class="absolute left-0 box-middle color-333">定金</view>
|
||||
<view class="pt30 pb30 text-right font-28 color-666" style="height:38rpx;">
|
||||
<text wx:if="{{priceinfo.deposit}}">{{priceinfo.deposit}}元</text>
|
||||
<text>{{priceinfo.deposit}}元</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
|
||||
Reference in New Issue
Block a user