|
@@ -74,7 +74,9 @@ var basicInfohtml = '', |
|
@@ -74,7 +74,9 @@ var basicInfohtml = '', |
74
|
},
|
74
|
},
|
75
|
basicInfo = NETSALEDATA.baseProductInfo.baseProduct || '',
|
75
|
basicInfo = NETSALEDATA.baseProductInfo.baseProduct || '',
|
76
|
productExtBo = NETSALEDATA.productExtBo || '';
|
76
|
productExtBo = NETSALEDATA.productExtBo || '';
|
77
|
-
|
77
|
+var basicInfoTmp = JSON.stringify(basicInfo);
|
|
|
78
|
+basicInfoTmp = JSON.parse(basicInfoTmp);
|
|
|
79
|
+//alert( JSON.stringify(basicInfo));
|
78
|
/*
|
80
|
/*
|
79
|
* 基本信息value值转换
|
81
|
* 基本信息value值转换
|
80
|
* @param: basicInfo(请求的要渲染的数据), obj(转换的对象)
|
82
|
* @param: basicInfo(请求的要渲染的数据), obj(转换的对象)
|
|
@@ -108,6 +110,53 @@ basicInfoData.renderType = $('.contentpanel').data('type'); |
|
@@ -108,6 +110,53 @@ basicInfoData.renderType = $('.contentpanel').data('type'); |
108
|
basicInfohtml = common.util.__template2($('#basicInfo').html(), basicInfoData);
|
110
|
basicInfohtml = common.util.__template2($('#basicInfo').html(), basicInfoData);
|
109
|
$('#basic-info').html(basicInfohtml);
|
111
|
$('#basic-info').html(basicInfohtml);
|
110
|
|
112
|
|
|
|
113
|
+$(document).ready(function(){
|
|
|
114
|
+ initInfo(basicInfoTmp);
|
|
|
115
|
+});
|
|
|
116
|
+
|
|
|
117
|
+function initInfo(basicInfo) {
|
|
|
118
|
+ $("#ageLevel").val(basicInfo.ageLevel);
|
|
|
119
|
+ $("#seasons").val(basicInfo.seasons);
|
|
|
120
|
+ $("#gender").val(basicInfo.gender);
|
|
|
121
|
+ $("#grade").val(basicInfo.grade);
|
|
|
122
|
+ $("#isLimited").val(basicInfo.isLimited);
|
|
|
123
|
+ $("#isOutlets").val(basicInfo.isOutLets);
|
|
|
124
|
+
|
|
|
125
|
+ var ageLevel=basicInfo.ageLevel;
|
|
|
126
|
+ $(":checkbox[name=ageLevel]").each(function(){
|
|
|
127
|
+ if(ageLevel.indexOf($(this).val())>-1){
|
|
|
128
|
+ $(this).prop("checked",true)
|
|
|
129
|
+ }
|
|
|
130
|
+ });
|
|
|
131
|
+
|
|
|
132
|
+ $(":checkbox[name=seasons]").each(function(){
|
|
|
133
|
+ if(basicInfo.seasons.indexOf($(this).val())>-1){
|
|
|
134
|
+ $(this).prop("checked",true)
|
|
|
135
|
+ }
|
|
|
136
|
+ });
|
|
|
137
|
+ $(":radio[name=gender]").each(function(){
|
|
|
138
|
+ if(basicInfo.gender.indexOf($(this).val())>-1){
|
|
|
139
|
+ $(this).prop("checked",true)
|
|
|
140
|
+ }
|
|
|
141
|
+ });
|
|
|
142
|
+ $(":radio[name=grade]").each(function(){
|
|
|
143
|
+ if(basicInfo.grade.indexOf($(this).val())>-1){
|
|
|
144
|
+ $(this).prop("checked",true)
|
|
|
145
|
+ }
|
|
|
146
|
+ });
|
|
|
147
|
+ $(":radio[name=isLimited]").each(function(){
|
|
|
148
|
+ if(basicInfo.isLimited.indexOf($(this).val())>-1){
|
|
|
149
|
+ $(this).prop("checked",true)
|
|
|
150
|
+ }
|
|
|
151
|
+ });
|
|
|
152
|
+ $(":radio[name=isOutLets]").each(function(){
|
|
|
153
|
+ if(basicInfo.isOutLets.indexOf($(this).val())>-1){
|
|
|
154
|
+ $(this).prop("checked",true)
|
|
|
155
|
+ }
|
|
|
156
|
+ });
|
|
|
157
|
+}
|
|
|
158
|
+
|
|
|
159
|
+
|
111
|
//能否补货
|
160
|
//能否补货
|
112
|
var suppledTable = new common.grid({
|
161
|
var suppledTable = new common.grid({
|
113
|
el: '#suppled-table',
|
162
|
el: '#suppled-table',
|
|
@@ -169,6 +218,54 @@ common.util.__ajax({ |
|
@@ -169,6 +218,54 @@ common.util.__ajax({ |
169
|
}, true);
|
218
|
}, true);
|
170
|
$('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo));
|
219
|
$('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo));
|
171
|
|
220
|
|
|
|
221
|
+$(document).on("change", ":checkbox[name=ageLevel]", function () {
|
|
|
222
|
+ var value = $(this).val();
|
|
|
223
|
+ var c = $(":checkbox[name=ageLevel]");
|
|
|
224
|
+ if ($(this).is(":checked")) {
|
|
|
225
|
+ if (value == 1) {
|
|
|
226
|
+ c.slice(1, 5).prop("checked", false);
|
|
|
227
|
+ } else {
|
|
|
228
|
+ c.eq(0).prop("checked", false);
|
|
|
229
|
+ }
|
|
|
230
|
+ }
|
|
|
231
|
+ var arr = [];
|
|
|
232
|
+ $(":checked[name=ageLevel]").each(function () {
|
|
|
233
|
+ arr.push($(this).val())
|
|
|
234
|
+ });
|
|
|
235
|
+ $("#ageLevel").val(arr.join('|'));
|
|
|
236
|
+});
|
|
|
237
|
+
|
|
|
238
|
+$(document).on("change",":checkbox[name=seasons]",function(){
|
|
|
239
|
+ var value=$(this).val();
|
|
|
240
|
+ var c=$(":checkbox[name=seasons]");
|
|
|
241
|
+ if($(this).is(":checked")){
|
|
|
242
|
+ if(value=="seasons"){
|
|
|
243
|
+ c.slice(0,4).prop("checked",false);
|
|
|
244
|
+ }else{
|
|
|
245
|
+ c.eq(4).prop("checked",false);
|
|
|
246
|
+ }
|
|
|
247
|
+ }
|
|
|
248
|
+ var arr=[];
|
|
|
249
|
+ $(":checked[name=seasons]").each(function(){
|
|
|
250
|
+ arr.push($(this).val())
|
|
|
251
|
+ });
|
|
|
252
|
+ $("#seasons").val(arr.join(','));
|
|
|
253
|
+});
|
|
|
254
|
+
|
|
|
255
|
+$(document).on("change",":radio[name=gender]",function(){
|
|
|
256
|
+ $("#gender").val($(this).val());
|
|
|
257
|
+});
|
|
|
258
|
+$(document).on("change",":radio[name=isOutLets]",function(){
|
|
|
259
|
+ $("#isOutlets").val($(this).val());
|
|
|
260
|
+});
|
|
|
261
|
+$(document).on("change",":radio[name=grade]",function(){
|
|
|
262
|
+ $("#grade").val($(this).val());
|
|
|
263
|
+});
|
|
|
264
|
+$(document).on("change",":radio[name=isLimited]",function(){
|
|
|
265
|
+ $("#isLimited").val($(this).val());
|
|
|
266
|
+});
|
|
|
267
|
+
|
|
|
268
|
+
|
172
|
//如果是info页,所有input btn置灰
|
269
|
//如果是info页,所有input btn置灰
|
173
|
if ($('.contentpanel').data('type') == 'info') {
|
270
|
if ($('.contentpanel').data('type') == 'info') {
|
174
|
$('.contentpanel').find('input').prop('disabled', true);
|
271
|
$('.contentpanel').find('input').prop('disabled', true);
|
|
@@ -193,7 +290,7 @@ $('#saveBasicInfo').on('click', function() { |
|
@@ -193,7 +290,7 @@ $('#saveBasicInfo').on('click', function() { |
193
|
});
|
290
|
});
|
194
|
});
|
291
|
});
|
195
|
|
292
|
|
196
|
-GOLABDATA.on("LYbasicInfo", function() {
|
293
|
+GOLABDATA.on("LYbasicInfo", function () {
|
197
|
var data = null;
|
294
|
var data = null;
|
198
|
if (!e.validate(true)) {
|
295
|
if (!e.validate(true)) {
|
199
|
return e.errMessage;
|
296
|
return e.errMessage;
|
|
@@ -202,6 +299,13 @@ GOLABDATA.on("LYbasicInfo", function() { |
|
@@ -202,6 +299,13 @@ GOLABDATA.on("LYbasicInfo", function() { |
202
|
data.productSkn = $('#productSkn').val();
|
299
|
data.productSkn = $('#productSkn').val();
|
203
|
data.sellChannels = data.sellChannels.split('|').join(',');
|
300
|
data.sellChannels = data.sellChannels.split('|').join(',');
|
204
|
data.shopIds = data.shopIds ? data.shopIds.split('|').join(',') : '';
|
301
|
data.shopIds = data.shopIds ? data.shopIds.split('|').join(',') : '';
|
|
|
302
|
+ data.ageLevel = common.util.__input('ageLevel');
|
|
|
303
|
+ data.gender = common.util.__input('gender');
|
|
|
304
|
+ data.grade = common.util.__input('grade');
|
|
|
305
|
+ data.isLimited = common.util.__input('isLimited');
|
|
|
306
|
+ data.isOutlets =$('#isOutlets').val();;
|
|
|
307
|
+ data.seasons = common.util.__input('seasons');
|
|
|
308
|
+
|
205
|
return data;
|
309
|
return data;
|
206
|
}
|
310
|
}
|
207
|
}); |
311
|
}); |