Edit.js 999 Bytes
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;
});