客户标签改为非必填
This commit is contained in:
+80
-104
@@ -280,114 +280,90 @@ Page({
|
||||
// })
|
||||
// }
|
||||
else{
|
||||
let taglList = that.data.taglList
|
||||
taglList.forEach(itemA => {
|
||||
itemA.have=false
|
||||
itemA.list.forEach((itemB) => {
|
||||
if(itemB.checked){
|
||||
itemA.have=true
|
||||
}
|
||||
})
|
||||
that.setData({
|
||||
submitFlag: true,
|
||||
})
|
||||
let tindex = -1
|
||||
for (var i=0,len=taglList.length; i<len; i++)
|
||||
{
|
||||
if(!taglList[i].have){
|
||||
tindex = i
|
||||
break;
|
||||
}
|
||||
let params = {};
|
||||
params['status'] = that.data.status;
|
||||
params['name'] = that.data.name;
|
||||
params['mobile'] = that.data.mobile;
|
||||
// params['car_id'] = that.data.car_id;
|
||||
// params['v_id'] = that.data.v_id;
|
||||
// params['color_id'] = that.data.color_id;
|
||||
params['tag'] = that.data.taglList;
|
||||
// if(this.data.b_s_id != ''){
|
||||
// params['b_s_id'] = this.data.b_s_id;
|
||||
// }
|
||||
if(this.data.of_id != ''){
|
||||
params['of_id'] = this.data.of_id;
|
||||
}
|
||||
if(tindex != -1){
|
||||
wx.showToast({
|
||||
title: '请选择'+taglList[tindex].name,
|
||||
icon: 'none'
|
||||
})
|
||||
}else{
|
||||
that.setData({
|
||||
submitFlag: true,
|
||||
})
|
||||
let params = {};
|
||||
params['status'] = that.data.status;
|
||||
params['name'] = that.data.name;
|
||||
params['mobile'] = that.data.mobile;
|
||||
// params['car_id'] = that.data.car_id;
|
||||
// params['v_id'] = that.data.v_id;
|
||||
// params['color_id'] = that.data.color_id;
|
||||
params['tag'] = that.data.taglList;
|
||||
// if(this.data.b_s_id != ''){
|
||||
// params['b_s_id'] = this.data.b_s_id;
|
||||
// }
|
||||
if(this.data.of_id != ''){
|
||||
params['of_id'] = this.data.of_id;
|
||||
}
|
||||
if(this.data.of2_id != ''){
|
||||
params['of2_id'] = this.data.of2_id;
|
||||
}
|
||||
if(this.data.buy_time != ''){
|
||||
params['buy_time'] = this.data.buy_time;
|
||||
}
|
||||
_.apiQuery.postAppCustomers(params).then(res => {
|
||||
|
||||
//刷新列表页
|
||||
let pages = getCurrentPages();
|
||||
let prevPage = null; //上一个页面
|
||||
if (pages.length >= 2) {
|
||||
prevPage = pages[pages.length - 2]; //上一个页面
|
||||
if(prevPage.route == 'pages/customer/index'){
|
||||
prevPage.onPullDownRefresh()
|
||||
}
|
||||
if(this.data.of2_id != ''){
|
||||
params['of2_id'] = this.data.of2_id;
|
||||
}
|
||||
if(this.data.buy_time != ''){
|
||||
params['buy_time'] = this.data.buy_time;
|
||||
}
|
||||
_.apiQuery.postAppCustomers(params).then(res => {
|
||||
|
||||
//刷新列表页
|
||||
let pages = getCurrentPages();
|
||||
let prevPage = null; //上一个页面
|
||||
if (pages.length >= 2) {
|
||||
prevPage = pages[pages.length - 2]; //上一个页面
|
||||
if(prevPage.route == 'pages/customer/index'){
|
||||
prevPage.onPullDownRefresh()
|
||||
}
|
||||
|
||||
wx.showModal({
|
||||
title: '创建成功',
|
||||
content: '',
|
||||
confirmText: "继续创建",
|
||||
confirmColor: "#36afa2",
|
||||
cancelText: "返回",
|
||||
cancelColor: "#666",
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
that.setData({
|
||||
name:'',//名字
|
||||
mobile:'',//手机号
|
||||
// brand_id:'',//品牌
|
||||
// car_id:'',//车系id
|
||||
// v_id:'',//车辆版本id
|
||||
// color_id:'',//颜色id
|
||||
// b_s_id:'',//备选车型id
|
||||
buy_time:'',//预计购车时间
|
||||
// brandIndex:-1,//车辆品牌索引
|
||||
// modelIndex:-1,//车系车型索引
|
||||
// spareIndex:-1,//备选车型索引
|
||||
// colorArray:[],//车身颜色列表
|
||||
// levelArray:[],//车辆版本列表
|
||||
// colorIndex:-1,//车身颜色索引
|
||||
// levelIndex:-1,//车辆版本索引
|
||||
timeArray:[],//预计购车时间列表
|
||||
timeIndex:-1,//预计购车时间索引
|
||||
submitFlag:false,
|
||||
|
||||
|
||||
of_id:'',
|
||||
of2_id:'',
|
||||
of1Index:-1,
|
||||
of2Index:-1,
|
||||
})
|
||||
that.getAppCustomersTag()
|
||||
} else if (res.cancel) {
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
wx.showModal({
|
||||
title: '创建成功',
|
||||
content: '',
|
||||
confirmText: "继续创建",
|
||||
confirmColor: "#36afa2",
|
||||
cancelText: "返回",
|
||||
cancelColor: "#666",
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
that.setData({
|
||||
name:'',//名字
|
||||
mobile:'',//手机号
|
||||
// brand_id:'',//品牌
|
||||
// car_id:'',//车系id
|
||||
// v_id:'',//车辆版本id
|
||||
// color_id:'',//颜色id
|
||||
// b_s_id:'',//备选车型id
|
||||
buy_time:'',//预计购车时间
|
||||
// brandIndex:-1,//车辆品牌索引
|
||||
// modelIndex:-1,//车系车型索引
|
||||
// spareIndex:-1,//备选车型索引
|
||||
// colorArray:[],//车身颜色列表
|
||||
// levelArray:[],//车辆版本列表
|
||||
// colorIndex:-1,//车身颜色索引
|
||||
// levelIndex:-1,//车辆版本索引
|
||||
timeArray:[],//预计购车时间列表
|
||||
timeIndex:-1,//预计购车时间索引
|
||||
submitFlag:false,
|
||||
|
||||
|
||||
of_id:'',
|
||||
of2_id:'',
|
||||
of1Index:-1,
|
||||
of2Index:-1,
|
||||
})
|
||||
that.getAppCustomersTag()
|
||||
} else if (res.cancel) {
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(res=>{
|
||||
this.setData({
|
||||
submitFlag: false,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}).catch(res=>{
|
||||
this.setData({
|
||||
submitFlag: false,
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -400,107 +400,83 @@ Page({
|
||||
// })
|
||||
// }
|
||||
else{
|
||||
let taglList = that.data.taglList
|
||||
taglList.forEach(itemA => {
|
||||
itemA.have=false
|
||||
itemA.list.forEach((itemB) => {
|
||||
if(itemB.checked){
|
||||
itemA.have=true
|
||||
}
|
||||
})
|
||||
that.setData({
|
||||
submitFlag: true,
|
||||
})
|
||||
let tindex = -1
|
||||
for (var i=0,len=taglList.length; i<len; i++)
|
||||
{
|
||||
if(!taglList[i].have){
|
||||
tindex = i
|
||||
break;
|
||||
}
|
||||
|
||||
let params = {};
|
||||
params['cus_id'] = that.data.id;
|
||||
params['tag'] = that.data.taglList;
|
||||
if(that.data.name != that.data.baseinfo.name.value){
|
||||
params['name'] = that.data.name;
|
||||
}
|
||||
if(tindex != -1){
|
||||
wx.showToast({
|
||||
title: '请选择'+taglList[tindex].name,
|
||||
icon: 'none'
|
||||
})
|
||||
}else{
|
||||
if(that.data.mobile != that.data.baseinfo.mobile.value){
|
||||
params['mobile'] = that.data.mobile;
|
||||
}
|
||||
if(that.data.of_id != that.data.baseinfo.of_id.of_id){
|
||||
params['of_id'] = that.data.of_id;
|
||||
}
|
||||
if(that.data.of2_id != that.data.baseinfo.of_id.of2_id){
|
||||
params['of2_id'] = that.data.of2_id;
|
||||
}
|
||||
// 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: true,
|
||||
submitFlag: false,
|
||||
})
|
||||
|
||||
wx.showModal({
|
||||
title: '编辑成功',
|
||||
content: '',
|
||||
confirmText: "确定",
|
||||
confirmColor: "#36afa2",
|
||||
cancelText: "返回",
|
||||
cancelColor: "#666",
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
that.getAppCustomerData()
|
||||
that.getAppCustomersTag()
|
||||
} else if (res.cancel) {
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
let params = {};
|
||||
params['cus_id'] = that.data.id;
|
||||
params['tag'] = that.data.taglList;
|
||||
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.of_id != that.data.baseinfo.of_id.of_id){
|
||||
params['of_id'] = that.data.of_id;
|
||||
}
|
||||
if(that.data.of2_id != that.data.baseinfo.of_id.of2_id){
|
||||
params['of2_id'] = that.data.of2_id;
|
||||
}
|
||||
// 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()
|
||||
that.getAppCustomersTag()
|
||||
} else if (res.cancel) {
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}).catch(res=>{
|
||||
that.setData({
|
||||
submitFlag: false,
|
||||
})
|
||||
});
|
||||
}
|
||||
}).catch(res=>{
|
||||
that.setData({
|
||||
submitFlag: false,
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
+14
-14
@@ -18,9 +18,9 @@ Page({
|
||||
e_time:'',//结束时间
|
||||
if_driver:'',//是否试驾
|
||||
level:'',//客户顶级
|
||||
brand_id:'',//品牌
|
||||
s_id:'',//车型id
|
||||
v_id:'',//车辆版本id
|
||||
// brand_id:'',//品牌
|
||||
// s_id:'',//车型id
|
||||
// v_id:'',//车辆版本id
|
||||
cfrom:'',//客户来源
|
||||
o_type:'',//排序类型
|
||||
isShowfilter:false,//是否显示筛查
|
||||
@@ -215,15 +215,15 @@ 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;
|
||||
}
|
||||
if(this.data.v_id != ''){
|
||||
params['v_id'] = this.data.v_id;
|
||||
}
|
||||
// if(this.data.brand_id != ''){
|
||||
// params['brand_id'] = this.data.brand_id;
|
||||
// }
|
||||
// if(this.data.s_id != ''){
|
||||
// params['s_id'] = this.data.s_id;
|
||||
// }
|
||||
// if(this.data.v_id != ''){
|
||||
// params['v_id'] = this.data.v_id;
|
||||
// }
|
||||
if(this.data.cfrom != ''){
|
||||
params['cfrom'] = this.data.cfrom;
|
||||
}
|
||||
@@ -510,8 +510,8 @@ Page({
|
||||
e_time:'',
|
||||
if_driver:'',
|
||||
level:'',
|
||||
brand_id:'',
|
||||
s_id:'',
|
||||
// brand_id:'',
|
||||
// s_id:'',
|
||||
cfrom:'',
|
||||
of_id:'',
|
||||
of2_id:'',
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<!-- <view class="relative bbs-1-eb pl190 last-b-none">
|
||||
<view class="absolute left-0 box-middle font-28 color-333">车辆品牌</view>
|
||||
<view class="pt25 pb25 text-right font-28 color-666">
|
||||
<picker bindchange="changeBrand" value="{{brandIndex}}" range="{{brandArray}}">
|
||||
@@ -184,7 +184,7 @@
|
||||
<i class="iconfont ml5 icon-gengduo"></i>
|
||||
</picker>
|
||||
</view>
|
||||
</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="pt25 pb25 text-right font-28 color-666">
|
||||
|
||||
Reference in New Issue
Block a user