Authored by weiqingting

类目

@@ -2,6 +2,11 @@ @@ -2,6 +2,11 @@
2 var $ = require('jquery'), 2 var $ = require('jquery'),
3 common=require('../common/common'); 3 common=require('../common/common');
4 4
  5 +// require('../common/tree');
  6 +// var sorttree=$("#tree").SnAddress().data("tree.sort");
  7 +// console.log(sorttree);
  8 +var tabTree=new common.tabTree("#tree");
  9 +tabTree.init();
5 10
6 var ENUM={ 11 var ENUM={
7 goodsSizeList:{"factoryCode":"","sizeId":"","salePrice":""} 12 goodsSizeList:{"factoryCode":"","sizeId":"","salePrice":""}
@@ -117,22 +122,23 @@ e.on("validate",function(){ @@ -117,22 +122,23 @@ e.on("validate",function(){
117 }); 122 });
118 e.init(); 123 e.init();
119 $(document).on("click","#btnReview",function(){ 124 $(document).on("click","#btnReview",function(){
120 - console.log(g.__e.validate());  
121 - // e.submit($("#basicForm").attr("action"),function(option){  
122 - // option.debug=true;  
123 - // option.success=function(res){  
124 - // res = res.data;  
125 - // if(res.code == "200") {  
126 - // e.$tip("提交成功", function() {  
127 - // location.href="/activity/drawline/index"  
128 - // }, 'growl-success');  
129 - // }else{  
130 - // e.$tip(res.message);  
131 - // }  
132 - // },  
133 - // option.error=function(res){  
134 - // e.$tip(res.message);  
135 - // }  
136 - // });  
137 - // return false; 125 + var sortid=tabTree.selected.length>0?tabTree.selected[tabTree.selected.length-1].id:"";
  126 + console.log(sortid);
  127 + e.submit($("#basicForm").attr("action"),function(option){
  128 + option.debug=true;
  129 + option.success=function(res){
  130 + res = res.data;
  131 + if(res.code == "200") {
  132 + e.$tip("提交成功", function() {
  133 + location.href="/activity/drawline/index"
  134 + }, 'growl-success');
  135 + }else{
  136 + e.$tip(res.message);
  137 + }
  138 + },
  139 + option.error=function(res){
  140 + e.$tip(res.message);
  141 + }
  142 + });
  143 + return false;
138 }); 144 });
@@ -6,6 +6,7 @@ edit = require('./edit'), @@ -6,6 +6,7 @@ edit = require('./edit'),
6 dropDown = require('./dropDown'), 6 dropDown = require('./dropDown'),
7 dialog=require('./dialog'); 7 dialog=require('./dialog');
8 tab=require('./tab'), 8 tab=require('./tab'),
  9 +tabTree=require('./tabTree');
9 util=require('./util'); 10 util=require('./util');
10 11
11 var common={ 12 var common={
@@ -14,7 +15,8 @@ var common={ @@ -14,7 +15,8 @@ var common={
14 tab:tab, 15 tab:tab,
15 dropDown:dropDown, 16 dropDown:dropDown,
16 edit:edit, 17 edit:edit,
17 - util:util 18 + util:util,
  19 + tabTree:tabTree
18 } 20 }
19 21
20 module.exports=common; 22 module.exports=common;
  1 +var $=require('jquery');
  2 +
  3 +function tabTree(ele,options){
  4 + var defaults = {
  5 + innerHtml: ' <a href="javascript:void(0);" class="cityboxbtn" ></a>' + '<div class="citybox">' + '<div class="chooseArea">' + "</div>" + '<div class="arriveBox">' + '<div class="cityshow"></div>' + "</div>" + '<div class="closeSelector"></div>' + "</div>",
  6 + level: 1,
  7 + columns: [{
  8 + state: "prov",
  9 + text: "一级分类",
  10 + hide: false,
  11 + addclass: ""
  12 + }, {
  13 + state: "city",
  14 + text: "二级分类",
  15 + hide: false,
  16 + addclass: ""
  17 + }, {
  18 + state: "area",
  19 + text: "三级分类",
  20 + hide: false,
  21 + addclass: ""
  22 + }, {
  23 + state: "town",
  24 + text: "四级分类",
  25 + hide: false,
  26 + addclass: ""
  27 + }],
  28 + datas: [{
  29 + sortName: "",
  30 + code: "",
  31 + id: ""
  32 + }, {
  33 + sortName: "",
  34 + code: "",
  35 + id: ""
  36 + }, {
  37 + sortName: "",
  38 + code: "",
  39 + id: ""
  40 + }, {
  41 + sortName: "",
  42 + code: "",
  43 + id: ""
  44 + }],
  45 + otherParam: null,
  46 + stepMet: null,
  47 + complete: null
  48 + };
  49 + this.options = $.extend({}, defaults, options);
  50 + this.element = $(ele);
  51 +}
  52 +
  53 +tabTree.prototype= {
  54 + init: function(datas) {
  55 + var g = this,
  56 + p = this.options;
  57 + g.element.addClass("citySelect");
  58 + g.dom = g.dom || g._dom();
  59 + g.selected = [], g.records = [], g.rows = [];
  60 + p.datas = datas || p.datas;
  61 + if (p.columns.length < p.datas.length) {
  62 + return
  63 + }
  64 + g.renderHeader();
  65 + g.setEvent()
  66 + },
  67 + setEvent: function() {
  68 + var g = this,
  69 + p = this.options;
  70 + g.dom["cityboxbtn"].click(function(event) {
  71 + g.dom["cityboxbtn"].addClass("select");
  72 + g.dom["citybox"].show().css("top", g.inputHeight + "px");
  73 + if ($("iframe", g.element).length > 0) {
  74 + $("iframe", g.element).css({
  75 + top: g.inputHeight + "px",
  76 + height: g.dom["citybox"].height()
  77 + })
  78 + }
  79 + g.dom["chooseArea"].children("p").each(function() {
  80 + if ($(this).hasClass("disable") && $(this).hasClass("cur")) {
  81 + g.active_count = 0;
  82 + g.getData(g._getParam(0))
  83 + }
  84 + });
  85 + return event.stopPropagation()
  86 + });
  87 + g.dom["closeSelector"].click(function(event) {
  88 + g.reset();
  89 + return event.stopPropagation()
  90 + });
  91 + g.dom["chooseArea"].children("p").click(function(event) {
  92 + if ($(this).hasClass("disable")) {
  93 + return event.stopPropagation()
  94 + } else {
  95 + g.active_count = $(this).index();
  96 + g.getData(g._getParam(g.active_count));
  97 + return event.stopPropagation()
  98 + }
  99 + });
  100 + g.dom["cityshow"].on("click", "span>a", function(event) {
  101 + var rowid = $(this).attr("data").split("_")[1];
  102 + g.select(g.records[rowid]);
  103 + if (p.stepMet != null && g.selected.length != p.datas.length) {
  104 + p.stepMet(g.selected, g.active_count)
  105 + }
  106 + g.changeVolume();
  107 + return event.stopPropagation()
  108 + });
  109 + $(document).click(function() {
  110 + if (g.dom["citybox"].css("display") == "block") {
  111 + g.reset()
  112 + }
  113 + })
  114 + },
  115 + changeVolume: function() {
  116 + var g = this,
  117 + p = this.options;
  118 + var _data = g.selected[g.active_count];
  119 + $("span", g.dom["chooseArea"]).eq(g.active_count).html(_data.sortName);
  120 + g.selected[g.active_count].isdirect = _data.item ? true : false;
  121 + var _cur = g.active_count;
  122 + for (var i = g.active_count + 1; i < p.datas.length; i++) {
  123 + $("span", g.dom["chooseArea"]).eq(i).html(p.columns[i].text)
  124 + }
  125 + if (g.active_count + 1 <= p.datas.length - 1) {
  126 + g.active_count++;
  127 + var _next = g.active_count;
  128 + if (_data.item) {
  129 + _cur = g.active_count;
  130 + $("p", g.dom["chooseArea"]).eq(g.active_count).addClass("disable");
  131 + $("span", g.dom["chooseArea"]).eq(g.active_count).html(_data.item[0].sortName);
  132 + g.selected[g.selected.length] = _data.item[0];
  133 + g.active_count++;
  134 + _next = g.active_count
  135 + }
  136 + if (g.active_count <= p.datas.length - 1) {
  137 + g.getData(g._getParam(_next))
  138 + } else {
  139 + g.active_count = 0;
  140 + g.setHeadVal();
  141 + g.reset()
  142 + }
  143 + } else {
  144 + g.setHeadVal();
  145 + g.reset()
  146 + }
  147 + },
  148 + getData: function(_param) {
  149 + var g = this,
  150 + p = this.options;
  151 + $("p", g.dom["chooseArea"]).eq(g.active_count).removeClass("disable").addClass("cur").siblings("p").removeClass("cur");
  152 + for (var i = g.active_count + 1; i < p.datas.length; i++) {
  153 + if ($("span", g.dom["chooseArea"]).eq(i).html() == p.columns[i].text) {
  154 + $("p", g.dom["chooseArea"]).eq(i).addClass("disable")
  155 + }
  156 + }
  157 + _param.param=_param.selectId;
  158 + g.getAjax(_param)
  159 + },
  160 + getAjax: function(param) {
  161 + var g = this,
  162 + p = this.options;
  163 + var ajaxOptions = {
  164 + type: "POST",
  165 + url: param.state=="prov"?" /product/class/queryAllProductSortList":"/product/class/queryProductSortList",
  166 + data: param,
  167 + dataType: 'json',
  168 + beforeSend: function(msg) {
  169 + g.dom["cityshow"].html("加载中...")
  170 + },
  171 + success: function(items) {
  172 + items=items.data;
  173 + g.dom["cityshow"].html("");
  174 + g.records.length = 0;
  175 + g.rows.length = 0;
  176 + if (items.data.length == 0) {
  177 + g.active_count = 0;
  178 + g.setHeadVal();
  179 + g.reset();
  180 + }else{
  181 + $.each(items.data, function(count, item) {
  182 + var b = $("<span/>");
  183 + var a = $("<a/>");
  184 + if (item.ishot == "true") {
  185 + a.addClass("imp")
  186 + }
  187 + a.attr("data", "Sns_" + count).html(item.sortName);
  188 + b.append(a);
  189 + g.dom["cityshow"].append(b);
  190 + g.records.push(count);
  191 + g.rows.push(item)
  192 + });
  193 + if ($("iframe", g.dom["citybox"]).length > 0) {
  194 + $("iframe", g.dom["citybox"]).height(g.element[0].offsetHeight)
  195 + }
  196 + }
  197 + },
  198 + error: function(e1, e2) {}
  199 + };
  200 + $.ajax(ajaxOptions)
  201 + },
  202 + setHeadVal: function() {
  203 + var g = this,
  204 + p = this.options;
  205 + $.each(g.selected, function(count, item) {
  206 + $("span", g.dom["cityboxbtn"]).eq(count).show().html(item.sortName);
  207 + if (item.isdirect || p.columns[count].hide) {
  208 + if (p.datas.length != 1) {
  209 + $("span", g.dom["cityboxbtn"]).eq(count).hide()
  210 + }
  211 + }
  212 + });
  213 + p.datas.length = 0;
  214 + $.each(g.selected, function(count, item) {
  215 + p.datas.push(item)
  216 + });
  217 + if (p.complete != null) {
  218 + p.complete(p.datas, false)
  219 + }
  220 + },
  221 + renderHeader: function() {
  222 + var g = this,
  223 + p = this.options;
  224 +
  225 + function _buildHtml(_count, items, isdisable) {
  226 + var _tempfun1 = function(_count, item, isdisable) {
  227 + var _html = "";
  228 + var _txt = $.trim(item.sortName) == "" ? p.columns[_count].text : item.sortName;
  229 + _html += "<span ";
  230 + if (item.isdirect || p.columns[_count].hide) {
  231 + _html += 'style="display: none"'
  232 + }
  233 + if (p.columns[_count].addclass) {
  234 + _html += ' class="' + p.columns[_count].addclass + '"'
  235 + }
  236 + _html += ">" + _txt + "</span>";
  237 + _html += "<em></em>";
  238 + return _html
  239 + };
  240 + var _tempfun2 = function(count, item, isdisable) {
  241 + var _txt = $.trim(item.sortName) == "" ? p.columns[_count].text : item.sortName;
  242 + var _html = '<p eq="' + count + '"><span>' + _txt + "</span><b></b></p>";
  243 + if (isdisable || item.id == "") {
  244 + _html = '<p class="disable"><span>' + _txt + "</span><b></b></p>"
  245 + }
  246 + return _html
  247 + };
  248 + g.dom["cityboxbtn"].append(_tempfun1(_count, items, isdisable));
  249 + g.dom["chooseArea"].append(_tempfun2(_count, items, isdisable))
  250 + }
  251 + if (p.datas && p.columns && p.datas.length > 0) {
  252 + var _isdirect = false;
  253 + $.each(p.datas, function(count, item) {
  254 + if (item.id) {
  255 + g.selected[count] = item
  256 + }
  257 + _buildHtml(count, item, _isdirect);
  258 + _isdirect = p.datas[count].isdirect
  259 + });
  260 + if (g.selected.length > 0 && !g.selected[g.selected.length - 1].isdirect) {
  261 + if (g.selected.length != p.datas.length) {
  262 + g.active_count = g.selected.length;
  263 + g.getData(g._getParam(g.active_count))
  264 + } else {
  265 + g.active_count = g.selected.length - 1;
  266 + g.getData(g._getParam(g.active_count))
  267 + }
  268 + } else {
  269 + g.active_count = 0;
  270 + g.getData(g._getParam(g.active_count))
  271 + }
  272 + _isdirect = false;
  273 + if (p.complete != null) {
  274 + p.complete(p.datas, true)
  275 + }
  276 + }
  277 + g.dom.chooseArea["append"]('<div class="clear"></div>');
  278 + g.dom.cityboxbtn["append"]("<b></b>");
  279 + g.inputHeight = g.dom.cityboxbtn["height"]();
  280 + g.dom["chooseArea"].addClass("fix");
  281 + var _isIE6 = window.VBArray && !window.XMLHttpRequest;
  282 + if (_isIE6 && $("iframe", g.dom["citybox"]).length < 1) {
  283 + var iframe = document.createElement("iframe");
  284 + g.dom["citybox"].after(iframe);
  285 + var httpType = ("https:" == document.location.protocol) ? "https" : "http";
  286 + if (httpType == "https") {
  287 + $(iframe).attr("src", "https://imgssl.suning.com/images/ShoppingArea/Common/blankbg.gif")
  288 + }
  289 + $(iframe).css({
  290 + width: g.dom["citybox"].width(),
  291 + height: 0,
  292 + position: "absolute",
  293 + "z-index": 10,
  294 + opacity: 0,
  295 + top: 0,
  296 + left: 0
  297 + })
  298 + }
  299 + },
  300 + reset: function() {
  301 + var g = this,
  302 + p = this.options;
  303 + g.dom["cityboxbtn"].removeClass("select");
  304 + g.dom["citybox"].hide();
  305 + if ($("iframe", g.element).length > 0) {
  306 + $("iframe", g.element).css({
  307 + height: 0 + "px"
  308 + })
  309 + }
  310 + },
  311 + select: function(rp) {
  312 + var g = this,
  313 + p = this.options;
  314 + var row = g.rows[parseInt(rp)];
  315 + g.selected.length = g.active_count;
  316 + g.selected[g.selected.length] = row
  317 + },
  318 + _getParam: function(rp) {
  319 + var g = this,
  320 + p = this.options;
  321 + var defaults = {
  322 + state: p.columns[rp].state,
  323 + selectId: rp - 1 > -1 ? g.selected[rp - 1].id : 0
  324 + };
  325 + var setting = {};
  326 + if (p.otherParam) {
  327 + var obj = p.otherParam(rp, p.columns, g.selected);
  328 + if (obj && typeof(obj) == "object") {
  329 + setting = obj
  330 + }
  331 + }
  332 + var params = $.extend(defaults, setting);
  333 + return params
  334 + },
  335 + _dom: function() {
  336 + var g = this,
  337 + p = this.options;
  338 + g.element.html(p.innerHtml);
  339 + var wrap = g.element;
  340 + var name, DOM = {
  341 + wrap: $(wrap)
  342 + },
  343 + els = wrap[0].getElementsByTagName("*"),
  344 + elsLen = els.length;
  345 + for (var i = 0; i < elsLen; i++) {
  346 + name = els[i].className;
  347 + if (name) {
  348 + DOM[name] = $(els[i], wrap)
  349 + }
  350 + }
  351 + return DOM
  352 + },
  353 + getAddress: function() {
  354 + var g = this,
  355 + p = this.options;
  356 + return p.datas
  357 + },
  358 + getRows: function() {
  359 + var g = this,
  360 + p = this.options;
  361 + return g.selected
  362 + },
  363 + setCurrent: function(rp) {
  364 + var g = this,
  365 + p = this.options;
  366 + g.dom["cityboxbtn"].addClass("select");
  367 + g.dom["citybox"].show().css("top", g.inputHeight + "px");
  368 + if (g.selected.length - parseInt(rp) >= 0) {
  369 + g.active_count = parseInt(rp);
  370 + g.getData(g._getParam(g.active_count))
  371 + } else {
  372 + g.active_count = 0;
  373 + g.getData(g._getParam(g.active_count))
  374 + }
  375 + return event.stopPropagation()
  376 + }
  377 + };
  378 +module.exports = tabTree;
1 var $ = require('jquery'), 1 var $ = require('jquery'),
2 common = require('../common/common'); 2 common = require('../common/common');
3 3
4 -require('../common/bootstrap-wysihtml5');  
5 -require('../util/datepicker'); 4 +// require('../common/bootstrap-wysihtml5');
  5 +// require('../util/datepicker');
6 6
7 var ENMA = { 7 var ENMA = {
8 attachType: { 8 attachType: {
@@ -362,7 +362,7 @@ var Bll = { @@ -362,7 +362,7 @@ var Bll = {
362 e1.init(); 362 e1.init();
363 } 363 }
364 }); 364 });
365 - $('#text-editor').wysihtml5(); 365 + // $('#text-editor').wysihtml5();
366 } 366 }
367 } 367 }
368 368
@@ -372,3 +372,214 @@ ul { @@ -372,3 +372,214 @@ ul {
372 border: 1px solid #ddd; 372 border: 1px solid #ddd;
373 border-bottom-color: transparent; 373 border-bottom-color: transparent;
374 } 374 }
  375 +
  376 +
  377 +.fix:after {
  378 + content: ".";
  379 + display: block;
  380 + clear: both;
  381 + height: 0;
  382 + visibility: hidden
  383 +}
  384 +
  385 +.fix {
  386 + _height: 1%;
  387 + *zoom:1}
  388 +
  389 +.citySelect {
  390 + position: relative;
  391 + z-index: 99;
  392 + height: 30px;
  393 + line-height: 30px
  394 +}
  395 +
  396 +.citySelect b {
  397 + position: absolute;
  398 + display: block;
  399 + height: 12px;
  400 + width: 12px;
  401 + overflow: hidden;
  402 + right: 5px
  403 +}
  404 +
  405 +.citySelect span.attr {
  406 + float: left;
  407 + width: 75px;
  408 + height: 26px;
  409 + line-height: 26px;
  410 + color: #666
  411 +}
  412 +
  413 +.citySelect .cityboxbtn {
  414 + position: relative;
  415 + float: left;
  416 + border: 1px solid #ccc;
  417 + height: 27px;
  418 + line-height: 27px;
  419 + padding: 0 38px 0 5px;
  420 + color: #333;
  421 + z-index: 99;
  422 + white-space: nowrap
  423 +}
  424 +
  425 +.citySelect .cityboxbtn:hover {
  426 + text-decoration: none;
  427 + color: #333
  428 +}
  429 +
  430 +.citySelect .cityboxbtn b {
  431 + // background: url(images/jiantou.png) no-repeat;
  432 + top: 8px
  433 +}
  434 +
  435 +.citySelect .select {
  436 + border: 1px solid #ccc;
  437 + border-bottom: 0;
  438 + height: 27px;
  439 + z-index: 100;
  440 + background: #fff;
  441 + box-shadow: 0 -1px 2px #ddd
  442 +}
  443 +
  444 +.citySelect .cityboxbtn em {
  445 + color: #999;
  446 + padding: 0 2px
  447 +}
  448 +
  449 +.citybox {
  450 + display: none;
  451 + position: absolute;
  452 + left: 0;
  453 + top: 0;
  454 + width: 600px;
  455 + padding: 0 5px 5px 5px;
  456 + background: #fff;
  457 + border: 1px solid #ccc;
  458 + line-height: 1;
  459 + z-index: 98;
  460 + box-shadow: 0 0 6px #ddd
  461 +}
  462 +
  463 +.chooseArea {
  464 + padding: 10px;
  465 + padding-bottom: 0
  466 +}
  467 +
  468 +.chooseArea p {
  469 + position: relative;
  470 + float: left;
  471 + display: inline;
  472 + height: 24px;
  473 + border: 1px solid #ccc;
  474 + line-height: 25px;
  475 + margin-right: 5px;
  476 + padding: 0 25px 0 8px;
  477 + cursor: pointer;
  478 + white-space: nowrap;
  479 + z-index: 8;
  480 + margin: 0 2px;
  481 +}
  482 +
  483 +.chooseArea p b {
  484 + // background: url(images/jiantou.png) no-repeat;
  485 + top: 6px
  486 +}
  487 +
  488 +.chooseArea p.cur {
  489 + height: 25px;
  490 + background: #fff;
  491 + line-height: 24px;
  492 + border: 2px solid #ffb786;
  493 + border-bottom: 0;
  494 + z-index: 10
  495 +}
  496 +
  497 +.chooseArea p span {
  498 + display: block;
  499 + max-width: 60px;
  500 + _width: expression(this.offsetWidth>60 ? '60px':'auto');
  501 + height: 26px;
  502 + overflow: hidden;
  503 + white-space: normal
  504 +}
  505 +
  506 +.chooseArea p.cur b {
  507 + background-position: 0 -11px;
  508 + top: 4px
  509 +}
  510 +
  511 +.chooseArea p.disable {
  512 + color: #999
  513 +}
  514 +
  515 +.citybox .arriveBox {
  516 + position: relative;
  517 + background: #fff;
  518 + border-top: 2px solid #ffb786;
  519 + margin: -2px 5px 0 5px;
  520 + padding: 8px 0;
  521 + z-index: 9;
  522 + *margin-top: -3px;
  523 + _margin-top: -2px
  524 +}
  525 +
  526 +.cityshow {
  527 + width: 600px;
  528 + margin: 0 auto
  529 +}
  530 +
  531 +.citybox a,.cityshow a:visited {
  532 + color: #333
  533 +}
  534 +
  535 +.citybox div.cityshow span {
  536 + display: inline-block;
  537 + float: left;
  538 + height: 26px;
  539 + width: 85px;
  540 + line-height: 26px;
  541 + text-align: left;
  542 + overflow: hidden
  543 +}
  544 +
  545 +.citybox div.cityshow span a {
  546 + padding: 5px 7px;
  547 + text-decoration: none;
  548 + cursor: pointer;
  549 +}
  550 +
  551 +.citybox div.cityshow span a:hover {
  552 + color: #fff;
  553 + background: #f60;
  554 + text-decoration: none
  555 +}
  556 +
  557 +.citybox div.cityshow span a.imp {
  558 + color: #f70
  559 +}
  560 +
  561 +.citybox div.cityshow span a.imp:hover {
  562 + color: #fff
  563 +}
  564 +
  565 +.citybox div.cityshow span {
  566 + width: 65px;
  567 + padding-right: 15px;
  568 + display: inline-block;
  569 + float: left;
  570 + height: 26px;
  571 + line-height: 26px;
  572 + text-align: left;
  573 + overflow: hidden
  574 +}
  575 +
  576 +.closeSelector {
  577 + position: absolute;
  578 + top: 5px;
  579 + right: 5px;
  580 + height: 16px;
  581 + width: 16px;
  582 + // background: url(images/closeSelector.png) no-repeat;
  583 + cursor: pointer;
  584 + z-index: 9999
  585 +}
