Authored by weiqingting

基础商品bug修改

... ... @@ -14,6 +14,7 @@ if(param){
RESPONSEDATA=res.data;
},true);
}
RESPONSEDATA.ENUMYEAR=(function(){
var _y=[];
for(var i=2005;i<(new Date).getFullYear()+10;i++){
... ... @@ -46,15 +47,34 @@ var Bll={
}
return id;
},
IsEnter:false,
productNameArr:['','',''],
setProductName:function(){
if(!param){
if(!Bll.IsEnter){
$("#productName").val(Bll.productNameArr.join(""));
}
}
}
}
}
//attributeTable
var ag=new common.grid({
el:"#attributeTable",
columns:[
{display:"名称",name:"attributeName"},
{display:"属性",render:function(item){
item.required=item.isMust=="Y"?"required":"";
item.attributeValues=item.attributeValues.split(',').map(function(elem, index, arr){
return {name:elem}
});
// item.attributeValues={name:};
return common.util.__template2($("#template3").html(),item);
}},
{display:"备注",name:"remark"}
]
});
var SORTDATA={
... ... @@ -74,11 +94,12 @@ var SORTDATA={
common.util.__ajax({
url:'/base/goods/queryAllProductAttr',
data:{
categoryId:454,
categoryId:sorid,
displayPosition:1
}
},function(res){
console.log(res);
ag.init(res.data);
},true);
}
... ... @@ -110,56 +131,49 @@ var ENUM={
}
/*下拉选择*/
new common.dropDown({el:"#brandId",ajax:"queryBrand"});
new common.dropDown({el:"#shopId",ajax:"sortbybrand",param:function(){
return {brandId:$("#brandId").val()}
}});
new common.dropDown({el:"#supplierId",ajax:"querySupplier"});
var e=new common.edit("#basicInfo");
e.init();
if(RESPONSEDATA.isAuditing!=200){
new common.dropDown({el:"#brandId",ajax:"queryBrand"});
new common.dropDown({el:"#shopId",ajax:"sortbybrand",params:function(){
return {brandId:$("#brandId").val()}
}});
new common.dropDown({el:"#supplierId",ajax:"getjitSup",params:function(){
return {brandId:$("#brandId").val()}
}});
}else{
tabTree.isfeeze=true;
}
//attributeTable
var ag=new common.grid({
el:"#attributeTable",
columns:[
{display:"名称",name:"attributeName"},
{display:"属性",render:function(item){
item.required=item.isMust=="Y"?"required":"";
item.attributeValues=item.attributeValues.split(',').map(function(elem, index, arr){
return {name:elem}
});
// item.attributeValues={name:};
return common.util.__template2($("#template3").html(),item);
}},
{display:"备注",name:"remark"}
]
});
ag.init([{
attributeId: 15,
attributeName: "防风外套属性",
attributeType: 2,
attributeValues: "11,22",
belong: 1,
categoryId: 454,
createTime: 1453951139,
displayPosition: 1,
inputType: "checkbox",
isAllowAlias: "Y",
isColor: "N",
isMust: "Y",
isSearch: "Y",
maxValueLen: 50,
orderBy: 0,
remark: "备注",
saleType: 0,
state: 0
}]);
// ag.init([{
// attributeId: 15,
// attributeName: "防风外套属性",
// attributeType: 2,
// attributeValues: "11,22",
// belong: 1,
// categoryId: 454,
// createTime: 1453951139,
// displayPosition: 1,
// inputType: "checkbox",
// isAllowAlias: "Y",
// isColor: "N",
// isMust: "Y",
// isSearch: "Y",
// maxValueLen: 50,
// orderBy: 0,
// remark: "备注",
// saleType: 0,
// state: 0
// }]);
//baseTable
... ... @@ -239,6 +253,9 @@ $(document).on("click",".sortadd",function(){
// g.__e.init();
}
});
$(document).on("keydown","#productName",function(){
Bll.IsEnter=true;
});
$(document).on("change","#brandId",function(){
var id=$(this).val();
Bll.productNameArr[0]=$(this).find("option[value='"+id+"']").text();
... ... @@ -250,6 +267,13 @@ $(document).on("change",":radio[name=gender]",function(){
});
$(document).on("change",":radio[name=isAdvance]",function(){
g.reload();
if($(this).val()=="Y"){
$("#expectArrivalTimeStr").attr("required","required");
$("#expectArrivalTimeStrTxt").html("预计到货时间<span class='red'>*</span>");
}else{
$("#expectArrivalTimeStr").removeAttr("required");
$("#expectArrivalTimeStrTxt").html("预计到货时间");
}
});
$(document).on("click",".sortdelete",function(){
... ... @@ -319,12 +343,13 @@ $(document).on("change",".w-goods-text",function(){
});
$(document).on("change",":checkbox[name=ageLevel]",function(){
var value=$(this).val();
var c=$(":checkbox[name=ageLevel]");
if($(this).is(":checked")){
if(value==1){
$(":checkbox[name=ageLevel]").eq(1).prop("checked",false);
$(":checkbox[name=ageLevel]").eq(2).prop("checked",false);
c.eq(1).prop("checked",false);
c.eq(2).prop("checked",false);
}else{
$(":checkbox[name=ageLevel]").eq(0).prop("checked",false);
c.eq(0).prop("checked",false);
}
}
var arr=[];
... ... @@ -348,7 +373,7 @@ e.on("validate",function(){
if(g.__rows.length==0){
return "请添加销售属性";
}
var map={},_count=0;
var map={},map2={},_count=0,_count1=0;
if(g.__rows.length>0){
$.each(g.__rows,function(index,item){
var gname= item.factoryGoodsName;
... ... @@ -359,12 +384,19 @@ e.on("validate",function(){
return;
}
map[gname+"_"+item1.sizeId]="";
if(map2.hasOwnProperty(item1.barCode)){
_count1++;
}
map2[item1.barCode]="";
});
});
}
if(_count>0){
return "同一颜色包含两组相同尺码";
}
if(_count1>0&&common.util.__input("supplierId")){
return "JIT商品条码不能重复";
}
});
e.on("validate",function(){
if((+$("#salesPriceStr").val())>(+$("#retailPriceStr").val())){
... ...
... ... @@ -15,8 +15,9 @@ var urlObj = {
'maxSort': '/goods/query/maxSort',//查询一级类目列表接口
'shopsRest': '/ShopsRest/getShopsByName', // 店铺列表
'xiangouID': '/limit/xiangouID/selectActivityListForSelect', //限购ID
'sortsize2':'/erpproduct/sortsize/ajax/querySizeListBySortId',//尺码
'sortsize2':'/erpproduct/sortsize/ajax/querySizeListBySortId4Html',//尺码
'sortbybrand':'/goods/query/queryShopsByBrandId',
'getjitSup':'/goods/query/getJitSupplierByBrandld',
'sortlist': '/product/class/queryAllProductSortList',
'productPool': '/runManage/subjectManage/queryBaseProductPoolListByName',
... ...
... ... @@ -61,13 +61,17 @@ tabTree.prototype= {
if (p.columns.length < p.datas.length) {
return
}
g.isfeeze=false;
g.renderHeader();
g.setEvent()
g.setEvent();
},
setEvent: function() {
var g = this,
p = this.options;
g.dom["cityboxbtn"].click(function(event) {
if(g.isfeeze){
return false;
}
g.dom["cityboxbtn"].addClass("select");
g.dom["citybox"].show().css("top", (g.inputHeight-10) + "px");
g.dom["chooseArea"].children("p").each(function() {
... ...
... ... @@ -13,7 +13,7 @@ var config = {
redis: null,
apiKey: 'sd4H1ecAqlp',
domain: 'http://192.168.102.202:8088/platform',
domain: 'http://192.168.102.214:8088/platform',
loggers: {
api: {
level: 'verbose',
... ...
exports.domain =require('../config/common.js').domain;
// exports.domain = "http://172.16.6.240:8088/platform";
// exports.domain =require('../config/common.js').domain;
exports.domain="http://172.16.6.240:8088/platform";
exports.res = [
{//基础商品列表
route:'/supplier/baseproduct/index',
... ...
exports.domain = require('../config/common.js').domain;
// exports.domain = "http://172.16.6.252:9080";
exports.res = [
//原 supplier
... ... @@ -132,6 +133,14 @@ exports.res = [
params:[
{name:"idName",type:"String"}
]
},{
//获取JIT店铺
route:'/goods/query/getJitSupplierByBrandld',
method:'POST',
url:'/AgreementRest/getJitSupplierByBrandId',
params:[
{name:"brandId",type:"Number"}
]
}
]
\ No newline at end of file
... ...
... ... @@ -63,7 +63,7 @@
<div class="panel-footer">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<a href="javascript:;" class="btn btn-default" onclick="javascript:history.go(-1);">取消</a>
<a class="btn btn-default" href="/supplier/baseproduct/index">取消</a>
<button type="submit" class="btn btn-success mr5" data-loading-text="提交审核中..." id="btnReview">提交审核</button>
</div>
</div>
... ... @@ -98,7 +98,7 @@
</div>
[[if ISXIANGO]]
<div class="col-sm-2">
<input type="text" class="form-control btn-sort-kucun" value="[[item.presaleStorageNum]]" placeholder="预售库存" data-index=[[index]] data-eq=[[__index]]></input>
<input type="text" class="form-control btn-sort-kucun" value="[[item.presaleStorageNum]]" placeholder="预售库存" data-index=[[index]] data-eq=[[__index]] required></input>
</div>
[[/if]]
<div class="col-sm-2">
... ... @@ -333,12 +333,20 @@
<div class="form-group">
<label class="col-sm-2 control-label">预计上架时间<span class="red">*</span></label>
<div class="col-sm-2">
<input type="text" id="expectShelfTimeStr" jsaction="time" value="[[expectShelfTimeStr]]" required class="form-control" readonly="readonly" />
<input type="text" id="expectShelfTimeStr" jsaction="time" value="[[expectShelfTimeStr]]" required class="form-control" readonly="readonly" placeholder="预计上架时间" />
</div>
<label class="col-sm-1 control-label">预计到货时间</label>
[[if isAdvance=='Y']]
<label class="col-sm-1 control-label" id="expectArrivalTimeStrTxt">预计到货时间<span class="red">*</span></label>
<div class="col-sm-2">
<input type="text" id="expectArrivalTimeStr" jsaction="time" value="[[expectArrivalTimeStr]]" class="form-control" readonly="readonly"/>
<input type="text" id="expectArrivalTimeStr" jsaction="time" value="[[expectArrivalTimeStr]]" class="form-control" readonly="readonly" required placeholder="预计到货时间" />
</div>
[[else]]
<label class="col-sm-1 control-label" id="expectArrivalTimeStrTxt">预计到货时间</label>
<div class="col-sm-2">
<input type="text" id="expectArrivalTimeStr" jsaction="time" value="[[expectArrivalTimeStr]]" class="form-control" readonly="readonly" placeholder="预计到货时间" />
</div>
[[/if]]
</div>
</div>
... ...
... ... @@ -42,7 +42,7 @@
<div class="col-sm-3">供应商:[[supplierName]]</div>
</div>
<div class="form-group">
<div class="col-sm-3">品类:[[maxSortName]]/[[middleSorttName]]/[[smallSorttName]]</div>
<div class="col-sm-3">品类:<span> [[maxSortName]]</span><span> [[middleSortName]]</span><span> [[smallSortName]]</span></div>
<div class="col-sm-3">货品年/季:[[goodsYears]] / [[goodsSeason]]</div>
<div class="col-sm-3">厂家编号:[[factoryCode]]</div>
</div>
... ...