<page-plugin isAuth="{{authInfo['SF_FINANCE_FLOW_VIEW']}}" loading="{{loading}}"
  is-login="{{isLogin}}" bind:handleLogin="handleLogin">
  <search-popup placeholder="输入单据编号" bind:change="searchChange" bind:ok="searchOk"
    bind:reset="searchReset" value="{{params.rel_bill_no}}" data-key="rel_bill_no">
    <view slot="content">

      <search-input label="业务类型" value="{{params.type}}" data-key="type"
        bind:change="searchChange" />

      <option-cell-plugin title="收支类型" value="{{params.pay_type || ''}}" bind:change="searchChange"
        mode="radio" options="{{payType}}" data-key="pay_type" />

      <select-plugin title="账户" options="{{accounts}}" value="{{params.account_id}}"
        bind:change="searchChange" data-key="account_id" />

      <select-plugin title="往来单位" options="{{crms}}" value="{{params.crm_id}}"
        bind:change="searchChange" data-key="crm_id" />

      <date-picker-plugin title="交易开始日期" value="{{params.pay_dateL}}" data-key="pay_dateL"
        bind:confirm="searchChange" />
      <date-picker-plugin title="交易结束日期" value="{{params.pay_dateU}}" data-key="pay_dateU"
        bind:confirm="searchChange" />
      <date-picker-plugin title="创建开始日期" value="{{params.create_dateL}}" data-key="create_dateL"
        bind:confirm="searchChange" />
      <date-picker-plugin title="创建结束日期" value="{{params.create_dateU}}" data-key="create_dateU"
        bind:confirm="searchChange" />
    </view>
  </search-popup>

  <count-plugin count="{{count}}">
    <!-- <sort-plugin options="{{sort}}" bind:ok="onSort" value="{{params.order}}" slot="right" /> -->
  </count-plugin>

  <empty-plugin wx:if="{{list.length == 0}}" />
  <card-plugin wx:for="{{ list }}" wx:key="account_log_id">
    <view slot="header" style="display: flex;justify-content: space-between;width: 100%;">
      <view>{{ item.rel_bill_no }}</view>
      <view style="font-weight: normal;">{{item.type}}</view>
    </view>
    <view slot="content">
      <!-- <card-item-plugin label="业务类型" value="{{item.type}}" /> -->
      <card-item-plugin label="账户" value="{{item.account_name}}" />
      <card-item-plugin label="收支类型" value="{{payTypeObj[item.pay_type]}}" />
      <card-item-plugin label="变更金额" value="{{item.amount}}" />
      <card-item-plugin label="变更前" value="{{item.before}}" />
      <card-item-plugin label="剩余金额" value="{{item.after}}" />
      <card-item-plugin label="操作员">
        <view slot="value">
          {{item.creator_name}}
          <text wx:if="{{item.creator_nick_name}}">({{item.creator_nick_name}})</text>
        </view>
      </card-item-plugin>
      <card-item-plugin label="备注" value="{{item.comments}}" />
      <card-item-plugin label="交易时间" value="{{item.pay_date}}" />
      <card-item-plugin label="创建日期" value="{{item.create_date}}" />
    </view>
    <view slot="footer" class="card-plugin-footer">
      <t-button wx:if="{{item.file_cnt}}" size="small" bind:tap="onViewAttachment"
        data-index="{{index}}">附件({{item.file_cnt}})</t-button>
    </view>
  </card-plugin>
  <pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
    total="{{count}}" bind:change="paginationChange" />
</page-plugin>