|
@@ -2,13 +2,25 @@ $(function () {
|
2
|
2
|
var repairMain = JSON.parse(sessionStorage.getItem("repair_main")); //报修主体
|
3
|
3
|
var reqHasCategory = JSON.parse(sessionStorage.getItem("reqHasCategory")); //自动建单
|
4
|
4
|
var loginUser = JSON.parse(window.sessionStorage.getItem("loginUser")); //用户信息
|
5
|
|
- var wxIncidentWithCmdb = JSON.parse(window.sessionStorage.getItem("wxIncidentWithCmdb")); //是否绑定资产
|
6
|
|
- var incidentWithConsumable = JSON.parse(window.sessionStorage.getItem("incidentWithConsumable")); //是否绑定耗材
|
|
5
|
+ var ifRoom = JSON.parse(window.sessionStorage.getItem("ifRoom")); //是否增加房间号选择
|
|
6
|
+ var wxIncidentWithCmdb = JSON.parse(
|
|
7
|
+ window.sessionStorage.getItem("wxIncidentWithCmdb")
|
|
8
|
+ ); //是否绑定资产
|
7
|
9
|
// demo start
|
8
|
10
|
$("#demo").html(template("demo_temp", { account: loginUser.account }));
|
9
|
11
|
// demo end
|
|
12
|
+ $("#head").append(
|
|
13
|
+ template("favicon_temp", {
|
|
14
|
+ isVersion: sessionStorage.getItem("version_qd"),
|
|
15
|
+ })
|
|
16
|
+ );
|
|
17
|
+ $("#logo").html(
|
|
18
|
+ template("logo_temp", { isVersion: sessionStorage.getItem("version_qd") })
|
|
19
|
+ );
|
|
20
|
+ $("#areaPlaceRoom").html(template("areaPlaceRoom_temp", { ifRoom: ifRoom }));
|
10
|
21
|
// repairMain.valueconfig = '2';
|
11
|
22
|
var placeList = []; //获取到的地点列表
|
|
23
|
+ var roomList = []; //获取到的房间号列表
|
12
|
24
|
var wxId = ""; //微信报修ID
|
13
|
25
|
var processMessageData = null; //详情页流程数据
|
14
|
26
|
var dictionary = []; //详情页流程数据
|
|
@@ -78,6 +90,10 @@ $(function () {
|
78
|
90
|
getAreaList({ idx: 0, sum: 1000, area: { wechatArea: true } });
|
79
|
91
|
// 获取地点列表
|
80
|
92
|
getPlaceList({ idx: 0, sum: 1000, area: { wechatAreaId: "" } });
|
|
93
|
+ // 获取地点列表
|
|
94
|
+ if (ifRoom == 1) {
|
|
95
|
+ getRoomList({ idx: 0, sum: 1000, room: {} });
|
|
96
|
+ }
|
81
|
97
|
// 获取WxId
|
82
|
98
|
getWxId();
|
83
|
99
|
// 获取最新报修列表
|
|
@@ -474,7 +490,7 @@ $(function () {
|
474
|
490
|
});
|
475
|
491
|
}
|
476
|
492
|
|
477
|
|
- //选择框联动
|
|
493
|
+ //选择框联动-选区域
|
478
|
494
|
$("#area_list").on("change", function () {
|
479
|
495
|
//获取id
|
480
|
496
|
var id = $(this).val();
|
|
@@ -488,6 +504,42 @@ $(function () {
|
488
|
504
|
//填充数据
|
489
|
505
|
var html = template("place_list_temp", resFilter);
|
490
|
506
|
$("#place_list").html(html);
|
|
507
|
+ // 过滤数据
|
|
508
|
+ var resFilter1 = { list: [] };
|
|
509
|
+ for (var i = 0; i < roomList.length; i++) {
|
|
510
|
+ if (roomList[i]["place"]["id"] == resFilter.list[0].id) {
|
|
511
|
+ resFilter1.list.push(roomList[i]);
|
|
512
|
+ }
|
|
513
|
+ }
|
|
514
|
+ //填充数据
|
|
515
|
+ var html = template("room_list_temp", resFilter1);
|
|
516
|
+ $("#room_list").html(html);
|
|
517
|
+ if (resFilter1.list.length) {
|
|
518
|
+ $("#bx_address").val(resFilter1.list[0].room);
|
|
519
|
+ }
|
|
520
|
+ });
|
|
521
|
+ //选择框联动-选地点
|
|
522
|
+ $("#place_list").on("change", function () {
|
|
523
|
+ //获取id
|
|
524
|
+ var id = $(this).val();
|
|
525
|
+ // 过滤数据
|
|
526
|
+ var resFilter = { list: [] };
|
|
527
|
+ for (var i = 0; i < roomList.length; i++) {
|
|
528
|
+ if (roomList[i]["place"]["id"] == id) {
|
|
529
|
+ resFilter.list.push(roomList[i]);
|
|
530
|
+ }
|
|
531
|
+ }
|
|
532
|
+ //填充数据
|
|
533
|
+ var html = template("room_list_temp", resFilter);
|
|
534
|
+ $("#room_list").html(html);
|
|
535
|
+ });
|
|
536
|
+ //选择框联动-选房间号
|
|
537
|
+ $("#room_list").on("change", function () {
|
|
538
|
+ //获取id
|
|
539
|
+ var id = $(this).val();
|
|
540
|
+ var val = roomList.find((v) => v.id == id);
|
|
541
|
+ //填充数据
|
|
542
|
+ $("#bx_address").val(val.room);
|
491
|
543
|
});
|
492
|
544
|
// 提交报修
|
493
|
545
|
$("#f-submit").on("click", function () {
|
|
@@ -580,6 +632,7 @@ $(function () {
|
580
|
632
|
description: $.trim($("#bx_description").val()),
|
581
|
633
|
fileUrl: "url",
|
582
|
634
|
placeId: $.trim($("#place_list").val()),
|
|
635
|
+ roomId: ifRoom == 1 ? $.trim($("#room_list").val()) : undefined,
|
583
|
636
|
requester: loginUser,
|
584
|
637
|
sourceType: "wechatUserIncident",
|
585
|
638
|
};
|
|
@@ -626,10 +679,10 @@ $(function () {
|
626
|
679
|
bx_arr.data = [];
|
627
|
680
|
ch_arr.list = [];
|
628
|
681
|
currentBxOrCh = $(this).index();
|
629
|
|
- if(currentBxOrCh === 0){
|
630
|
|
- $('.right .r-list').css('top','41px')
|
631
|
|
- }else if(currentBxOrCh === 1){
|
632
|
|
- $('.right .r-list').css('top','63px')
|
|
682
|
+ if (currentBxOrCh === 0) {
|
|
683
|
+ $(".right .r-list").css("top", "41px");
|
|
684
|
+ } else if (currentBxOrCh === 1) {
|
|
685
|
+ $(".right .r-list").css("top", "63px");
|
633
|
686
|
}
|
634
|
687
|
$(this).addClass("active").siblings().removeClass("active");
|
635
|
688
|
getNewBxList(currentBxOrCh);
|
|
@@ -638,7 +691,7 @@ $(function () {
|
638
|
691
|
$("#bx_list").on(
|
639
|
692
|
"scroll",
|
640
|
693
|
debounce(function () {
|
641
|
|
- if($.trim($('.opcBg_item.active').text()) === '电话查号'){
|
|
694
|
+ if ($.trim($(".opcBg_item.active").text()) === "电话查号") {
|
642
|
695
|
return;
|
643
|
696
|
}
|
644
|
697
|
var itemLen = $(this).find(".r-item").length;
|
|
@@ -988,6 +1041,7 @@ $(function () {
|
988
|
1041
|
if (res.status == 200) {
|
989
|
1042
|
var html = template("area_list_temp", res);
|
990
|
1043
|
$("#area_list").html(html);
|
|
1044
|
+ $("#area_list").val(loginUser.place.area.id);
|
991
|
1045
|
}
|
992
|
1046
|
},
|
993
|
1047
|
error: function (err) {
|
|
@@ -1004,9 +1058,38 @@ $(function () {
|
1004
|
1058
|
data: JSON.stringify(data),
|
1005
|
1059
|
success: function (res) {
|
1006
|
1060
|
if (res.status == 200) {
|
|
1061
|
+ placeList = JSON.parse(JSON.stringify(res.list));
|
|
1062
|
+ res.list = res.list.filter((v) => {
|
|
1063
|
+ return v.area.id == loginUser.place.area.id;
|
|
1064
|
+ });
|
1007
|
1065
|
var html = template("place_list_temp", res);
|
1008
|
1066
|
$("#place_list").html(html);
|
1009
|
|
- placeList = res.list;
|
|
1067
|
+ $("#place_list").val(loginUser.place.id);
|
|
1068
|
+ }
|
|
1069
|
+ },
|
|
1070
|
+ error: function (err) {
|
|
1071
|
+ console.log(err);
|
|
1072
|
+ },
|
|
1073
|
+ });
|
|
1074
|
+ }
|
|
1075
|
+ //获取房间号列表
|
|
1076
|
+ function getRoomList(data) {
|
|
1077
|
+ $.ajax({
|
|
1078
|
+ type: "POST",
|
|
1079
|
+ contentType: "application/json;charset=UTF-8",
|
|
1080
|
+ url: baseUrl + "user/data/fetchDataList/room",
|
|
1081
|
+ data: JSON.stringify(data),
|
|
1082
|
+ success: function (res) {
|
|
1083
|
+ if (res.status == 200) {
|
|
1084
|
+ roomList = JSON.parse(JSON.stringify(res.list));
|
|
1085
|
+ res.list = res.list.filter((v) => {
|
|
1086
|
+ return v.place.id == loginUser.place.id;
|
|
1087
|
+ });
|
|
1088
|
+ var html = template("room_list_temp", res);
|
|
1089
|
+ $("#room_list").html(html);
|
|
1090
|
+ if (res.list.length) {
|
|
1091
|
+ $("#bx_address").val(res.list[0].room);
|
|
1092
|
+ }
|
1010
|
1093
|
}
|
1011
|
1094
|
},
|
1012
|
1095
|
error: function (err) {
|
|
@@ -1068,7 +1151,7 @@ $(function () {
|
1068
|
1151
|
});
|
1069
|
1152
|
}
|
1070
|
1153
|
//处理查号
|
1071
|
|
- function handlerCh(val,list){
|
|
1154
|
+ function handlerCh(val, list) {
|
1072
|
1155
|
//触发
|
1073
|
1156
|
$("#bx_list").getNiceScroll().resize();
|
1074
|
1157
|
$("#bx_list").show().next(".loading").hide();
|
|
@@ -1087,27 +1170,27 @@ $(function () {
|
1087
|
1170
|
}
|
1088
|
1171
|
});
|
1089
|
1172
|
//点击单位或部门
|
1090
|
|
- $('.ch-search').click(function(e){
|
|
1173
|
+ $(".ch-search").click(function (e) {
|
1091
|
1174
|
console.log(list.list);
|
1092
|
1175
|
console.log($(this).index());
|
1093
|
1176
|
var index = $(this).index();
|
1094
|
1177
|
var obj = list.list[index];
|
1095
|
1178
|
var data = {};
|
1096
|
|
- if(obj.unit.id){
|
|
1179
|
+ if (obj.unit.id) {
|
1097
|
1180
|
//部门
|
1098
|
1181
|
data.list = [obj];
|
1099
|
1182
|
var html = template("ch_list_temp", data);
|
1100
|
1183
|
$("#bx_list").html(html);
|
1101
|
1184
|
//处理
|
1102
|
|
- handlerCh(val,data);
|
1103
|
|
- }else{
|
|
1185
|
+ handlerCh(val, data);
|
|
1186
|
+ } else {
|
1104
|
1187
|
//单位
|
1105
|
1188
|
$.ajax({
|
1106
|
1189
|
type: "POST",
|
1107
|
1190
|
contentType: "application/json;charset=UTF-8",
|
1108
|
1191
|
url: baseUrl + "user/queryPhone",
|
1109
|
1192
|
data: JSON.stringify({
|
1110
|
|
- unitId: obj.id
|
|
1193
|
+ unitId: obj.id,
|
1111
|
1194
|
}),
|
1112
|
1195
|
success: function (res) {
|
1113
|
1196
|
if (res.state == 200) {
|
|
@@ -1115,7 +1198,7 @@ $(function () {
|
1115
|
1198
|
var html = template("ch_list_temp", data);
|
1116
|
1199
|
$("#bx_list").html(html);
|
1117
|
1200
|
//处理
|
1118
|
|
- handlerCh(val,data);
|
|
1201
|
+ handlerCh(val, data);
|
1119
|
1202
|
}
|
1120
|
1203
|
},
|
1121
|
1204
|
error: function (err) {
|
|
@@ -1123,7 +1206,7 @@ $(function () {
|
1123
|
1206
|
},
|
1124
|
1207
|
});
|
1125
|
1208
|
}
|
1126
|
|
- })
|
|
1209
|
+ });
|
1127
|
1210
|
}
|
1128
|
1211
|
function search1() {
|
1129
|
1212
|
bx_pageNum = 0;
|
|
@@ -1136,7 +1219,7 @@ $(function () {
|
1136
|
1219
|
let postData = {};
|
1137
|
1220
|
let url = "";
|
1138
|
1221
|
if (type === 0) {
|
1139
|
|
- $('.opcBg_searchBox').hide();
|
|
1222
|
+ $(".opcBg_searchBox").hide();
|
1140
|
1223
|
postData = {
|
1141
|
1224
|
assignee: loginUser.account,
|
1142
|
1225
|
state: 0,
|
|
@@ -1145,22 +1228,22 @@ $(function () {
|
1145
|
1228
|
};
|
1146
|
1229
|
url = "apply/bpm/fetchServiceTasks";
|
1147
|
1230
|
} else if (type === 1) {
|
1148
|
|
- $('.opcBg_searchBox').show();
|
|
1231
|
+ $(".opcBg_searchBox").show();
|
1149
|
1232
|
var val =
|
1150
|
1233
|
$.trim($("#searchPro1").val()) == "可简拼、名称搜索"
|
1151
|
1234
|
? ""
|
1152
|
1235
|
: $.trim($("#searchPro1").val());
|
1153
|
1236
|
postData = {};
|
1154
|
|
- if(val){
|
|
1237
|
+ if (val) {
|
1155
|
1238
|
postData.keyword = val;
|
1156
|
1239
|
}
|
1157
|
1240
|
url = "user/queryPhone";
|
1158
|
1241
|
//没有搜索内容的时候,返回空数组
|
1159
|
|
- if($("#searchPro1").val() === '可简拼、名称搜索'){
|
1160
|
|
- var html = template("ch_search_list_temp", {list:[]});
|
|
1242
|
+ if ($("#searchPro1").val() === "可简拼、名称搜索") {
|
|
1243
|
+ var html = template("ch_search_list_temp", { list: [] });
|
1161
|
1244
|
$("#bx_list").html(html);
|
1162
|
1245
|
//处理
|
1163
|
|
- handlerCh(val,{list:[]});
|
|
1246
|
+ handlerCh(val, { list: [] });
|
1164
|
1247
|
return;
|
1165
|
1248
|
}
|
1166
|
1249
|
}
|
|
@@ -1198,7 +1281,7 @@ $(function () {
|
1198
|
1281
|
res.data[i].time = res.data[i].createTime;
|
1199
|
1282
|
res.data[i].processInstanceId =
|
1200
|
1283
|
res.data[i].incident.processInstanceId;
|
1201
|
|
- res.data[i].wxIncidentWithCmdb = wxIncidentWithCmdb;//是否展示资产带入模板
|
|
1284
|
+ res.data[i].wxIncidentWithCmdb = wxIncidentWithCmdb; //是否展示资产带入模板
|
1202
|
1285
|
}
|
1203
|
1286
|
//添加分页数据,汇总
|
1204
|
1287
|
bx_arr.data = bx_arr.data.concat(res.data);
|
|
@@ -1242,9 +1325,9 @@ $(function () {
|
1242
|
1325
|
if (resFilter.state.id == 1592) {
|
1243
|
1326
|
//未受理
|
1244
|
1327
|
//添加详情页流程数据
|
1245
|
|
- processMessageData.forEach(function(v){
|
1246
|
|
- v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, '$1');
|
1247
|
|
- })
|
|
1328
|
+ processMessageData.forEach(function (v) {
|
|
1329
|
+ v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, "$1");
|
|
1330
|
+ });
|
1248
|
1331
|
resFilter.processList = processMessageData;
|
1249
|
1332
|
//填充弹窗数据
|
1250
|
1333
|
var html = template("bx1_detail_temp", resFilter);
|
|
@@ -1305,9 +1388,9 @@ $(function () {
|
1305
|
1388
|
});
|
1306
|
1389
|
} else if (resFilter.state.id == 0) {
|
1307
|
1390
|
//添加详情页流程数据
|
1308
|
|
- processMessageData.forEach(function(v){
|
1309
|
|
- v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, '$1');
|
1310
|
|
- })
|
|
1391
|
+ processMessageData.forEach(function (v) {
|
|
1392
|
+ v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, "$1");
|
|
1393
|
+ });
|
1311
|
1394
|
resFilter.processList = processMessageData;
|
1312
|
1395
|
//填充弹窗数据
|
1313
|
1396
|
var html = template("bx2_detail_temp", resFilter);
|
|
@@ -1367,9 +1450,9 @@ $(function () {
|
1367
|
1450
|
});
|
1368
|
1451
|
} else if (resFilter.state.id == 1594) {
|
1369
|
1452
|
//添加详情页流程数据
|
1370
|
|
- processMessageData.forEach(function(v){
|
1371
|
|
- v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, '$1');
|
1372
|
|
- })
|
|
1453
|
+ processMessageData.forEach(function (v) {
|
|
1454
|
+ v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, "$1");
|
|
1455
|
+ });
|
1373
|
1456
|
resFilter.processList = processMessageData;
|
1374
|
1457
|
//填充弹窗数据
|
1375
|
1458
|
var html = template("bx3_detail_temp", resFilter);
|
|
@@ -1386,9 +1469,9 @@ $(function () {
|
1386
|
1469
|
});
|
1387
|
1470
|
} else if (resFilter.state.id == 1595) {
|
1388
|
1471
|
//添加详情页流程数据
|
1389
|
|
- processMessageData.forEach(function(v){
|
1390
|
|
- v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, '$1');
|
1391
|
|
- })
|
|
1472
|
+ processMessageData.forEach(function (v) {
|
|
1473
|
+ v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, "$1");
|
|
1474
|
+ });
|
1392
|
1475
|
resFilter.processList = processMessageData;
|
1393
|
1476
|
//填充弹窗数据
|
1394
|
1477
|
var html = template("bx4_detail_temp", resFilter);
|
|
@@ -1485,9 +1568,9 @@ $(function () {
|
1485
|
1568
|
});
|
1486
|
1569
|
} else if (resFilter.state.id == 1593) {
|
1487
|
1570
|
//添加详情页流程数据
|
1488
|
|
- processMessageData.forEach(function(v){
|
1489
|
|
- v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, '$1');
|
1490
|
|
- })
|
|
1571
|
+ processMessageData.forEach(function (v) {
|
|
1572
|
+ v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, "$1");
|
|
1573
|
+ });
|
1491
|
1574
|
resFilter.processList = processMessageData;
|
1492
|
1575
|
//填充弹窗数据
|
1493
|
1576
|
var html = template("bx5_detail_temp", resFilter);
|
|
@@ -1504,9 +1587,9 @@ $(function () {
|
1504
|
1587
|
});
|
1505
|
1588
|
} else if (resFilter.state.id == 1597) {
|
1506
|
1589
|
//添加详情页流程数据
|
1507
|
|
- processMessageData.forEach(function(v){
|
1508
|
|
- v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, '$1');
|
1509
|
|
- })
|
|
1590
|
+ processMessageData.forEach(function (v) {
|
|
1591
|
+ v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, "$1");
|
|
1592
|
+ });
|
1510
|
1593
|
resFilter.processList = processMessageData;
|
1511
|
1594
|
//填充弹窗数据
|
1512
|
1595
|
var html = template("bx6_detail_temp", resFilter);
|
|
@@ -1523,9 +1606,9 @@ $(function () {
|
1523
|
1606
|
});
|
1524
|
1607
|
} else {
|
1525
|
1608
|
//添加详情页流程数据
|
1526
|
|
- processMessageData.forEach(function(v){
|
1527
|
|
- v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, '$1');
|
1528
|
|
- })
|
|
1609
|
+ processMessageData.forEach(function (v) {
|
|
1610
|
+ v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, "$1");
|
|
1611
|
+ });
|
1529
|
1612
|
resFilter.processList = processMessageData;
|
1530
|
1613
|
//填充弹窗数据
|
1531
|
1614
|
var html = template("bx7_detail_temp", resFilter);
|
|
@@ -1556,7 +1639,7 @@ $(function () {
|
1556
|
1639
|
ch_arr.list = res.data;
|
1557
|
1640
|
var html = template("ch_search_list_temp", ch_arr);
|
1558
|
1641
|
$("#bx_list").html(html);
|
1559
|
|
- handlerCh(val,ch_arr);
|
|
1642
|
+ handlerCh(val, ch_arr);
|
1560
|
1643
|
}
|
1561
|
1644
|
}
|
1562
|
1645
|
},
|