config.js
1.68 KB
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
39
40
41
42
define(['jquery', 'bootstrap', 'backend', 'form', 'fastflow-base'], function ($, undefined, Backend, Form, FastflowBase) {
var Controller = {
index: function () {
Form.api.bindevent($("form[role=form]"));
Controller.api.bindBillShowWayEvent();
},
api: {
bindevent: function () {
},
bindBillShowWayEvent: function () {
$('input:radio[name="row[billshowway]"]').on('click', function () {
let val = $('input:radio[name="row[billshowway]"]:checked').val();
var index = layer.load();
$.ajax({
type: "POST",
url: "fastflow/flow/config/handleBillShowWayAjax",
data: {billshowway: val},
dataType: "json",
success: function (data) {
if (data['code'] == 1) {
Toastr.success(data['msg']);
top.window.$(".sidebar-menu").trigger("refresh");
setTimeout(function (e){
FastflowBase.api.renderbadge();
}, 1000 );
}else if (data['code'] == 0) {
Toastr.error(data['msg']);
}
layer.close(index);
},
error: function (e) {
layer.close(index);
}
});
});
}
}
};
return Controller;
});