Showing
1 changed file
with
5 additions
and
10 deletions
@@ -311,23 +311,18 @@ var operationEdit={ | @@ -311,23 +311,18 @@ var operationEdit={ | ||
311 | return false; | 311 | return false; |
312 | } | 312 | } |
313 | var _g=this; | 313 | var _g=this; |
314 | - var result=true; | ||
315 | - var msg; | 314 | + var result=true; |
316 | switch(_reqData["promotionType"]){ | 315 | switch(_reqData["promotionType"]){ |
317 | case _g.config.Degressdiscount.enName: | 316 | case _g.config.Degressdiscount.enName: |
318 | - var regrex=new RegExp("(\d+:\d+(\.\d+)?)(;\d+:\d+(\.\d+)?)*",'g'); | 317 | + var regrex=new RegExp(/(\d+:\d+(\.\d+)?)(;\d+:\d+(\.\d+)?)*/,'g'); |
319 | var degress_discount_list=_reqData["data"]["degress_discount_list"]; | 318 | var degress_discount_list=_reqData["data"]["degress_discount_list"]; |
320 | - result = regrex.test(degress_discount_list); | ||
321 | - if(!result){ | ||
322 | - msg=""; | ||
323 | - } | 319 | + result = regrex.test(degress_discount_list); |
324 | break; | 320 | break; |
325 | case _g.config.SpecifiedAmount.enName: | 321 | case _g.config.SpecifiedAmount.enName: |
326 | - var regrex=new RegExp("\d+:\d+(\.\d+)?",'g'); | 322 | + var regrex=new RegExp(/^\d+:\d+(\.\d+)?$/,'g'); |
327 | var specified_amount_list=_reqData["data"]["specified_amount_list"]; | 323 | var specified_amount_list=_reqData["data"]["specified_amount_list"]; |
328 | result = regrex.test(specified_amount_list); | 324 | result = regrex.test(specified_amount_list); |
329 | - break; | ||
330 | - | 325 | + break; |
331 | } | 326 | } |
332 | return result; | 327 | return result; |
333 | } | 328 | } |
-
Please register or login to post a comment