...
|
...
|
@@ -201,17 +201,17 @@ var g=new common.grid({ |
|
|
var txt=item.factoryGoodsName?item.factoryGoodsName:item.goodsName;
|
|
|
//待上架商品可以修改色系
|
|
|
if((ACTION == 1 && canEditSort)||ACTION == 0){
|
|
|
html.push("<p>厂家颜色:</p><p><input type='text' id='factoryGoodsName' class='w-goods-text form-control' data-index="+item.__index+" value='"+txt+"' placeholder='厂家颜色' required style='padding: 10px; width: 150px' /></p>");
|
|
|
html.push("<p>厂家颜色:</p><p><input type='text' id='factoryGoodsName' class='w-goods-text form-control' data-index="+item.__index+" value='"+txt+"' placeholder='厂家颜色' required style='padding: 10px; width: 150px' /></p>");
|
|
|
html.push("<p>色系:</p><p>"+common.util.__template2($('#colorSelect').html(),item)+"</p>");
|
|
|
}else{
|
|
|
if(item.isNew){
|
|
|
html.push("<p>厂家颜色:</p><p><input type='text' id='factoryGoodsName' class='w-goods-text form-control' data-index="+item.__index+" value='"+item.goodsName+"' placeholder='厂家颜色' required style='padding: 10px; width: 150px' /></p>");
|
|
|
}else if(RESPONSEDATA.sellType == 3 || RESPONSEDATA.isJit == 'Y'){ // JIT上架后的商品也可以修改厂家颜色
|
|
|
html.push("<p>厂家颜色:</p><p><input type='text' id='factoryGoodsName' class='w-goods-text form-control' data-index="+item.__index+" value='"+txt+"' placeholder='厂家颜色' required style='padding: 10px; width: 150px' /></p>");
|
|
|
html.push("<p>厂家颜色:</p><p><input type='text' id='factoryGoodsName' class='w-goods-text form-control' data-index="+item.__index+" value='"+txt+"' placeholder='厂家颜色' required style='padding: 10px; width: 150px' /></p>");
|
|
|
}else{
|
|
|
html.push("<p>厂家颜色:</p><p><input type='text' id='factoryGoodsName' disabled='disabled' class='w-goods-text form-control' data-index="+item.__index+" value='"+txt+"' placeholder='厂家颜色' required style='padding: 10px; width: 150px' /></p>");
|
|
|
html.push("<p>厂家颜色:</p><p><input type='text' id='factoryGoodsName' disabled='disabled' class='w-goods-text form-control' data-index="+item.__index+" value='"+txt+"' placeholder='厂家颜色' required style='padding: 10px; width: 150px' /></p>");
|
|
|
}
|
|
|
|
|
|
|
|
|
html.push("<p>色系: "+item.goodsName+"</p>");
|
|
|
}
|
|
|
html.push('<p><button type="button" data-index='+item.__index+' class="sortdelete btn btn-danger btn-xs">删除</button></p>');
|
...
|
...
|
@@ -229,11 +229,53 @@ var g=new common.grid({ |
|
|
if(!item.isAdd&&!g.__gsm.hasOwnProperty(item.__index)){
|
|
|
g.__gsm[item.__index]=item.goodsSizeList.length;
|
|
|
}
|
|
|
var rowHead = [
|
|
|
{name: '尺码', width: '14%'},
|
|
|
{name: '销售价', width: '10%'},
|
|
|
{name: '条码', width: '13%'},
|
|
|
{name: '品牌条码', width: '13%'},
|
|
|
{name: '是否补货', width: '10%'},
|
|
|
{name: 'UPC条码', width: '13%'},
|
|
|
{name: '支付尾款时间', width: '10%'},
|
|
|
];
|
|
|
var html=[];
|
|
|
html.push("<div class='form-group' style='padding-bottom: 0'><div class='col-sm-11 red'><input type=text value='"+item.factoryCode+"' data-index="+item.__index+" class='modelCode form-control' placeholder='款型编码' required/></div></div>");
|
|
|
html.push("<div class='rows'><div class='form-group' style='padding-bottom: 0'><div class='col-sm-1' style='width: 14%'>尺码</div><div class='col-sm-1'>销售价</div><div class='col-sm-2' style='width: 13%'>条码</div><div class='col-sm-2' style='width: 13%'>品牌条码</div><div class='col-sm-1'>是否补货</div><div class='col-sm-2' style='width: 13%'>UPC条码</div><div class='col-sm-2' style='width: 10%'>支付尾款时间</div></div></div>");
|
|
|
|
|
|
if (+_sellType === 6) {
|
|
|
rowHead.push({
|
|
|
name: '备案名称'
|
|
|
}, {
|
|
|
name: '规格型号'
|
|
|
}, {
|
|
|
name: '净重(kg)'
|
|
|
}, {
|
|
|
name: '毛重(kg)'
|
|
|
});
|
|
|
|
|
|
rowHead.forEach(val => {
|
|
|
val.width = '8.5%';
|
|
|
});
|
|
|
}
|
|
|
|
|
|
html.push('<div class="rows"><div class="form-group" style="padding-bottom: 0">');
|
|
|
|
|
|
rowHead.forEach(val => {
|
|
|
html.push(`<div class="col-sm-1" style="width: ${val.width || 'auto'}; padding: 0 5px;">${val.name}</div>`);
|
|
|
});
|
|
|
|
|
|
html.push('</div></div>');
|
|
|
html.push('<div class="rows" id="rows__'+item.__index+'">');
|
|
|
item.goodsSizeList=item.goodsSizeList||[$.extend({},ENUM.goodsSizeList)];
|
|
|
|
|
|
item.goodsSizeList.forEach(size => {
|
|
|
size.isBonded = (+_sellType === 6);
|
|
|
size._rowHead = rowHead;
|
|
|
|
|
|
if (size.isBonded) {
|
|
|
size.storageBondedBo = size.storageBondedBo || {};
|
|
|
}
|
|
|
});
|
|
|
|
|
|
html.push(common.util.__template2($("#template").html(),{index:item.__index,goodsSizeList:item.goodsSizeList}));
|
|
|
html.push('</div>');
|
|
|
return html.join('');
|
...
|
...
|
@@ -311,7 +353,7 @@ $(document).on("click",".sortadd",function(){ |
|
|
// if(ACTION == 1 && !canEditSort){
|
|
|
// common.util.__tip("商品有过上架操作,不允许修改厂家颜色","warning");
|
|
|
// return;
|
|
|
// }
|
|
|
// }
|
|
|
if ($.trim($("#salesPriceStr").val())=="") {
|
|
|
common.util.__tip("请填写销售价","warning");
|
|
|
return;
|
...
|
...
|
@@ -351,12 +393,12 @@ $(document).on("change","#brandId",function(){ |
|
|
if(/\((.*)\)/g.test(Bll.productNameArr[0])){
|
|
|
Bll.productNameArr[0]=Bll.productNameArr[0].match(/\((.*)\)/)[1];
|
|
|
}
|
|
|
|
|
|
|
|
|
Bll.setProductName();
|
|
|
$("#supplierId").val(-1).trigger("change");
|
|
|
$("#shopId").val(-1).trigger("change");
|
|
|
$("#supplierId").val(-1).trigger("change");
|
|
|
// $("#shopId").val(-1).trigger("change");
|
|
|
$("#supplierId").val(-1).trigger("change");
|
|
|
// $("#shopId").val(-1).trigger("change");
|
|
|
tabTree.isfeeze=false;
|
|
|
tabTree.init([{id:"",sortName:""},{id:"",sortName:""},{id:"",sortName:""},{id:"",sortName:""}]);
|
|
|
});
|
...
|
...
|
@@ -401,6 +443,8 @@ $(document).on("change","#supplierId",function(){ // 不维护供应商 |
|
|
$(document).on("change","#sellType",function(){
|
|
|
tabTree.isfeeze=false;
|
|
|
tabTree.init([{id:"",sortName:""},{id:"",sortName:""},{id:"",sortName:""},{id:"",sortName:""}]);
|
|
|
_sellType = $(this).val();
|
|
|
g.reload();
|
|
|
});
|
|
|
|
|
|
$(document).on("change",":radio[name=gender]",function(){
|
...
|
...
|
@@ -484,6 +528,24 @@ $(document).on("change",".btn-sort-kebu",function(){ |
|
|
var _eq=$(this).data("eq");
|
|
|
var item=g.__rows[_index].goodsSizeList[_eq];
|
|
|
item.isSuppled=$(this).val();
|
|
|
}).on("change", ".sku-input-control",function(){
|
|
|
var data=$(this).data();
|
|
|
var inputVal = $(this).val();
|
|
|
var item=g.__rows[data.index].goodsSizeList[data.eq];
|
|
|
|
|
|
if (!data.key) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
data.key = data.key.split('.');
|
|
|
data.key.forEach(function(val, index) {
|
|
|
if (data.key[index + 1]) {
|
|
|
item[val] = item[val] || {};
|
|
|
item = item[val];
|
|
|
} else {
|
|
|
item[val] = inputVal;
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
$(document).on("change",".w-goods-text",function(){
|
|
|
var item=g.__rows[$(this).data("index")];
|
...
|
...
|
@@ -703,7 +765,7 @@ $(document).on("click","#btnReview",function(){ |
|
|
|
|
|
if(e.validate()){
|
|
|
common.dialog.confirm("温馨提示","<p>你确定提交吗?</p>",function(){
|
|
|
|
|
|
|
|
|
common.util.__disButton.call($this);
|
|
|
|
|
|
e.submit($("#basicForm").attr("action"),function(option){
|
...
|
...
|
@@ -713,29 +775,52 @@ $(document).on("click","#btnReview",function(){ |
|
|
// option.data.isAuditing=200;
|
|
|
option.data.supplierId=common.util.__input("supplierId")?$("#supplierId").val():"0";
|
|
|
option.data.shopId=common.util.__input("shopId")?$("#shopId").val():"0";
|
|
|
|
|
|
|
|
|
option.data.productSkn=ACTION?RESPONSEDATA.productSkn:"";
|
|
|
option.data.maxSortId=select[0]?select[0].id:"";
|
|
|
option.data.middleSortId=select[1]?select[1].id:"";
|
|
|
option.data.smallSortId=select[2]?select[2].id:"";
|
|
|
option.data.sortId=select[3]?select[3].id:"";
|
|
|
|
|
|
|
|
|
option.data.isVip=option.data.isVip||'B';
|
|
|
option.data.isOutLets=option.data.isOutLets||'N';
|
|
|
|
|
|
|
|
|
// option.data.shopId=$("#shopId").val();
|
|
|
option.data.brandId=$("#brandId").val();
|
|
|
|
|
|
option.data.isAuditing=RESPONSEDATA.isAuditing?RESPONSEDATA.isAuditing:"";
|
|
|
|
|
|
option.data.seasons=option.data.seasons?option.data.seasons.replace(/\|/g,','):"";
|
|
|
|
|
|
option.data.isBonded = +_sellType === 6 ? 'Y' : 'N';
|
|
|
|
|
|
$('.skn-input-control').each(function() {
|
|
|
var key = $(this).data('key');
|
|
|
var item = option.data;
|
|
|
var keys, inputVal;
|
|
|
|
|
|
if (key) {
|
|
|
inputVal = $(this).val();
|
|
|
keys = key.split('.');
|
|
|
keys.forEach(function(val, index) {
|
|
|
if (keys[index + 1]) {
|
|
|
item[val] = item[val] || {};
|
|
|
item = item[val];
|
|
|
} else {
|
|
|
item[val] = inputVal;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
//expectShelfTime
|
|
|
// option.data=new Date(expectShelfTime).getTime();
|
|
|
$.each(g.__rows,function(index,item){
|
|
|
$.each(item.goodsSizeList ,function(i,sku){
|
|
|
sku.salePrice = $.trim(sku.salePrice);
|
|
|
delete sku.isBonded;
|
|
|
delete sku._rowHead;
|
|
|
sku.salePrice = $.trim(sku.salePrice);
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
|
|
|
option.data.baseGoodInfoStr=JSON.stringify(g.__rows);
|
|
|
|
...
|
...
|
@@ -767,7 +852,7 @@ $(document).on("click","#btnReview",function(){ |
|
|
parameterMakeId:ag.rows[i].id
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -791,6 +876,6 @@ $(document).on("click","#btnReview",function(){ |
|
|
});
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
return false;
|
|
|
}); |
...
|
...
|
|