index.js
6.93 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
const util = new window.publicMethod() ;
const citys = {
'南京市': ['玄武区', '秦淮区', '建邺区', '鼓楼区', '浦口区', '栖霞区', '雨花台区', '江宁区', '六合区', '溧水区', '高淳区'],
'苏州市': ['姑苏区', '吴中区', '相城区', '虎丘区', '吴江区', '新区', '经开区', '昆山市', '常熟市', '张家港市', '太仓市', '苏州工业园区'],
'扬州市': ['广陵区', '邗江区', '江都区', '宝应县', '高邮市', '仪征市'],
'无锡市': ['梁溪区', '锡山区', '惠山区', '滨湖区', '新吴区', '江阴市', '宜兴市'],
'徐州市': ['鼓楼区', '云龙区', '贾汪区', '泉山区', '铜山区', '丰县', '沛县', '睢宁县', '邳州市', '新沂市'],
'常州市': ['天宁区', '钟楼区', '新北区', '武进区', '金坛区', '溧阳市'],
'连云港市': ['海州区', '连云区', '赣榆区', '东海县', '灌云县', '灌南县'],
'淮安市': ['清江浦区', '淮阴区', '淮安区', '洪泽区', '涟水县', '盱眙县', '金湖县'],
'盐城市': ['亭湖区', '盐都区', '盐开区','大丰区', '响水县', '滨海县', '阜宁县', '射阳县', '建湖县','东台市'],
'南通市': ['崇川区', '通州区', '海门区', '如东县', '启东市', '如皋市', '海安市'],
'泰州市': ['海陵区', '高港区', '姜堰区', '兴化市', '靖江市', '泰兴市'],
'宿迁市': ['宿城区', '宿豫区', '沭阳县', '泗阳县', '泗洪县'],
};
new Vue({
el: '#pageDiv',
data: {
tarr: ['精准高效','智能检测','实时监控','全程录像'],
orderFlag: false,
appParam: {},
detail: {},
pickData: {
isShow: false,
title: '地区选择',
arr:[
{
values: Object.keys(citys),
className: 'column1',
defaultIndex: 0
},
{
values: citys['南京市'],
className: 'column2',
defaultIndex: 0
}
],
nCity: '',
nArea: '',
menpai: ''
},
fbData:{
isShow: false,
confirmFlag: false,
explain: '',
},
reasonPickData: {
isShow: false,
title: '原因选择',
orArr: [],
arr:[],
index: 0,
reason: '个人原因'
},
noDataFlag: false
},
created(){
this.getReason()
if(sessionStorage.getItem('huaiAnAppParam')){
this.appParam = JSON.parse(sessionStorage.getItem('huaiAnAppParam'))
this.getDetail()
}else{
this.appParam = JSON.parse(sessionStorage.getItem('listInfoParam'))
this.getDetail('init')
}
},
methods: {
getReason(){
util.httpRequest({
url: '/listEnum',
middleUrl: '/zhijian-trial/common',
data: {
type: 3
},
}).then(res=>{
if(res.code == 200){
this.reasonPickData.orArr = res.data
this.reasonPickData.arr = res.data.map(item=>{
return item.label
})
}
})
},
saveFeedback(){
if(!this.fbData.explain){
util.toast('请填写具体情况')
return
}
let status = ''
let p = this.reasonPickData
p.orArr.forEach(item=>{
if(item.label == p.reason){
status = item.value
}
})
util.httpRequest({
data: {
applyId: this.detail.id,
checkStatus: status,
failReason: this.fbData.explain
},
url: '/unCheck'
}).then(res=>{
if(res.code == 200){
this.getDetail()
this.fbData.isShow = false
this.fbData.confirmFlag = false
util.toast('保存成功')
}else{
util.toast(res.msg)
}
})
},
showCity(){
let __this = this
let cIndex = __this.pickData.nCity?Object.keys(citys).indexOf(__this.pickData.nCity):0
let aIndex = __this.pickData.nArea?(citys[__this.pickData.nCity||'南京市'].indexOf(__this.pickData.nArea)):0
this.pickData.arr = [
{
values: Object.keys(citys),
className: 'column1',
defaultIndex: cIndex
},
{
values: citys[__this.pickData.nCity||'南京市'],
className: 'column2',
defaultIndex: aIndex
}
]
this.pickData.isShow = true
},
onChange(picker, values) {
picker.setColumnValues(1, citys[values[0]]);
},
onConfirm(value, index) {
this.pickData.nCity = value[0]
this.pickData.nArea = value[1]
this.pickData.isShow = false
},
onCancel(){
this.pickData.isShow = false
},
showReason(){
this.reasonPickData.isShow = true
},
reasonCancel(){
this.reasonPickData.isShow = false
},
reasonConfirm(value, index){
this.reasonPickData.reason = value
this.reasonPickData.index = index
this.reasonCancel()
},
release(applyId){
if(!sessionStorage.getItem('haCallId')){
return
}
util.httpRequest({
url: '/releaseConn',
data: {
callId: sessionStorage.getItem('haCallId')||'',
applyId: applyId
}
})
},
getDetail(source){
let json = this.appParam
json.cmcc = source=='init'?true:false
json.phoneModel = navigator.userAgent.toLowerCase()
util.httpRequest({
data: json,
url: '/getOrderInfo'
}).then(res=>{
document.getElementById('pageDiv').style.display = 'block'; // 显示内容
document.getElementById('loading').style.display = 'none'; // 去掉加载框
if(res.code == 200){
this.detail = res.data
let json = {...this.appParam,...{
address: res.data.addressName,
applyId: res.data.id,
campaignId: res.data.campaignId
}}
sessionStorage.setItem('huaiAnAppParam',JSON.stringify(json))
this.release(json.applyId)
}else if(res.code == '5002'){
this.noDataFlag = true
}else{
util.toast(res.msg)
}
})
},
orderError(){
this.orderFlag = true
},
feedback(){
this.fbData.explain = ''
this.reasonPickData.reason = '个人原因'
this.reasonPickData.index = 0
this.fbData.isShow = true
},
closeAlert(){
this.orderFlag = false
},
beginTest(){
if(!this.detail.id){
util.toast('暂未查询到质检信息,请向技术支持方反馈')
return
}
window.location.href = 'demo.html?time='+ new Date().getTime()
},
addOrder(){
this.orderFlag = false
window.location.href = 'addOrder.html?time='+ new Date().getTime()
},
delOrder(index){
util.httpRequest({
data: {
devicesId: this.detail.devicessList[index].id
},
url: '/delDevices'
}).then(res=>{
if(res.code == 200){
util.toast('删除成功')
this.getDetail()
}else{
util.toast(res.msg)
}
})
}
}
})