<div class="modal-content">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title"><?php echo $this->translate('选择商品')?></h4>
    </div>
    <div class="modal-body box-body table-responsive no-padding">
        <table class="table table-hover">
            <thead>
            <tr>
                <td colspan="5">
                    <div class="col-xs-12 form-group">
                        <div class="col-sm-8">
                            <input type="text" name="searchGoodsName" id="searchGoodsName" class="form-control input-sm" placeholder="<?php echo $this->translate('输入全部或部分商品名称')?>" value="<?php echo $this->searchGoodsName; ?>">
                        </div>
                        <div>
                            <button type="button" class="btn btn-primary btn-sm" onclick="searchGoods();"><?php echo $this->translate('搜索'); ?></button>
                        </div>
                    </div>

                </td>
            </tr>
            <tr>
                <th width="2%"></th>
                <th width="10%"><?php echo $this->translate('商品ID'); ?></th>
                <th><?php echo $this->translate('商品名称'); ?></th>
                <th width="20%"><?php echo $this->translate('商品货号'); ?></th>
                <th width="10%"><?php echo $this->translate('操作'); ?></th>
            </tr>
            </thead>
            <tbody>
            <?php if($this->goodsList->getCurrentItemCount() > 0) foreach ($this->goodsList as $goods) { ?>
                <tr>
                    <td><input name="selectGoodsId[]" value="<?php echo $goods[0]->getGoodsId(); ?>" type="checkbox" class="minimal"></td>
                    <td><?php echo $this->escapeHtml($goods[0]->getGoodsId()); ?></td>
                    <td><?php echo $this->escapeHtml($goods[0]->getGoodsName()); ?></td>
                    <td><?php echo $this->escapeHtml($goods[0]->getGoodsItem()); ?></td>
                    <td><button type="button" class="btn btn-primary btn-sm" onclick="addSelectGoods(<?php echo $goods[0]->getGoodsId(); ?>);"><?php echo $this->translate('点击添加')?></button></td>
                </tr>
            <?php } ?>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="5">
                        <?php echo $this->paginationControl($this->goodsList,
                            'Sliding',
                            'layout/ajaxPage',
                            ['route' => 'goods', 'params' => ['action' => 'ajaxGoodsSearch'], 'showDivId' => 'addGoodsListBody']); ?>
                    </td>
                </tr>
            </tfoot>

        </table>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-primary btn-sm" onclick="addMoreSelectGoods();"><?php echo $this->translate('添加选择的商品'); ?></button>
        <button type="button" class="btn btn-default btn-sm" data-dismiss="modal"><?php echo $this->translate('关闭'); ?></button>
    </div>
</div>