|
@@ -1,37 +1,69 @@
|
|
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
- $(document).on("click", ".btn-aaaa", function () {
|
|
|
-
|
|
|
-
|
|
|
- var c_id=$(this).attr('data-title');
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $(document).on("click", ".btn-dell", function () {
|
|
|
+ var colorid = $(this).attr('data-title')
|
|
|
+
|
|
|
+ layer.confirm('确定删除吗?', {btn: ['是','否'] },
|
|
|
+ function () {
|
|
|
+ Fast.api.ajax({
|
|
|
+ url: 'commodity/commodity/delcolor',
|
|
|
+ data: {colorid: colorid},
|
|
|
+ type: "POST"
|
|
|
+ , success: function (data, ret) {
|
|
|
+
|
|
|
+ layer.msg(ret.msg)
|
|
|
+ location.replace(location.href);
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ error: function (data, ret) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
+ });
|
|
|
+ $(document).on("click", ".btn-addd", function () {
|
|
|
+ var p_id = $(this).attr('data-title')
|
|
|
var msg = "配置添加";
|
|
|
var options = {
|
|
|
shadeClose: false,
|
|
|
shade: [0.3, '#393D49'],
|
|
|
callback:function(value){
|
|
|
- loaction.href="commodity/commodity/index"
|
|
|
+ $(".btn-refresh").trigger('click')
|
|
|
}
|
|
|
};
|
|
|
- Fast.api.open('commodity/commodity/addparameter?c_id='+c_id,msg,options);
|
|
|
+ Fast.api.open('commodity/commodity/addcolor?p_id='+p_id,msg,options);
|
|
|
+
|
|
|
});
|
|
|
- $(document).on("click", ".btn-del", function () {
|
|
|
+ $(document).on("click", ".btn-editt", function () {
|
|
|
var colorid = $(this).attr('data-title')
|
|
|
- layer.confirm('确定删除吗?', {btn: ['是','否'] })
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ var msg = "配置添加";
|
|
|
+ var options = {
|
|
|
+ shadeClose: false,
|
|
|
+ shade: [0.3, '#393D49'],
|
|
|
+ callback:function(value){
|
|
|
+ $(".btn-refresh").trigger('click')
|
|
|
+ }
|
|
|
+ };
|
|
|
+ Fast.api.open('commodity/commodity/editcolor?colorid='+colorid,msg,options);
|
|
|
});
|
|
|
Form.api.bindevent($("form[role=form]"), function(data, ret){
|
|
|
|
|
|
-
|
|
|
+ Fast.api.close(data);
|
|
|
Toastr.success("成功");
|
|
|
}, function(data, ret){
|
|
|
Toastr.success("失败");
|
|
@@ -78,7 +110,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
icon: 'fa fa-list',
|
|
|
url: "commodity/commodity/commodityInfo",
|
|
|
callback: function (data) {
|
|
|
- Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
|
|
|
+ $(".btn-refresh").trigger('click')
|
|
|
},
|
|
|
visible: function (row) {
|
|
|
|
|
@@ -116,7 +148,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
bindevent: function () {
|
|
|
Form.api.bindevent($("form[role=form]"));
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
};
|
|
|
return Controller;
|
|
|
});
|