<view class="header">
    <view>
        <view class="label">线索状态</view>
        <view class="con" style="color: {{tagColor}};">{{detailsData.status}}</view>
    </view>
    <view>
        <view class="label">客户名称</view>
        <view class="con line-1">{{detailsData.name}}</view>
    </view>
    <view bindtap="callOut" data-phonenumber="{{detailsData.phonenumber}}">
        <view class="label">手机号码</view>
        <view class="con">{{detailsData.phonenumber}}</view>
    </view>
</view>
<van-tabs sticky color='#3874F6' title-active-color='#3874F6' tab-class='tab-class'>
    <van-tab title="线索详情">
        <Details detailsData='{{detailsData}}' tagColor="{{tagColor}}" />
        <view style="height: 140rpx;" />
    </van-tab>
    <van-tab title="跟进记录">
        <view class="filtrate">
            <view class="date" bindtap="openSelectDate">{{showWhere}}
                <van-icon style="margin-left: 8rpx;" name="arrow-down" />
            </view>
            <view class="sort" bindtap="changeIsdesc">
                <text class="iconfont {{ isdesc==1?'icon-jiangxu':'icon-shengxu1' }}" />
            </view>
        </view>
        <Record followList='{{followList}}' />
        <My_empty wx:if="{{followList.length==0}}" />
        <view style="height: 140rpx;" />
    </van-tab>
</van-tabs>

<block wx:if="{{!per.query(auth,'只读')}}">
    <view class="footer" wx:if="{{detailsData.status=='待跟进'||detailsData.status=='跟进中'}}">
        <navigator url="#" data-name="跟进计划" catchtap="openPoput">
            <view class="iconfont icon-genjin" />
            <view class="text">执行</view>
        </navigator>
        <navigator wx:if="{{per.query(auth,'修改')}}" url="#" data-name="线索编辑" catchtap="openPoput">
            <view class="iconfont icon-bianji" />
            <view class="text">编辑</view>
        </navigator>
        <navigator wx:if="{{per.query(auth,'转移')}}" url="#" data-name="线索转移" catchtap="openPoput">
            <view class="iconfont icon-zhuanyi" />
            <view class="text">转移</view>
        </navigator>
    </view>
</block>

<Popup sheetTitle='{{sheetTitle}}'>
    <view hidden="{{sheetTitle!='跟进计划'}}">
        <follow id='follow' sat_orderclueid='{{sat_orderclueid}}' bind:endChange='endFollow' />
    </view>
    <view hidden="{{sheetTitle!='线索编辑'}}">
        <Insert id="edit" content='{{detailsData}}' type="{{sheetTitle}}" bind:endInsert='endEdit' />
    </view>
    <view hidden="{{sheetTitle!='线索转移'}}">
        <handOver sat_orderclueid='{{sat_orderclueid}}' list='{{teamList}}' bind:endChange='endEdit' />
    </view>
</Popup>

<van-action-sheet show="{{ timeRangeShow }}" bind:close='timeRangeClose'>
    <view class="detePickerHeader">
        <text catchtap="toSeeAll">所有日期</text>
        <view class="type" catchtap="selectDateType">
            <view class="option {{whereType.value=='start'?'active-op':''}}" data-name="start">
                <view data-name="start">开始</view>
                <view data-name="start" class="time">{{whereType.list.start||'开始时间'}}</view>
            </view>
            <view class="option {{whereType.value=='end'?'active-op':''}}" data-name="end">
                <view data-name="end">结束</view>
                <view data-name="end" class="time">{{whereType.list.end||'结束时间'}}</view>
            </view>
        </view>
        <text catchtap="determineScope">确定</text>
    </view>
    <My_datePicker bind:getDate='getDate' />
</van-action-sheet>

<wxs src='../../../utils/wxmlQueryPer.wxs' module="per" />

<van-action-sheet show="{{ sheetShow }}" actions="{{ actions }}" bind:select='handleSelect' bind:cancel='selectCancel' cancel-text="取消" />