<page-plugin isAuth="{{authInfo['SF_ERP_PRODUCT_PROCESS_VIEW']}}" loading="{{loading}}"
  is-login="{{isLogin}}" bind:handleLogin="handleLogin">
  <search-popup placeholder="输入销售单号" value="{{params.order_no}}" data-key="order_no"
    bind:change="searchChange" bind:ok="searchOk" bind:reset="searchReset">
    <view slot="content">
      <search-input label="自定义单号" value="{{params.custom_order_no}}" data-key="custom_order_no"
        bind:change="searchChange" />
      <search-input label="经销商名称" value="{{params.custom_name}}" data-key="custom_name"
        bind:change="searchChange" />
      <search-input label="经销商手机" value="{{params.custom_phone}}" data-key="custom_phone"
        bind:change="searchChange" />
      <search-input label="经销商地址" value="{{params.custom_address}}" data-key="custom_address"
        bind:change="searchChange" />
      <search-input label="客户名称" value="{{params.end_user_name}}" data-key="end_user_name"
        bind:change="searchChange" />
      <search-input label="客户手机" value="{{params.end_user_phone}}" data-key="end_user_phone"
        bind:change="searchChange" />
      <search-input label="客户地址" value="{{params.end_user_address}}" data-key="end_user_address"
        bind:change="searchChange" />
    </view>
  </search-popup>
  <view class="tabs">
    <view class="tabs-item {{ params.state == '1' ? 'active': '' }}" bind:tap="tabChange"
      data-key="1">待处理</view>
    <view class="tabs-item {{ params.state == '2' ? 'active': '' }}" bind:tap="tabChange"
      data-key="2">已处理</view>
  </view>
  <empty-plugin wx:if="{{list.length == 0}}" />
  <card-plugin wx:for="{{ list }}" wx:key="produce_info_id">
    <view slot="header">{{ item.order_no }}</view>
    <view slot="content">
      <card-item-plugin label="自定义单号" value="{{item.custom_order_no}}" />
      <card-item-plugin label="产品名称" value="{{item.goods_name}}" />
      <card-item-plugin label="经销商名称" value="{{item.custom_name}}" />
      <card-item-plugin label="经销商手机" value="{{item.custom_phone}}" />
      <card-item-plugin label="经销商地址" value="{{item.custom_address}}" />
      <card-item-plugin label="客户名称" value="{{item.end_user_name}}" />
      <card-item-plugin label="客户手机" value="{{item.end_user_phone}}" />
      <card-item-plugin label="客户地址" value="{{item.end_user_address}}" />
    </view>
    <view slot="footer" class="card-plugin-footer">
      <t-button size="small" theme="{{params.state == '1' ? 'primary' : 'danger'}}"
        data-action="{{params.state == '1' ? 'end' : 'back'}}" bind:tap="onEndOrBack"
        data-index="{{index}}">{{params.state == '1' ? '完成' : '撤回'}}
      </t-button>
    </view>
  </card-plugin>
  <pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
    total="{{count}}" bind:change="paginationChange" />
</page-plugin>
<t-dialog visible="{{dialog.visible}}" title="系统提示" content="{{dialog.content}}"
  confirm-btn="{{{ content: '确定', theme: 'primary', variant: 'base'} }}" cancel-btn="取消"
  bind:confirm="confirmDialog" bind:cancel="closeDialog" />