线索来源是否显示

This commit is contained in:
老叶
2022-06-30 16:05:12 +08:00
parent d97c06a053
commit 3c62dab9d0
6 changed files with 75 additions and 67 deletions
+7 -5
View File
@@ -271,13 +271,13 @@ Page({
icon: 'none'
})
}
else if (that.data.of_id == '' ) {
else if (that.data.sources.length>0&&that.data.of_id == '' ) {
wx.showToast({
title: '请选择线索来源',
icon: 'none'
})
}
else if (that.data.sources[that.data.of1Index].list.length>0&&that.data.of2_id == '' ) {
else if (that.data.sources.length>0&&that.data.sources[that.data.of1Index].list.length>0&&that.data.of2_id == '' ) {
wx.showToast({
title: '请选择'+that.data.sources[that.data.of1Index].name+'类型',
icon: 'none'
@@ -320,7 +320,9 @@ Page({
// if(this.data.b_s_id != ''){
// params['b_s_id'] = this.data.b_s_id;
// }
params['of_id'] = this.data.of_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;
}
@@ -395,12 +397,12 @@ Page({
params['status'] = this.data.status;
_.apiQuery.getAppCustomersOffline_sources(params).then(res => {
let of1Arr = []
res.data.forEach(item => {
res.data.sources.forEach(item => {
of1Arr.push(item.name)
})
this.setData({
of1Arr,
sources:res.data
sources:res.data.sources
})
});
},
+20 -18
View File
@@ -72,26 +72,28 @@
</picker>
</view>
</view> -->
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="absolute left-0 box-middle">线索来源</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeOf1" value="{{of1Index}}" range="{{of1Arr}}">
<text class="color-ccc" wx:if="{{of1Index == -1}}">请选择</text>
<text wx:else>{{of1Arr[of1Index]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
<block wx:if="{{sources.length>0}}">
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="absolute left-0 box-middle">线索来源</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeOf1" value="{{of1Index}}" range="{{of1Arr}}">
<text class="color-ccc" wx:if="{{of1Index == -1}}">请选择</text>
<text wx:else>{{of1Arr[of1Index]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl140 font-28" wx:if="{{of2Arr.length>0}}">
<view class="absolute left-0 box-middle">{{sources[of1Index].name}}</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeOf2" value="{{of2Index}}" range="{{of2Arr}}">
<text class="color-ccc" wx:if="{{of2Index == -1}}">请选择</text>
<text wx:else>{{of2Arr[of2Index]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
<view class="relative bbs-1-eb last-b-none pl140 font-28" wx:if="{{of2Arr.length>0}}">
<view class="absolute left-0 box-middle">{{sources[of1Index].name}}</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeOf2" value="{{of2Index}}" range="{{of2Arr}}">
<text class="color-ccc" wx:if="{{of2Index == -1}}">请选择</text>
<text wx:else>{{of2Arr[of2Index]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view>
</view>
</block>
<view class="relative bbs-1-eb last-b-none pl190" wx:if="{{status==0}}">
<view class="absolute left-0 box-middle font-28 color-333">预计购车时间</view>
<view class="pt30 pb30 text-right font-28 color-666">
+6 -6
View File
@@ -338,13 +338,13 @@ Page({
icon: 'none'
})
}
else if (that.data.of_id == '' ) {
else if (that.data.sources.length>0&&that.data.of_id == '' ) {
wx.showToast({
title: '请选择线索来源',
icon: 'none'
})
}
else if (that.data.sources[that.data.of1Index].list.length>0&&that.data.of2_id == '' ) {
else if (that.data.sources.length>0&&that.data.sources[that.data.of1Index].list.length>0&&that.data.of2_id == '' ) {
wx.showToast({
title: '请选择'+that.data.sources[that.data.of1Index].name+'类型',
icon: 'none'
@@ -454,15 +454,15 @@ Page({
getAppCustomersOffline_sources(){
_.apiQuery.getAppCustomersOffline_sources().then(res => {
let of1Arr = []
res.data.forEach(item => {
res.data.sources.forEach(item => {
of1Arr.push(item.name)
})
this.setData({
of1Arr,
sources:res.data
sources:res.data.sources
})
if(this.data.of_id != ''){
res.data.forEach((item,index) => {
res.data.sources.forEach((item,index) => {
if(item.id == this.data.of_id){
this.setData({
of1Index:index,
@@ -471,7 +471,7 @@ Page({
})
if(this.data.of2Index != ''){
let of2Arr = []
res.data[this.data.of1Index].list.forEach((item,index) => {
res.data.sources[this.data.of1Index].list.forEach((item,index) => {
of2Arr.push(item.name)
if(item.id == this.data.of2_id){
this.setData({
+20 -18
View File
@@ -53,26 +53,28 @@
</picker>
</view>
</view> -->
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="absolute left-0 box-middle">线索来源</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeOf1" value="{{of1Index}}" range="{{of1Arr}}">
<text class="color-ccc" wx:if="{{of1Index == -1}}">请选择</text>
<text wx:else>{{of1Arr[of1Index]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
<block wx:if="{{sources.length>0}}">
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="absolute left-0 box-middle">线索来源</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeOf1" value="{{of1Index}}" range="{{of1Arr}}">
<text class="color-ccc" wx:if="{{of1Index == -1}}">请选择</text>
<text wx:else>{{of1Arr[of1Index]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl140 font-28" wx:if="{{of2Arr.length>0}}">
<view class="absolute left-0 box-middle">{{sources[of1Index].name}}</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeOf2" value="{{of2Index}}" range="{{of2Arr}}">
<text class="color-ccc" wx:if="{{of2Index == -1}}">请选择</text>
<text wx:else>{{of2Arr[of2Index]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
<view class="relative bbs-1-eb last-b-none pl140 font-28" wx:if="{{of2Arr.length>0}}">
<view class="absolute left-0 box-middle">{{sources[of1Index].name}}</view>
<view class="pt30 pb30 text-right font-28 color-666">
<picker bindchange="changeOf2" value="{{of2Index}}" range="{{of2Arr}}">
<text class="color-ccc" wx:if="{{of2Index == -1}}">请选择</text>
<text wx:else>{{of2Arr[of2Index]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view>
</view>
</block>
<block wx:for='{{taglList}}' wx:for-item='list' wx:for-index='i' wx:key='i'>
<view class="relative mt40">
+2 -2
View File
@@ -601,12 +601,12 @@ Page({
getAppCustomersOffline_sources(){
_.apiQuery.getAppCustomersOffline_sources().then(res => {
let of1Arr = []
res.data.forEach(item => {
res.data.sources.forEach(item => {
of1Arr.push(item.name)
})
this.setData({
of1Arr,
sources:res.data
sources:res.data.sources
})
});
},
+20 -18
View File
@@ -211,26 +211,28 @@
</picker>
</view>
</view> -->
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="absolute left-0 box-middle">客户来源</view>
<view class="pt25 pb25 text-right font-28 color-666">
<picker bindchange="changeOf1" value="{{of1Index}}" range="{{of1Arr}}">
<text class="color-ccc" wx:if="{{of1Index == -1}}">请选择</text>
<text wx:else>{{of1Arr[of1Index]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
<block wx:if="{{sources.length>0}}">
<view class="relative bbs-1-eb last-b-none pl140 font-28">
<view class="absolute left-0 box-middle">客户来源</view>
<view class="pt25 pb25 text-right font-28 color-666">
<picker bindchange="changeOf1" value="{{of1Index}}" range="{{of1Arr}}">
<text class="color-ccc" wx:if="{{of1Index == -1}}">请选择</text>
<text wx:else>{{of1Arr[of1Index]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view>
</view>
<view class="relative bbs-1-eb last-b-none pl140 font-28" wx:if="{{of2Arr.length>0}}">
<view class="absolute left-0 box-middle">{{sources[of1Index].name}}</view>
<view class="pt25 pb25 text-right font-28 color-666">
<picker bindchange="changeOf2" value="{{of2Index}}" range="{{of2Arr}}">
<text class="color-ccc" wx:if="{{of2Index == -1}}">请选择</text>
<text wx:else>{{of2Arr[of2Index]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
<view class="relative bbs-1-eb last-b-none pl140 font-28" wx:if="{{of2Arr.length>0}}">
<view class="absolute left-0 box-middle">{{sources[of1Index].name}}</view>
<view class="pt25 pb25 text-right font-28 color-666">
<picker bindchange="changeOf2" value="{{of2Index}}" range="{{of2Arr}}">
<text class="color-ccc" wx:if="{{of2Index == -1}}">请选择</text>
<text wx:else>{{of2Arr[of2Index]}}</text>
<i class="iconfont ml5 icon-gengduo"></i>
</picker>
</view>
</view>
</view>
</block>
<!-- <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">