Quellcode durchsuchen

Merge branch 'master' of http://10.1.235.20:3000/asiainfo/ebc.git

konghl vor 4 Jahren
Ursprung
Commit
8c1bd0a40d

+ 3 - 1
ebc-middle-platform/src/conf/services.js

@ -190,8 +190,10 @@ export default {
190 190
    RESCUE_LOG: '/rescue/queryPageRescueLog' // // 查询历史报警信息
191 191
  },
192 192
  workEmployee: {
193
    GET_JOB_POSTION: '/workEmployee/queryJobPositionList', // 查询人员信息
193 194
    GET_WORK_EMPLOYEE: '/workEmployee/queryWorkEmployee', // 查询人员信息
194 195
    GET_ALL_ORGANIZE: '/workEmployee/queryAllOrganize', // 查询部门信息
195
    ADD_WORK_EMPLOYEE: '/workEmployee/createWorkEmployee' // 新增人员信息
196
    ADD_WORK_EMPLOYEE: '/workEmployee/createWorkEmployee', // 新增人员信息
197
    UPD_WORK_EMPLOYEE: '/workEmployee/modifyWorkEmployee' // 修改人员信息
196 198
  }
197 199
}

+ 124 - 100
ebc-middle-platform/src/modules/system-management/terminal-management.vue

@ -6,7 +6,6 @@
6 6
          <div class="label">绑定状态:</div>
7 7
          <div class="input-rule">
8 8
            <t-select v-model="queryCondition.isBindDevice" placeholder="请选择...">
9
              <t-option value="0">全部</t-option>
10 9
              <t-option value="1">已绑定</t-option>
11 10
              <t-option value="2">未绑定</t-option>
12 11
            </t-select>
@ -16,7 +15,7 @@
16 15
          <div class="label">终端类型:</div>
17 16
          <div class="input-rule">
18 17
            <t-select v-model="queryCondition.type" placeholder="请选择...">
19
              <t-option v-for="(item, index) in deviceTypes" :key="index" :value="item.code">{{ item.value }}</t-option>
18
              <t-option v-for="(item, index) in deviceTypes" :key="index" :value="item.deviceTypeId">{{ item.deviceTypeName }}</t-option>
20 19
            </t-select>
21 20
          </div>
22 21
        </div>
@ -43,16 +42,16 @@
43 42
      </div>
44 43
    </div>
45 44
    <div>
46
      <t-table :data="table.data" @selection-change="handleSelectionChange">
45
      <t-table :data="table.data" :loading="tableLoading" @selection-change="handleSelectionChange">
47 46
        <t-table-column type="selection" width="70"></t-table-column>
48 47
        <t-table-column prop="deviceTypeName" label="终端类型"></t-table-column>
49 48
        <t-table-column prop="deviceNo" label="终端编号"></t-table-column>
50 49
        <t-table-column prop="bindName" label="关联用户/船舶"></t-table-column>
51 50
        <t-table-column prop="remarks" label="备注"></t-table-column>
52 51
        <t-table-column
53
            fixed="right"
54
            label="操作"
55
            width="220"
52
          fixed="right"
53
          label="操作"
54
          width="220"
56 55
        >
57 56
          <template slot-scope="scope">
58 57
            <a href="javascript:void(0)" size="sm" @click="() => handleClickUser(scope.row)">关联</a>
@ -75,7 +74,7 @@
75 74
      <t-form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80" label-position="left">
76 75
        <t-form-item label="终端类型" prop="type">
77 76
          <t-select v-model="formValidate.type" label-in-value placeholder="请选择...">
78
            <t-option v-for="(item, index) in deviceTypes" :key="index" :value="item.code">{{ item.value }}</t-option>
77
            <t-option v-for="(item, index) in deviceTypes" :key="index" :value="item.deviceTypeId">{{ item.deviceTypeName }}</t-option>
79 78
          </t-select>
80 79
        </t-form-item>
81 80
        <t-form-item label="终端编号" prop="number">
@ -83,10 +82,10 @@
83 82
        </t-form-item>
84 83
        <t-form-item label="备注" prop="desc">
85 84
          <t-input
86
              v-model="formValidate.desc"
87
              :autosize="{minRows: 2,maxRows: 5}"
88
              type="textarea"
89
              placeholder="请输入..."
85
            v-model="formValidate.desc"
