<!--pages/order/index.wxml-->
<view class="sg-container">
  <view class="sg-top-box sg-fix-top sg-white-bg">
    <view class="sg-search-box sg-flex sg-align-center">
      <van-dropdown-menu active-color="#5992fd">
        <van-dropdown-item value="{{ work_point_id }}" options="{{ work_points }}" bind:change="onDropChange" data-name="work_point_id"/>
      </van-dropdown-menu>
      <van-search value="{{ keyword }}" placeholder="请输入订单号或提交人搜索" use-right-icon-slot class="sg-flex-grow" left-icon="none" bind:change="onDropChange" data-name="keyword">
        <van-icon name="search" class="sg-index-color sg-icon" slot="right-icon" bindtap="search"></van-icon>
      </van-search>
    </view>
    <view class="sg-tabs sg-flex sg-align-center sg-white-bg sg-pad sg-bottom-border sg-top-border sg-font-small">
      <view wx:for="{{tabs}}" wx:key="index" class="sg-tab {{tabIndex == index ? 'sg-selected' : ''}}"
        bindtap="switchTab" data-index="{{index}}" hidden="{{ index == 2 && (!role || !role.rights || !role.rights.applyHandle) }}">{{ item }}</view>
    </view>
  </view>
  <view class="sg-list-box sg-pad">
    <view class="sg-list" wx:for="{{list}}" hidden="{{tabIndex != index}}" wx:key="index">
      <block wx:for="{{item}}" wx:for-item="i_item" wx:for-index="i_index" wx:key="i_index">
        <out-order-item wx:if="{{i_item.type == 1}}" item="{{i_item}}" role="{{role}}" bind:update="search"></out-order-item>
        <inner-order-item wx:else item="{{i_item}}" role="{{role}}" bind:update="search"></inner-order-item>
      </block>
    </view>
  </view>
  <van-dialog id="van-dialog" />
</view>