add.html 14.4 KB
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Category_ids')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-category_ids" data-rule="required" data-source="category/selectpage" data-params='{"custom[type]":"goods","isTree":"1"}' data-multiple="true" class="form-control selectpage" name="row[category_ids]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-goods_images" data-rule="required" class="form-control" size="50" name="row[goods_images]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-goods_images" class="btn btn-danger plupload" data-input-id="c-goods_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-goods_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-goods_images" class="btn btn-primary fachoose" data-input-id="c-goods_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-goods_images"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-goods_images"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-goods_name" data-rule="required" class="form-control" name="row[goods_name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Sale_num')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-sale_num" data-rule="required" class="form-control" name="row[sale_num]" type="number" value="0">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-goods_content" data-rule="required" class="form-control editor" rows="5" name="row[goods_content]" cols="50"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Issale')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-issale" data-rule="required" class="form-control selectpicker" name="row[issale]">
                {foreach name="issaleList" item="vo"}
                    <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Ismember')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-ismember" data-rule="required" class="form-control selectpicker" name="row[ismember]">
                {foreach name="ismemberList" item="vo"}
                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Ishot')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-ishot" data-rule="required" class="form-control selectpicker" name="row[ishot]">
                {foreach name="ishotList" item="vo"}
                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Ismake')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-ismake" data-rule="required" class="form-control selectpicker" name="row[ismake]">
                {foreach name="ismakeList" item="vo"}
                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group buyer_images">
        <label class="control-label col-xs-12 col-sm-2">{:__('Buyer_images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-buyer_images" class="form-control" size="50" name="row[buyer_images]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-buyer_images" class="btn btn-danger plupload" data-input-id="c-buyer_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-buyer_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-buyer_images" class="btn btn-primary fachoose" data-input-id="c-buyer_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-buyer_images"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-buyer_images"></ul>
        </div>
    </div>
    <!--规格-->
    <style>
        .goods-spec-many { display: none; margin-top: 15px; border: 1px solid #e4e4e4; padding: 20px; border-radius: 4px; /* 添加规格组 */ /* sku容器 */ }
        .goods-spec-many input { font-size: 1.3rem !important; padding-left: 10px !important; border: 1px solid #e3e2e5 !important; }
        .goods-spec-many input.am-field-error { border-color: #dd514c !important; }
        .goods-spec-many .spec { margin-bottom: 25px; }
        .goods-spec-many .spec .spec-name { margin-bottom: 15px; }
        .goods-spec-many .spec .spec-name span { font-size: 1.5rem; }
        .goods-spec-many .spec .spec-name .icon-shanchu1 { display: inline-block; }
        .goods-spec-many .spec .spec-value-list .spec-value { margin-right: 12px; margin-bottom: 12px; }
        .goods-spec-many .spec .spec-value-list .spec-value span { min-width: 50px; display: inline-block; border: 1px solid #ddd; text-align: center; padding: 0 15px; border-radius: 2px; font-size: 1.3rem; line-height: 30px; }
        .goods-spec-many .spec .spec-value-add input { width: 110px; border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
        .goods-spec-many .spec .spec-value-add button { display: table-cell; height: 32px; font-size: 1.3rem; border-color: #e3e2e5; border-left: none; border-top-right-radius: 4px; border-bottom-right-radius: 4px; outline: none; }
        .goods-spec-many .spec-button button { color: #2589ff; background-color: #fff; border-color: #2589ff; font-size: 12px; border-radius: 4px; outline: 0; font-weight: 400; padding: .6em 1em; outline: none !important; }
        .goods-spec-many .spec-button button:hover, .goods-spec-many .spec-button button:focus { color: #fbfbfb; background-color: #19a7f0; }
        .goods-spec-many .spec-add { display: none; }
        .goods-spec-many .spec-add .spec-add-item { margin-bottom: 10px; }
        .goods-spec-many .spec-add .spec-add-item input { width: 160px; border-radius: 4px; display: inline-block; margin-left: 12px; }
        .goods-spec-many .goods-sku { display: none; /* 批量设置sku */ /* 商品sku表格 */ }
        .goods-spec-many .goods-sku .goods-spec-line { border: 1px dashed #e3e2e5; }
        .goods-spec-many .goods-sku .spec-batch { margin-bottom: 2rem; }
        .goods-spec-many .goods-sku .spec-batch .am-form-label { padding-top: 0; }
        .goods-spec-many .goods-sku .spec-batch .form-group { margin-left: 0.6rem; }
        .goods-spec-many .goods-sku .spec-batch .form-group input { width: 140px; }
        .goods-spec-many .goods-sku .spec-sku-tabel td.td-spec-value { padding: .7rem 1.3rem !important; }
        .goods-spec-many .goods-sku .spec-sku-tabel input { display: inline-block !important; }
        .goods-spec-many .goods-sku .spec-sku-tabel input.ipt-goods-no { width: 140px; }
        .goods-spec-many .goods-sku .spec-sku-tabel input.ipt-w80 { width: 80px; }
    </style>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Spec_type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-spec_type" data-rule="required" class="form-control selectpicker" name="row[spec_type]">
                {foreach name="specTypeList" item="vo"}
                    <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>
            
            <div class="form-group goods-spec-many">
                <input type="hidden" name="row[spec_many]" value="0">
                <div class="goods-spec-box col-xs-12 col-sm-8">
                    <!-- 规格属性 -->
                    <div class="spec-attr"></div>

                    <!-- 添加规格:按钮 -->
                    <div class="spec-button">
                        <a href="javascript:;" class="btn btn-sm btn-success btn-addSpec" style=""><i class="fa fa-plus"></i> 添加规格</a>
                    </div>

                    <!-- 添加规格:表单 -->
                    <div class="spec-add">
                        <div class="form-group spec-add-value">
                            <label class="control-label col-xs-12 col-sm-3">规格名 </label>
                            <!-- <input type="text" class="input-specName tpl-form-input" placeholder="请输入规格名称"> -->
                            <div class="col-xs-12 col-sm-8">
                                <input class="form-control input-specName" type="text" placeholder="请输入规格名称">
                            </div>
                        </div>
                        <div class="spec-add-value form-group">
                            <label class="control-label col-xs-12 col-sm-3">规格值 </label>
                            <!-- <input type="text" class="input-specValue tpl-form-input" placeholder="请输入规格值"> -->
                            <div class="col-xs-12 col-sm-8">
                                <input class="form-control input-specValue" type="text" placeholder="请输入规格值">
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-8 spec-add-value">
                            <button type="button" class="btn btn-success btn-embossed btn-addSpecName">确定</button>
                            <button type="button" class="btn btn-default btn-embossed btn-cancleAddSpecName">取消</button>
                        </div>
                    </div>
                    <!-- 商品多规格sku信息 -->
                    <div class="goods-sku">
                        <!-- 分割线 -->
                        <div class="goods-spec-line am-margin-top-lg am-margin-bottom-lg"></div>
                        <!-- sku 批量设置 -->
                        <div class="spec-batch am-form-inline">
                            <div class="form-group">
                                <label class="am-form-label">批量设置</label>
                            </div>
                            <div class="form-group">
                                <input type="number" data-type="goods_price" placeholder="商品价格">
                            </div>
                            <div class="form-group">
                                <input type="number" data-type="stock_num" placeholder="库存数量">
                            </div>
                            <div class="form-group">
                                <input type="number" data-type="goods_weight" placeholder="重量">
                            </div>
                            <div class="form-group">
                                <button type="button" class="btn btn-success btn-embossed btn-specBatchBtn">确定</button>
                            </div>
                        </div >
                        <!-- sku table -->
                        <!-- <table class="spec-sku-tabel am-table am-table-bordered am-table-centered
                     am-margin-bottom-xs am-text-nowrap"></table> -->
                        <table id="table" class="table table-striped table-bordered table-hover spec-sku-tabel" width="100%"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="goods-spec-single">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">商品价格:</label>
            <div class="col-xs-12 col-sm-8">
                <input class="form-control" name="row[spec][goods_price]" type="number">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">当前库存数量:</label>
            <div class="col-xs-12 col-sm-8">
                <input class="form-control" name="row[spec][stock_num]" type="number">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">商品重量(Kg):</label>
            <div class="col-xs-12 col-sm-8">
                <input class="form-control" name="row[spec][goods_weight]" type="number">
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="0">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>