Showing
9 changed files
with
189 additions
and
160 deletions
@@ -76,6 +76,14 @@ e.on("file_onComplete", function (obj) { | @@ -76,6 +76,14 @@ e.on("file_onComplete", function (obj) { | ||
76 | fn(drawlineBean); | 76 | fn(drawlineBean); |
77 | console.log(drawlineBean); | 77 | console.log(drawlineBean); |
78 | }); | 78 | }); |
79 | +var onlyNumber = function(event){ | ||
80 | + var keyCode = event.keyCode; | ||
81 | + console.log(keyCode); | ||
82 | + if(keyCode<48 || keyCode>57){ | ||
83 | + event.keyCode = 0; | ||
84 | + } | ||
85 | +} | ||
86 | +$(document).on("keydown", ".numberbox",onlyNumber); | ||
79 | 87 | ||
80 | common.edit.ajaxfileupload("#productSkn",{ | 88 | common.edit.ajaxfileupload("#productSkn",{ |
81 | params: { | 89 | params: { |
@@ -169,8 +169,6 @@ components.prototype={ | @@ -169,8 +169,6 @@ components.prototype={ | ||
169 | var name = $this.attr("id"), | 169 | var name = $this.attr("id"), |
170 | values = $this.val().split(/[|,]/g), //String.prototype.split.call($this.val(), '|'), | 170 | values = $this.val().split(/[|,]/g), //String.prototype.split.call($this.val(), '|'), |
171 | type = $this.attr("for"); | 171 | type = $this.attr("for"); |
172 | - //var name = $this.attr("id"), | ||
173 | - //values = $this.val().split() | ||
174 | 172 | ||
175 | if (type) { | 173 | if (type) { |
176 | $(":" + type + "[name=" + name + "]").each(function() { | 174 | $(":" + type + "[name=" + name + "]").each(function() { |
@@ -6,6 +6,52 @@ var e = new common.edit2("#basicForm"); | @@ -6,6 +6,52 @@ var e = new common.edit2("#basicForm"); | ||
6 | var type = $("#basicForm").attr("role"), | 6 | var type = $("#basicForm").attr("role"), |
7 | action = $("#basicForm").data("action"); | 7 | action = $("#basicForm").data("action"); |
8 | 8 | ||
9 | +var Bll = { | ||
10 | + __render:function() { | ||
11 | + $("#basicForm").html(common.util.__template2($("#limitcodeEdit-template").html(), editBean)); | ||
12 | + e.init(); | ||
13 | + if(type != "add") { | ||
14 | + $('input[name="skn_sku"]').prop('disabled', true); | ||
15 | + $(".noEdit").prop("disabled", true); | ||
16 | + $('input[name="userTypeLimit"]').prop('disabled', true); | ||
17 | + if(Bll.getLocalTime(editBean.limitDateFrom) <= Bll.getLocalTime(new Date())) { | ||
18 | + $("#limitDateFrom").prop("disabled", true); | ||
19 | + } | ||
20 | + } | ||
21 | + }, | ||
22 | + __checkSkn:function(callback) { | ||
23 | + var flag = false; | ||
24 | + common.util.__ajax({ | ||
25 | + async:false, | ||
26 | + url: "/limitCode/checkSknValidity", | ||
27 | + data: {skn:editBean.limitSkn} | ||
28 | + },function(res) { | ||
29 | + if(!res.data.isExist) { | ||
30 | + flag = true; | ||
31 | + common.util.__tip("SKN不存在"); | ||
32 | + } else if(res.data.isConflict) { | ||
33 | + flag = true; | ||
34 | + common.util.__tip("SKN与其他限购冲突"); | ||
35 | + } else if(res.data.isOnSales) { | ||
36 | + flag = true; | ||
37 | + common.util.__tip("SKN已上架,请先下架"); | ||
38 | + } | ||
39 | + callback && callback(res); | ||
40 | + }, true); | ||
41 | + return flag; | ||
42 | + }, | ||
43 | + getLocalTime:function(nS) { | ||
44 | + var date = new Date(parseInt(nS) * 1000); | ||
45 | + var mm = date.getMonth() + 1; | ||
46 | + var dd = date.getDate(); | ||
47 | + var h = date.getHours(); | ||
48 | + var min = date.getMinutes(); | ||
49 | + var second = date.getSeconds(); | ||
50 | + return date.getFullYear() + "-" + (mm < 10 ? "0" + mm : mm) + "-" + (dd < 10 ? "0" + dd : dd) + " " + (h < 10 ? "0" + h : h) + ":" | ||
51 | + + (min < 10 ? "0" + min : min) + ":" + (second < 10 ? "0" + second : second); | ||
52 | + }, | ||
53 | +}; | ||
54 | + | ||
9 | if(type != "add") { | 55 | if(type != "add") { |
10 | var id = location.href.substring(location.href.lastIndexOf("/") + 1); | 56 | var id = location.href.substring(location.href.lastIndexOf("/") + 1); |
11 | common.util.__ajax({ | 57 | common.util.__ajax({ |
@@ -20,170 +66,87 @@ if(type != "add") { | @@ -20,170 +66,87 @@ if(type != "add") { | ||
20 | "营销策划" | 66 | "营销策划" |
21 | ]; | 67 | ]; |
22 | } | 68 | } |
23 | - $("#basicForm").html(common.util.__template2($("#limitcodeEdit-template").html(), editBean)); | ||
24 | - e.init(); | ||
25 | - if (type == 'edit') { | ||
26 | - //$('#name, #limitTimes, #userUseLimit, #department1, #department2, #limitDateFrom, #limitDateTo, #describe, #UID').prop('disabled', true); | ||
27 | - $(".noEdit").prop("disabled", true); | ||
28 | - $('input[name="userTypeLimit"]').prop('disabled', true); | ||
29 | - $("#indetify").hide(); | ||
30 | - $("#limit-userUseLimit").hide(); | ||
31 | - } | 69 | + editBean.selected = editBean.skus ? "SKU" : "SKN"; |
70 | + Bll.__render(); | ||
32 | },true); | 71 | },true); |
33 | } else { | 72 | } else { |
34 | - $("#basicForm").html(common.util.__template2($("#limitcodeEdit-template").html(), editBean)); | ||
35 | - e.init(); | ||
36 | - $("#indetify").hide(); | ||
37 | - $("#limit-userUseLimit").hide(); | 73 | + Bll.__render(); |
38 | } | 74 | } |
39 | -//var e = new edit("#basicForm"); | ||
40 | - | ||
41 | -// | ||
42 | 75 | ||
43 | $(document).on("change", ".observe", function () { | 76 | $(document).on("change", ".observe", function () { |
44 | - var val = $(this).val(); | ||
45 | - var fn = new Function("editBean", "val", "editBean." + $(this).data("field") + "= val;"); | ||
46 | - fn(editBean, val); | 77 | + var $this = $(this); |
78 | + var name = $this.data("field"); | ||
79 | + editBean = common.util.__buildobj(name, '.', editBean, function (obj, name) { | ||
80 | + obj[name] = $this.val(); | ||
81 | + }); | ||
82 | + editBean.limitDateFrom = $("#limitDateFrom").val(); | ||
83 | + editBean.limitDateTo = $("#limitDateTo").val(); | ||
47 | console.log(editBean); | 84 | console.log(editBean); |
48 | }); | 85 | }); |
49 | 86 | ||
50 | -$(document).on("change", "#limitSkn", function() { | ||
51 | - var val = $(this).val(); | ||
52 | - if($("#sknsku").val() == "SKU" && val && val.length == 8) { | 87 | +$(document).on("click", ".limitProduct", function() { |
88 | + editBean.selected = $(this).val(); | ||
89 | + Bll.__render(); | ||
90 | + console.log(editBean); | ||
91 | +}); | ||
53 | 92 | ||
54 | - } | 93 | +$(document).on("click", ".delSku", function () { |
94 | + var index = $(this).data("index"); | ||
95 | + editBean.skusInfos.splice(index, 1); | ||
96 | + Bll.__render(); | ||
97 | +}); | ||
98 | +$(document).on("click", ".addSku", function () { | ||
99 | + editBean.skusInfo.push({ | ||
100 | + "sku": "", | ||
101 | + "skuTimes": "" | ||
102 | + }); | ||
103 | + Bll.__render(); | ||
55 | }); | 104 | }); |
56 | -// | ||
57 | -// | ||
58 | -//e.on("render", function() { | ||
59 | -// if ($("#reqDepartment").val()) { | ||
60 | -// var departmentArr = String.prototype.split.call($("#reqDepartment").val(), '/'), | ||
61 | -// $department1 = $("#department1"), | ||
62 | -// $department2 = $("#department2"); | ||
63 | -// | ||
64 | -// $department1.val(departmentArr[0]); | ||
65 | -// if (departmentArr[1]) { | ||
66 | -// $department2.val(departmentArr[1]).show(); | ||
67 | -// } else { | ||
68 | -// $department2.hide(); | ||
69 | -// } | ||
70 | -// } | ||
71 | -//}); | ||
72 | -// | ||
73 | -//e.on("bind", function() { | ||
74 | -// if ($("#reqDepartment").val()) { | ||
75 | -// var departmentArr = String.prototype.split.call($("#reqDepartment").val(), '/'), | ||
76 | -// $department1 = $("#department1"), | ||
77 | -// $department2 = $("#department2"); | ||
78 | -// | ||
79 | -// $("select").change(function() { | ||
80 | -// if ($(this).is($department1)) { | ||
81 | -// departmentArr.length = 0; | ||
82 | -// departmentArr[0] = $(this).val(); | ||
83 | -// if ($(this).val() === "零售部") { | ||
84 | -// $department2.show(); | ||
85 | -// departmentArr[1] = $department2.val(); | ||
86 | -// } else { | ||
87 | -// $department2.hide(); | ||
88 | -// } | ||
89 | -// } else { | ||
90 | -// departmentArr[1] = $(this).val(); | ||
91 | -// } | ||
92 | -// $("#reqDepartment").val(departmentArr.join('/')); | ||
93 | -// }); | ||
94 | -// } | ||
95 | -//}); | ||
96 | -// | ||
97 | -//e.on("validate", function() { | ||
98 | -// var num = $.trim($("#limitTimes").val()); | ||
99 | -// if (+num > 100000 || +num < 1) { | ||
100 | -// return "数量(范围:1-100000)"; | ||
101 | -// } | ||
102 | -// return true; | ||
103 | -//}); | ||
104 | -//e.on("validate", function() { | ||
105 | -// var skn = $.trim($("#limitSkn").val()); | ||
106 | -// if (skn.length > 8) { | ||
107 | -// return "skn长度不能超过8位"; | ||
108 | -// } | ||
109 | -// return true; | ||
110 | -//}); | ||
111 | -// | ||
112 | -//e.on("validate", function() { | ||
113 | -// var startTime = $('#limitDateFrom').val(), | ||
114 | -// endTime = $('#limitDateTo').val(); | ||
115 | -// | ||
116 | -// if (startTime > endTime) { | ||
117 | -// return '结束时间不能小于开始时间'; | ||
118 | -// } | ||
119 | -//}); | ||
120 | -// | ||
121 | -//e.init(); | ||
122 | -// | ||
123 | -//var submit = function(callback) { | ||
124 | -// | ||
125 | -// e.submit($("#basicForm").attr("action"), function(option) { | ||
126 | -// $("#save_brand").addClass('disabled'); | ||
127 | -// option.success = function(res) { | ||
128 | -// res = res.data; | ||
129 | -// if (res.code == "200") { | ||
130 | -// e.$tip('提交成功', function() { | ||
131 | -// location.href = "/market/limitcode/index"; | ||
132 | -// }, 'growl-success'); | ||
133 | -// } else { | ||
134 | -// e.$tip(res.message); | ||
135 | -// $("#save_brand").removeClass('disabled'); | ||
136 | -// }; | ||
137 | -// | ||
138 | -// return false; | ||
139 | -// }; | ||
140 | -// option.error = function(res) { | ||
141 | -// $("#save_brand").removeClass('disabled'); | ||
142 | -// e.$tip("提交失败"); | ||
143 | -// } | ||
144 | -// console.log(option.data); | ||
145 | -// callback && callback(option.data); | ||
146 | -// }); | ||
147 | -//} | ||
148 | -// | ||
149 | -// | ||
150 | -$("#save_brand").click(function() { | ||
151 | 105 | ||
152 | - //submit(function(data) { | ||
153 | - // // 限购码状态0:待审核 1:审核通过 2:驳回 3:过期 4:作废 | ||
154 | - // if (+data.status == 1) { | ||
155 | - // //不改 | ||
156 | - // } else { | ||
157 | - // data.status = 0; | ||
158 | - // } | ||
159 | - //}); | ||
160 | - if(e.validate()) { | ||
161 | - editBean.limitDateFrom = $("#limitDateFrom").val(); | ||
162 | - editBean.limitDateTo = $("#limitDateTo").val(); | 106 | +$(document).on("blur", "#limitSkn", function() { |
107 | + Bll.__checkSkn(function(res) { | ||
108 | + if (res.data.skuList) { | ||
109 | + editBean.skusInfo = []; | ||
110 | + for (var i = 0; i < res.data.skuList.length; i++) { | ||
111 | + editBean.skusInfo.push({ | ||
112 | + "sku": res.data.skuList[i], | ||
113 | + "skuTimes": "" | ||
114 | + }); | ||
115 | + } | ||
116 | + $(".addSku").prop("disabled", false); | ||
117 | + } | ||
118 | + Bll.__render(); | ||
119 | + }); | ||
120 | +}); | ||
121 | +$(document).on("blur", ".skus", function() { | ||
122 | + //TODO | ||
123 | +}); | ||
124 | +$(document).on("click","#save_brand", function() { | ||
125 | + // 限购码状态0:待审核 1:审核通过 2:驳回 3:过期 4:作废 | ||
126 | + if(e.validate() && (!editBean.limitSkn || !Bll.__checkSkn())) { | ||
163 | editBean.reqDepartment = editBean.reqDepartment.join("/"); | 127 | editBean.reqDepartment = editBean.reqDepartment.join("/"); |
164 | editBean.creatorId = $("#auth_id").val(); | 128 | editBean.creatorId = $("#auth_id").val(); |
165 | editBean.creatorName = $("#auth_name").val(); | 129 | editBean.creatorName = $("#auth_name").val(); |
166 | if (editBean.status != 1) { | 130 | if (editBean.status != 1) { |
167 | editBean.status = 0; | 131 | editBean.status = 0; |
168 | } | 132 | } |
169 | - console.log(editBean); | 133 | + if(editBean.selected != "SKN") { |
134 | + editBean.skus = ""; | ||
135 | + editBean.skuTimes = ""; | ||
136 | + for(var item in editBean.skusInfo) { | ||
137 | + if(item != 0) { | ||
138 | + editBean.skus+=";"; | ||
139 | + editBean.skuTimes+=";"; | ||
140 | + } | ||
141 | + editBean.skus += editBean.skusInfo[item].sku; | ||
142 | + editBean.skuTimes+=editBean.skusInfo[item].skuTimes; | ||
143 | + } | ||
144 | + } | ||
170 | common.util.__ajax({ | 145 | common.util.__ajax({ |
171 | url: action, | 146 | url: action, |
172 | data: editBean | 147 | data: editBean |
173 | }, function (res) { | 148 | }, function (res) { |
174 | location.href = "/market/limitcode/index"; | 149 | location.href = "/market/limitcode/index"; |
175 | - //editBean = res.data; | ||
176 | - //editBean.reqDepartment = editBean.reqDepartment.split("/"); | ||
177 | - //if(!editBean.reqDepartment.length) { | ||
178 | - // editBean.reqDepartment = [ | ||
179 | - // "零售部", | ||
180 | - // "营销策划" | ||
181 | - // ]; | ||
182 | - //} | ||
183 | - //$("#basicForm").html(common.util.__template2($("#limitcodeEdit-template").html(), editBean)); | ||
184 | - //e.init(); | ||
185 | - },function() { | ||
186 | - editBean.reqDepartment = editBean.reqDepartment.split("/"); | ||
187 | }); | 150 | }); |
188 | } | 151 | } |
189 | return false; | 152 | return false; |
@@ -31,7 +31,9 @@ var g = new common.grid({ | @@ -31,7 +31,9 @@ var g = new common.grid({ | ||
31 | batchNo:common.util.__input("filter-id"), | 31 | batchNo:common.util.__input("filter-id"), |
32 | name:common.util.__input("filter-name"), | 32 | name:common.util.__input("filter-name"), |
33 | reqDepartment:common.util.__input("filter-dep"), | 33 | reqDepartment:common.util.__input("filter-dep"), |
34 | - status: t.active | 34 | + status: t.active, |
35 | + skn: common.util.__input("filter-skn"), | ||
36 | + sku: common.util.__input("filter-sku") | ||
35 | }; | 37 | }; |
36 | }, | 38 | }, |
37 | columns:[ | 39 | columns:[ |
@@ -52,6 +54,15 @@ var g = new common.grid({ | @@ -52,6 +54,15 @@ var g = new common.grid({ | ||
52 | {display:"限购码使用说明",name:"describe", render: function(item) { | 54 | {display:"限购码使用说明",name:"describe", render: function(item) { |
53 | return '<p style="max-width: 200px;word-wrap: break-word;">' + item.describe + '</p>'; | 55 | return '<p style="max-width: 200px;word-wrap: break-word;">' + item.describe + '</p>'; |
54 | }}, | 56 | }}, |
57 | + {display:"SKN/SKU", render: function(item) { | ||
58 | + var arr = []; | ||
59 | + var skn = item.skn?item.skn:""; | ||
60 | + arr.push('<p style="max-width: 200px;word-wrap: break-word;">SKN:' + item.skn + '</p>'); | ||
61 | + if(item.skus) { | ||
62 | + arr.push('<p style="max-width: 200px;word-wrap: break-word;">SKU:' + item.skus + '</p>'); | ||
63 | + } | ||
64 | + return arr.join(""); | ||
65 | + }}, | ||
55 | {display:"申请人",name:"creatorName", render: function(item) { | 66 | {display:"申请人",name:"creatorName", render: function(item) { |
56 | return item.creatorName + '<br>' + item.createTime; | 67 | return item.creatorName + '<br>' + item.createTime; |
57 | }}, | 68 | }}, |
@@ -3,6 +3,8 @@ | @@ -3,6 +3,8 @@ | ||
3 | */ | 3 | */ |
4 | 4 | ||
5 | var limitcode_bean = { | 5 | var limitcode_bean = { |
6 | + auditTime:"", | ||
7 | + batchNo:"", | ||
6 | name:"", | 8 | name:"", |
7 | limitTimes:1, | 9 | limitTimes:1, |
8 | reqDepartment:[ | 10 | reqDepartment:[ |
@@ -18,7 +20,11 @@ var limitcode_bean = { | @@ -18,7 +20,11 @@ var limitcode_bean = { | ||
18 | creatorName:"", | 20 | creatorName:"", |
19 | creatorId:"", | 21 | creatorId:"", |
20 | status:"", | 22 | status:"", |
21 | - id:"" | 23 | + id:"", |
24 | + "createTime": "", | ||
25 | + "skn": "", | ||
26 | + selected:"SKN", | ||
27 | + "skusInfo": [] | ||
22 | }; | 28 | }; |
23 | 29 | ||
24 | module.exports = limitcode_bean; | 30 | module.exports = limitcode_bean; |
1 | -exports.domain = require('../config/common.js').domain; | 1 | +//exports.domain = require('../config/common.js').domain; |
2 | //exports.domain = 'http://172.16.6.240:8088/platform'; | 2 | //exports.domain = 'http://172.16.6.240:8088/platform'; |
3 | //exports.domain = 'http://172.16.6.162:8088/platform'; | 3 | //exports.domain = 'http://172.16.6.162:8088/platform'; |
4 | +exports.domain = 'http://172.16.6.108:8088/platform';//谭玲 | ||
4 | 5 | ||
5 | //营销管理路由配置 | 6 | //营销管理路由配置 |
6 | exports.res = [ | 7 | exports.res = [ |
@@ -259,7 +260,8 @@ exports.res = [ | @@ -259,7 +260,8 @@ exports.res = [ | ||
259 | pageTitle: '限购码列表', | 260 | pageTitle: '限购码列表', |
260 | filter: true, | 261 | filter: true, |
261 | createUrl: '/market/limitcode/add', | 262 | createUrl: '/market/limitcode/add', |
262 | - gridurl: '/market/limitcode/getLimitCode' | 263 | + gridurl: '/market/limitcode/getLimitCode', |
264 | + limitcode:true | ||
263 | } | 265 | } |
264 | }, { | 266 | }, { |
265 | //限购码管理 -> 限购码列表 | 267 | //限购码管理 -> 限购码列表 |
@@ -344,7 +346,21 @@ exports.res = [ | @@ -344,7 +346,21 @@ exports.res = [ | ||
344 | }, { | 346 | }, { |
345 | name: "status", | 347 | name: "status", |
346 | type: "Number" | 348 | type: "Number" |
349 | + }, { | ||
350 | + name: "skus", | ||
351 | + type: "string" | ||
352 | + }, { | ||
353 | + name: "skuTimes", | ||
354 | + type: "string" | ||
347 | }] | 355 | }] |
356 | +},{ | ||
357 | + //检查SKN的合法性并且获得其下的所有SKU | ||
358 | + route: '/limitCode/checkSknValidity', | ||
359 | + method: 'POST', | ||
360 | + url: '/limitCode/checkSknValidity', | ||
361 | + params:[ | ||
362 | + {name: "skn", type: "string"} | ||
363 | + ] | ||
348 | }, { | 364 | }, { |
349 | //限购码管理 -> 查看限购码页面渲染 | 365 | //限购码管理 -> 查看限购码页面渲染 |
350 | route: '/market/limitcode/info/:id', | 366 | route: '/market/limitcode/info/:id', |
@@ -65,7 +65,7 @@ | @@ -65,7 +65,7 @@ | ||
65 | <label class="col-sm-2"></label> | 65 | <label class="col-sm-2"></label> |
66 | <div class="input-group col-sm-6"> | 66 | <div class="input-group col-sm-6"> |
67 | <span class="input-group-addon">人数上限:</span> | 67 | <span class="input-group-addon">人数上限:</span> |
68 | - <input type="text" form="activityForm" class="form-control observe" data-field="limitHum" value="{{limitHum}}" placeholder="人数上限"> | 68 | + <input type="text" form="activityForm" class="form-control observe numberbox" data-field="limitHum" value="{{limitHum}}" placeholder="人数上限"> |
69 | </div> | 69 | </div> |
70 | </div> | 70 | </div> |
71 | 71 |
@@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
33 | <div class="panel-col2"> | 33 | <div class="panel-col2"> |
34 | <input id="filter-id" class="form-control panel-input" type="text" placeholder="请输入批次号"> | 34 | <input id="filter-id" class="form-control panel-input" type="text" placeholder="请输入批次号"> |
35 | </div> | 35 | </div> |
36 | - <div class="panel-col2"> | 36 | + <div class="panel-col"> |
37 | <input id="filter-name" class="form-control panel-input" type="text" placeholder="请输入名称"> | 37 | <input id="filter-name" class="form-control panel-input" type="text" placeholder="请输入名称"> |
38 | </div> | 38 | </div> |
39 | <div class="panel-col"> | 39 | <div class="panel-col"> |
@@ -47,6 +47,14 @@ | @@ -47,6 +47,14 @@ | ||
47 | <option value="其他">其他</option> | 47 | <option value="其他">其他</option> |
48 | </select> | 48 | </select> |
49 | </div> | 49 | </div> |
50 | + {{# limitcode}} | ||
51 | + <div class="panel-col"> | ||
52 | + <input id="filter-skn" class="form-control panel-input" type="text" placeholder="请输skn"> | ||
53 | + </div> | ||
54 | + <div class="panel-col"> | ||
55 | + <input id="filter-sku" class="form-control panel-input" type="text" placeholder="请输sku"> | ||
56 | + </div> | ||
57 | + {{/ limitcode}} | ||
50 | <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a> | 58 | <a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a> |
51 | <a id="all-btn" href="" class="btn btn-info">全部</a> | 59 | <a id="all-btn" href="" class="btn btn-info">全部</a> |
52 | </div> | 60 | </div> |
@@ -54,10 +54,10 @@ | @@ -54,10 +54,10 @@ | ||
54 | <label class="col-sm-2 control-label">使用期限<span class="red">*</span></label> | 54 | <label class="col-sm-2 control-label">使用期限<span class="red">*</span></label> |
55 | <div class="col-sm-6"> | 55 | <div class="col-sm-6"> |
56 | <div class="col-sm-6"> | 56 | <div class="col-sm-6"> |
57 | - <input type="text" class="form-control noEdit" jsaction="time:end:limitDateTo" id="limitDateFrom" placeholder="开始时间" value="[[limitDateFrom]]" readonly required> | 57 | + <input type="text" class="form-control" jsaction="time:end:limitDateTo" id="limitDateFrom" placeholder="开始时间" value="[[limitDateFrom]]" readonly required> |
58 | </div> | 58 | </div> |
59 | <div class="col-sm-6"> | 59 | <div class="col-sm-6"> |
60 | - <input type="text" class="form-control noEdit" jsaction="time:start:limitDateFrom" id="limitDateTo" placeholder="结束时间" value="[[limitDateTo]]" readonly required> | 60 | + <input type="text" class="form-control" jsaction="time:start:limitDateFrom" id="limitDateTo" placeholder="结束时间" value="[[limitDateTo]]" readonly required> |
61 | </div> | 61 | </div> |
62 | </div> | 62 | </div> |
63 | </div> | 63 | </div> |
@@ -75,7 +75,7 @@ | @@ -75,7 +75,7 @@ | ||
75 | <h4 class="panel-title">使用条件</h4> | 75 | <h4 class="panel-title">使用条件</h4> |
76 | </div> | 76 | </div> |
77 | 77 | ||
78 | - <div class="form-group" id="indetify"> | 78 | + <div class="form-group" hidden> |
79 | <label class="col-sm-2 control-label">会员身份<i class="red">*</i></label> | 79 | <label class="col-sm-2 control-label">会员身份<i class="red">*</i></label> |
80 | <div class="col-sm-10"> | 80 | <div class="col-sm-10"> |
81 | <label class="checkbox-inline"> | 81 | <label class="checkbox-inline"> |
@@ -107,7 +107,7 @@ | @@ -107,7 +107,7 @@ | ||
107 | 107 | ||
108 | <input type="hidden" value="[[userTypeLimit]]" id="userTypeLimit" for="checkbox" required placeholder="会员身份"> | 108 | <input type="hidden" value="[[userTypeLimit]]" id="userTypeLimit" for="checkbox" required placeholder="会员身份"> |
109 | </div> | 109 | </div> |
110 | - <div class="form-group" id="limit-userUseLimit"> | 110 | + <div class="form-group" hidden> |
111 | <label class="col-sm-2 control-label">限用次数<i class="red">*</i></label> | 111 | <label class="col-sm-2 control-label">限用次数<i class="red">*</i></label> |
112 | <div class="col-sm-8"> | 112 | <div class="col-sm-8"> |
113 | <input type="text" prompt="限用次数" placeholder="0 表示不限制" class="form-control observe noEdit" data-field="userUseLimit" required pattern="^[0-9]+$" value="[[userUseLimit]]"> | 113 | <input type="text" prompt="限用次数" placeholder="0 表示不限制" class="form-control observe noEdit" data-field="userUseLimit" required pattern="^[0-9]+$" value="[[userUseLimit]]"> |
@@ -117,12 +117,31 @@ | @@ -117,12 +117,31 @@ | ||
117 | <div class="form-group"> | 117 | <div class="form-group"> |
118 | <label class="col-sm-2 control-label">指定商品</label> | 118 | <label class="col-sm-2 control-label">指定商品</label> |
119 | <div class="col-sm-4"> | 119 | <div class="col-sm-4"> |
120 | - <input type="radio" value="SKN" name="sknsku" checked />SKN | ||
121 | - <input type="radio" value="SKU" name="sknsku" />SKU | ||
122 | - <input type="hidden" id="sknsku" for="radio" value="[[SKN]]"/> | ||
123 | - </div> | ||
124 | - <div class="col-sm-2"> | ||
125 | - <input type="number" maxlength="8" id="limitSkn" placeholder="SKN" class="form-control" value="[[limitSkn]]"> | 120 | + <div class="col-sm-10"> |
121 | + <input type="radio" class="limitProduct" value="SKN" name="skn_sku" checked />SKN | ||
122 | + <input type="radio" class="limitProduct" value="SKU" name="skn_sku" />SKU | ||
123 | + <input type="hidden" id="skn_sku" for="radio" value="[[selected]]"/><br> | ||
124 | + </div> | ||
125 | + <label class="col-sm-3 control-label">SKN值:</label> | ||
126 | + <div class="col-sm-4"> | ||
127 | + <input id="limitSkn" type="text" maxlength="8" placeholder="SKN" class="form-control observe" data-field="limitSkn" value="[[limitSkn]]"> | ||
128 | + </div><br> | ||
129 | + <div id="skus" class="col-sm-10" [[selected=="SKU"?"":"hidden"]]> | ||
130 | + <table class="table table-bordered responsive dataTable no-footer"> | ||
131 | + [[each skusInfo as item index]] | ||
132 | + <tr> | ||
133 | + <td><input type="text" class="form-control observe skus" data-field="skusInfo.[[index]].sku" value="[[item.sku]]" required></td> | ||
134 | + <td><input type="text" class="form-control observe" data-field="skusInfo.[[index]].skuTimes" value="[[item.skuTimes]]" required></td> | ||
135 | + <td><a href="javascript:;" class="btn btn-danger btn-xs delSku" data-index="[[index]]">删除</a></td> | ||
136 | + </tr> | ||
137 | + [[/each]] | ||
138 | + <tr> | ||
139 | + <td>sku</td> | ||
140 | + <td>数量</td> | ||
141 | + <td><a href="javascript:;" class="btn btn-info btn-xs addSku" disabled>添加</a></td> | ||
142 | + </tr> | ||
143 | + </table> | ||
144 | + </div> | ||
126 | </div> | 145 | </div> |
127 | </div> | 146 | </div> |
128 | 147 |
-
Please register or login to post a comment