initialization.js
1.6 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
define(['jquery', 'bootstrap', 'backend', 'table', 'form', '/assets/addons/kuerp/layui/layui.js'], function ($, undefined, Backend, Table, Form, Layui) {
var Controller = {
index: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
$(document).on("click", ".sub_btn", function(){
if(!document.getElementById("understand").checked){
Toastr.error('请先确认并勾选“我已清楚了解将产生的后果”!');return;
}
$.ajax({
url: "kuerp/initialization/index",
type: "POST",
data:{'type':'initialization'},
success: function(res){
if(res.code==1){
Toastr.success('操作成功');
setTimeout(function () {
top.window.$("ul.nav-addtabs li").find(".fa-remove").click();
parent.location.reload();
},1500)
}else{
Toastr.error('操作失败,请稍后再试!');
}
}
})
});
Form.api.bindevent($("form[role=form]"), function(data, ret){
parent.location.reload();
});
}
}
};
return Controller;
});