Authored by uedxwg

产品颜色修改

... ... @@ -11,7 +11,7 @@ $('#save').on('click',function(){
var id =$('#id').val();
var colorName = $('#colorName').val();
var colorCode = $('#colorCode').val();
var colorValue = $('#colorValue').val();
var colorValue = $('#colorValue').attr('value');
if(!id){
__ajax({
url:'/erpproduct/product/saveColor',
... ... @@ -21,6 +21,16 @@ $('#save').on('click',function(){
colorValue: colorValue
}
})
}else{
__ajax({
url:'/erpproduct/size/updatColor',
data:{
id:id,
colorName: colorName,
colorCode: colorCode,
colorValue: colorValue
}
})
}
})
... ... @@ -43,7 +53,7 @@ function __ajax(options,callback){
}
});
setInterval(function(){
history.go(-1);
window.location.href='/erpproduct/color/index';
},1000)
} else {
$.gritter.add({
... ... @@ -53,7 +63,7 @@ function __ajax(options,callback){
time: '1000'
});
setInterval(function(){
history.go(-1);
window.location.href='/erpproduct/color/index';
},1000)
}
}
... ...
... ... @@ -33,4 +33,28 @@ exports.res = [{
{name: 'colorCode', type: 'String'},
{name: 'colorValue', type: 'String'}
]
},{
// 新增颜色
route: '/erpproduct/product/addColor/:param',
method: 'GET',
url:"/productColor/queryProductColor",
view:'pages/product/addColor',
isJsonRaw:true,
params:[
{name:'param',type:'Number'}
],
src:'/product/color'
},{
// 新增尺码
route: '/erpproduct/size/updatColor',
method: 'POST',
url:"/productColor/updateProductColor",
isJsonRaw:true,
params:[
{name: 'id', type: 'Number'},
{name: 'colorName', type: 'String'},
{name: 'colorCode', type: 'String'},
{name: 'colorValue', type: 'String'}
]
}]
... ...
... ... @@ -18,29 +18,29 @@
</div>
</div>
</div>
<div class="contentpanel">
<div class="panel panel-default" style="margin-bottom:10px;">
<div class="container" style="margin-top:10px;">
<div class="row form-horizontal" style="margin-bottom:10px;">
<input type="hidden" id='id' value="{{data.id}}" />
<div class="col-xs-10 col-sm-10 col-md-10 col-lg-10">
<div class="form-group">
<label for="input" class="col-sm-2 control-label">颜色名称:</label>
<div class="col-sm-8">
<input type="text" name="" id="colorName" class="form-control" value="" required="required" pattern="" title="">
<input type="text" name="" id="colorName" class="form-control" value="
{{data.colorCode}}" required="required" pattern="" title="">
</div>
</div>
<div class="form-group">
<label for="input" class="col-sm-2 control-label">颜色代码:</label>
<div class="col-sm-8">
<input type="text" name="" id="colorCode" class="form-control" value="" required="required" pattern="" title="">
<input type="text" name="" id="colorCode" class="form-control" value=" {{data.colorName}}" required="required" pattern="" title="">
</div>
</div>
<div class="form-group">
<label for="input" class="col-sm-2 control-label">颜色值:</label>
<div class="col-sm-8" id="colorUrlBox">
<input type="file" id="colorValue" name="colorValue" value="{{colorValue}}">
<input type="file" id="colorValue" name="colorValue" value="{{data.colorValue}}">
</div>
</div>
<button id="save" type="button" class="col-sm-offset-3 btn btn-info">保存</button>
... ... @@ -48,4 +48,4 @@
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
... ...