spec_many_template.html
4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!-- 商品规格属性模板 -->
<script id="tpl_spec_attr" type="text/template">
<% for(var j=0;j< spec_attr.length;j++){ %>
<div class="spec-group-item" data-index="<%=j%>" data-group-id="<%=spec_attr[j].group_id%>">
<div class="spec-group-name">
<span><%=spec_attr[j].group_name%></span>
<i class="spec-group-delete fa fa-trash icon-shanchu1" title="点击删除"></i>
</div>
<div class="spec-list am-cf">
<% for(var k=0;k<spec_attr[j].spec_items.length;k++){ %>
<div class="spec-item am-fl" data-item-index="<%=k%>">
<span><%=spec_attr[j].spec_items[k].spec_value%></span>
<i class="spec-item-delete fa fa-trash icon-shanchu1" title="点击删除"></i>
</div>
<% } %>
<div class="spec-item-add am-cf am-fl">
<input type="text" class="ipt-specItem am-fl am-field-valid">
<button type="button" class="btn-addSpecItem btn btn-xs btn-success am-fl">添加</button>
</div>
</div>
</div>
<% } %>
</script>
<!-- 商品规格table模板 -->
<script id="tpl_spec_table" type="text/template">
<tbody>
<tr>
<th>单sku隐藏</th>
<% for(var i=0;i< spec_attr.length;i++){ %>
<th><%=spec_attr[i].group_name%></th>
<% } %>
<th>商品编码</th>
<th>销售价</th>
<th>划线价</th>
<th>库存(-1隐藏)</th>
<th>重量(kg)</th>
<th>规格封面</th>
<th>封面编辑</th>
</tr>
<% for(var i=0;i<spec_list.length;i++){ %>
<tr data-index="<%=i%>" data-sku-id="<%=spec_list[i].spec_sku_id %>">
<td>
<button type="button" class="am-text-middle btn delsku-bt"><% if(spec_list[i].form.stock_num===-1) {%> 显示 <%}else{%> 隐藏 <%} %></button>
</td>
<% for(var k=0;k<spec_list[i].rows.length;k++){ %>
<td class="td-spec-value am-text-middle" rowspan="<%=spec_list[i].rows[k].rowspan%>">
<%=spec_list[i].rows[k].spec_value%>
</td>
<% } %>
<td>
<input <% if(spec_list[i].form.stock_num===-1) {%> disabled <%}else{%> <%} %> type="text" name="goods_no" data-rule="required" value="<%=spec_list[i].form.goods_no%>" class="ipt-goods-no am-field-valid">
</td>
<td>
<input <% if(spec_list[i].form.stock_num===-1) {%> disabled <%}else{%> <%} %> type="number" name="goods_price" data-rule="required" value="<%=spec_list[i].form.goods_price%>" class="am-field-valid ipt-w80"
required>
</td>
<td>
<input <% if(spec_list[i].form.stock_num===-1) {%> disabled <%}else{%> <%} %> type="number" name="line_price" data-rule="required" value="<%=spec_list[i].form.line_price%>" class="am-field-valid ipt-w80">
</td>
<td>
<input <% if(spec_list[i].form.stock_num===-1) {%>disabled <%}else{%> <%} %> type="number" name="stock_num" data-rule="required" value="<%=spec_list[i].form.stock_num%>" class="am-field-valid ipt-w80"
required>
</td>
<td>
<input <% if(spec_list[i].form.stock_num===-1) {%>disabled <%}else{%> <%} %> type="number" name="goods_weight" data-rule="required" value="<%=spec_list[i].form.goods_weight%>" class="am-field-valid ipt-w80"
required>
</td>
<td>
<input <% if(spec_list[i].form.stock_num===-1) {%> disabled <%}else{%> <%} %> id="c-image<%=i%>" class="form-control form-control" style="display: none!important;" name="spec_image" type="text" value="<%=spec_list[i].form.spec_image%>">
<div class="row list-inline plupload-preview spe_img_one" id="p-image<%=i%>"></div>
</td>
<td>
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-image<%=i%>" style="display: none!important;" class="btn btn-danger plupload" data-input-id="c-image<%=i%>" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image<%=i%>"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" <% if(spec_list[i].form.stock_num===-1) {%> disabled <%}else{%> <%} %> id="fachoose-image<%=i%>" class="btn btn-primary fachoose" data-input-id="c-image<%=i%>" data-mimetype="image/*" data-preview-id="p-image<%=i%>" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
</td>
</tr>
<% } %>
</tbody>
</script>