|
@@ -19,6 +19,7 @@ $(function () {
|
19
|
19
|
);
|
20
|
20
|
$("#areaPlaceRoom").html(template("areaPlaceRoom_temp", { ifRoom: ifRoom }));
|
21
|
21
|
// repairMain.valueconfig = '2';
|
|
22
|
+ var areaList = []; //获取到的区域列表
|
22
|
23
|
var placeList = []; //获取到的地点列表
|
23
|
24
|
var roomList = []; //获取到的房间号列表
|
24
|
25
|
var wxId = ""; //微信报修ID
|
|
@@ -86,6 +87,8 @@ $(function () {
|
86
|
87
|
sum: 10,
|
87
|
88
|
solution: { title: "", status: { id: 72 }, solutionRange: 1 },
|
88
|
89
|
});
|
|
90
|
+ // 获取校区列表
|
|
91
|
+ getBranchList({ idx: 0, sum: 1000 });
|
89
|
92
|
// 获取区域列表
|
90
|
93
|
getAreaList({ idx: 0, sum: 1000, area: { wechatArea: true } });
|
91
|
94
|
// 获取地点列表
|
|
@@ -489,7 +492,34 @@ $(function () {
|
489
|
492
|
solution: { title: val, status: { id: 72 } },
|
490
|
493
|
});
|
491
|
494
|
}
|
492
|
|
-
|
|
495
|
+ //选择框联动-选校区
|
|
496
|
+ $("#branch_list").on("change", function () {
|
|
497
|
+ //获取id
|
|
498
|
+ var id = $(this).val();
|
|
499
|
+ // 过滤数据
|
|
500
|
+ var resFilter = { list: [] };
|
|
501
|
+ for (var i = 0; i < areaList.length; i++) {
|
|
502
|
+ if (areaList[i]["branch"] == id) {
|
|
503
|
+ resFilter.list.push(areaList[i]);
|
|
504
|
+ }
|
|
505
|
+ }
|
|
506
|
+ //填充数据
|
|
507
|
+ var html = template("area_list_temp", resFilter);
|
|
508
|
+ $("#area_list").html(html);
|
|
509
|
+ // 过滤数据
|
|
510
|
+ var resFilter1 = { list: [] };
|
|
511
|
+ for (var i = 0; i < placeList.length; i++) {
|
|
512
|
+ if (placeList[i]["area"]["id"] == resFilter.list[0].id) {
|
|
513
|
+ resFilter1.list.push(placeList[i]);
|
|
514
|
+ }
|
|
515
|
+ }
|
|
516
|
+ //填充数据
|
|
517
|
+ var html = template("place_list_temp", resFilter1);
|
|
518
|
+ $("#place_list").html(html);
|
|
519
|
+ if (resFilter1.list.length) {
|
|
520
|
+ $("#bx_address").val(resFilter1.list[0].place);
|
|
521
|
+ }
|
|
522
|
+ });
|
493
|
523
|
//选择框联动-选区域
|
494
|
524
|
$("#area_list").on("change", function () {
|
495
|
525
|
//获取id
|
|
@@ -577,6 +607,13 @@ $(function () {
|
577
|
607
|
$("#bx_name").val("");
|
578
|
608
|
}
|
579
|
609
|
}
|
|
610
|
+ if ($("#branch_list").val() < 1) {
|
|
611
|
+ alert("校区不能为空");
|
|
612
|
+ //按钮禁止取消
|
|
613
|
+ $(this).removeProp("disabled");
|
|
614
|
+ $(this).removeClass("f-submit--disable");
|
|
615
|
+ return;
|
|
616
|
+ }
|
580
|
617
|
if ($("#area_list").val() < 1) {
|
581
|
618
|
alert("区域不能为空");
|
582
|
619
|
//按钮禁止取消
|
|
@@ -625,6 +662,7 @@ $(function () {
|
625
|
662
|
var data = { verification: "true" };
|
626
|
663
|
data.incident = {
|
627
|
664
|
address: $.trim($("#bx_address").val()),
|
|
665
|
+ branch: {id: $.trim($("#branch_list").val())},
|
628
|
666
|
areaId: $.trim($("#area_list").val()),
|
629
|
667
|
bxcode: wxId,
|
630
|
668
|
contacts: $.trim($("#bx_name").val()),
|
|
@@ -1030,6 +1068,25 @@ $(function () {
|
1030
|
1068
|
},
|
1031
|
1069
|
});
|
1032
|
1070
|
}
|
|
1071
|
+ //获取校区列表
|
|
1072
|
+ function getBranchList(data) {
|
|
1073
|
+ $.ajax({
|
|
1074
|
+ type: "POST",
|
|
1075
|
+ contentType: "application/json;charset=UTF-8",
|
|
1076
|
+ url: baseUrl + "user/data/fetchDataList/branch",
|
|
1077
|
+ data: JSON.stringify(data),
|
|
1078
|
+ success: function (res) {
|
|
1079
|
+ if (res.status == 200) {
|
|
1080
|
+ var html = template("branch_list_temp", res);
|
|
1081
|
+ $("#branch_list").html(html);
|
|
1082
|
+ $("#branch_list").val(loginUser.branch.id);
|
|
1083
|
+ }
|
|
1084
|
+ },
|
|
1085
|
+ error: function (err) {
|
|
1086
|
+ console.log(err);
|
|
1087
|
+ },
|
|
1088
|
+ });
|
|
1089
|
+ }
|
1033
|
1090
|
//获取区域列表
|
1034
|
1091
|
function getAreaList(data) {
|
1035
|
1092
|
$.ajax({
|
|
@@ -1039,6 +1096,10 @@ $(function () {
|
1039
|
1096
|
data: JSON.stringify(data),
|
1040
|
1097
|
success: function (res) {
|
1041
|
1098
|
if (res.status == 200) {
|
|
1099
|
+ areaList = JSON.parse(JSON.stringify(res.list));
|
|
1100
|
+ res.list = res.list.filter((v) => {
|
|
1101
|
+ return v.branch == loginUser.branch.id;
|
|
1102
|
+ });
|
1042
|
1103
|
var html = template("area_list_temp", res);
|
1043
|
1104
|
$("#area_list").html(html);
|
1044
|
1105
|
$("#area_list").val(loginUser.place.area.id);
|