|
@@ -70,46 +70,51 @@ $(function () {
|
70
|
70
|
JSON.stringify(res.data.requester)
|
71
|
71
|
);
|
72
|
72
|
//判断版本类别
|
73
|
|
- $.ajax({
|
|
73
|
+ // ----------------------start--------------------
|
|
74
|
+ //报修主体
|
|
75
|
+ var promise1 = $.ajax({
|
74
|
76
|
type: "POST",
|
75
|
77
|
contentType: "application/json;charset=UTF-8",
|
76
|
78
|
url: baseUrl + "sysinfo/data/fetchDataList/systemConfiguration",
|
77
|
|
- data: JSON.stringify({ idx: 0, sum: 1000 }),
|
78
|
|
- success: function (result) {
|
79
|
|
- if (result.status == 200) {
|
80
|
|
- var list = result.list;
|
81
|
|
- list.forEach((v) => {
|
82
|
|
- switch (v.keyconfig) {
|
83
|
|
- case "repairMain": //报修主体
|
84
|
|
- sessionStorage.setItem("repair_main", JSON.stringify(v));
|
85
|
|
- break;
|
86
|
|
- case "wxIncidentWithCmdb": //是否绑定资产
|
87
|
|
- sessionStorage.setItem(
|
88
|
|
- "wxIncidentWithCmdb",
|
89
|
|
- v.valueconfig
|
90
|
|
- );
|
91
|
|
- break;
|
92
|
|
- case "reqHasCategory": //获取是否自动建单
|
93
|
|
- sessionStorage.setItem(
|
94
|
|
- "reqHasCategory",
|
95
|
|
- JSON.stringify(v)
|
96
|
|
- );
|
97
|
|
- break;
|
98
|
|
- case "ifRoom": //是否增加房间号选择
|
99
|
|
- sessionStorage.setItem("ifRoom", v.valueconfig);
|
100
|
|
- break;
|
101
|
|
- }
|
102
|
|
- });
|
|
79
|
+ data: JSON.stringify({ idx: 0, sum: 1, systemConfiguration: {keyconfig: 'repairMain'} }),
|
|
80
|
+ });
|
|
81
|
+ //是否绑定资产
|
|
82
|
+ var promise2 = $.ajax({
|
|
83
|
+ type: "POST",
|
|
84
|
+ contentType: "application/json;charset=UTF-8",
|
|
85
|
+ url: baseUrl + "sysinfo/data/fetchDataList/systemConfiguration",
|
|
86
|
+ data: JSON.stringify({ idx: 0, sum: 1, systemConfiguration: {keyconfig: 'wxIncidentWithCmdb'} }),
|
|
87
|
+ });
|
|
88
|
+ //获取是否自动建单
|
|
89
|
+ var promise3 = $.ajax({
|
|
90
|
+ type: "POST",
|
|
91
|
+ contentType: "application/json;charset=UTF-8",
|
|
92
|
+ url: baseUrl + "sysinfo/data/fetchDataList/systemConfiguration",
|
|
93
|
+ data: JSON.stringify({ idx: 0, sum: 1, systemConfiguration: {keyconfig: 'reqHasCategory'} }),
|
|
94
|
+ });
|
|
95
|
+ //是否增加房间号选择
|
|
96
|
+ var promise4 = $.ajax({
|
|
97
|
+ type: "POST",
|
|
98
|
+ contentType: "application/json;charset=UTF-8",
|
|
99
|
+ url: baseUrl + "sysinfo/data/fetchDataList/systemConfiguration",
|
|
100
|
+ data: JSON.stringify({ idx: 0, sum: 1, systemConfiguration: {keyconfig: 'ifRoom'} }),
|
|
101
|
+ });
|
|
102
|
+
|
|
103
|
+ $.when($.all([promise1, promise2, promise3, promise4])).then(function(data1, data2, data3, data4){
|
|
104
|
+ console.log(data1, data2, data3, data4);
|
|
105
|
+ if(data1 && data2 && data3 && data4){
|
|
106
|
+ sessionStorage.setItem("repair_main", JSON.stringify(data1));
|
|
107
|
+ sessionStorage.setItem("wxIncidentWithCmdb", data2.valueconfig);
|
|
108
|
+ sessionStorage.setItem("reqHasCategory", JSON.stringify(data3));
|
|
109
|
+ sessionStorage.setItem("ifRoom", data4.valueconfig);
|
|
110
|
+ hasClick = false;
|
103
|
111
|
window.location.href = "index.html";
|
104
|
112
|
}
|
|
113
|
+ }).catch(function(){
|
105
|
114
|
hasClick = false;
|
106
|
|
- },
|
107
|
|
- //请求失败,包含具体的错误信息
|
108
|
|
- error: function (e) {
|
109
|
|
- console.log(e.status);
|
110
|
|
- console.log(e.responseText);
|
111
|
|
- },
|
|
115
|
+ console.log('Some request failed...');
|
112
|
116
|
});
|
|
117
|
+ // ----------------------end--------------------
|
113
|
118
|
} else if(res.state == 501) {
|
114
|
119
|
window.location.href = "index.html";
|
115
|
120
|
hasClick = false;
|