Authored by mali

品牌条码

... ... @@ -128,4 +128,6 @@ module.exports=function(app) {
app.post("/product/queryProductInfoBySkns","basegoods_queryProductInfoBySkns");
app.post("/product/searchProductDetail","basegoods_searchProductDetail");
app.post("/product/checkNationalCodeExist","basegoods_checkNationalCodeExist");
}
\ No newline at end of file
... ...
... ... @@ -29,7 +29,8 @@ module.exports={
{name:'skuFactoryCode',type:'String'},
{name:'appType',type:'Number'},
{name: 'goodsYears', type: 'Number'},
{name: 'goodsSeason', type: 'Number'}
{name: 'goodsSeason', type: 'Number'},
{name: 'nationalCode', type: 'String'}
]
},
getBaseProductList:{
... ... @@ -60,7 +61,8 @@ module.exports={
{name:'skuFactoryCode',type:'String'},
{name: 'appType', type: 'Number'},
{name: 'goodsYears', type: 'Number'},
{name: 'goodsSeason', type: 'Number'}
{name: 'goodsSeason', type: 'Number'},
{name: 'nationalCode', type: 'String'}
]
},
addBaseProduct:{
... ... @@ -248,6 +250,13 @@ module.exports={
{name: "order",type:"String"},
{name: "shopId",type:"String"}
]
},
checkNationalCodeExist : {
title: '校验品牌条码唯一性',
url: '/product/checkNationalCodeExist',
params:[
{name: "nationalCode",type:"String"}
]
}
}
}
\ No newline at end of file
... ...
... ... @@ -52,17 +52,20 @@
[[each goodsSizeList as item __index]]
<div class="form-group">
<!-- <label class="col-sm-1 red">*</label> -->
<div class="col-sm-2">
<div class="col-sm-1">
<select id="sizeName" class="form-control btn-sort-chima" data-index=[[index]] data-eq=[[__index]] value='[[item.sizeId]]' required placeholder="尺码">
<option value="[[item.sizeId||'-1']]">[[item.sizeName||'选择尺码']]</option>
</select>
</div>
<div class="col-sm-2">
<div class="col-sm-1">
<input class="form-control btn-sort-xiaoshou" value="[[item.salePrice]]" placeholder="默认销售价" data-index=[[index]] data-eq=[[__index]] required match="numbers" type="text"></input>
</div>
<div class="col-sm-2">
<input class="form-control btn-sort-tiaoma" value="[[item.factoryCode]]" placeholder="条码" data-index=[[index]] data-eq=[[__index]]></input>
</div>
<div class="col-sm-2">
<input class="form-control btn-sort-nationalCode" value="[[item.nationalCode]]" placeholder="品牌条码" data-index=[[index]] data-eq=[[__index]]></input>
</div>
<div class="col-sm-1">
<select class="form-control btn-sort-kebu" value="[[item.isSuppled||'Y']]" data-index=[[index]] data-eq=[[__index]]>
<option value="N">不可补货</option>
... ...
... ... @@ -93,7 +93,9 @@
<option value="6">秋冬</option>
</select>
</div>
<div class="panel-col">
<input type="text" id="nationalCode" class="form-control" placeholder="品牌条码" style="height: 39px;"/>
</div>
<div class="panel-col">
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="all-btn" href="" class="btn btn-info">全部</a>
... ...
... ... @@ -105,6 +105,7 @@
<th>销售价</th>
<th>款型编码</th>
<th>条码</th>
<th>品牌条码</th>
<th>厂家颜色</th>
<th>能否补货</th>
<th>支付尾款时间</th>
... ... @@ -125,6 +126,7 @@
<th>[[_item.salePrice]]</th>
<th>[[item.factoryCode]]</th>
<th>[[_item.factoryCode]]</th>
<th>[[_item.nationalCode]]</th>
<th>[[item.factoryGoodsName]]</th>
[[if _item.isSuppled=="Y"]]
<th></th>
... ...
... ... @@ -229,7 +229,7 @@ var g=new common.grid({
}
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-2'>尺码</div><div class='col-sm-2'>销售价</div><div class='col-sm-2'>条码</div><div class='col-sm-1'>是否补货</div><div class='col-sm-2'>UPC条码</div><div class='col-sm-2'>支付尾款时间</div></div></div>");
html.push("<div class='rows'><div class='form-group' style='padding-bottom: 0'><div class='col-sm-1'>尺码</div><div class='col-sm-1'>销售价</div><div class='col-sm-2'>条码</div><div class='col-sm-2'>品牌条码</div><div class='col-sm-1'>是否补货</div><div class='col-sm-2'>UPC条码</div><div class='col-sm-2'>支付尾款时间</div></div></div>");
html.push('<div class="rows" id="rows__'+item.__index+'">');
item.goodsSizeList=item.goodsSizeList||[$.extend({},ENUM.goodsSizeList)];
html.push(common.util.__template2($("#template").html(),{index:item.__index,goodsSizeList:item.goodsSizeList}));
... ... @@ -475,6 +475,12 @@ $(document).on("change",".colorSelect",function(){
item.colorId=$(this).val();
item.goodsName=this.options[this.selectedIndex].text;
});
$(document).on("change",".btn-sort-nationalCode",function(){
var _index=$(this).data("index");
var _eq=$(this).data("eq");
var item=g.__rows[_index].goodsSizeList[_eq];
item.nationalCode=$(this).val();
});
// $(document).on("change",":checkbox[name=ageLevel]",function(){
// var value=$(this).val();
// var c=$(":checkbox[name=ageLevel]");
... ... @@ -548,7 +554,6 @@ e.on("validate",function(){
map[gname+"_"+item1.sizeId]="";
map3.push({'productSku': item1.productSku, 'factoryCode':item1.factoryCode});
});
});
}
... ... @@ -591,6 +596,38 @@ e.on("validate",function(){
return ispass;
}
});
e.on("validate", function(){
if(g.__rows.length==0){
return "请添加销售属性";
}
var nationalCodeMap = [];
if(g.__rows.length>0) {
$.each(g.__rows,function(index,item){
$.each(item.goodsSizeList,function(index1,item1){
nationalCodeMap.push({'productSku' : item1.productSku, 'nationalCode' : item1.nationalCode});
});
});
}
// 校验品牌条码唯一性
if(nationalCodeMap.length>0){
nationalCodeMap = nationalCodeMap.filter(function(item){
return $.trim(item.nationalCode)?true:false;
});
var ispass=true;
common.util.__ajax2({
url:'/product/checkNationalCodeExist',
async:false,
data:{nationalCode: JSON.stringify(nationalCodeMap)}
},function(res){
if(res.data.length){
ispass = "品牌条码 "+res.data.join(',')+" 已存在";
}
},true);
return ispass;
}
});
e.on("validate",function(){
if((+$("#salesPriceStr").val())>(+$("#retailPriceStr").val())){
return "销售价应该限定小于等于吊牌价";
... ...
... ... @@ -230,7 +230,8 @@ var g = new common.grid({
skuFactoryCode: common.util.__input("skuFactoryCode"),
appType: common.util.__input("appType"),
goodsYears: common.util.__input("goodsYears"),
goodsSeason: common.util.__input("goodsSeason")
goodsSeason: common.util.__input("goodsSeason"),
nationalCode: common.util.__input("nationalCode")
};
},
columns: [{
... ...