@@ -33,29 +33,35 @@ @@ -33,29 +33,35 @@
33 <div class="form-group"> 33 <div class="form-group">
34 <label class="col-sm-2 control-label">店铺 <span class="red">*</span></label> 34 <label class="col-sm-2 control-label">店铺 <span class="red">*</span></label>
35 <div class="col-sm-2"> 35 <div class="col-sm-2">
36 - <select id="shopId" class="form-control"> 36 + <select id="shopId" class="form-control" required>
37 <option value="-1">店铺</option> 37 <option value="-1">店铺</option>
38 </select> 38 </select>
39 </div> 39 </div>
40 40
41 <label class="col-sm-1 control-label">品牌 <span class="red">*</span></label> 41 <label class="col-sm-1 control-label">品牌 <span class="red">*</span></label>
42 <div class="col-sm-2"> 42 <div class="col-sm-2">
43 - <select id="brandId" class="form-control"> 43 + <select id="brandId" class="form-control" required>
44 <option value="-1">品牌</option> 44 <option value="-1">品牌</option>
45 </select> 45 </select>
46 </div> 46 </div>
47 47
48 <label class="col-sm-1 control-label">供应商 <span class="red">*</span></label> 48 <label class="col-sm-1 control-label">供应商 <span class="red">*</span></label>
49 <div class="col-sm-2"> 49 <div class="col-sm-2">
50 - <select id="supplierId" class="form-control"> 50 + <select id="supplierId" class="form-control" required>
51 <option value="-1">供应商</option> 51 <option value="-1">供应商</option>
52 </select> 52 </select>
53 </div> 53 </div>
54 </div> 54 </div>
55 <div class="form-group"> 55 <div class="form-group">
  56 + <label class="col-sm-2 control-label">分类<span class="red">*</span></label>
  57 + <div class="col-sm-10">
  58 + <div id="tree"></div>
  59 + </div>
  60 + </div>
  61 + <div class="form-group">
