Authored by weiqingting

基础商品修改

... ... @@ -29,10 +29,14 @@ function batchExport(el, type) {
__type: "batch-import"
},
onStart: function(params) {
params.brandId=common.util.__input("brandId");
params.shopId=common.util.__input("shopId");
params.supplierId=common.util.__input("supplierId");
params.brandName=params.brandId?$("#brandId").find("option[value="+$("#brandId").val()+"]").text():"";
params.shopsName=params.shopId?$("#shopId").find("option[value="+$("#shopId").val()+"]").text():"";
params.supplierName=params.supplierId?$("#supplierId").find("option[value="+$("#supplierId").val()+"]").text():"";
console.log("params",params);
loadModal = common.dialog.load();
... ...
... ... @@ -68,7 +68,15 @@ var Bll={
var ag=new common.grid({
el:"#attributeTable",
columns:[
{display:"名称",name:"attributeName"},
{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('');
}},
{display:"属性",render:function(item){
item.required=item.isMust=="Y"?"required":"";
// item.attributeValues=item.attributeValues.split(',').map(function(elem, index, arr){
... ... @@ -403,14 +411,15 @@ e.on("validate",function(){
return "请选择完整的分类目录";
});
e.on("validate",function(){
console.log(g.__gsm);
if(g.__rows.length==0){
return "请添加销售属性";
}
var map={},map2={},_count=0,_count1=0;
var map={},map2={},map3=[],_count=0,_count1=0;
if(g.__rows.length>0){
$.each(g.__rows,function(index,item){
var gname= item.factoryGoodsName;
$.each(item.goodsSizeList,function(index,item1){
$.each(item.goodsSizeList,function(index1,item1){
var key=gname+"_"+item1.sizeId;
if(map.hasOwnProperty(key)){
_count++;
... ... @@ -421,6 +430,10 @@ e.on("validate",function(){
_count1++;
}
map2[item1.barCode]="";
if(g.__gsm[index]&&index1<g.__gsm[index]){
return;
}
map3.push(item1.barCode);
});
});
}
... ... @@ -429,6 +442,20 @@ e.on("validate",function(){
}
if(_count1>0){
return "商品条码不能重复";
}else{
if(map3.length>0){
var ispass=true;
common.util.__ajax2({
url:'/goods/base/checkSkuBarCodeExist',
async:false,
data:{barCode:map3.join(',')}
},function(res){
if(res.data.length){
ispass="商品条码"+res.data.join(',')+"已经存在";
}
},true);
return ispass;
}
}
});
e.on("validate",function(){
... ...
... ... @@ -14,13 +14,13 @@ var config = {
apiKey: 'sd4H1ecAqlp',
//http: //192.168.102.214:8088/platform
// domain: 'http://172.16.6.240:8088/platform',
// domain:'http://172.16.6.240:8088/platform',//王书生
domain:'http://172.16.6.240:8088/platform',//王书生
// domain: 'http://172.16.6.124:8088/platform',//陈超
//http://172.16.6.124:8088/platform/product/queryAllProductAttr
//domain: 'http://172.16.6.227:8088/platform', //玛丽
// domain: 'http://192.168.102.202:8088/platform',
//domain:'http://172.16.9.8:8080/yohobuy-platform-web',//葛超
domain: 'http://192.168.102.202:8088/platform',
// domain: 'http://192.168.102.202:8088/platform',
//domain: 'http://172.16.6.239:8080', //孙杰翔
loggers: {
api: {
... ...
... ... @@ -313,4 +313,12 @@ exports.res = [
domain: exports.domain
}
},
{
route:'/goods/base/checkSkuBarCodeExist',
method:'POST',
url:'/product/checkSkuBarCodeExist',
params:[
{name:"barCode",type:"String"}
]
}
];
\ No newline at end of file
... ...