|
@@ -55,9 +55,9 @@ $(function () {
|
55
|
55
|
// 获取常见问题列表
|
56
|
56
|
getSolutionList({ "idx": solution_pageNum, "sum": 10, "solution": { "title": "", "status": { "id": 72 }, "solutionRange": 1 } });
|
57
|
57
|
// 获取区域列表
|
58
|
|
- // getAreaList({ "idx": 0, "sum": 1000, "area": { "wechatArea": true } });
|
|
58
|
+ getAreaList({ "idx": 0, "sum": 1000, "area": { "wechatArea": true } });
|
59
|
59
|
// 获取地点列表
|
60
|
|
- // getPlaceList({ "idx": 0, "sum": 1000, "area": { "wechatAreaId": "" } });
|
|
60
|
+ getPlaceList({ "idx": 0, "sum": 1000, "area": { "wechatAreaId": "" } });
|
61
|
61
|
// 获取WxId
|
62
|
62
|
getWxId();
|
63
|
63
|
// 获取最新报修列表
|
|
@@ -82,55 +82,55 @@ $(function () {
|
82
|
82
|
}
|
83
|
83
|
pageInit();
|
84
|
84
|
//故障地点seimin
|
85
|
|
- (function () {
|
86
|
|
- //故障地点带入区域地点
|
87
|
|
- $('#bx_address').val(loginUser.place ? loginUser.place.area.area + loginUser.place.place : '');
|
88
|
|
- //点击文本框
|
89
|
|
- $('#bx_address').on('click', searchAreaPlace);
|
90
|
|
- //修改文字,实时监听
|
91
|
|
- $('#bx_address').on('keyup', debounce(searchAreaPlace, 500));
|
92
|
|
- //报修科室滚动条
|
93
|
|
- $('#bx_address_ul').niceScroll();
|
94
|
|
- //故障地点搜索
|
95
|
|
- function searchAreaPlace() {
|
96
|
|
- $.ajax({
|
97
|
|
- type: "POST",
|
98
|
|
- contentType: "application/json;charset=UTF-8",
|
99
|
|
- url: baseUrl + "apply/bpm/searchFaultLocation",
|
100
|
|
- data: JSON.stringify({ "searchKey": $('#bx_address').val() }),
|
101
|
|
- success: function (res) {
|
102
|
|
- if (res.state == 200) {
|
103
|
|
- $('#bx_address_ul').find('li').off('click');
|
104
|
|
- var html = template('bx_address_ul_temp', { list: res.result });
|
105
|
|
- $('#bx_address_ul').html(html).show().find('li').on('click', function () {
|
106
|
|
- $('#bx_address').val($(this).text());//文本框赋值
|
107
|
|
- $('#bx_address_ul').hide();
|
108
|
|
- })
|
109
|
|
- }
|
110
|
|
- },
|
111
|
|
- error: function (err) {
|
112
|
|
- console.log(err);
|
113
|
|
- }
|
114
|
|
- });
|
115
|
|
- }
|
116
|
|
- //点击空白处隐藏
|
117
|
|
- $(document).on('click', function (e) {
|
118
|
|
- if (e.target !== $('#bx_address').get(0)) {
|
119
|
|
- $('#bx_address_ul').hide();
|
120
|
|
- //模拟placeholder
|
121
|
|
- if ($('#bx_address').val() == '') {
|
122
|
|
- $('#bx_address').val('请输入故障地点');
|
123
|
|
- }
|
124
|
|
- }
|
125
|
|
- })
|
126
|
|
- })();
|
|
85
|
+ // (function () {
|
|
86
|
+ // //故障地点带入区域地点
|
|
87
|
+ // $('#bx_address').val(loginUser.place ? loginUser.place.area.area + loginUser.place.place : '');
|
|
88
|
+ // //点击文本框
|
|
89
|
+ // $('#bx_address').on('click', searchAreaPlace);
|
|
90
|
+ // //修改文字,实时监听
|
|
91
|
+ // $('#bx_address').on('keyup', debounce(searchAreaPlace, 500));
|
|
92
|
+ // //报修科室滚动条
|
|
93
|
+ // $('#bx_address_ul').niceScroll();
|
|
94
|
+ // //故障地点搜索
|
|
95
|
+ // function searchAreaPlace() {
|
|
96
|
+ // $.ajax({
|
|
97
|
+ // type: "POST",
|
|
98
|
+ // contentType: "application/json;charset=UTF-8",
|
|
99
|
+ // url: baseUrl + "apply/bpm/searchFaultLocation",
|
|
100
|
+ // data: JSON.stringify({ "searchKey": $('#bx_address').val() }),
|
|
101
|
+ // success: function (res) {
|
|
102
|
+ // if (res.state == 200) {
|
|
103
|
+ // $('#bx_address_ul').find('li').off('click');
|
|
104
|
+ // var html = template('bx_address_ul_temp', { list: res.result });
|
|
105
|
+ // $('#bx_address_ul').html(html).show().find('li').on('click', function () {
|
|
106
|
+ // $('#bx_address').val($(this).text());//文本框赋值
|
|
107
|
+ // $('#bx_address_ul').hide();
|
|
108
|
+ // })
|
|
109
|
+ // }
|
|
110
|
+ // },
|
|
111
|
+ // error: function (err) {
|
|
112
|
+ // console.log(err);
|
|
113
|
+ // }
|
|
114
|
+ // });
|
|
115
|
+ // }
|
|
116
|
+ // //点击空白处隐藏
|
|
117
|
+ // $(document).on('click', function (e) {
|
|
118
|
+ // if (e.target !== $('#bx_address').get(0)) {
|
|
119
|
+ // $('#bx_address_ul').hide();
|
|
120
|
+ // //模拟placeholder
|
|
121
|
+ // if ($('#bx_address').val() == '') {
|
|
122
|
+ // $('#bx_address').val('请输入故障地点');
|
|
123
|
+ // }
|
|
124
|
+ // }
|
|
125
|
+ // })
|
|
126
|
+ // })();
|
127
|
127
|
//报修科室seimin
|
128
|
128
|
(function () {
|
129
|
129
|
//自动带入报修科室
|
130
|
130
|
if (loginUser.dept) {
|
131
|
131
|
$('#bx_ks').val(loginUser.dept.dept).data('id', loginUser.dept.id);
|
132
|
132
|
} else {
|
133
|
|
- $('#bx_address').val('请输入故障地点');
|
|
133
|
+ $('#bx_address').val('请输入详细的地址');
|
134
|
134
|
}
|
135
|
135
|
//点击文本框
|
136
|
136
|
$('#bx_ks').on('click', function () {
|
|
@@ -238,7 +238,7 @@ $(function () {
|
238
|
238
|
});
|
239
|
239
|
|
240
|
240
|
$('#bx_address').on('focus', function () {
|
241
|
|
- if ($(this).val() == '请输入故障地点') {
|
|
241
|
+ if ($(this).val() == '请输入详细的地址') {
|
242
|
242
|
$(this).val('');
|
243
|
243
|
}
|
244
|
244
|
});
|
|
@@ -419,20 +419,20 @@ $(function () {
|
419
|
419
|
$('#bx_name').val('');
|
420
|
420
|
}
|
421
|
421
|
}
|
422
|
|
- // if ($('#area_list').val() < 1) {
|
423
|
|
- // alert('区域不能为空');
|
424
|
|
- // //按钮禁止取消
|
425
|
|
- // $(this).removeProp('disabled');
|
426
|
|
- // $(this).removeClass('f-submit--disable');
|
427
|
|
- // return;
|
428
|
|
- // }
|
429
|
|
- // if ($('#place_list').val() < 1) {
|
430
|
|
- // alert('地点不能为空');
|
431
|
|
- // //按钮禁止取消
|
432
|
|
- // $(this).removeProp('disabled');
|
433
|
|
- // $(this).removeClass('f-submit--disable');
|
434
|
|
- // return;
|
435
|
|
- // }
|
|
422
|
+ if ($('#area_list').val() < 1) {
|
|
423
|
+ alert('区域不能为空');
|
|
424
|
+ //按钮禁止取消
|
|
425
|
+ $(this).removeProp('disabled');
|
|
426
|
+ $(this).removeClass('f-submit--disable');
|
|
427
|
+ return;
|
|
428
|
+ }
|
|
429
|
+ if ($('#place_list').val() < 1) {
|
|
430
|
+ alert('地点不能为空');
|
|
431
|
+ //按钮禁止取消
|
|
432
|
+ $(this).removeProp('disabled');
|
|
433
|
+ $(this).removeClass('f-submit--disable');
|
|
434
|
+ return;
|
|
435
|
+ }
|
436
|
436
|
if ($('#bx_tel').val().replace(/\s/g, '') === '' || $('#bx_tel').val().replace(/\s/g, '') === '请输入联系电话' || !/^[\d\-]*$/.test($('#bx_tel').val())) {
|
437
|
437
|
alert('请输入正确的联系电话');
|
438
|
438
|
//按钮禁止取消
|
|
@@ -440,8 +440,8 @@ $(function () {
|
440
|
440
|
$(this).removeClass('f-submit--disable');
|
441
|
441
|
return;
|
442
|
442
|
}
|
443
|
|
- if ($('#bx_address').val().replace(/\s/g, '') === '' || $('#bx_address').val() == '请输入故障地点') {
|
444
|
|
- alert('故障地点不能为空');
|
|
443
|
+ if ($('#bx_address').val().replace(/\s/g, '') === '' || $('#bx_address').val() == '请输入详细的地址') {
|
|
444
|
+ alert('地址不能为空');
|
445
|
445
|
//按钮禁止取消
|
446
|
446
|
$(this).removeProp('disabled');
|
447
|
447
|
$(this).removeClass('f-submit--disable');
|
|
@@ -457,13 +457,13 @@ $(function () {
|
457
|
457
|
var data = { verification: "true" };
|
458
|
458
|
data.incident = {
|
459
|
459
|
address: $.trim($('#bx_address').val()),
|
460
|
|
- // areaId: $.trim($('#area_list').val()),
|
|
460
|
+ areaId: $.trim($('#area_list').val()),
|
461
|
461
|
bxcode: wxId,
|
462
|
462
|
contacts: $.trim($('#bx_name').val()),
|
463
|
463
|
contactsInformation: $('#bx_tel').val(),
|
464
|
464
|
description: $.trim($('#bx_description').val()),
|
465
|
465
|
fileUrl: 'url',
|
466
|
|
- // placeId: $.trim($('#place_list').val()),
|
|
466
|
+ placeId: $.trim($('#place_list').val()),
|
467
|
467
|
requester: loginUser,
|
468
|
468
|
sourceType: "wechatRequesterIncident"
|
469
|
469
|
};
|
|
@@ -795,42 +795,42 @@ $(function () {
|
795
|
795
|
})
|
796
|
796
|
}
|
797
|
797
|
//获取区域列表
|
798
|
|
- // function getAreaList(data) {
|
799
|
|
- // $.ajax({
|
800
|
|
- // type: 'POST',
|
801
|
|
- // contentType: "application/json;charset=UTF-8",
|
802
|
|
- // url: baseUrl + "user/data/fetchDataList/area",
|
803
|
|
- // data: JSON.stringify(data),
|
804
|
|
- // success: function (res) {
|
805
|
|
- // if (res.status == 200) {
|
806
|
|
- // var html = template('area_list_temp', res);
|
807
|
|
- // $('#area_list').html(html);
|
808
|
|
- // }
|
809
|
|
- // },
|
810
|
|
- // error: function (err) {
|
811
|
|
- // console.log(err)
|
812
|
|
- // }
|
813
|
|
- // })
|
814
|
|
- // }
|
|
798
|
+ function getAreaList(data) {
|
|
799
|
+ $.ajax({
|
|
800
|
+ type: 'POST',
|
|
801
|
+ contentType: "application/json;charset=UTF-8",
|
|
802
|
+ url: baseUrl + "user/data/fetchDataList/area",
|
|
803
|
+ data: JSON.stringify(data),
|
|
804
|
+ success: function (res) {
|
|
805
|
+ if (res.status == 200) {
|
|
806
|
+ var html = template('area_list_temp', res);
|
|
807
|
+ $('#area_list').html(html);
|
|
808
|
+ }
|
|
809
|
+ },
|
|
810
|
+ error: function (err) {
|
|
811
|
+ console.log(err)
|
|
812
|
+ }
|
|
813
|
+ })
|
|
814
|
+ }
|
815
|
815
|
//获取地点列表
|
816
|
|
- // function getPlaceList(data) {
|
817
|
|
- // $.ajax({
|
818
|
|
- // type: 'POST',
|
819
|
|
- // contentType: "application/json;charset=UTF-8",
|
820
|
|
- // url: baseUrl + "user/data/fetchDataList/place",
|
821
|
|
- // data: JSON.stringify(data),
|
822
|
|
- // success: function (res) {
|
823
|
|
- // if (res.status == 200) {
|
824
|
|
- // var html = template('place_list_temp', res);
|
825
|
|
- // $('#place_list').html(html);
|
826
|
|
- // placeList = res.list;
|
827
|
|
- // }
|
828
|
|
- // },
|
829
|
|
- // error: function (err) {
|
830
|
|
- // console.log(err)
|
831
|
|
- // }
|
832
|
|
- // })
|
833
|
|
- // }
|
|
816
|
+ function getPlaceList(data) {
|
|
817
|
+ $.ajax({
|
|
818
|
+ type: 'POST',
|
|
819
|
+ contentType: "application/json;charset=UTF-8",
|
|
820
|
+ url: baseUrl + "user/data/fetchDataList/place",
|
|
821
|
+ data: JSON.stringify(data),
|
|
822
|
+ success: function (res) {
|
|
823
|
+ if (res.status == 200) {
|
|
824
|
+ var html = template('place_list_temp', res);
|
|
825
|
+ $('#place_list').html(html);
|
|
826
|
+ placeList = res.list;
|
|
827
|
+ }
|
|
828
|
+ },
|
|
829
|
+ error: function (err) {
|
|
830
|
+ console.log(err)
|
|
831
|
+ }
|
|
832
|
+ })
|
|
833
|
+ }
|
834
|
834
|
//获取微信报修ID
|
835
|
835
|
function getWxId() {
|
836
|
836
|
$.ajax({
|