Authored by weiqingting

基础商品非销售模块

... ... @@ -74,8 +74,12 @@ var ag=new common.grid({
return common.util.__template2($("#template3").html(),item);
}},
{display:"备注",name:"remark"}
]
],
complete:function(){
ag.__edit.init();
}
});
ag.__edit=new common.edit("#attributeTable");
var SORTDATA={
... ... @@ -86,7 +90,7 @@ var SORTDATA={
{id:RESPONSEDATA.sortId,sortName:RESPONSEDATA.sortName}
],
otherParam:function(){
return {brandId:$("#brandId").val()}//$("#brandId").val()
return {brandId:928}//$("#brandId").val()
},
complete:function(data){
if(data.length>2){
... ... @@ -98,7 +102,7 @@ var SORTDATA={
common.util.__ajax({
url:'/base/goods/queryAllProductAttr',
data:{
categoryId:$("#brandId").val(),
categoryId:sorid,
displayPosition:1
}
},function(res){
... ... @@ -115,7 +119,7 @@ var SORTDATA={
var tabTree=new common.tabTree("#tree",SORTDATA);
tabTree.init(SORTDATA.datas);
tabTree.isfeeze=true;
// tabTree.isfeeze=true;
var ENUM={
/*
... ... @@ -264,8 +268,8 @@ $(document).on("change","#brandId",function(){
var id=$(this).val();
Bll.productNameArr[0]=$(this).find("option[value='"+id+"']").text();
Bll.setProductName();
tabTree.isfeeze=false;
tabTree.init([{id:"",sortName:""},{id:"",sortName:""},{id:"",sortName:""},{id:"",sortName:""}]);
// tabTree.isfeeze=false;
// tabTree.init([{id:"",sortName:""},{id:"",sortName:""},{id:"",sortName:""},{id:"",sortName:""}]);
});
$(document).on("change",":radio[name=gender]",function(){
Bll.productNameArr[1]=["男","女","通用"][+$(this).val()-1];
... ... @@ -364,6 +368,16 @@ $(document).on("change",":checkbox[name=ageLevel]",function(){
});
$("#ageLevel").val(arr.join('|'));
});
$(document).on("change",".attr_input",function(){
var item=ag.rows[$(this).data("index")];
item.val=$(this).val();
});
$(document).on("change",".attr_checkobx_class",function(){
var item=ag.rows[$(this).data("index")];
item.val=$("#attr_"+$(this).data("index")).val();
})
var e=new common.edit("#basicInfo");
e.on("validate",function(){
return g.__e.validate();
... ... @@ -412,6 +426,8 @@ e.on("validate",function(){
//
$(document).on("click","#btnReview",function(){
console.log(ag.rows);
if(e.validate()){
common.dialog.confirm("温馨提示","<p>若是JIT商品,请务必选择供应商!</p><p>你确定提交吗?</p>",function(){
... ... @@ -436,6 +452,20 @@ $(document).on("click","#btnReview",function(){
// option.data=new Date(expectShelfTime).getTime();
option.data.baseGoodInfoStr=JSON.stringify(g.__rows);
option.data.productStandardRelationStr=[];
if(ag.rows.length>0){
for(var i in ag.rows){
if(ag.rows[i]){
option.data.productStandardRelationStr.push({
standardId:ag.rows[i].attributeId,
standardVal:ag.rows[i].val
});
}
}
}
option.data.productStandardRelationStr=JSON.stringify(option.data.productStandardRelationStr);
// option.debug=true;
console.log(option.data);
option.success=function(res){
... ...
... ... @@ -158,12 +158,14 @@ tabTree.prototype= {
}
}
_param.param=_param.sortId;
console.log(_param.param);
g.getAjax(_param)
},
getAjax: function(param) {
var g = this,
p = this.options;
console.log("参数",param);
var ajaxOptions = {
type: "POST",
url: "/goods/query/querySortBySmallSort",
... ... @@ -173,7 +175,11 @@ tabTree.prototype= {
g.dom["cityshow"].html("加载中...")
},
success: function(items) {
console.log("返回值",items);
items=items.data;
g.dom["cityshow"].html("");
g.records.length = 0;
g.rows.length = 0;
... ...
... ... @@ -14,7 +14,10 @@ var config = {
apiKey: 'sd4H1ecAqlp',
//http://192.168.102.214:8088/platform
// domain: 'http://172.16.6.240:8088/platform',
domain: 'http://192.168.102.202:8088/platform',
domain:'http://172.16.6.240:8088/platform',
// domain: 'http://172.16.6.252:9080',//陈超
// domain:'http://172.16.6.227:8088/platform',//玛丽
// domain: 'http://192.168.102.202:8088/platform',
loggers: {
api: {
level: 'verbose',
... ...
... ... @@ -118,7 +118,8 @@ exports.res = [
{name:'maxSortId',type:'Number'},
{name:'middleSortId',type:'Number'},
{name:'smallSortId',type:'Number'}
{name:'smallSortId',type:'Number'},
{name:'productStandardRelationStr',type:'String'}
]
},
{//修改页面
... ... @@ -183,7 +184,8 @@ exports.res = [
{name:'isVip',type:'String'},
{name:'vipSetting',type:'String'},
{name:'stock',type:'Number'},
{name:'isAuditing',type:'Number'}
{name:'isAuditing',type:'Number'},
{name:'productStandardRelationStr',type:'String'}
]
},
// {
... ...
... ... @@ -357,21 +357,21 @@
[[if inputType=='checkbox']]
[[each attributeValues as item index ]]
<label class="radio-inline">
<input type="checkbox" name="attr_[[__index]]" value="[[item.name]]">[[item.name]]</label>
<input type="checkbox" name="attr_[[__index]]" data-index=[[__index]] class="attr_checkobx_class" value="[[item.name]]">[[item.name]]</label>
[[/each]]
<input type="hidden" id="attr_[[__index]]" [[required]] for="checkbox"/>
<input type="hidden" id="attr_[[__index]]" [[required]] for="checkbox"/>
[[/if]]
[[if inputType=='radio']]
[[each attributeValues as item index ]]
<label class="radio-inline">
<input type="radio" name="attr_[[__index]]" value="">[[item.name]]</label>
<input type="radio" name="attr_[[__index]]" data-index=[[__index]] class="attr_input" value="">[[item.name]]</label>
[[/each]]
<input type="hidden" id="attr_[[__index]]" [[required]] for="checkbox"/>
<input type="hidden" id="attr_[[__index]]" data-index='[[__index]]' [[required]] for="checkbox"/>
[[/if]]
[[if inputType=='select']]
<select class="form-control" [[required]]>
<select class="form-control attr_input" data-index='[[__index]]' [[required]]>
[[each attributeValues as item index ]]
<option>[[item.name]]</option>
[[/each]]
... ... @@ -379,10 +379,10 @@
[[/if]]
[[if inputType=='text']]
<input type="text" class="form-control" [[required]] maxlength='[[maxValueLen]]'/>
<input type="text" class="form-control attr_input" data-index='[[__index]]' [[required]] maxlength='[[maxValueLen]]'/>
[[/if]]
[[if inputType=='textarea']]
<textarea class="form-control" [[required]] maxlength='[[maxValueLen]]'></textarea>
<textarea class="form-control attr_input" data-index='[[__index]]' [[required]] maxlength='[[maxValueLen]]'></textarea>
[[/if]]
</div>
</script>
\ No newline at end of file
... ...