|
@@ -40,6 +40,50 @@
|
|
|
</label>
|
|
|
</div>
|
|
|
|
|
|
+ <div class="layui-form-item layui-row layui-col-space15">
|
|
|
+ <label class="layui-col-xs9 relative">
|
|
|
+ <span class="color-green">分类</span>
|
|
|
+ </label>
|
|
|
+ <div class="layui-inline" style="top: -15px;margin-bottom: -25px">
|
|
|
+ <div class="layui-input-inline">
|
|
|
+ <select name="first_classify" lay-filter ="first_classify">
|
|
|
+ <option value="0">请选择</option>
|
|
|
+ {if !empty($cate_tree)}
|
|
|
+ {foreach $cate_tree as $ck=>$cv}
|
|
|
+ {if isset($vo.first_classify) && $vo.first_classify == $cv['id'] }
|
|
|
+ <option selected data-cl_key="{$ck}" value="{$cv['id']}">{$cv['title']}</option>
|
|
|
+ {else}
|
|
|
+ <option data-cl_key="{$ck}" value="{$cv['id']}">{$cv['title']}</option>
|
|
|
+ {/if}
|
|
|
+ {/foreach}
|
|
|
+ {/if}
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="layui-input-inline">
|
|
|
+ <select name="second_classify" lay-filter ="second_classify">
|
|
|
+ <option value="0">请选择</option>
|
|
|
+ {if !empty($cate_tree)}
|
|
|
+ {foreach $cate_tree as $ck=>$cv}
|
|
|
+ {if isset($vo.first_classify) && $vo.first_classify == $cv['id'] }
|
|
|
+ {if isset($cv['children'])}
|
|
|
+ {foreach $cv['children'] as $cln}
|
|
|
+ {if isset($vo.second_classify) && $vo.second_classify == $cln['id'] }
|
|
|
+ <option selected value="{$cln['id']}">{$cln['title']}</option>
|
|
|
+ {else}
|
|
|
+ <option value="{$cln['id']}">{$cln['title']}</option>
|
|
|
+ {/if}
|
|
|
+ {/foreach}
|
|
|
+ {/if}
|
|
|
+ {/if}
|
|
|
+ {/foreach}
|
|
|
+ {/if}
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
<div class="layui-form-item layui-row layui-col-space15" >
|
|
|
<label class="layui-col-xs9 relative">
|
|
@@ -58,7 +102,6 @@
|
|
|
</div>
|
|
|
|
|
|
|
|
|
-
|
|
|
<div class="layui-form-item layui-row layui-col-space15">
|
|
|
<label class="layui-col-xs9 relative">
|
|
|
<span class="color-green">关联资料</span>
|
|
@@ -300,5 +343,23 @@
|
|
|
window.form.render();
|
|
|
});
|
|
|
|
|
|
+
|
|
|
+ // 分类选择监听
|
|
|
+ form.on('select(first_classify)', function(data){
|
|
|
+ var cl_html = '<option value="0">请选择</option>';
|
|
|
+ if(data.value == 0) {
|
|
|
+ $("select[name='second_classify']").html(cl_html);
|
|
|
+ }else{
|
|
|
+ var cl_key = data.elem[data.elem.selectedIndex].dataset.cl_key;
|
|
|
+ var goods_spec = {:json_encode($cate_tree)};
|
|
|
+ $.each(goods_spec[cl_key]['children'],function (ck,cv) {
|
|
|
+ cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
|
|
|
+ })
|
|
|
+ $("select[name='second_classify']").html(cl_html);
|
|
|
+ }
|
|
|
+ window.form.render();
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
</script>
|
|
|
{/block}
|