...
|
...
|
@@ -74,7 +74,9 @@ var basicInfohtml = '', |
|
|
},
|
|
|
basicInfo = NETSALEDATA.baseProductInfo.baseProduct || '',
|
|
|
productExtBo = NETSALEDATA.productExtBo || '';
|
|
|
|
|
|
var basicInfoTmp = JSON.stringify(basicInfo);
|
|
|
basicInfoTmp = JSON.parse(basicInfoTmp);
|
|
|
//alert( JSON.stringify(basicInfo));
|
|
|
/*
|
|
|
* 基本信息value值转换
|
|
|
* @param: basicInfo(请求的要渲染的数据), obj(转换的对象)
|
...
|
...
|
@@ -108,6 +110,53 @@ basicInfoData.renderType = $('.contentpanel').data('type'); |
|
|
basicInfohtml = common.util.__template2($('#basicInfo').html(), basicInfoData);
|
|
|
$('#basic-info').html(basicInfohtml);
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
initInfo(basicInfoTmp);
|
|
|
});
|
|
|
|
|
|
function initInfo(basicInfo) {
|
|
|
$("#ageLevel").val(basicInfo.ageLevel);
|
|
|
$("#seasons").val(basicInfo.seasons);
|
|
|
$("#gender").val(basicInfo.gender);
|
|
|
$("#grade").val(basicInfo.grade);
|
|
|
$("#isLimited").val(basicInfo.isLimited);
|
|
|
$("#isOutlets").val(basicInfo.isOutLets);
|
|
|
|
|
|
var ageLevel=basicInfo.ageLevel;
|
|
|
$(":checkbox[name=ageLevel]").each(function(){
|
|
|
if(ageLevel.indexOf($(this).val())>-1){
|
|
|
$(this).prop("checked",true)
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$(":checkbox[name=seasons]").each(function(){
|
|
|
if(basicInfo.seasons.indexOf($(this).val())>-1){
|
|
|
$(this).prop("checked",true)
|
|
|
}
|
|
|
});
|
|
|
$(":radio[name=gender]").each(function(){
|
|
|
if(basicInfo.gender.indexOf($(this).val())>-1){
|
|
|
$(this).prop("checked",true)
|
|
|
}
|
|
|
});
|
|
|
$(":radio[name=grade]").each(function(){
|
|
|
if(basicInfo.grade.indexOf($(this).val())>-1){
|
|
|
$(this).prop("checked",true)
|
|
|
}
|
|
|
});
|
|
|
$(":radio[name=isLimited]").each(function(){
|
|
|
if(basicInfo.isLimited.indexOf($(this).val())>-1){
|
|
|
$(this).prop("checked",true)
|
|
|
}
|
|
|
});
|
|
|
$(":radio[name=isOutLets]").each(function(){
|
|
|
if(basicInfo.isOutLets.indexOf($(this).val())>-1){
|
|
|
$(this).prop("checked",true)
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
//能否补货
|
|
|
var suppledTable = new common.grid({
|
|
|
el: '#suppled-table',
|
...
|
...
|
@@ -169,6 +218,54 @@ common.util.__ajax({ |
|
|
}, true);
|
|
|
$('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo));
|
|
|
|
|
|
$(document).on("change", ":checkbox[name=ageLevel]", function () {
|
|
|
var value = $(this).val();
|
|
|
var c = $(":checkbox[name=ageLevel]");
|
|
|
if ($(this).is(":checked")) {
|
|
|
if (value == 1) {
|
|
|
c.slice(1, 5).prop("checked", false);
|
|
|
} else {
|
|
|
c.eq(0).prop("checked", false);
|
|
|
}
|
|
|
}
|
|
|
var arr = [];
|
|
|
$(":checked[name=ageLevel]").each(function () {
|
|
|
arr.push($(this).val())
|
|
|
});
|
|
|
$("#ageLevel").val(arr.join('|'));
|
|
|
});
|
|
|
|
|
|
$(document).on("change",":checkbox[name=seasons]",function(){
|
|
|
var value=$(this).val();
|
|
|
var c=$(":checkbox[name=seasons]");
|
|
|
if($(this).is(":checked")){
|
|
|
if(value=="seasons"){
|
|
|
c.slice(0,4).prop("checked",false);
|
|
|
}else{
|
|
|
c.eq(4).prop("checked",false);
|
|
|
}
|
|
|
}
|
|
|
var arr=[];
|
|
|
$(":checked[name=seasons]").each(function(){
|
|
|
arr.push($(this).val())
|
|
|
});
|
|
|
$("#seasons").val(arr.join(','));
|
|
|
});
|
|
|
|
|
|
$(document).on("change",":radio[name=gender]",function(){
|
|
|
$("#gender").val($(this).val());
|
|
|
});
|
|
|
$(document).on("change",":radio[name=isOutLets]",function(){
|
|
|
$("#isOutlets").val($(this).val());
|
|
|
});
|
|
|
$(document).on("change",":radio[name=grade]",function(){
|
|
|
$("#grade").val($(this).val());
|
|
|
});
|
|
|
$(document).on("change",":radio[name=isLimited]",function(){
|
|
|
$("#isLimited").val($(this).val());
|
|
|
});
|
|
|
|
|
|
|
|
|
//如果是info页,所有input btn置灰
|
|
|
if ($('.contentpanel').data('type') == 'info') {
|
|
|
$('.contentpanel').find('input').prop('disabled', true);
|
...
|
...
|
@@ -193,7 +290,7 @@ $('#saveBasicInfo').on('click', function() { |
|
|
});
|
|
|
});
|
|
|
|
|
|
GOLABDATA.on("LYbasicInfo", function() {
|
|
|
GOLABDATA.on("LYbasicInfo", function () {
|
|
|
var data = null;
|
|
|
if (!e.validate(true)) {
|
|
|
return e.errMessage;
|
...
|
...
|
@@ -202,6 +299,13 @@ GOLABDATA.on("LYbasicInfo", function() { |
|
|
data.productSkn = $('#productSkn').val();
|
|
|
data.sellChannels = data.sellChannels.split('|').join(',');
|
|
|
data.shopIds = data.shopIds ? data.shopIds.split('|').join(',') : '';
|
|
|
data.ageLevel = common.util.__input('ageLevel');
|
|
|
data.gender = common.util.__input('gender');
|
|
|
data.grade = common.util.__input('grade');
|
|
|
data.isLimited = common.util.__input('isLimited');
|
|
|
data.isOutlets =$('#isOutlets').val();;
|
|
|
data.seasons = common.util.__input('seasons');
|
|
|
|
|
|
return data;
|
|
|
}
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|