|
@@ -241,13 +241,9 @@ $('#editProductName').on('click', function() { |
|
@@ -241,13 +241,9 @@ $('#editProductName').on('click', function() { |
241
|
// });
|
241
|
// });
|
242
|
|
242
|
|
243
|
|
243
|
|
244
|
-
|
|
|
245
|
-/*陈超*/
|
|
|
246
|
-
|
|
|
247
|
-var ag = new common.grid({
|
|
|
248
|
- el: "#attributeTable",
|
|
|
249
|
- columns: [{
|
244
|
+var common_columns=[{
|
250
|
display: "名称",
|
245
|
display: "名称",
|
|
|
246
|
+ width:'10%',
|
251
|
name: "attributeName",
|
247
|
name: "attributeName",
|
252
|
render: function(item) {
|
248
|
render: function(item) {
|
253
|
item.required = item.isMust == "Y" ? "required" : "";
|
249
|
item.required = item.isMust == "Y" ? "required" : "";
|
|
@@ -258,13 +254,16 @@ var ag = new common.grid({ |
|
@@ -258,13 +254,16 @@ var ag = new common.grid({ |
258
|
}
|
254
|
}
|
259
|
return arr.join('');
|
255
|
return arr.join('');
|
260
|
}
|
256
|
}
|
261
|
- }, {
|
257
|
+ }]
|
|
|
258
|
+
|
|
|
259
|
+/*陈超*/
|
|
|
260
|
+
|
|
|
261
|
+var ag = new common.grid({
|
|
|
262
|
+ el: "#attributeTable",
|
|
|
263
|
+ columns: common_columns.concat([{
|
262
|
display: "属性",
|
264
|
display: "属性",
|
263
|
render: function(item) {
|
265
|
render: function(item) {
|
264
|
item.required = item.isMust == "Y" ? "required" : "";
|
266
|
item.required = item.isMust == "Y" ? "required" : "";
|
265
|
- // item.attributeValues=item.attributeValues.split(',').map(function(elem, index, arr){
|
|
|
266
|
- // return {name:elem}
|
|
|
267
|
- // });
|
|
|
268
|
|
267
|
|
269
|
var attrs = NETSALEDATA.productStandardRelationBoList;
|
268
|
var attrs = NETSALEDATA.productStandardRelationBoList;
|
270
|
if (attrs) {
|
269
|
if (attrs) {
|
|
@@ -276,13 +275,10 @@ var ag = new common.grid({ |
|
@@ -276,13 +275,10 @@ var ag = new common.grid({ |
276
|
}
|
275
|
}
|
277
|
}
|
276
|
}
|
278
|
|
277
|
|
279
|
- // item.attributeValues={name:};
|
278
|
+ item.__name="attributeTable";
|
280
|
return common.util.__template2($("#template33").html(), item);
|
279
|
return common.util.__template2($("#template33").html(), item);
|
281
|
}
|
280
|
}
|
282
|
- }, {
|
|
|
283
|
- display: "备注",
|
|
|
284
|
- name: "remark"
|
|
|
285
|
- }],
|
281
|
+ }]),
|
286
|
complete: function() {
|
282
|
complete: function() {
|
287
|
ag.__edit.init();
|
283
|
ag.__edit.init();
|
288
|
}
|
284
|
}
|
|
@@ -305,26 +301,11 @@ common.util.__ajax({ |
|
@@ -305,26 +301,11 @@ common.util.__ajax({ |
305
|
console.log("attributeProValuesBosOne", NETSALEDATA.attributeProValuesBosOne);
|
301
|
console.log("attributeProValuesBosOne", NETSALEDATA.attributeProValuesBosOne);
|
306
|
var ag2 = new common.grid({
|
302
|
var ag2 = new common.grid({
|
307
|
el: "#goodsParamWrap",
|
303
|
el: "#goodsParamWrap",
|
308
|
- columns: [{
|
|
|
309
|
- display: "名称",
|
|
|
310
|
- name: "attributeName",
|
|
|
311
|
- render: function(item) {
|
|
|
312
|
- item.required = item.isMust == "Y" ? "required" : "";
|
|
|
313
|
- var arr = [];
|
|
|
314
|
- arr.push(item.attributeName);
|
|
|
315
|
- if (item.required) {
|
|
|
316
|
- arr.push("<span class='red'>*</span>");
|
|
|
317
|
- }
|
|
|
318
|
- return arr.join('');
|
|
|
319
|
- }
|
|
|
320
|
- }, {
|
304
|
+ columns: common_columns.concat([{
|
321
|
display: "属性",
|
305
|
display: "属性",
|
322
|
render: function(item) {
|
306
|
render: function(item) {
|
323
|
item.required = item.isMust == "Y" ? "required" : "";
|
307
|
item.required = item.isMust == "Y" ? "required" : "";
|
324
|
item.id = item.parameterMakeId;
|
308
|
item.id = item.parameterMakeId;
|
325
|
- // item.attributeValues=item.attributeValues.split(',').map(function(elem, index, arr){
|
|
|
326
|
- // return {name:elem}
|
|
|
327
|
- // });
|
|
|
328
|
var attrs = NETSALEDATA.attributeProValuesBosOne;
|
309
|
var attrs = NETSALEDATA.attributeProValuesBosOne;
|
329
|
if (attrs) {
|
310
|
if (attrs) {
|
330
|
for (var i in attrs) {
|
311
|
for (var i in attrs) {
|
|
@@ -334,14 +315,10 @@ var ag2 = new common.grid({ |
|
@@ -334,14 +315,10 @@ var ag2 = new common.grid({ |
334
|
}
|
315
|
}
|
335
|
}
|
316
|
}
|
336
|
}
|
317
|
}
|
337
|
-
|
|
|
338
|
- // item.attributeValues={name:};
|
318
|
+ item.__name="goodsParamWrap";
|
339
|
return common.util.__template2($("#template33").html(), item);
|
319
|
return common.util.__template2($("#template33").html(), item);
|
340
|
}
|
320
|
}
|
341
|
- }, {
|
|
|
342
|
- display: "备注",
|
|
|
343
|
- name: "remark"
|
|
|
344
|
- }],
|
321
|
+ }]),
|
345
|
complete: function() {
|
322
|
complete: function() {
|
346
|
ag2.__edit.init();
|
323
|
ag2.__edit.init();
|
347
|
}
|
324
|
}
|
|
@@ -360,19 +337,64 @@ common.util.__ajax({ |
|
@@ -360,19 +337,64 @@ common.util.__ajax({ |
360
|
ag2.init(res.data);
|
337
|
ag2.init(res.data);
|
361
|
}, true);
|
338
|
}, true);
|
362
|
|
339
|
|
|
|
340
|
+// console.log(basicInfo);
|
|
|
341
|
+
|
|
|
342
|
+var ag3 = new common.grid({
|
|
|
343
|
+ el: "#goodsParamWrap2",
|
|
|
344
|
+ columns: common_columns.concat([{
|
|
|
345
|
+ display: "属性",
|
|
|
346
|
+ render: function(item) {
|
|
|
347
|
+ item.required = item.isMust == "Y" ? "required" : "";
|
|
|
348
|
+ item.id = item.parameterMakeId;
|
|
|
349
|
+ var attrs = NETSALEDATA.specialAttrBo;
|
|
|
350
|
+ if (attrs&&attrs.materialList) {
|
|
|
351
|
+ var _arr=[];
|
|
|
352
|
+ for (var i in attrs.materialList) {
|
|
|
353
|
+ _arr.push(attrs.materialList[i].id);
|
|
|
354
|
+ }
|
|
|
355
|
+ item.__val = _arr.join('|');
|
|
|
356
|
+ }
|
|
|
357
|
+
|
|
|
358
|
+ item.__name="goodsParamWrap2";
|
|
|
359
|
+ return common.util.__template2($("#template33").html(), item);
|
|
|
360
|
+ }
|
|
|
361
|
+ }]),
|
|
|
362
|
+ complete: function() {
|
|
|
363
|
+ ag3.__edit.init();
|
|
|
364
|
+ }
|
|
|
365
|
+});
|
|
|
366
|
+ag3.__edit = new common.edit("#goodsParamWrap2");
|
|
|
367
|
+common.util.__ajax({
|
|
|
368
|
+ url: '/base/goods/queryMaterialList',
|
|
|
369
|
+ data: {
|
|
|
370
|
+ categoryId: basicInfo.maxSortId
|
|
|
371
|
+ }
|
|
|
372
|
+}, function(res) {
|
|
|
373
|
+ console.log("接口queryMaterialList",res.data);
|
|
|
374
|
+ ag3.init([res.data]);
|
|
|
375
|
+}, true);
|
|
|
376
|
+
|
|
|
377
|
+
|
363
|
$(document).on("change", "#goodsParamWrap .attr_input", function() {
|
378
|
$(document).on("change", "#goodsParamWrap .attr_input", function() {
|
364
|
var item = ag2.rows[$(this).data("index")];
|
379
|
var item = ag2.rows[$(this).data("index")];
|
365
|
item.val = $(this).val();
|
380
|
item.val = $(this).val();
|
366
|
});
|
381
|
});
|
367
|
-$(document).on("change", "#goodsParamWrap .attr_checkobx_class", function() {
|
|
|
368
|
- var item = ag2.rows[$(this).data("index")];
|
|
|
369
|
- item.val = $("#attr_" + $(this).data("index")).val().replace(/\|/g, ',');
|
|
|
370
|
-})
|
382
|
+
|
371
|
$(document).on("change", "#attributeTable .attr_input", function() {
|
383
|
$(document).on("change", "#attributeTable .attr_input", function() {
|
372
|
var item = ag.rows[$(this).data("index")];
|
384
|
var item = ag.rows[$(this).data("index")];
|
373
|
item.val = $(this).val();
|
385
|
item.val = $(this).val();
|
374
|
});
|
386
|
});
|
375
|
|
387
|
|
|
|
388
|
+$(document).on("change", "#goodsParamWrap .attr_checkobx_class", function() {
|
|
|
389
|
+ var item = ag2.rows[$(this).data("index")];
|
|
|
390
|
+ item.val = $("#goodsParamWrap_attr_" + $(this).data("index")).val().replace(/\|/g, ',');
|
|
|
391
|
+})
|
|
|
392
|
+
|
|
|
393
|
+$(document).on("change", "#goodsParamWrap2 .attr_checkobx_class", function() {
|
|
|
394
|
+ var item = ag3.rows[$(this).data("index")];
|
|
|
395
|
+ item.val = $("#goodsParamWrap2_attr_" + $(this).data("index")).val().replace(/\|/g, ',');
|
|
|
396
|
+})
|
|
|
397
|
+
|
376
|
|
398
|
|
377
|
/*保存*/
|
399
|
/*保存*/
|
378
|
GOLABDATA.on("TYgoodsParams", function() {
|
400
|
GOLABDATA.on("TYgoodsParams", function() {
|
|
@@ -381,7 +403,10 @@ GOLABDATA.on("TYgoodsParams", function() { |
|
@@ -381,7 +403,10 @@ GOLABDATA.on("TYgoodsParams", function() { |
381
|
return ag.__edit.errMessage;
|
403
|
return ag.__edit.errMessage;
|
382
|
}
|
404
|
}
|
383
|
if (!ag2.__edit.validate(true)) {
|
405
|
if (!ag2.__edit.validate(true)) {
|
384
|
- return ag.__edit.errMessage;
|
406
|
+ return ag2.__edit.errMessage;
|
|
|
407
|
+ }
|
|
|
408
|
+ if (!ag3.__edit.validate(true)) {
|
|
|
409
|
+ return ag3.__edit.errMessage;
|
385
|
}
|
410
|
}
|
386
|
|
411
|
|
387
|
var productStandardRelationStr = [];
|
412
|
var productStandardRelationStr = [];
|
|
@@ -421,8 +446,14 @@ GOLABDATA.on("TYgoodsParams", function() { |
|
@@ -421,8 +446,14 @@ GOLABDATA.on("TYgoodsParams", function() { |
421
|
}
|
446
|
}
|
422
|
}
|
447
|
}
|
423
|
data.attributeProValuesOne = JSON.stringify(goodsParamArr);
|
448
|
data.attributeProValuesOne = JSON.stringify(goodsParamArr);
|
|
|
449
|
+
|
|
|
450
|
+ data.productMaterial="";
|
|
|
451
|
+ if (ag3.rows.length > 0) {
|
|
|
452
|
+ data.productMaterial=ag3.rows[0].val;
|
|
|
453
|
+ }
|
|
|
454
|
+
|
424
|
data.productSkn = $('#productSkn').val();
|
455
|
data.productSkn = $('#productSkn').val();
|
425
|
- console.log(data);
|
456
|
+ console.log("data",data);
|
426
|
return data;
|
457
|
return data;
|
427
|
|
458
|
|
428
|
});
|
459
|
});
|