|
@ -14,10 +14,7 @@
|
14
|
14
|
<div>
|
15
|
15
|
<div class="label">终端编号:</div>
|
16
|
16
|
<div class="input-rule">
|
17
|
|
<t-select v-model="queryCondition.alarmPerson" placeholder="请输入终端编号">
|
18
|
|
<t-option>ZDBH0001</t-option>
|
19
|
|
<t-option>ZDBH0002</t-option>
|
20
|
|
</t-select>
|
|
17
|
<t-input v-model="queryCondition.deviceNo" placeholder="请输入..."></t-input>
|
21
|
18
|
</div>
|
22
|
19
|
</div>
|
23
|
20
|
<div class="btns">
|
|
@ -52,20 +49,20 @@
|
52
|
49
|
</div>
|
53
|
50
|
</template>
|
54
|
51
|
</t-table-column>
|
55
|
|
<t-table-column prop="number" label="终端编号"></t-table-column>
|
56
|
|
<t-table-column prop="relevanceUser" label="关联用户"></t-table-column>
|
|
52
|
<t-table-column prop="deviceNo" label="终端编号"></t-table-column>
|
|
53
|
<t-table-column prop="bindName" label="关联用户/船舶"></t-table-column>
|
57
|
54
|
<t-table-column prop="finalPositioningTime" label="最后定位时间"></t-table-column>
|
58
|
|
<t-table-column prop="remark" label="备注"></t-table-column>
|
|
55
|
<t-table-column prop="remarks" label="备注"></t-table-column>
|
59
|
56
|
<t-table-column
|
60
|
57
|
fixed="right"
|
61
|
58
|
label="操作"
|
62
|
59
|
width="220"
|
63
|
60
|
>
|
64
|
61
|
<template slot-scope="scope">
|
65
|
|
<a href="javascript:void(0)" size="sm" @click="() => {relevance = true}">关联用户</a>
|
66
|
|
<a href="javascript:void(0)" size="sm" @click="solution(scope.$index)">解绑用户</a>
|
|
62
|
<a href="javascript:void(0)" size="sm" @click="() => handleClickUser(scope.row)">关联用户</a>
|
|
63
|
<a href="javascript:void(0)" size="sm" @click="solution(scope.row)">解绑用户</a>
|
67
|
64
|
<a href="javascript:void(0)" size="sm" @click="handleClick(scope.row)">编辑</a>
|
68
|
|
<a href="javascript:void(0)" size="sm" @click="delete(scope.$index)">删除</a>
|
|
65
|
<a href="javascript:void(0)" size="sm" @click="removeD(scope.row)">删除</a>
|
69
|
66
|
</template>
|
70
|
67
|
</t-table-column>
|
71
|
68
|
</t-table>
|
|
@ -97,11 +94,30 @@
|
97
|
94
|
<t-button class="submit-button" @click="submit">保存</t-button>
|
98
|
95
|
</div>
|
99
|
96
|
</t-modal>
|
|
97
|
<t-modal :visibled.sync="updateModal" title="编辑终端" >
|
|
98
|
<t-form label-width="80" label-position="left">
|
|
99
|
<t-form-item label="终端编号" prop="number">
|
|
100
|
{{ updateFormValidate.number }}
|
|
101
|
</t-form-item>
|
|
102
|
<t-form-item label="备注" prop="desc">
|
|
103
|
<t-input
|
|
104
|
v-model="updateFormValidate.desc"
|
|
105
|
:autosize="{minRows: 2,maxRows: 5}"
|
|
106
|
type="textarea"
|
|
107
|
placeholder="请输入..."
|
|
108
|
></t-input>
|
|
109
|
</t-form-item>
|
|
110
|
</t-form>
|
|
111
|
<div slot="footer">
|
|
112
|
<t-button @click="cancel">取消</t-button>
|
|
113
|
<t-button class="submit-button" @click="updateSubmit">保存</t-button>
|
|
114
|
</div>
|
|
115
|
</t-modal>
|
100
|
116
|
<t-modal :visibled.sync="relevance" title="关联用户">
|
101
|
117
|
<div>
|
102
|
118
|
<t-form ref="relevanceValidate" :model="relevanceValidate" :rules="relevanceRuleValidate" :label-width="80" label-position="left">
|
103
|
119
|
<t-form-item label="终端编号" prop="number">
|
104
|
|
<div>ZDBH002</div>
|
|
120
|
<div>{{ relevanceValidate.number }}</div>
|
105
|
121
|
</t-form-item>
|
106
|
122
|
<t-form-item label="关联类型">
|
107
|
123
|
<t-radio-group v-model="relevanceValidate.type" @change="userConectChanged()">
|
|
@ -112,7 +128,7 @@
|
112
|
128
|
<div class="row">
|
113
|
129
|
<div class="col-9">
|
114
|
130
|
<t-select v-model="relevanceValidate.user" placeholder="请选择">
|
115
|
|
<t-option v-for="(todo,index) in item.goList" :key="index" :value="todo.value">{{ todo.name }}</t-option>
|
|
131
|
<t-option v-for="(todo,index) in item.goList" :key="index" :value="todo">{{ todo.userName }}({{ todo.employeeNo }})</t-option>
|
116
|
132
|
</t-select>
|
117
|
133
|
</div>
|
118
|
134
|
<div class="col-3">
|
|
@ -120,6 +136,18 @@
|
120
|
136
|
</div>
|
121
|
137
|
</div>
|
122
|
138
|
</t-form-item>
|
|
139
|
<t-form-item v-show="relevanceValidate.msgisShow">
|
|
140
|
<div class="row">
|
|
141
|
<div class="col-3">
|
|
142
|
</div>
|
|
143
|
<div class="col-9">
|
|
144
|
<span style="color: #d01429;">
|
|
145
|
<t-icon icon="alert-circle-outline" color="danger" class="mr-5"></t-icon>
|
|
146
|
{{ relevanceValidate.msg }}
|
|
147
|
</span>
|
|
148
|
</div>
|
|
149
|
</div>
|
|
150
|
</t-form-item>
|
123
|
151
|
</t-form>
|
124
|
152
|
</div>
|
125
|
153
|
<div slot="footer">
|
|
@ -131,6 +159,7 @@
|
131
|
159
|
</template>
|
132
|
160
|
<script>
|
133
|
161
|
import './terminal-management.scss'
|
|
162
|
import services from "../../conf/services";
|
134
|
163
|
export default {
|
135
|
164
|
data() {
|
136
|
165
|
return {
|
|
@ -148,58 +177,37 @@ export default {
|
148
|
177
|
isRadio: '1',
|
149
|
178
|
isShow: true,
|
150
|
179
|
goList: [
|
151
|
|
{
|
152
|
|
name: '张三',
|
153
|
|
value: '0'
|
154
|
|
},
|
155
|
|
{
|
156
|
|
name: '李四',
|
157
|
|
value: '2'
|
158
|
|
},
|
159
|
|
{
|
160
|
|
name: '用户',
|
161
|
|
value: '1'
|
162
|
|
}
|
|
180
|
// {
|
|
181
|
// name: '张三',
|
|
182
|
// value: '0'
|
|
183
|
// },
|
|
184
|
// {
|
|
185
|
// name: '李四',
|
|
186
|
// value: '2'
|
|
187
|
// },
|
|
188
|
// {
|
|
189
|
// name: '用户',
|
|
190
|
// value: '1'
|
|
191
|
// }
|
163
|
192
|
]
|
164
|
193
|
},
|
165
|
194
|
{
|
166
|
195
|
isRadio: '2',
|
167
|
196
|
isShow: false,
|
168
|
197
|
goList: [
|
169
|
|
{
|
170
|
|
name: '张三',
|
171
|
|
value: '0'
|
172
|
|
},
|
173
|
|
{
|
174
|
|
name: '船舶',
|
175
|
|
value: '1'
|
176
|
|
}
|
|
198
|
// {
|
|
199
|
// name: '张三',
|
|
200
|
// value: '0'
|
|
201
|
// },
|
|
202
|
// {
|
|
203
|
// name: '船舶',
|
|
204
|
// value: '1'
|
|
205
|
// }
|
177
|
206
|
]
|
178
|
207
|
}
|
179
|
208
|
],
|
180
|
209
|
table: {
|
181
|
210
|
data: [
|
182
|
|
{
|
183
|
|
status: 1,
|
184
|
|
number: 'ZDBH0001',
|
185
|
|
relevanceUser: '张三',
|
186
|
|
finalPositioningTime: '2020.7.10 08:21:43',
|
187
|
|
remark: '无'
|
188
|
|
},
|
189
|
|
{
|
190
|
|
status: 2,
|
191
|
|
number: 'ZDBH0001',
|
192
|
|
relevanceUser: '张三',
|
193
|
|
finalPositioningTime: '2020.7.10 08:21:43',
|
194
|
|
remark: '无'
|
195
|
|
},
|
196
|
|
{
|
197
|
|
status: 3,
|
198
|
|
number: 'ZDBH0001',
|
199
|
|
relevanceUser: '张三',
|
200
|
|
finalPositioningTime: '2020.7.10 08:21:43',
|
201
|
|
remark: '无'
|
202
|
|
}
|
203
|
211
|
],
|
204
|
212
|
pager: {
|
205
|
213
|
currentPage: 1,
|
|
@ -208,12 +216,18 @@ export default {
|
208
|
216
|
}
|
209
|
217
|
},
|
210
|
218
|
queryCondition: {
|
211
|
|
type: '',
|
212
|
|
alarmPerson: ''
|
|
219
|
isBindDevice: '',
|
|
220
|
deviceNo: ''
|
213
|
221
|
},
|
214
|
222
|
connectName: '关联用户',
|
215
|
223
|
rangeDate: '',
|
216
|
224
|
modal: false,
|
|
225
|
updateModal: false,
|
|
226
|
updateFormValidate: {
|
|
227
|
number: '',
|
|
228
|
id: '',
|
|
229
|
desc: ''
|
|
230
|
},
|
217
|
231
|
formValidate: {
|
218
|
232
|
number: '',
|
219
|
233
|
desc: ''
|
|
@ -226,16 +240,18 @@ export default {
|
226
|
240
|
trigger: 'blur'
|
227
|
241
|
},
|
228
|
242
|
{
|
229
|
|
message: '请输入字母、数字、中划线、下划线、#',
|
|
243
|
message: '请输入数字#',
|
230
|
244
|
trigger: 'blur',
|
231
|
245
|
validator: function(rule, value, callback) {
|
232
|
|
if (!/^[a-zA-Z0-9-_#]+$/.test(value)) {
|
|
246
|
if (!/^[0-9-_#]+$/.test(value)) {
|
233
|
247
|
callback(rule.message)
|
234
|
248
|
} else {
|
235
|
249
|
// TODO 判断编号重复
|
236
|
|
if (true) {
|
|
250
|
if (false) {
|
237
|
251
|
rule.message = '编号重复'
|
238
|
252
|
callback(rule.message)
|
|
253
|
}else {
|
|
254
|
return true
|
239
|
255
|
}
|
240
|
256
|
}
|
241
|
257
|
}
|
|
@ -244,43 +260,106 @@ export default {
|
244
|
260
|
},
|
245
|
261
|
relevance: false,
|
246
|
262
|
relevanceValidate: {
|
247
|
|
type: '0',
|
248
|
|
user: ''
|
|
263
|
number: '',
|
|
264
|
PARTY_TERMINAL_ID: null,
|
|
265
|
id: '',
|
|
266
|
type: '1',
|
|
267
|
msg: '',
|
|
268
|
msgisShow: false,
|
|
269
|
user: null
|
249
|
270
|
},
|
250
|
271
|
relevanceRuleValidate: {
|
251
|
272
|
user: [
|
252
|
|
{ required: true, message: '请选择读写类型', trigger: 'change' }
|
|
273
|
{
|
|
274
|
message: '请选择关联对象',
|
|
275
|
trigger: 'change',
|
|
276
|
t: this,
|
|
277
|
validator: function(rule, value, callback) {
|
|
278
|
// TODO 判断编号重复
|
|
279
|
if (value == null) {
|
|
280
|
callback(rule.message)
|
|
281
|
} else {
|
|
282
|
var that = rule.t
|
|
283
|
var params = new FormData()
|
|
284
|
params.append('data', JSON.stringify({
|
|
285
|
PARTY_CODE: value.employeeNo
|
|
286
|
}))
|
|
287
|
that.$test.post(services.device.VERIFY_ASSOCIATINFO, params
|
|
288
|
).then(res => {
|
|
289
|
// 请求成功处理...
|
|
290
|
if (res.data.result !== null) {
|
|
291
|
that.relevanceValidate.PARTY_TERMINAL_ID = res.data.result.PARTY_TERMINAL_ID
|
|
292
|
that.relevanceValidate.msgisShow = true
|
|
293
|
that.relevanceValidate.msg = res.data.result.PARTY_NAME + ' 已关联终端 ' + res.data.result.DEVICE_ID + ' ,点击保存更改关联关系'
|
|
294
|
} else {
|
|
295
|
that.relevanceValidate.msgisShow = false
|
|
296
|
}
|
|
297
|
}).catch(res => {
|
|
298
|
// 请求失败处理...
|
|
299
|
})
|
|
300
|
return true
|
|
301
|
}
|
|
302
|
}
|
|
303
|
}
|
253
|
304
|
]
|
254
|
|
// user: [
|
255
|
|
// {
|
256
|
|
// required: true,
|
257
|
|
// message: '编号不能为空',
|
258
|
|
// trigger: 'blur'
|
259
|
|
// },
|
260
|
|
// {
|
261
|
|
// message: '张三已关联终端ZDBH001,点击保存更改关联关系',
|
262
|
|
// trigger: 'blur',
|
263
|
|
// validator: function(rule, value, callback) {
|
264
|
|
// if (!/^[a-zA-Z0-9-_#]+$/.test(value)) {
|
265
|
|
// callback(rule.message)
|
266
|
|
// } else {
|
267
|
|
// // TODO 判断编号重复
|
268
|
|
// if (true) {
|
269
|
|
// rule.message = '编号重复'
|
270
|
|
// callback(rule.message)
|
271
|
|
// }
|
272
|
|
// }
|
273
|
|
// }
|
274
|
|
// }
|
275
|
|
// ]
|
276
|
305
|
}
|
277
|
306
|
}
|
278
|
307
|
},
|
279
|
308
|
mounted() {
|
280
|
|
this.table.data = this.table.data.concat(this.table.data)
|
281
|
|
this.table.pager.total = this.table.data.length
|
|
309
|
// this.table.data = this.table.data.concat(this.table.data)
|
|
310
|
// this.table.pager.total = this.table.data.length
|
|
311
|
this.getList(1, 10 , 0,'')
|
|
312
|
this.initItemList()
|
282
|
313
|
},
|
283
|
314
|
methods: {
|
|
315
|
getList(pageNum, pageSize, isBindDevice, deviceNo) {
|
|
316
|
var params = new FormData()
|
|
317
|
params.append('data', JSON.stringify({
|
|
318
|
pageNum: pageNum,
|
|
319
|
pageSize: pageSize,
|
|
320
|
IsBindDevice: isBindDevice,
|
|
321
|
deviceNo: deviceNo
|
|
322
|
}))
|
|
323
|
this.$test.post(services.device.GET_DEVICE, params
|
|
324
|
).then(res => {
|
|
325
|
// 请求成功处理...
|
|
326
|
this.table.data = res.data.dataList
|
|
327
|
this.table.pager.total = res.data.dataNum
|
|
328
|
this.table.pager.currentPage = pageNum
|
|
329
|
}).catch(res => {
|
|
330
|
// 请求失败处理...
|
|
331
|
})
|
|
332
|
},
|
|
333
|
initItemList() {
|
|
334
|
var params = new FormData()
|
|
335
|
params.append('data', JSON.stringify({
|
|
336
|
type: '1'
|
|
337
|
}))
|
|
338
|
this.$test.post(services.device.GET_ASSOCIATINFO, params
|
|
339
|
).then(res => {
|
|
340
|
// 请求成功处理...
|
|
341
|
this.itemList[0].goList = res.data.result
|
|
342
|
}).catch(res => {
|
|
343
|
// 请求失败处理...
|
|
344
|
})
|
|
345
|
params = new FormData()
|
|
346
|
params.append('data', JSON.stringify({
|
|
347
|
type: '2'
|
|
348
|
}))
|
|
349
|
this.$test.post(services.device.GET_ASSOCIATINFO, params
|
|
350
|
).then(res => {
|
|
351
|
// 请求成功处理...
|
|
352
|
var arr = res.data.result
|
|
353
|
for (let i = 0; i < arr.length; i++) {
|
|
354
|
arr[i].userName = arr[i].FACILITY_NAME
|
|
355
|
arr[i].employeeNo = arr[i].FACILITY_CODE
|
|
356
|
arr[i].id = arr[i].FACILITY_ID
|
|
357
|
}
|
|
358
|
this.itemList[1].goList = arr
|
|
359
|
}).catch(res => {
|
|
360
|
// 请求失败处理...
|
|
361
|
})
|
|
362
|
},
|
284
|
363
|
cancelUserModal() {
|
285
|
364
|
this.relevance = false
|
286
|
365
|
this.$refs['relevanceValidate'].resetFields()
|
|
@ -288,19 +367,51 @@ export default {
|
288
|
367
|
confirmUserModal() {
|
289
|
368
|
this.$refs['relevanceValidate'].validate(valid => {
|
290
|
369
|
if (valid) {
|
291
|
|
this.relevance = false
|
|
370
|
var params = new FormData()
|
|
371
|
if (this.relevanceValidate.type === '1') {
|
|
372
|
params.append('data', JSON.stringify({
|
|
373
|
type: '1',
|
|
374
|
PARTY_TYPE: 1,
|
|
375
|
PARTY_CODE: this.relevanceValidate.user.employeeNo,
|
|
376
|
PARTY_TERMINAL_ID: this.relevanceValidate.PARTY_TERMINAL_ID,
|
|
377
|
PARTY_NAME: this.relevanceValidate.user.userName,
|
|
378
|
PARTY_POST: this.relevanceValidate.user.duty,
|
|
379
|
DEVICE_ID: this.relevanceValidate.id
|
|
380
|
}))
|
|
381
|
} else {
|
|
382
|
params.append('data', JSON.stringify({
|
|
383
|
type: '2',
|
|
384
|
FACILITY_ID: this.relevanceValidate.user.id,
|
|
385
|
DEVICE_ID: this.relevanceValidate.id
|
|
386
|
}))
|
|
387
|
}
|
|
388
|
this.$test.post(services.device.BIND_DEVICE, params
|
|
389
|
).then(res => {
|
|
390
|
// 请求成功处理...
|
|
391
|
if (res.data.result) {
|
|
392
|
this.relevance = false
|
|
393
|
this.$Message.success('提交成功!')
|
|
394
|
this.getList(this.table.pager.currentPage, this.table.pager.size, this.queryCondition.isBindDevice, this.queryCondition.deviceNo)
|
|
395
|
}
|
|
396
|
}).catch(res => {
|
|
397
|
// 请求失败处理...
|
|
398
|
})
|
292
|
399
|
}
|
293
|
400
|
})
|
294
|
401
|
},
|
295
|
402
|
goUserManagement () {
|
296
|
|
this.$router.push({path: '../system-management/user-management'})
|
|
403
|
if (this.relevanceValidate.type == '1') {
|
|
404
|
this.$router.push({path: '../system-management/user-management'})
|
|
405
|
} else {
|
|
406
|
this.$router.push({path: '../system-management/equipment-management'})
|
|
407
|
}
|
297
|
408
|
this.relevance = false
|
298
|
409
|
},
|
299
|
410
|
userConectChanged() {
|
300
|
411
|
this.itemList.forEach(element => {
|
301
|
412
|
if (element.isRadio === this.relevanceValidate.type) {
|
302
|
413
|
this.radioList.forEach(todo => {
|
303
|
|
this.relevanceValidate.user = ''
|
|
414
|
this.relevanceValidate.user = null
|
304
|
415
|
if (todo.value === this.relevanceValidate.type) {
|
305
|
416
|
this.connectName = '关联' + todo.label
|
306
|
417
|
}
|
|
@ -310,55 +421,135 @@ export default {
|
310
|
421
|
})
|
311
|
422
|
},
|
312
|
423
|
changeType(type) {
|
|
424
|
// 'all' 'relevance' 'unrelevance'
|
313
|
425
|
Object.keys(this.relevanceType).forEach((value, key) => {
|
314
|
426
|
this.relevanceType[value] = value === type
|
315
|
427
|
})
|
|
428
|
if (type === 'all') {
|
|
429
|
this.queryCondition.isBindDevice = 0
|
|
430
|
} else if (type === 'relevance') {
|
|
431
|
this.queryCondition.isBindDevice = 1
|
|
432
|
} else {
|
|
433
|
this.queryCondition.isBindDevice = 2
|
|
434
|
}
|
|
435
|
this.getList(1, this.table.pager.size, this.queryCondition.isBindDevice, this.queryCondition.deviceNo)
|
316
|
436
|
},
|
317
|
437
|
onChange(value) {
|
318
|
|
console.log('date change:' + value)
|
|
438
|
// console.log('date change:' + value)
|
319
|
439
|
},
|
320
|
440
|
onReset() {
|
321
|
|
|
|
441
|
Object.keys(this.relevanceType).forEach((value, key) => {
|
|
442
|
this.relevanceType[value] = value === 'all'
|
|
443
|
})
|
|
444
|
this.queryCondition.isBindDevice = 0
|
|
445
|
this.queryCondition.deviceNo = ''
|
|
446
|
this.onSearch()
|
322
|
447
|
},
|
323
|
448
|
onSearch() {
|
324
|
|
|
|
449
|
this.getList(1, this.table.pager.size, this.queryCondition.isBindDevice, this.queryCondition.deviceNo)
|
325
|
450
|
},
|
326
|
451
|
toExport() {
|
327
|
452
|
|
328
|
453
|
},
|
329
|
454
|
onPagerChange(page) {
|
330
|
|
|
|
455
|
this.table.pager.currentPage = page
|
|
456
|
this.getList(page, this.table.pager.size, this.queryCondition.isBindDevice, this.queryCondition.deviceNo)
|
331
|
457
|
},
|
332
|
458
|
onSizeChange(number) {
|
333
|
|
|
|
459
|
this.getList(1, number, this.queryCondition.isBindDevice, this.queryCondition.deviceNo)
|
334
|
460
|
},
|
335
|
461
|
addTerminal() {
|
336
|
462
|
this.modal = true
|
337
|
463
|
},
|
338
|
464
|
cancel() {
|
|
465
|
this.$refs['formValidate'].resetFields()
|
339
|
466
|
this.modal = false
|
|
467
|
this.updateModal = false
|
|
468
|
this.getList(this.table.pager.currentPage, this.table.pager.size, this.queryCondition.isBindDevice, this.queryCondition.deviceNo)
|
340
|
469
|
},
|
341
|
470
|
submit() {
|
|
471
|
var that = this
|
342
|
472
|
this.$refs.formValidate.validate(valid => {
|
343
|
473
|
if (valid) {
|
344
|
|
this.$Message.success('提交成功!')
|
|
474
|
var params = new FormData()
|
|
475
|
params.append('data', JSON.stringify({
|
|
476
|
deviceNo: that.formValidate.number,
|
|
477
|
remarks: that.formValidate.desc
|
|
478
|
}))
|
|
479
|
// console.log(that.formValidate.desc)
|
|
480
|
that.$test.post(services.device.ADD_DEVICE, params
|
|
481
|
).then(res => {
|
|
482
|
// 请求成功处理...
|
|
483
|
if (res.data.result) {
|
|
484
|
that.$Message.success('提交成功!')
|
|
485
|
that.cancel()
|
|
486
|
}else {
|
|
487
|
this.$Message.danger('终端编号重复!')
|
|
488
|
}
|
|
489
|
// this.getList(this.table.pager.currentPage, this.table.pager.size, this.queryCondition.equipmentType, this.queryCondition.equipmentName, this.queryCondition.equipmentNumber)
|
|
490
|
}).catch(res => {
|
|
491
|
// 请求失败处理...
|
|
492
|
})
|
345
|
493
|
} else {
|
346
|
494
|
this.$Message.danger('表单验证失败!')
|
347
|
495
|
}
|
348
|
496
|
})
|
349
|
497
|
},
|
350
|
|
solution(row) {
|
351
|
|
this.$Confirm.confirm({
|
352
|
|
title: '确认要解除终端ZDBH001和张三的关联关系吗?',
|
353
|
|
content: '解绑后将不可通过终端ZDH001获取张三的定位信息',
|
354
|
|
ok: () => {
|
355
|
|
console.log('点击了确定')
|
356
|
|
},
|
357
|
|
cancel: () => {
|
358
|
|
console.log('点击了取消')
|
|
498
|
updateSubmit() {
|
|
499
|
var params = new FormData()
|
|
500
|
params.append('data', JSON.stringify({
|
|
501
|
deviceId: this.updateFormValidate.id,
|
|
502
|
remarks: this.updateFormValidate.desc
|
|
503
|
}))
|
|
504
|
this.$test.post(services.device.UPD_DEVICE, params
|
|
505
|
).then(res => {
|
|
506
|
// 请求成功处理...
|
|
507
|
if (res.data.result) {
|
|
508
|
this.$Message.success('提交成功!')
|
|
509
|
this.cancel()
|
|
510
|
} else {
|
|
511
|
this.$Message.danger('终端编号重复!')
|
359
|
512
|
}
|
|
513
|
// this.getList(this.table.pager.currentPage, this.table.pager.size, this.queryCondition.equipmentType, this.queryCondition.equipmentName, this.queryCondition.equipmentNumber)
|
|
514
|
}).catch(res => {
|
|
515
|
// 请求失败处理...
|
360
|
516
|
})
|
361
|
517
|
},
|
|
518
|
solution(row) {
|
|
519
|
if (row.bindName === '--') {
|
|
520
|
this.$Confirm.info({
|
|
521
|
title: '提示',
|
|
522
|
content: '该终端未绑定对象,无需解绑'
|
|
523
|
})
|
|
524
|
} else {
|
|
525
|
this.$Confirm.confirm({
|
|
526
|
title: '确认要解除终端' + row.deviceNo + '和' + row.bindName + '的关联关系吗?',
|
|
527
|
content: '解绑后将不可通过终端' + row.deviceNo + '获取' + row.bindName + '的定位信息',
|
|
528
|
ok: () => {
|
|
529
|
var params = new FormData()
|
|
530
|
params.append('data', JSON.stringify({
|
|
531
|
DEVICE_ID: row.deviceId
|
|
532
|
}))
|
|
533
|
// console.log(that.formValidate.desc)
|
|
534
|
this.$test.post(services.device.UNBIND_DEVICE, params
|
|
535
|
).then(res => {
|
|
536
|
// 请求成功处理...
|
|
537
|
if (res.data.result) {
|
|
538
|
this.$Message.success('解绑成功!')
|
|
539
|
this.getList(this.table.pager.currentPage, this.table.pager.size, this.queryCondition.isBindDevice, this.queryCondition.deviceNo)
|
|
540
|
} else {
|
|
541
|
this.$Message.danger('解绑失败!')
|
|
542
|
}
|
|
543
|
}).catch(res => {
|
|
544
|
// 请求失败处理...
|
|
545
|
})
|
|
546
|
},
|
|
547
|
cancel: () => {
|
|
548
|
console.log('点击了取消')
|
|
549
|
}
|
|
550
|
})
|
|
551
|
}
|
|
552
|
},
|
362
|
553
|
delete(row) {
|
363
|
554
|
this.$Confirm.confirm({
|
364
|
555
|
title: '确认要删除终端ZDBH001吗?',
|
|
@ -370,6 +561,54 @@ export default {
|
370
|
561
|
console.log('点击了取消')
|
371
|
562
|
}
|
372
|
563
|
})
|
|
564
|
},
|
|
565
|
handleClick(row) {
|
|
566
|
this.updateModal = true
|
|
567
|
this.updateFormValidate.number = row.deviceNo
|
|
568
|
this.updateFormValidate.id = row.deviceId
|
|
569
|
this.updateFormValidate.desc = row.remarks
|
|
570
|
},
|
|
571
|
handleClickUser(row) {
|
|
572
|
this.initItemList()
|
|
573
|
this.relevanceValidate.type = '1'
|
|
574
|
this.relevanceValidate.PARTY_TERMINAL_ID = null
|
|
575
|
this.userConectChanged()
|
|
576
|
this.relevance = true
|
|
577
|
this.relevanceValidate.number = row.deviceNo
|
|
578
|
this.relevanceValidate.id = row.deviceId
|
|
579
|
if (row.bindName == '--') {
|
|
580
|
this.relevanceValidate.msgisShow = false
|
|
581
|
this.relevanceValidate.msg = ''
|
|
582
|
} else {
|
|
583
|
this.relevanceValidate.msgisShow = true
|
|
584
|
this.relevanceValidate.msg = '当前终端已关联 ' + row.bindName + ' ,点击保存更改关联关系'
|
|
585
|
}
|
|
586
|
},
|
|
587
|
removeD(row) {
|
|
588
|
let that = this
|
|
589
|
let confirm = {
|
|
590
|
title: '请确认',
|
|
591
|
content: '删除后不可恢复,确认删除吗?',
|
|
592
|
ok: function () {
|
|
593
|
var params = new FormData()
|
|
594
|
params.append('data', JSON.stringify({
|
|
595
|
deviceId: row.deviceId
|
|
596
|
}))
|
|
597
|
this.$test.post(services.device.DEL_DEVICE, params
|
|
598
|
).then(res => {
|
|
599
|
// 请求成功处理...
|
|
600
|
if (res.data.result) {
|
|
601
|
that.$Message.success('操作成功')
|
|
602
|
that.getList(that.table.pager.currentPage, that.table.pager.size, that.queryCondition.isBindDevice, that.queryCondition.deviceNo)
|
|
603
|
} else {
|
|
604
|
that.$Message.danger(res.data.errMsg)
|
|
605
|
}
|
|
606
|
}).catch(res => {
|
|
607
|
// 请求失败处理...
|
|
608
|
})
|
|
609
|
}
|
|
610
|
}
|
|
611
|
this.$Confirm.confirm(confirm)
|
373
|
612
|
}
|
374
|
613
|
}
|
375
|
614
|
}
|