{echo:JS::import('dialog?skin=brief');}
{echo:JS::import('dialogtools');}
{echo:JS::import('form');}
<div style="padding:10px;margin-bottom: 40px;">
<form action="" method="post" >
    <input name="goods_id" type="hidden" value="{$goods_id}">
<div class="tools_bar clearfix" >
    <span class="fr"><input type="text"  value="{$s_content}" name="s_content" /><a href='javascript:;' onclick="tools_submit({action:'{url:/marketing/radio_goods_select}'})" class="fr icon-search" style="" ></a></span>
    <span class="fr"><select name="s_type"><option value="0">全部</option><option value="1">商品编号</option><option value="2">商品名</option></select></span>
</div>
<table class="default" >
  <colgroup>
    <col width="60"/>
    <col />
    <col width="100"/>
    <col width="100"/>
  </colgroup>
    <tr>
        <th>选择</th>
        <th>商品名称</th>
        <th>零售价</th>
        <th>库存</th>
    </tr>
    </table>
<div style="overflow: auto; height: 300px;">
<table class="default" style="border-top: 0">
  <colgroup>
    <col width="60"/>
    <col />
    <col width="100"/>
    <col width="100"/>
  </colgroup>
    {query:name=goods id=$obj where= $where page=1 order=id desc }
        <tr><td><input type="radio" name="goods_id" value="{$item['id']}"></td><td>{$item['name']}</td><td>{$item['sell_price']}</td><td>{$item['store_nums']}</td></tr>
    {/query}
</table>
</div>
</form>
<div class="page_nav">
{echo:$obj->pageBar()}
</div>
</div>
<div class="alone_footer tc"><button class="button" onclick="add_goods()">选定商品</button></div>
<script type="text/javascript">
    function add_goods(){
        if($("input[name='goods_id']:checked").size()>0){
            var dom = $("input[name='goods_id']:checked");
            var val = dom.val();
            var name = dom.parent().next().text();
            $("#goods_id",window.parent.document).val(val);
            $("#goods_name",window.parent.document).val(name);
            FireEvent(window.parent.document.getElementById('goods_name'),"change");
            art.dialog.close();
            
        }else{
            art.dialog.tips("<p class='warning'>选择商品后再添加！</p>");
        }
        
    }
    var form =  new Form();
    form.setValue('s_type','{$s_type}');
    form.setValue('s_content','{$s_content}');
</script>