add.html 19.6 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">所属仓库:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-depot_id" data-rule="required" data-source="depot/index" data-multiple="false" class="form-control selectpage" name="row[depot_id]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Category_one_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-category_one_id" data-source="category/selectpage" data-params='{"custom[pid]":0}' data-multiple="true" class="form-control selectpage" name="row[category_one_id]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Category_two_id')}:</label>
        <div class="col-xs-12 col-sm-8 category_two">
            <input id="c-category_two_id" data-source="category/selectpage" data-multiple="true" class="form-control selectpage" name="row[category_two_id]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Category_three_id')}:</label>
        <div class="col-xs-12 col-sm-8 category_three">
            <input id="c-category_three_id" data-source="category/selectpage" data-multiple="true" class="form-control selectpage" name="row[category_three_id]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Category_group_ids')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-category_group_ids" data-rule="required" data-source="category_group/index" data-field="ch_name" data-multiple="true" class="form-control selectpage" name="row[category_group_ids]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Country_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-country_id" data-rule="required" data-source="country/index" data-field="ch_name" class="form-control selectpage" name="row[country_id]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Brand_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-brand_id" data-rule="required" data-source="brand/index" data-field="ch_name" class="form-control selectpage" name="row[brand_id]" type="text" value="">
        </div>
    </div>
    <!--<div class="form-group">-->
        <!--<label class="control-label col-xs-12 col-sm-2">{:__('Level_id')}:</label>-->
        <!--<div class="col-xs-12 col-sm-8">-->
            <!--<input id="c-level_id" data-source="level/index" data-field="ch_name" class="form-control selectpage" name="row[level_id]" type="text" value="">-->
        <!--</div>-->
    <!--</div>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Part_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-part_id" data-source="part/index" data-field="ch_name" class="form-control selectpage" name="row[part_id]" type="text" value="">
        </div>
    </div>
    <!--<div class="form-group">-->
        <!--<label class="control-label col-xs-12 col-sm-2">{:__('Category2_id')}:</label>-->
        <!--<div class="col-xs-12 col-sm-8">-->
            <!--<input id="c-category2_id" data-source="category2/index" data-field="ch_name" class="form-control selectpage" name="row[category2_id]" type="text" value="">-->
        <!--</div>-->
    <!--</div>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Ch_name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-ch_name" data-rule="required" class="form-control" name="row[ch_name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('En_name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-en_name" data-rule="required" class="form-control" name="row[en_name]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" class="form-control" size="50" name="row[image]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-images" class="form-control" size="50" name="row[images]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-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-images"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-images"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Video')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-video" class="form-control" size="50" name="row[video]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-video" class="btn btn-danger plupload" data-input-id="c-video" data-mimetype="mp4,mp3,avi,flv,wmv" data-multiple="false" data-preview-id="p-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-input-id="c-video" data-mimetype="mp4,mp3,avi,flv,wmv" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-video"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Video_image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-video_image" class="form-control" size="50" name="row[video_image]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-video_image" class="btn btn-danger plupload" data-input-id="c-video_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-video_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-video_image" class="btn btn-primary fachoose" data-input-id="c-video_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-video_image"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-video_image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_no')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-goods_no" class="form-control" name="row[goods_no]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Ch_specification')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-ch_specification" class="form-control" name="row[ch_specification]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('En_specification')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-en_specification" class="form-control" name="row[en_specification]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Ch_save_where')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-ch_save_where" class="form-control" name="row[ch_save_where]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('En_save_where')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-en_save_where" class="form-control" name="row[en_save_where]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Ch_period')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-ch_period" class="form-control" name="row[ch_period]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('En_period')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-en_period" class="form-control" name="row[en_period]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Ch_content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-ch_content" class="form-control editor" rows="5" name="row[ch_content]" cols="50"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('En_content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-en_content" class="form-control editor" rows="5" name="row[en_content]" cols="50"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Sales_initial')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-sales_initial" class="form-control" name="row[sales_initial]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Is_group')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-is_group" class="form-control selectpicker" name="row[is_group]">
                {foreach name="isGroupList" item="vo"}
                    <option value="{$key}" {in name="key" value="2"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group group" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('Group_num')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-group_num" class="form-control" name="row[group_num]" type="number">
        </div>
    </div>
    <div class="form-group group" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('Grouptime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-grouptime" class="form-control" name="row[grouptime]" type="number">
        </div>
    </div>
    <div class="form-group group" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('Group_vip_rebate')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-group_vip_rebate" class="form-control" step="0.01" name="row[group_vip_rebate]" type="number">
        </div>
    </div>
    <div class="form-group group" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('Group_staff_rebate')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-group_staff_rebate" class="form-control" step="0.01" name="row[group_staff_rebate]" type="number">
        </div>
    </div>
    <div class="form-group group" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('Group_one_agency_rebate')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-group_one_agency_rebate" class="form-control" step="0.01" name="row[group_one_agency_rebate]" type="number">
        </div>
    </div>
    <div class="form-group group" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('Group_two_agency_rebate')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-group_two_agency_rebate" class="form-control" step="0.01" name="row[group_two_agency_rebate]" type="number">
        </div>
    </div>
    <div class="form-group group" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('Group_three_agency_rebate')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-group_three_agency_rebate" class="form-control" step="0.01" name="row[group_three_agency_rebate]" type="number">
        </div>
    </div>
    <div class="form-group group" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('Group_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-group_price" class="form-control" step="0.01" name="row[group_price]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Goods_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-goods_price" data-rule="required" class="form-control" step="0.01" name="row[goods_price]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Vip1_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-vip1_price" data-rule="required" class="form-control" step="0.01" name="row[vip1_price]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Staff_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-staff_price" data-rule="required" class="form-control" step="0.01" name="row[staff_price]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('One_agency_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-one_agency_price" data-rule="required" class="form-control" step="0.01" name="row[one_agency_price]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Two_agency_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-two_agency_price" data-rule="required" class="form-control" step="0.01" name="row[two_agency_price]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Three_agency_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-three_agency_price" data-rule="required" class="form-control" step="0.01" name="row[three_agency_price]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Is_vip_price')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-is_vip_price" class="form-control selectpicker" name="row[is_vip_price]">
                {foreach name="isVipPriceList" item="vo"}
                    <option value="{$key}" {in name="key" value="2"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group vip_price" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('Vip_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-vip_price" class="form-control" step="0.01" name="row[vip_price]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Is_recommend')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-is_recommend" class="form-control selectpicker" name="row[is_recommend]">
                {foreach name="isRecommendList" item="vo"}
                    <option value="{$key}" {in name="key" value="2"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </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>
<script>
    var category_one_id = document.getElementById("c-category_one_id");
    category_one_id.onchange = function () {
        $("#c-category_two_id").val('');
        $("#c-category_two_id_text").val('');
        $("#c-category_three_id").val('');
        $("#c-category_three_id_text").val('');
        $(".category_two .selected_tag").remove();
        $(".category_three .selected_tag").remove();
    }

    var category_two_id = document.getElementById("c-category_two_id");
    category_two_id.onchange = function () {
        $("#c-category_three_id").val('');
        $("#c-category_three_id_text").val('');
        $(".category_three .selected_tag").remove();
    }
</script>