86
            :autosize="{minRows: 2,maxRows: 5}"
87
            type="textarea"
88
            placeholder="请输入..."
90 89
          ></t-input>
91 90
        </t-form-item>
92 91
      </t-form>
@ -105,10 +104,10 @@
105 104
        </t-form-item>
106 105
        <t-form-item label="备注" prop="desc">
107 106
          <t-input
108
              v-model="updateFormValidate.desc"
109
              :autosize="{minRows: 2,maxRows: 5}"
110
              type="textarea"
111
              placeholder="请输入..."
107
            v-model="updateFormValidate.desc"
108
            :autosize="{minRows: 2,maxRows: 5}"
109
            type="textarea"
110
            placeholder="请输入..."
112 111
          ></t-input>
113 112
        </t-form-item>
114 113
      </t-form>
@ -128,15 +127,13 @@
128 127
              <t-radio v-for="(item,index) in radioList" :value="item.value" :key="index" :label="item.label"></t-radio>
129 128
            </t-radio-group>
130 129
          </t-form-item>
131
          <t-form-item v-for="(item,index) in itemList" v-show="item.isShow" :key="index" :label="connectName" prop="user">
130
          <t-form-item v-for="(item,index) in itemList" v-if="item.isShow" :key="index" :label="connectName" prop="user">
132 131
            <div class="row">
133 132
              <div class="col-9">
134 133
                <t-select v-model="relevanceValidate.user"
135
                          :loading.sync="currentLoading"
136 134
                          placeholder="请选择"
137 135
                          filterable
138 136
                          clearable
139
                          @load="$_onLoad"
140 137
                >
141 138
                  <t-option v-for="(todo,index) in item.goList" :key="index" :value="todo">{{ todo.name }}({{ todo.code }})</t-option>
142 139
                </t-select>
@ -162,9 +159,10 @@
162 159
      </div>
163 160
      <div slot="footer">
164 161
        <t-button @click="cancelUserModal">取消</t-button>
165
        <t-button color="primary" @click="confirmUserModal">确定</t-button>
162
        <t-button :loading="loading" color="primary" @click="confirmUserModal">确定</t-button>
166 163
      </div>
167 164
    </t-modal>
165
    <t-loading v-model="fullLoading" fullscreen tip="加载中...."></t-loading>
168 166
  </div>
169 167
</template>
170 168
<script>
@ -204,17 +202,20 @@ export default {
204 202
        }
205 203
      },
206 204
      queryCondition: {
207
        isBindDevice: '0',
205
        isBindDevice: '',
208 206
        type: '',
209 207
        deviceNo: ''
210 208
      },
211 209
      deviceTypes: [],
212 210
      selections: [],
211
      loading: false,
213 212
      currentLoading: false,
214 213
      connectName: '关联用户',
215 214
      rangeDate: '',
216 215
      modal: false,
217 216
      updateModal: false,
217
      tableLoading: true,
218
      fullLoading: false,
218 219
      updateFormValidate: {
219 220
        number: '',
220 221
        type: '',
@ -266,7 +267,7 @@ export default {
266 267
              }
267 268
            }
268 269
          }
269
        ],
270
        ]
270 271
      },
271 272
      relevance: false,
