Showing
3 changed files
with
14 additions
and
10 deletions
@@ -230,7 +230,7 @@ edit.prototype = { | @@ -230,7 +230,7 @@ edit.prototype = { | ||
230 | }); | 230 | }); |
231 | that.__listen("bind"); | 231 | that.__listen("bind"); |
232 | }, | 232 | }, |
233 | - validate: function() { | 233 | + validate: function(isTip) { |
234 | var that = this; | 234 | var that = this; |
235 | var rules = {}, | 235 | var rules = {}, |
236 | data = {}, | 236 | data = {}, |
@@ -320,7 +320,11 @@ edit.prototype = { | @@ -320,7 +320,11 @@ edit.prototype = { | ||
320 | // return false; | 320 | // return false; |
321 | // } | 321 | // } |
322 | if (err.length > 0) { | 322 | if (err.length > 0) { |
323 | + if(!isTip){ | ||
323 | that.__err(err.join('')); | 324 | that.__err(err.join('')); |
325 | + }else{ | ||
326 | + that.errMessage=err.join(''); | ||
327 | + } | ||
324 | return false; | 328 | return false; |
325 | } | 329 | } |
326 | var zierr = 0; | 330 | var zierr = 0; |
@@ -333,14 +337,19 @@ edit.prototype = { | @@ -333,14 +337,19 @@ edit.prototype = { | ||
333 | }); | 337 | }); |
334 | 338 | ||
335 | if (zierr > 0) { | 339 | if (zierr > 0) { |
340 | + if(!isTip){ | ||
336 | that.__err(err.join('')); | 341 | that.__err(err.join('')); |
342 | + }else{ | ||
343 | + that.errMessage=err.join(''); | ||
344 | + } | ||
345 | + | ||
337 | return false; | 346 | return false; |
338 | } | 347 | } |
339 | return true; | 348 | return true; |
340 | }, | 349 | }, |
341 | submit: function(url, callback) { | 350 | submit: function(url, callback) { |
342 | var that = this; | 351 | var that = this; |
343 | - if (!that.validate()) { | 352 | + if (!that.validate(url?false:true)) { |
344 | return false; | 353 | return false; |
345 | } | 354 | } |
346 | var data = {}; | 355 | var data = {}; |
@@ -209,7 +209,7 @@ common.util.__ajax({ | @@ -209,7 +209,7 @@ common.util.__ajax({ | ||
209 | 209 | ||
210 | 210 | ||
211 | GOLABDATA.on("TYcaizhi", function() { | 211 | GOLABDATA.on("TYcaizhi", function() { |
212 | - return goodsParamEdit.submit('', function(option) { | 212 | + var a= goodsParamEdit.submit(false, function(option) { |
213 | $('.goods-param-group').each(function() { | 213 | $('.goods-param-group').each(function() { |
214 | goodsParamArr.push({ | 214 | goodsParamArr.push({ |
215 | productSkn: $('#productSkn').val(), | 215 | productSkn: $('#productSkn').val(), |
@@ -221,6 +221,7 @@ GOLABDATA.on("TYcaizhi", function() { | @@ -221,6 +221,7 @@ GOLABDATA.on("TYcaizhi", function() { | ||
221 | option.data.productSkn = $('#productSkn').val(); | 221 | option.data.productSkn = $('#productSkn').val(); |
222 | option.debug = true; | 222 | option.debug = true; |
223 | }); | 223 | }); |
224 | + return a?a:goodsParamEdit.errMessage; | ||
224 | }); | 225 | }); |
225 | 226 | ||
226 | $("#propertySave").on('click', function() { | 227 | $("#propertySave").on('click', function() { |
@@ -230,9 +231,3 @@ $("#propertySave").on('click', function() { | @@ -230,9 +231,3 @@ $("#propertySave").on('click', function() { | ||
230 | }, function() {}); | 231 | }, function() {}); |
231 | }); | 232 | }); |
232 | 233 | ||
233 | -/*console.log(goodsParamArr) | ||
234 | -window.GOLABDATA.on('TYcaizhi', function() { | ||
235 | - return { | ||
236 | - attributeProValuesOne: JSON.stringify(goodsParamArr) | ||
237 | - }; | ||
238 | -});*/ |
@@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
43 | <label style="cursor: pointer;"><input name="[[b.attributeId]]" type="[[b.inputType]]" value="[[c.id]]">[[c.text]]</label> | 43 | <label style="cursor: pointer;"><input name="[[b.attributeId]]" type="[[b.inputType]]" value="[[c.id]]">[[c.text]]</label> |
44 | [[/each]] | 44 | [[/each]] |
45 | </span> | 45 | </span> |
46 | - <input id="[[b.attributeId]]" type="hidden" for="[[b.inputType]]" value="[[b.selectedValues]]"> | 46 | + <input id="[[b.attributeId]]" type="hidden" for="[[b.inputType]]" value="[[b.selectedValues]]" required="required"> |
47 | </div> | 47 | </div> |
48 | [[/each]] | 48 | [[/each]] |
49 | </script> | 49 | </script> |
-
Please register or login to post a comment