<loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
<wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
<van-sticky scroll-top="0">
  <van-search model:value="{{ searchText }}" placeholder="请输入名称/地址/电话" use-action-slot bind:search="doSearch">
  </van-search>

  <van-dropdown-menu>
      <!-- 状态 -->
      <van-dropdown-item id="statusItem" title="{{ statusItem.text }}">
      <dk-dropdown-switch dataList="{{statusList}}" bind:commit='dropdowncommit'></dk-dropdown-switch>
    </van-dropdown-item>
  
  </van-dropdown-menu>

</van-sticky>


<view wx:for="{{list}}" data-item="{{item}}" wx:for-index="childindex" wx:key="index" class="main-class">
  <view class="main-foot">
    <view class="table">
      <view data-index="{{index}}" data-item="{{item}}" catchtap="catchtapCheck">
        <view class="table-row-right">
          <view>
            <dk-text fontSize="13px" fontWeight="nomal" value="{{item.objName}}"></dk-text>
          </view>
          <view style="font-size: 27rpx;  text-align: right;display: flex;">
            <view style="padding-right: 15rpx;padding-top:5rpx;">
              <van-icon name="phone" />
            </view>
            <view>
              <dk-text fontSize="13px" fontWeight="nomal" value="{{item.customerPhone ? item.customerPhone :''}}"></dk-text>
            </view>

          </view>
        </view>
        <view style="width: 100%; display:flex;">
          <view style="width:10%; margin-top:5px">
            <van-checkbox value="{{item.checked}}" data-index="{{index}}" data-item="{{item}}" catchtap="catchtapCheck" checked-color="#1989FA" />
          </view>
          <view style="width:87%;">
            <van-divider />
          </view>
        </view>

        <view class="table-row-right">
          <view style="display: flex;">
            <van-icon name="location" color="#1B365D" />
            <dk-text fontSize="13px" fontWeight="nomal" value="{{ wxmlUtil.addressToIndexOf(item.addressFull ? item.addressFull :'')}}"></dk-text>
          </view>

        </view>
      </view>
    </view>

  </view>
</view>
<view style="height: 250rpx;"></view>
<van-empty wx:if="{{list.length<=0}}" description="暂无数据" />

<!--  保存 -->
<view class="bottom-class-1">
  <view class="bottom-class">
    <van-button custom-class="save-button-class" loading="{{loading}}" bind:click="submit" type="default">确定
    </van-button>
  </view>

</view>






<van-divider wx:if="{{noMore}}" contentPosition="center" borderColor="#DCDCDC">到底了~</van-divider>


<van-popup show="{{showPick}}" position="right" bind:close="onClose" class="popup" custom-style="height:100%;width:80%">

  <view class="pop-header">
    <van-icon class="pop-header-x" catchtap="closeSearchPop" name="cross" />
  </view>
  <scroll-view scroll-y class="popup-scroll-view">
    <van-cell-group customer-class="cell-group">

      <van-field value="{{ searchForm.customerName }}" label-class="label-class" label="客户名称" data-title="customerName" placeholder="请输入客户名称" bind:change="onChange" />
      <van-field value="{{ searchForm.customerCode }}" label-class="label-class" label="客户编码" data-title="customerCode" placeholder="请输入客户编码" bind:change="onChange" />
    </van-cell-group>
  </scroll-view>

  <view style="height:120rpx;"></view>

  <view class="popup-button">
    <view class="popup-button-item">
      <van-button type="default" size="large" custom-class="modal-button" catchtap="clearSearchForm">重置
      </van-button>
    </view>
    <view class="popup-button-item">
      <van-button type="danger" size="large" custom-class="modal-button" catchtap="doSearchData">确定</van-button>
    </view>
  </view>
</van-popup>


<!-- 业务部门 -->
<dk-single-dropdown-item show="{{orgSourceFlag}}" docName="客户资料" contentID="{{form.orgId}}" id='org' typeName='org' bind:muticommit='mutiSearch' bind:muticlose='muticlose'></dk-single-dropdown-item>

<!-- 业务员 -->
<dk-single-dropdown-item show="{{staffSourceFlag}}" docName="客户资料" contentID="{{form.staff}}" id='staff' typeName='staff' bind:muticommit='mutiSearch' bind:muticlose='muticlose'></dk-single-dropdown-item>

<!-- 渠道 -->
<dk-single-dropdown-item show="{{channelSourceFlag}}" id='salesChannel' typeName='salesChannel' bind:muticommit='mutiSearch' bind:muticlose='muticlose'></dk-single-dropdown-item>

<!-- 客户来源 -->
<dk-single-dropdown-item show="{{customerSourceFlag}}" id='customerFrom' typeName='customerFrom' bind:muticommit='mutiSearch' bind:muticlose='muticlose'></dk-single-dropdown-item>