<page-plugin isAuth="{{authInfo['SF_ERP_GOODS_VIEW']}}" loading="{{loading}}" is-login="{{isLogin}}"
  bind:handleLogin="handleLogin">
  <search-popup placeholder="输入商品名称" bind:change="searchChange" bind:ok="searchOk"
    bind:reset="searchReset" value="{{params.goods_name}}" data-key="goods_name">
    <view slot="content">
      <search-input label="商品编码" value="{{params.goods_code}}" data-key="goods_code"
        bind:change="searchChange" />
      <search-input label="助记码" value="{{params.sku_alias}}" data-key="sku_alias"
        bind:change="searchChange" />

      <!-- <option-cell-plugin title="订单阶段" value="{{params.order_step}}" bind:change="searchChange"
        mode="checkbox" options="{{orderStep}}" data-key="order_step" /> -->
      <select-plugin title="仓库" options="{{depots}}" value="{{params.depot_id}}"
        bind:change="searchChange" data-key="depot_id" />
      <select-plugin title="商品分类" options="{{goodsClass}}" value="{{params.goods_class}}"
        bind:change="searchChange" data-key="goods_class" />
      <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="goods_id">
    <view slot="header">{{ item.goods_name }}</view>
    <view slot="content">
      <card-item-plugin label="商品别名" value="{{item.goods_alias}}" />
      <card-item-plugin label="商品类别" value="{{item.cate_name}}" />
      <card-item-plugin label="商品编码" value="{{item.goods_code}}" />
      <card-item-plugin label="采购价格" value="{{item.purchase_price}}" />
      <card-item-plugin label="零售价格" value="{{item.commodity_price}}" />
      <card-item-plugin label="销售价格" value="{{item.wholesale_price}}" />
      <card-item-plugin label="单位" value="{{item.unit_ch_name}}" />
      <card-item-plugin label="仓库" value="{{item.depot_name}}" />
      <card-item-plugin label="供应商" value="{{item.crm_name}}" />
      <card-item-plugin label="备注" value="{{item.comments}}" />
      <card-item-plugin label="创建日期" value="{{item.create_date}}" />
    </view>
    <view slot="footer" class="card-plugin-footer">
      <t-button size="small" theme="primary" bind:tap="onDetail" data-index="{{index}}">子商品
      </t-button>
    </view>
  </card-plugin>
  <pagination-plugin curr_page="{{params.curr_page}}" page_count="{{params.page_count}}"
    total="{{count}}" bind:change="paginationChange" />
</page-plugin>