272 273
      relevanceValidate: {
@ -303,22 +304,28 @@ export default {
303 304
  },
304 305
  methods: {
305 306
    getList() {
307
      this.tableLoading = true
308
      this.table.data = []
306 309
      this.$test.post(services.device.GET_DEVICE, {
307 310
        pageNumber: this.table.pager.currentPage,
308 311
        pageSize: this.table.pager.size,
309
        IsBindDevice: this.queryCondition.isBindDevice,
310
        deviceNo: this.queryCondition.deviceNo,
311
        deviceTypeId: this.queryCondition.type
312
        data: {
313
          IsBindDevice: this.queryCondition.isBindDevice,
314
          deviceNo: this.queryCondition.deviceNo,
315
          deviceTypeId: this.queryCondition.type
316
        }
312 317
      }).then(res => {
313 318
        // 请求成功处理...
319
        this.tableLoading = false
314 320
        this.table.data = res.data.dataList
315 321
        this.table.pager.total = res.data.dataNum
316 322
      }).catch(res => {
317 323
        // 请求失败处理...
324
        this.tableLoading = false
318 325
      })
319 326
    },
320 327
    initItemList(name) { // 获取人员和设备的数据
321
      this.$test.post(services.device.GET_ASSOCIATINFO, {bindType: '1', name:name} // 查询人员
328
      this.$test.post(services.device.GET_ASSOCIATINFO, {bindType: '1', name: name} // 查询人员
322 329
      ).then(res => {
323 330
        // 请求成功处理...
324 331
        this.currentLoading = false
@ -326,7 +333,7 @@ export default {
326 333
      }).catch(res => {
327 334
        // 请求失败处理...
328 335
      })
329
      this.$test.post(services.device.GET_ASSOCIATINFO, {bindType: '2', name:name} // 查询设备
336
      this.$test.post(services.device.GET_ASSOCIATINFO, {bindType: '2', name: name} // 查询设备
330 337
      ).then(res => {
331 338
        // 请求成功处理...
332 339
        this.currentLoading = false
@ -354,40 +361,42 @@ export default {
354 361
      this.initItemList(filterValue)
355 362
    },
356 363
    cancelUserModal() {
357
      this.relevance = false
358 364
      this.$refs['relevanceValidate'].resetFields()
365
      this.itemList.forEach(e => {
366
        e.isShow = false
367
      })
368
      this.relevance = false
359 369
    },
360 370
    confirmUserModal() { // 绑定操作提交
371
      var that = this
361 372
      this.$refs['relevanceValidate'].validate(valid => {
362 373
        if (valid) {
363
          var params = new FormData()
364
          if (this.relevanceValidate.type === '1') {
365
            params.append('data', JSON.stringify({
366
              type: '1',
367
              PARTY_TYPE: 1,
368
              PARTY_CODE: this.relevanceValidate.user.employeeNo,
369
              PARTY_TERMINAL_ID: this.relevanceValidate.PARTY_TERMINAL_ID,
370
              PARTY_NAME: this.relevanceValidate.user.userName,
371
              PARTY_POST: this.relevanceValidate.user.duty,
372
              DEVICE_ID: this.relevanceValidate.id
373
            }))
374
          this.loading = true
375
          var id = ''
376
          if (that.relevanceValidate.type === '1') {
377
            id = that.relevanceValidate.user.id
374 378
          } else {
375
            params.append('data', JSON.stringify({
376
              type: '2',
377
              FACILITY_ID: this.relevanceValidate.user.id,
378
              DEVICE_ID: this.relevanceValidate.id
379
            }))
379
            id = that.relevanceValidate.user.id
380
          }
381
          that.fullLoading = true
382
          that.$test.post(services.device.BIND_DEVICE, {
383
            bindType: this.relevanceValidate.type,
384
            deviceId: this.relevanceValidate.id,
385
            associatedId: id
380 386
          }
381
          this.$test.post(services.device.BIND_DEVICE, params
382 387
          ).then(res => {
383 388
            // 请求成功处理...
389
            this.fullLoading = false
384 390
            if (res.data.result) {
385 391
              this.relevance = false
392
              this.loading = false
386 393
              this.$Message.success('提交成功!')
387 394
              this.getList()
388 395
            }
389 396
          }).catch(res => {
390 397
            // 请求失败处理...
398
            this.loading = false
399
            this.fullLoading = false
391 400
          })
392 401
        }
393 402
      })
@ -414,7 +423,7 @@ export default {
414 423
      })
415 424
    },
416 425
    onReset() {
417
      this.queryCondition.isBindDevice = 0
426
      this.queryCondition.isBindDevice = ''
418 427
      this.queryCondition.type = ''
419 428
      this.queryCondition.deviceNo = ''
420 429
      this.onSearch()
@ -447,7 +456,7 @@ export default {
447 456
      var that = this
448 457
      this.$refs.formValidate.validate(valid => {
449 458
        if (valid) {
450
          debugger
459
          that.fullLoading = true
451 460
          that.$test.post(services.device.ADD_DEVICE, {
452 461
            deviceTypeId: that.formValidate.type.value,
453 462
            deviceTypeName: that.formValidate.type.label,
@ -455,12 +464,13 @@ export default {
455 464
            remarks: that.formValidate.desc
456 465
          }).then(res => {
457 466
            // 请求成功处理...
467
            that.fullLoading = false
458 468
            if (res.data.result) {
459 469
              that.$Message.success('提交成功!')
460 470
              that.cancel()
461
              this.getList()
471
              that.getList()
462 472
            } else {
463
              this.$Message.danger(res.data.errMsg)
473
              that.$Message.danger(res.data.errMsg)
464 474
            }
465 475
          }).catch(res => {
466 476
            // 请求失败处理...
@ -471,6 +481,7 @@ export default {
471 481
      })
472 482
    },
473 483
    updateSubmit() { // 编辑提交
484
      this.fullLoading = true
474 485
      this.$test.post(services.device.UPD_DEVICE, {
475 486
        deviceId: this.updateFormValidate.id,
476 487
        deviceTypeName: this.updateFormValidate.type,
@ -478,6 +489,7 @@ export default {
478 489
        remarks: this.updateFormValidate.desc
479 490
      }).then(res => {
480 491
        // 请求成功处理...
492
        this.fullLoading = false
481 493
        if (res.data.result) {
482 494
          this.$Message.success('提交成功!')
483 495
          this.cancel()
@ -487,6 +499,7 @@ export default {
487 499
        }
488 500
      }).catch(res => {
489 501
        // 请求失败处理...
502
        this.fullLoading = false
490 503
      })
491 504
    },
492 505
    solution(row) { // 解绑
@ -498,16 +511,13 @@ export default {
498 511
      } else {
499 512
        this.$Confirm.confirm({
500 513
          title: '确认要解除终端' + row.deviceNo + '和' + row.bindName + '的关联关系吗?',
501
          content: '解绑后将不可通过终端' + row.deviceNo + '获取' + row.bindName + '的定位信息',
514
          content: '解绑后将不可通过终端 ' + row.deviceNo + ' 获取 ' + row.bindName + '的定位信息',
502 515
          ok: () => {
503
            var params = new FormData()
504
            params.append('data', JSON.stringify({
505
              DEVICE_ID: row.deviceId
506
            }))
507
            // console.log(that.formValidate.desc)
508
            this.$test.post(services.device.UNBIND_DEVICE, params
516
            this.fullLoading = true
517
            this.$test.post(services.device.UNBIND_DEVICE, {deviceId: row.deviceId}
509 518
            ).then(res => {
510 519
              // 请求成功处理...
520
              this.fullLoading = false
511 521
              if (res.data.result) {
512 522
                this.$Message.success('解绑成功!')
513 523
                this.getList()
@ -516,6 +526,7 @@ export default {
516 526
              }
517 527
            }).catch(res => {
518 528
              // 请求失败处理...
529
              this.fullLoading = false
519 530
            })
520 531
          },
521 532
          cancel: () => {
@ -525,39 +536,42 @@ export default {
525 536
      }
526 537
    },
527 538
    toBatchSolution(row) { // 批量解绑
528
      // if (row.bindName === '--') {
529
      //   this.$Confirm.info({
530
      //     title: '提示',
531
      //     content: '该终端未绑定对象,无需解绑'
532
      //   })
533
      // } else {
534
      //   this.$Confirm.confirm({
535
      //     title: '确认要解除终端' + row.deviceNo + '和' + row.bindName + '的关联关系吗?',
536
      //     content: '解绑后将不可通过终端' + row.deviceNo + '获取' + row.bindName + '的定位信息',
537
      //     ok: () => {
538
      //       var params = new FormData()
539
      //       params.append('data', JSON.stringify({
540
      //         DEVICE_ID: row.deviceId
541
      //       }))
542
      //       // console.log(that.formValidate.desc)
543
      //       this.$test.post(services.device.UNBIND_DEVICE, params
544
      //       ).then(res => {
545
      //         // 请求成功处理...
546
      //         if (res.data.result) {
547
      //           this.$Message.success('解绑成功!')
548
      //           this.getList()
549
      //         } else {
550
      //           this.$Message.danger('解绑失败!')
551
      //         }
552
      //       }).catch(res => {
553
      //         // 请求失败处理...
554
      //       })
555
      //     },
556
      //     cancel: () => {
557
      //       console.log('点击了取消')
558
      //     }
559
      //   })
560
      // }
539
      if (this.selections.length === 0) {
540
        this.$Confirm.info({
541
          title: '提示',
542
          content: '请选中需要删除的终端。'
543
        })
544
      } else {
545
        var deviceId = ''
546
        for (let i = 0; i < this.selections.length; i++) {
547
          deviceId += this.selections[i].deviceId + ','
548
        }
549
        deviceId = deviceId.substring(0, deviceId.length - 1)
550
        this.$Confirm.confirm({
551
          title: '确认要解除选中终端的关联关系吗?',
552
          content: '解绑后将不可通过终端获取定位信息',
553
          ok: () => {
554
            this.fullLoading = true
555
            this.$test.post(services.device.UNBIND_DEVICE, {deviceId: deviceId}
556
            ).then(res => {
557
              // 请求成功处理...
558
              this.fullLoading = false
559
              if (res.data.result) {
560
                this.$Message.success('解绑成功!')
561
                this.getList()
562
              } else {
563
                this.$Message.danger('解绑失败!')
564
              }
565
            }).catch(res => {
566
              // 请求失败处理...
567
              this.fullLoading = false
568
            })
569
          },
570
          cancel: () => {
571
            console.log('点击了取消')
572
          }
573
        })
574
      }
561 575
    },
562 576
    handleClick(row) {
563 577
      this.$test.post(services.device.GET_ONE_DEVICE, {deviceId: row.deviceId}
@ -589,34 +603,42 @@ export default {
589 603
      this.$test.post(services.device.GET_BIND_DEVICE, {deviceId: row.deviceId}
590 604
      ).then(res => {
591 605
        // 请求成功处理...
592
        if (res.data.resultData.bindName == '--') {
606
        if (res.data.resultData == null) {
593 607
          this.relevanceValidate.msgisShow = false
594 608
          this.relevanceValidate.msg = ''
595 609
        } else {
596 610
          this.relevanceValidate.msgisShow = true
597
          this.relevanceValidate.msg = '当前终端已关联 ' + res.data.resultData.bindName + ' ,点击保存更改关联关系'
611
          var name = ''
612
          if (res.data.resultData.bindType === '1') {
613
            name = res.data.resultData.name
614
          } else {
615
            name = res.data.resultData.resourceToolName
616
          }
617
          this.relevanceValidate.msg = '当前终端已关联 ' + name + ' ,点击保存更改关联关系'
598 618
        }
599 619
      }).catch(res => {
600 620
        // 请求失败处理...
601 621
      })
602 622
    },
603 623
    removeD(row) {
604
      let that = this
605 624
      let confirm = {
606 625
        title: '请确认',
607 626
        content: '删除后不可恢复,确认删除吗?',
608
        ok: function () {
627
        ok: () => {
628
          this.fullLoading = true
609 629
          this.$test.post(services.device.DEL_DEVICE, {deviceId: row.deviceId}
610 630
          ).then(res => {
611 631
            // 请求成功处理...
632
            this.fullLoading = false
612 633
            if (res.data.result) {
613
              that.$Message.success('操作成功')
614
              that.getList()
634
              this.$Message.success('操作成功')
635
              this.getList()
615 636
            } else {
616
              that.$Message.danger(res.data.errMsg)
637
              this.$Message.danger(res.data.errMsg)
617 638
            }
618 639
          }).catch(res => {
619 640
            // 请求失败处理...
641
            this.fullLoading = false
620 642
          })
621 643
        }
622 644
      }
@ -634,22 +656,24 @@ export default {
634 656
          deviceId += this.selections[i].deviceId + ','
635 657
        }
636 658
        deviceId = deviceId.substring(0, deviceId.length - 1)
637
        let that = this
638 659
        let confirm = {
639 660
          title: '请确认',
640 661
          content: '删除后不可恢复,确认删除吗?',
641
          ok: function () {
662
          ok: () => {
663
            this.fullLoading = true
642 664
            this.$test.post(services.device.DEL_DEVICE, {deviceId: deviceId}
643 665
            ).then(res => {
644 666
              // 请求成功处理...
667
              this.fullLoading = false
645 668
              if (res.data.result) {
646
                that.$Message.success('操作成功')
647
                that.getList()
669
                this.$Message.success('操作成功')
670
                this.getList()
648 671
              } else {
649
                that.$Message.danger(res.data.errMsg)
672
                this.$Message.danger(res.data.errMsg)
650 673
              }
651 674
            }).catch(res => {
652 675
              // 请求失败处理...
676
              this.fullLoading = false
653 677
            })
654 678
          }
655 679
        }