Edit.js
999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var $ = require('jquery');
var edit = require('../../common/edit');
var e = new edit("#basicForm", {
bucket: "brandLogo"
});
//brandTonality
e.on("validate", function () {
var num = $.trim($("#brandTonality").val());
if (num) {
if (+num > 100 || +num < 1) {
return "调性指数(范围:1-100)";
}
}
return true;
});
e.init();
$(document).on('click','#save_brand',function () {
e.submit($("#basicForm").attr("action"), function (option) {
option.success = function (res) {
if (res.code == "200") {
e.$tip("提交成功", function () {
location.href = "/erpproduct/brands/index"
}, 'growl-success');
} else {
e.$tip(res.message);
}
return false;
},
option.error = function (res) {
e.$tip(res.message);
}
console.log(option.data);
});
return false;
});