修复后台规格项目不能添加两个以上的问题
This commit is contained in:
1 parent
b5e9658449
commit
b577443803
2 files changed
+7
-3
No files matched your search
@@ -423,12 +423,15 @@ public class StoreGoodsController extends BaseController
|
||||
}
|
||||
//过滤规格组合新的规格数据集合
|
||||
if(name.contains("item")){
|
||||
String pattern = "item\\[(\\d+_\\d+)]\\[([a-z]+_?[a-z]+)]";
|
||||
String pattern = "item\\[(\\d+[_\\d+]*)]\\[([a-z]+_?[a-z]+)]";
|
||||
//String pattern = "item\\[(\\d+_\\d+)]\\[([a-z]+_?[a-z]+)]";
|
||||
Pattern r = Pattern.compile(pattern);
|
||||
Matcher m = r.matcher(name);
|
||||
if (m.find( )) {
|
||||
String keyOne = m.group(1).trim();
|
||||
System.out.println("keyOne:"+keyOne);
|
||||
String keyTwo = m.group(2).trim();
|
||||
System.out.println("keyTwo:"+keyTwo);
|
||||
String keyValue = builder.toString().trim();
|
||||
|
||||
if(!specDataMap.containsKey(keyOne)){
|
||||
@@ -456,7 +459,7 @@ public class StoreGoodsController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
//System.out.println(specDataMap);
|
||||
|
||||
|
||||
|
||||
if(specDataMap.isEmpty()){
|
||||
|
||||
@@ -58,7 +58,8 @@
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$("#goods_spec_table2")
|
||||
//$("#goods_spec_table2")
|
||||
console.log($.common.formToJSON("form-goods-edit"));
|
||||
$.operate.save(prefix + "/saveSpecAttr", $('#form-goods-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user