56 <label class="col-sm-2 control-label">商品名称<span class="red">*</span></label> 62 <label class="col-sm-2 control-label">商品名称<span class="red">*</span></label>
57 <div class="col-sm-3"> 63 <div class="col-sm-3">
58 - <input type="text" id="productName" class="form-control" /> 64 + <input type="text" id="productName" class="form-control" required/>
59 </div> 65 </div>
60 <label class="col-sm-1 control-label">厂家编号</label> 66 <label class="col-sm-1 control-label">厂家编号</label>
61 <div class="col-sm-1"> 67 <div class="col-sm-1">
@@ -65,13 +71,13 @@ @@ -65,13 +71,13 @@
65 <div class="form-group"> 71 <div class="form-group">
66 <label class="col-sm-2 control-label">货品年<span class="red">*</span></label> 72 <label class="col-sm-2 control-label">货品年<span class="red">*</span></label>
67 <div class="col-sm-1"> 73 <div class="col-sm-1">
68 - <select id="goodsYears" class="form-control"> 74 + <select id="goodsYears" class="form-control" required>
69 <option value="2015">2015</option> 75 <option value="2015">2015</option>
70 </select> 76 </select>
71 </div> 77 </div>
72 <label class="col-sm-1 control-label">货品季<span class="red">*</span></label> 78 <label class="col-sm-1 control-label">货品季<span class="red">*</span></label>
73 <div class="col-sm-1"> 79 <div class="col-sm-1">
74 - <select id="goodsSeason" class="form-control"> 80 + <select id="goodsSeason" class="form-control" required>
75 <option value="春"></option> 81 <option value="春"></option>
76 <option value="夏"></option> 82 <option value="夏"></option>
77 <option value="秋"></option> 83 <option value="秋"></option>
@@ -82,7 +88,7 @@ @@ -82,7 +88,7 @@
82 </div> 88 </div>
83 <label class="col-sm-1 control-label">商品属性<span class="red">*</span></label> 89 <label class="col-sm-1 control-label">商品属性<span class="red">*</span></label>
84 <div class="col-sm-1"> 90 <div class="col-sm-1">
85 - <select id="attribute" class="form-control"> 91 + <select id="attribute" class="form-control" required>
86 <option value="1">普通商品</option> 92 <option value="1">普通商品</option>
87 <option value="2">赠品</option> 93 <option value="2">赠品</option>
88 <option value="3">虚拟商品</option> 94 <option value="3">虚拟商品</option>
@@ -105,7 +111,7 @@ @@ -105,7 +111,7 @@
105 <input type="checkbox" name="brandLevel" value="2">大童</label> 111 <input type="checkbox" name="brandLevel" value="2">大童</label>
106 <label class="radio-inline"> 112 <label class="radio-inline">
107 <input type="checkbox" name="brandLevel" value="3">小童</label> 113 <input type="checkbox" name="brandLevel" value="3">小童</label>
108 - <input type="hidden" id="ageLevel" name="ageLevel" value="{{ageLevel}}" for="checkbox" /> 114 + <input type="hidden" id="ageLevel" name="ageLevel" value="{{ageLevel}}" for="checkbox" required />
109 </div> 115 </div>
110 <label class="col-sm-1 control-label">性别<span class="red">*</span></label> 116 <label class="col-sm-1 control-label">性别<span class="red">*</span></label>
111 <div class="col-sm-2"> 117 <div class="col-sm-2">
@@ -115,7 +121,7 @@ @@ -115,7 +121,7 @@
115 <input type="radio" name="gender" value="2"></label> 121 <input type="radio" name="gender" value="2"></label>
116 <label class="radio-inline"> 122 <label class="radio-inline">
117 <input type="radio" name="gender" value="3">通用</label> 123 <input type="radio" name="gender" value="3">通用</label>
118 - <input type="hidden" id="gender" name="gender" value="{{gender}}" for="radio" /> 124 + <input type="hidden" id="gender" name="gender" value="{{gender}}" for="radio" required />
119 </div> 125 </div>
120 </div> 126 </div>
121 <div class="form-group"> 127 <div class="form-group">
@@ -127,7 +133,7 @@ @@ -127,7 +133,7 @@
127 <label class="radio-inline"> 133 <label class="radio-inline">
128 <input type="radio" name="brandLevel" value="0"></label> 134 <input type="radio" name="brandLevel" value="0"></label>
129 </div> 135 </div>
130 - <input type="hidden" id="grade" value="{{grade}}" for="radio" /> 136 + <input type="hidden" id="grade" value="{{grade}}" for="radio" required/>
131 </div> 137 </div>
132 138
133 <div class="form-group"> 139 <div class="form-group">