...
|
...
|
@@ -241,13 +241,9 @@ $('#editProductName').on('click', function() { |
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
/*陈超*/
|
|
|
|
|
|
var ag = new common.grid({
|
|
|
el: "#attributeTable",
|
|
|
columns: [{
|
|
|
var common_columns=[{
|
|
|
display: "名称",
|
|
|
width:'10%',
|
|
|
name: "attributeName",
|
|
|
render: function(item) {
|
|
|
item.required = item.isMust == "Y" ? "required" : "";
|
...
|
...
|
@@ -258,13 +254,16 @@ var ag = new common.grid({ |
|
|
}
|
|
|
return arr.join('');
|
|
|
}
|
|
|
}, {
|
|
|
}]
|
|
|
|
|
|
/*陈超*/
|
|
|
|
|
|
var ag = new common.grid({
|
|
|
el: "#attributeTable",
|
|
|
columns: common_columns.concat([{
|
|
|
display: "属性",
|
|
|
render: function(item) {
|
|
|
item.required = item.isMust == "Y" ? "required" : "";
|
|
|
// item.attributeValues=item.attributeValues.split(',').map(function(elem, index, arr){
|
|
|
// return {name:elem}
|
|
|
// });
|
|
|
|
|
|
var attrs = NETSALEDATA.productStandardRelationBoList;
|
|
|
if (attrs) {
|
...
|
...
|
@@ -276,13 +275,10 @@ var ag = new common.grid({ |
|
|
}
|
|
|
}
|
|
|
|
|
|
// item.attributeValues={name:};
|
|
|
item.__name="attributeTable";
|
|
|
return common.util.__template2($("#template33").html(), item);
|
|
|
}
|
|
|
}, {
|
|
|
display: "备注",
|
|
|
name: "remark"
|
|
|
}],
|
|
|
}]),
|
|
|
complete: function() {
|
|
|
ag.__edit.init();
|
|
|
}
|
...
|
...
|
@@ -305,26 +301,11 @@ common.util.__ajax({ |
|
|
console.log("attributeProValuesBosOne", NETSALEDATA.attributeProValuesBosOne);
|
|
|
var ag2 = new common.grid({
|
|
|
el: "#goodsParamWrap",
|
|
|
columns: [{
|
|
|
display: "名称",
|
|
|
name: "attributeName",
|
|
|
render: function(item) {
|
|
|
item.required = item.isMust == "Y" ? "required" : "";
|
|
|
var arr = [];
|
|
|
arr.push(item.attributeName);
|
|
|
if (item.required) {
|
|
|
arr.push("<span class='red'>*</span>");
|
|
|
}
|
|
|
return arr.join('');
|
|
|
}
|
|
|
}, {
|
|
|
columns: common_columns.concat([{
|
|
|
display: "属性",
|
|
|
render: function(item) {
|
|
|
item.required = item.isMust == "Y" ? "required" : "";
|
|
|
item.id = item.parameterMakeId;
|
|
|
// item.attributeValues=item.attributeValues.split(',').map(function(elem, index, arr){
|
|
|
// return {name:elem}
|
|
|
// });
|
|
|
var attrs = NETSALEDATA.attributeProValuesBosOne;
|
|
|
if (attrs) {
|
|
|
for (var i in attrs) {
|
...
|
...
|
@@ -334,14 +315,10 @@ var ag2 = new common.grid({ |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// item.attributeValues={name:};
|
|
|
item.__name="goodsParamWrap";
|
|
|
return common.util.__template2($("#template33").html(), item);
|
|
|
}
|
|
|
}, {
|
|
|
display: "备注",
|
|
|
name: "remark"
|
|
|
}],
|
|
|
}]),
|
|
|
complete: function() {
|
|
|
ag2.__edit.init();
|
|
|
}
|
...
|
...
|
@@ -360,19 +337,64 @@ common.util.__ajax({ |
|
|
ag2.init(res.data);
|
|
|
}, true);
|
|
|
|
|
|
// console.log(basicInfo);
|
|
|
|
|
|
var ag3 = new common.grid({
|
|
|
el: "#goodsParamWrap2",
|
|
|
columns: common_columns.concat([{
|
|
|
display: "属性",
|
|
|
render: function(item) {
|
|
|
item.required = item.isMust == "Y" ? "required" : "";
|
|
|
item.id = item.parameterMakeId;
|
|
|
var attrs = NETSALEDATA.specialAttrBo;
|
|
|
if (attrs&&attrs.materialList) {
|
|
|
var _arr=[];
|
|
|
for (var i in attrs.materialList) {
|
|
|
_arr.push(attrs.materialList[i].id);
|
|
|
}
|
|
|
item.__val = _arr.join('|');
|
|
|
}
|
|
|
|
|
|
item.__name="goodsParamWrap2";
|
|
|
return common.util.__template2($("#template33").html(), item);
|
|
|
}
|
|
|
}]),
|
|
|
complete: function() {
|
|
|
ag3.__edit.init();
|
|
|
}
|
|
|
});
|
|
|
ag3.__edit = new common.edit("#goodsParamWrap2");
|
|
|
common.util.__ajax({
|
|
|
url: '/base/goods/queryMaterialList',
|
|
|
data: {
|
|
|
categoryId: basicInfo.maxSortId
|
|
|
}
|
|
|
}, function(res) {
|
|
|
console.log("接口queryMaterialList",res.data);
|
|
|
ag3.init([res.data]);
|
|
|
}, true);
|
|
|
|
|
|
|
|
|
$(document).on("change", "#goodsParamWrap .attr_input", function() {
|
|
|
var item = ag2.rows[$(this).data("index")];
|
|
|
item.val = $(this).val();
|
|
|
});
|
|
|
$(document).on("change", "#goodsParamWrap .attr_checkobx_class", function() {
|
|
|
var item = ag2.rows[$(this).data("index")];
|
|
|
item.val = $("#attr_" + $(this).data("index")).val().replace(/\|/g, ',');
|
|
|
})
|
|
|
|
|
|
$(document).on("change", "#attributeTable .attr_input", function() {
|
|
|
var item = ag.rows[$(this).data("index")];
|
|
|
item.val = $(this).val();
|
|
|
});
|
|
|
|
|
|
$(document).on("change", "#goodsParamWrap .attr_checkobx_class", function() {
|
|
|
var item = ag2.rows[$(this).data("index")];
|
|
|
item.val = $("#goodsParamWrap_attr_" + $(this).data("index")).val().replace(/\|/g, ',');
|
|
|
})
|
|
|
|
|
|
$(document).on("change", "#goodsParamWrap2 .attr_checkobx_class", function() {
|
|
|
var item = ag3.rows[$(this).data("index")];
|
|
|
item.val = $("#goodsParamWrap2_attr_" + $(this).data("index")).val().replace(/\|/g, ',');
|
|
|
})
|
|
|
|
|
|
|
|
|
/*保存*/
|
|
|
GOLABDATA.on("TYgoodsParams", function() {
|
...
|
...
|
@@ -381,7 +403,10 @@ GOLABDATA.on("TYgoodsParams", function() { |
|
|
return ag.__edit.errMessage;
|
|
|
}
|
|
|
if (!ag2.__edit.validate(true)) {
|
|
|
return ag.__edit.errMessage;
|
|
|
return ag2.__edit.errMessage;
|
|
|
}
|
|
|
if (!ag3.__edit.validate(true)) {
|
|
|
return ag3.__edit.errMessage;
|
|
|
}
|
|
|
|
|
|
var productStandardRelationStr = [];
|
...
|
...
|
@@ -421,8 +446,14 @@ GOLABDATA.on("TYgoodsParams", function() { |
|
|
}
|
|
|
}
|
|
|
data.attributeProValuesOne = JSON.stringify(goodsParamArr);
|
|
|
|
|
|
data.productMaterial="";
|
|
|
if (ag3.rows.length > 0) {
|
|
|
data.productMaterial=ag3.rows[0].val;
|
|
|
}
|
|
|
|
|
|
data.productSkn = $('#productSkn').val();
|
|
|
console.log(data);
|
|
|
console.log("data",data);
|
|
|
return data;
|
|
|
|
|
|
});
|
...
|
...
|
|