...
|
...
|
@@ -24,43 +24,42 @@ exports.init = function() { |
|
|
|
|
|
var item = g.rows[$(this).data("index")];
|
|
|
|
|
|
console.log(item);
|
|
|
// 修改尺码
|
|
|
common.dialog.confirm("修改尺码属性",
|
|
|
common.dialog.confirm("修改尺码",
|
|
|
common.util.__template($("#template").html(), {id: item.id, input: item.sizeName})
|
|
|
, function () {
|
|
|
common.util.__ajax({
|
|
|
url: '/erpproduct/size/updateSize',
|
|
|
data: function () {
|
|
|
|
|
|
|
|
|
if($("#input").val()==""){
|
|
|
return "尺码名不能为空";
|
|
|
}
|
|
|
data: (function () {
|
|
|
|
|
|
var input = $('#input').val();
|
|
|
if (input === '' || $.trim(input) === '') return "尺码名不能为空";
|
|
|
return {
|
|
|
id: item.id,
|
|
|
sizeName: $("#input").val()
|
|
|
}
|
|
|
}
|
|
|
sizeName: input
|
|
|
};
|
|
|
})()
|
|
|
}, function () {
|
|
|
g.reload();
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
// 添加尺码
|
|
|
$('#add').on('click', function () {
|
|
|
|
|
|
common.dialog.confirm("添加尺码属性",
|
|
|
common.dialog.confirm("添加尺码",
|
|
|
common.util.__template($("#template").html(), {id: "", input: ""})
|
|
|
, function () {
|
|
|
common.util.__ajax({
|
|
|
url: '/erpproduct/size/addSize',
|
|
|
data: {
|
|
|
sizeName: $("#input").val()
|
|
|
}
|
|
|
data: (function () {
|
|
|
var input = $('#input').val();
|
|
|
if (input === '' || $.trim(input) === '') return "尺码名不能为空";
|
|
|
return {
|
|
|
sizeName: input
|
|
|
};
|
|
|
})()
|
|
|
}, function () {
|
|
|
g.reload();
|
|
|
});
|
...
|
...
|
|