Sfoglia il codice sorgente

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

konghl 4 anni fa
parent
commit
387e92633d

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

@ -194,6 +194,7 @@ export default {
194 194
    GET_WORK_EMPLOYEE: '/workEmployee/queryWorkEmployee', // 查询人员信息
195 195
    GET_ALL_ORGANIZE: '/workEmployee/queryAllOrganize', // 查询部门信息
196 196
    ADD_WORK_EMPLOYEE: '/workEmployee/createWorkEmployee', // 新增人员信息
197
    DEL_WORK_EMPLOYEE: '/workEmployee/deleteWorkEmployee', // 删除人员信息
197 198
    UPD_WORK_EMPLOYEE: '/workEmployee/modifyWorkEmployee' // 修改人员信息
198 199
  }
199 200
}

+ 34 - 59
ebc-middle-platform/src/modules/system-management/terminal-management.vue

@ -317,8 +317,8 @@ export default {
317 317
      }).then(res => {
318 318
        // 请求成功处理...
319 319
        this.tableLoading = false
320
        this.table.data = res.data.dataList
321
        this.table.pager.total = res.data.dataNum
320
        this.table.data = res.data.data
321
        this.table.pager.total = res.data.total
322 322
      }).catch(res => {
323 323
        // 请求失败处理...
324 324
        this.tableLoading = false
@ -328,8 +328,9 @@ export default {
328 328
      this.$test.post(services.device.GET_ASSOCIATINFO, {bindType: '1', name: name} // 查询人员
329 329
      ).then(res => {
330 330
        // 请求成功处理...
331
        debugger
331 332
        this.currentLoading = false
332
        this.itemList[0].goList = res.data.result
333
        this.itemList[0].goList = res.data
333 334
      }).catch(res => {
334 335
        // 请求失败处理...
335 336
      })
@ -337,7 +338,7 @@ export default {
337 338
      ).then(res => {
338 339
        // 请求成功处理...
339 340
        this.currentLoading = false
340
        var arr = res.data.result
341
        var arr = res.data
341 342
        for (let i = 0; i < arr.length; i++) {
342 343
          arr[i].name = arr[i].resourceToolName
343 344
          arr[i].code = arr[i].resourceToolCode
@ -352,7 +353,7 @@ export default {
352 353
      this.$test.post(services.device.GET_DEVICETYPES, {}
353 354
      ).then(res => {
354 355
        // 请求成功处理...
355
        this.deviceTypes = res.data.dataList
356
        this.deviceTypes = res.data
356 357
      }).catch(res => {
357 358
        // 请求失败处理...
358 359
      })
@ -387,12 +388,10 @@ export default {
387 388
          ).then(res => {
388 389
            // 请求成功处理...
389 390
            this.fullLoading = false
390
            if (res.data.result) {
391
              this.relevance = false
392
              this.loading = false
393
              this.$Message.success('提交成功!')
394
              this.getList()
395
            }
391
            this.relevance = false
392
            this.loading = false
393
            this.$Message.success('提交成功!')
394
            this.getList()
396 395
          }).catch(res => {
397 396
            // 请求失败处理...
398 397
            this.loading = false
@ -465,13 +464,9 @@ export default {
465 464
          }).then(res => {
466 465
            // 请求成功处理...
467 466
            that.fullLoading = false
468
            if (res.data.result) {
469
              that.$Message.success('提交成功!')
470
              that.cancel()
471
              that.getList()
472
            } else {
473
              that.$Message.danger(res.data.errMsg)
474
            }
467
            that.$Message.success('提交成功!')
468
            that.cancel()
469
            that.getList()
475 470
          }).catch(res => {
476 471
            // 请求失败处理...
477 472
          })
@ -490,13 +485,9 @@ export default {
490 485
      }).then(res => {
491 486
        // 请求成功处理...
492 487
        this.fullLoading = false
493
        if (res.data.result) {
494
          this.$Message.success('提交成功!')
495
          this.cancel()
496
          this.getList()
497
        } else {
498
          this.$Message.danger(res.data.errMsg)
499
        }
488
        this.$Message.success('提交成功!')
489
        this.cancel()
490
        this.getList()
500 491
      }).catch(res => {
501 492
        // 请求失败处理...
502 493
        this.fullLoading = false
@ -518,12 +509,8 @@ export default {
518 509
            ).then(res => {
519 510
              // 请求成功处理...
520 511
              this.fullLoading = false
521
              if (res.data.result) {
522
                this.$Message.success('解绑成功!')
523
                this.getList()
524
              } else {
525
                this.$Message.danger('解绑失败!')
526
              }
512
              this.$Message.success('解绑成功!')
513
              this.getList()
527 514
            }).catch(res => {
528 515
              // 请求失败处理...
529 516
              this.fullLoading = false
@ -556,12 +543,8 @@ export default {
556 543
            ).then(res => {
557 544
              // 请求成功处理...
558 545
              this.fullLoading = false
559
              if (res.data.result) {
560
                this.$Message.success('解绑成功!')
561
                this.getList()
562
              } else {
563
                this.$Message.danger('解绑失败!')
564
              }
546
              this.$Message.success('解绑成功!')
547
              this.getList()
565 548
            }).catch(res => {
566 549
              // 请求失败处理...
567 550
              this.fullLoading = false
@ -578,14 +561,14 @@ export default {
578 561
      ).then(res => {
579 562
        // 请求成功处理...
580 563
        this.updateModal = true
581
        this.updateFormValidate.number = res.data.resultData.deviceNo
582
        this.updateFormValidate.type = res.data.resultData.deviceTypeName
583
        this.updateFormValidate.typeId = res.data.resultData.deviceTypeId
584
        this.updateFormValidate.id = res.data.resultData.deviceId
585
        if (res.data.resultData.remarks === '无') {
564
        this.updateFormValidate.number = res.data.deviceNo
565
        this.updateFormValidate.type = res.data.deviceTypeName
566
        this.updateFormValidate.typeId = res.data.deviceTypeId
567
        this.updateFormValidate.id = res.data.deviceId
568
        if (res.data.remarks === '无') {
586 569
          this.updateFormValidate.desc = ''
587 570
        } else {
588
          this.updateFormValidate.desc = res.data.resultData.remarks
571
          this.updateFormValidate.desc = res.data.remarks
589 572
        }
590 573
      }).catch(res => {
591 574
        // 请求失败处理...
@ -603,16 +586,16 @@ export default {
603 586
      this.$test.post(services.device.GET_BIND_DEVICE, {deviceId: row.deviceId}
604 587
      ).then(res => {
605 588
        // 请求成功处理...
606
        if (res.data.resultData == null) {
589
        if (res.data == null) {
607 590
          this.relevanceValidate.msgisShow = false
608 591
          this.relevanceValidate.msg = ''
609 592
        } else {
610 593
          this.relevanceValidate.msgisShow = true
611 594
          var name = ''
612
          if (res.data.resultData.bindType === '1') {
613
            name = res.data.resultData.name
595
          if (res.data.bindType === '1') {
596
            name = res.data.name
614 597
          } else {
615
            name = res.data.resultData.resourceToolName
598
            name = res.data.resourceToolName
616 599
          }
617 600
          this.relevanceValidate.msg = '当前终端已关联 ' + name + ' ,点击保存更改关联关系'
618 601
        }
@ -630,12 +613,8 @@ export default {
630 613
          ).then(res => {
631 614
            // 请求成功处理...
632 615
            this.fullLoading = false
633
            if (res.data.result) {
634
              this.$Message.success('操作成功')
635
              this.getList()
636
            } else {
637
              this.$Message.danger(res.data.errMsg)
638
            }
616
            this.$Message.success('操作成功')
617
            this.getList()
639 618
          }).catch(res => {
640 619
            // 请求失败处理...
641 620
            this.fullLoading = false
@ -665,12 +644,8 @@ export default {
665 644
            ).then(res => {
666 645
              // 请求成功处理...
667 646
              this.fullLoading = false
668
              if (res.data.result) {
669
                this.$Message.success('操作成功')
670
                this.getList()
671
              } else {
672
                this.$Message.danger(res.data.errMsg)
673
              }
647
              this.$Message.success('操作成功')
648
              this.getList()
674 649
            }).catch(res => {
675 650
              // 请求失败处理...
676 651
              this.fullLoading = false

+ 259 - 65
ebc-middle-platform/src/modules/system-management/user-management.vue

@ -29,10 +29,10 @@
29 29
            </div>
30 30
          </div>
31 31
          <div class="btns">
32
            <t-button color="secondary" class="reset-btn" @click="onReset">重置</t-button>
33 32
            <t-button color="success" icon="search-outline" @click="onSearch">查询</t-button>
33
            <t-button color="secondary" class="reset-btn" @click="onReset">重置</t-button>
34 34
            <t-button color="secondary" icon="upload-outline" @click="toExport">导出至Excel</t-button>
35
            <t-button color="secondary" icon="delete-outline" @click="toExport">删除</t-button>
35
            <t-button color="secondary" icon="delete-outline" @click="toBatchRemove">删除</t-button>
36 36
          </div>
37 37
        </div>
38 38
      </div>
@ -45,12 +45,12 @@
45 45
      </div>
46 46
    </div>
47 47
    <div>
48
      <t-table :data="table.data" @selection-change="handleSelectionChange">
48
      <t-table :loading="tableLoading" :data="table.data" @selection-change="handleSelectionChange">
49 49
        <t-table-column type="selection" width="70"></t-table-column>
50 50
        <t-table-column prop="name" label="姓名"></t-table-column>
51 51
        <t-table-column prop="code" label="员工编号"></t-table-column>
52 52
        <t-table-column prop="orgName" label="部门"></t-table-column>
53
        <t-table-column prop="mainJobPosition" label="职务"></t-table-column>
53
        <t-table-column :formatter="type_formatter" prop="mainJobPosition" label="职务"></t-table-column>
54 54
        <t-table-column prop="age" label="年龄"></t-table-column>
55 55
        <t-table-column prop="mainWirelessCall" label="手机"></t-table-column>
56 56
        <t-table-column
@ -90,10 +90,8 @@
90 90
          ></t-select-tree>
91 91
        </t-form-item>
92 92
        <t-form-item label="职务" prop="job">
93
          <t-select v-model="formValidate.job" label-in-value placeholder="请选择职务">
94
            <t-option value="1">职务1</t-option>
95
            <t-option value="2">职务2</t-option>
96
            <t-option value="3">职务3</t-option>
93
          <t-select v-model="formValidate.job" placeholder="请选择职务">
94
            <t-option v-for="(item, index) in JobPostions" :key="index" :value="item.code">{{ item.value }}</t-option>
97 95
          </t-select>
98 96
        </t-form-item>
99 97
        <t-form-item label="出生年月" prop="age">
@ -110,6 +108,41 @@
110 108
        <t-button class="submit-button" @click="submit">保存</t-button>
111 109
      </div>
112 110
    </t-modal>
111
    <t-modal :visibled.sync="updateModal" :mask-closable="false" title="编辑用户" >
112
      <t-form ref="updateFormValidate" :model="updateFormValidate" :rules="updateRuleValidate" :label-width="80" label-position="left">
113
        <t-form-item label="员工编号" prop="number">
114
          {{ updateFormValidate.number }}
115
        </t-form-item>
116
        <t-form-item label="姓名" prop="name">
117
          <t-input v-model="updateFormValidate.name" placeholder="请输入姓名"></t-input>
118
        </t-form-item>
119
        <t-form-item label="部门" prop="department">
120
          <t-select-tree
121
            v-model="updateFormValidate.department"
122
            :node-data="cloneNodes"
123
            node-key="code"
124
          ></t-select-tree>
125
        </t-form-item>
126
        <t-form-item label="职务" prop="job">
127
          <t-select v-model="updateFormValidate.job" placeholder="请选择职务">
128
            <t-option v-for="(item, index) in JobPostions" :key="index" :value="item.code">{{ item.value }}</t-option>
129
          </t-select>
130
        </t-form-item>
131
        <t-form-item label="出生年月" prop="age">
132
          <!--          <t-input v-model="formValidate.age" placeholder="请输入数字"></t-input>-->
133
          <t-date-picker v-model="updateFormValidate.age"
134
                         placeholder="请选择出生年月"></t-date-picker>
135
        </t-form-item>
136
        <t-form-item label="手机" prop="phone">
137
          <t-input v-model="updateFormValidate.phone" placeholder="请输入手机号码"></t-input>
138
        </t-form-item>
139
      </t-form>
140
      <div slot="footer">
141
        <t-button @click="cancel">取消</t-button>
142
        <t-button class="submit-button" @click="updateSubmit">保存</t-button>
143
      </div>
144
    </t-modal>
145
    <t-loading v-model="fullLoading" fullscreen tip="加载中...."></t-loading>
113 146
  </div>
114 147
</template>
115 148
<script>
@ -128,6 +161,9 @@ export default {
128 161
      },
129 162
      departments: [],
130 163
      selections: [],
164
      JobPostions: [],
165
      fullLoading: false,
166
      tableLoading: true,
131 167
      queryCondition: {
132 168
        type: '',
133 169
        employeeNo: '',
@ -227,6 +263,81 @@ export default {
227 263
            }
228 264
          }
229 265
        ]
266
      },
267
      updateModal: false,
268
      updateFormValidate: {
269
        id: '',
270
        name: '',
271
        number: '',
272
        department: '',
273
        job: '',
274
        age: '',
275
        phone: ''
276
      },
277
      updateRuleValidate: {
278
        name: [
279
          {
280
            required: true,
281
            message: '姓名不能为空',
282
            trigger: 'blur'
283
          }
284
        ],
285
        department: [
286
          {
287
            required: true,
288
            message: '部门不能为空',
289
            trigger: 'change',
290
            validator: function(rule, value, callback) {
291
              // TODO 判断编号重复
292
              if (!value) {
293
                callback(rule.message)
294
              } else {
295
                return true
296
              }
297
            }
298
          }
299
        ],
300
        job: [
301
          {
302
            required: true,
303
            message: '职务不能为空',
304
            trigger: 'change',
305
            validator: function(rule, value, callback) {
306
              // TODO 判断编号重复
307
              if (!value) {
308
                callback(rule.message)
309
              } else {
310
                return true
311
              }
312
            }
313
          }
314
        ],
315
        age: [
316
          {
317
            required: true,
318
            message: '出生年月不能为空',
319
            trigger: 'change'
320
          }
321
        ],
322
        phone: [
323
          {
324
            required: true,
325
            message: '手机不能为空',
326
            trigger: 'blur'
327
          },
328
          {
329
            message: '手机格式不正确',
330
            trigger: 'blur',
331
            validator: function(rule, value, callback) {
332
              let pattern = /^1[3456789]\d{9}$/
333
              if (!pattern.test(value)) {
334
                callback(rule.message)
335
              } else {
336
                return true
337
              }
338
            }
339
          }
340
        ]
230 341
      }
231 342
    }
232 343
  },
@ -247,17 +358,17 @@ export default {
247 358
    }
248 359
  },
249 360
  mounted() {
250
    // this.table.data = this.table.data.concat(this.table.data)
251
    // this.table.pager.total = this.table.data.length
252 361
    this.getList()
253 362
    this.getDepartmentsList()
363
    this.initJobPostion()
254 364
  },
255 365
  methods: {
256 366
    getList: function () {
367
      this.tableLoading = true
257 368
      this.$test
258 369
        .post(services.workEmployee.GET_WORK_EMPLOYEE, {
259 370
          data: {
260
            orgId: this.queryCondition.department,
371
            orgCode: this.queryCondition.department,
261 372
            code: this.queryCondition.employeeNo,
262 373
            name: this.queryCondition.employeeName
263 374
          },
@ -266,13 +377,23 @@ export default {
266 377
        })
267 378
        .then((res) => {
268 379
          // 请求成功处理...
380
          this.tableLoading = false
269 381
          this.table.data = res.data.data
270 382
          this.table.pager.total = res.data.total
271 383
        })
272 384
        .catch((res) => {
273 385
          // 请求失败处理...
386
          this.tableLoading = false
274 387
        })
275 388
    },
389
    type_formatter(row, column) {
390
      var arr = this.JobPostions.filter((item) => {
391
        return item.code === row.mainJobPosition
392
      })
393
      if (arr[0]) {
394
        return arr[0].value
395
      }
396
    },
276 397
    getDepartmentsList: function () {
277 398
      this.$test
278 399
        .post(services.workEmployee.GET_ALL_ORGANIZE, {})
@ -286,7 +407,7 @@ export default {
286 407
                label: res.data[i].name,
287 408
                title: res.data[i].name,
288 409
                id: res.data[i].code,
289
                data: res.data[i].id,
410
                data: res.data[i].code,
290 411
                pid: res.data[i].parentCode
291 412
              })
292 413
            } else {
@ -294,7 +415,7 @@ export default {
294 415
                label: res.data[i].name,
295 416
                title: res.data[i].name,
296 417
                id: res.data[i].code,
297
                data: res.data[i].id
418
                data: res.data[i].code
298 419
              })
299 420
            }
300 421
          }
@ -303,6 +424,17 @@ export default {
303 424
          // 请求失败处理...
304 425
        })
305 426
    },
427
    initJobPostion: function () {
428
      this.$test
429
        .post(services.workEmployee.GET_JOB_POSTION, {})
430
        .then((res) => {
431
          // 请求成功处理...
432
          this.JobPostions = res.data
433
        })
434
        .catch((res) => {
435
          // 请求失败处理...
436
        })
437
    },
306 438
    onChange(value) {
307 439
      console.log('date change:' + value)
308 440
    },
@ -330,68 +462,67 @@ export default {
330 462
      this.getList()
331 463
    },
332 464
    handleClick(row) {
333
      this.modal = true
334
      // var params = new FormData()
335
      // params.append('data', JSON.stringify({
336
      //   FACILITY_ID: row.FACILITY_ID
337
      // }))
338
      // this.$test.post(services.equipment.GET_ONE_EQUIPMENT, params
339
      // ).then(res => {
340
      //   // 请求成功处理...
341
      //   this.updateModal = true
342
      //   this.updateRow = res.data.resultData
343
      //   this.typeChange(2)
344
      // }).catch(res => {
345
      //   // 请求失败处理...
346
      // })
465
      this.updateModal = true
466
      this.$test
467
        .post(services.workEmployee.GET_WORK_EMPLOYEE, {
468
          data: {
469
            id: row.id
470
          },
471
          pageNumber: 1,
472
          pageSize: 1
473
        })
474
        .then((res) => {
475
        // 请求成功处理...
476
          var user = res.data.data[0]
477
          this.updateFormValidate = {
478
            id: user.id,
479
            name: user.name,
480
            number: user.code,
481
            department: user.orgCode,
482
            job: user.mainJobPosition,
483
            age: user.birthday,
484
            phone: user.mainWirelessCall
485
          }
486
        })
487
        .catch((res) => {
488
        // 请求失败处理...
489
        })
347 490
    },
348 491
    remove(row) {
349
      this.$Confirm.confirm({
350
        title: '确认要删除用户张三吗?',
351
        content: '删除后不可恢复',
492
      let confirm = {
493
        title: '确认',
494
        content: '删除后不可恢复,确认删除吗?',
352 495
        ok: () => {
353
          console.log('点击了确定')
354
        },
355
        cancel: () => {
356
          console.log('点击了取消')
496
          this.fullLoading = true
497
          this.$test.post(services.workEmployee.DEL_WORK_EMPLOYEE, {ids: row.id this.$test.post(services.workEmployee.DEL_WORK_EMPLOYEE, {ids: row.id}
498
          ).then(res => {
499
            // 请求成功处理...
500
            this.fullLoading = false
501
            this.$Message.success('操作成功')
502
            this.getList()
503
          }).catch(res => {
504
            // 请求失败处理...
505
            this.fullLoading = false
506
          })
357 507
        }
358
      })
359
      // let that = this
360
      // let confirm = {
361
      //   title: '请确认',
362
      //   content: '删除后不可恢复,确认删除吗?',
363
      //   ok: function () {
364
      //     var params = new FormData()
365
      //     params.append('data', JSON.stringify({
366
      //       params: {
367
      //         FACILITY_ID: row.FACILITY_ID
368
      //       }
369
      //     }))
370
      //     this.$test.post(services.equipment.DEL_EQUIPMENT, params
371
      //     ).then(res => {
372
      //       // 请求成功处理...
373
      //       that.$Message.success('操作成功')
374
      //       that.getList()
375
      //     }).catch(res => {
376
      //       // 请求失败处理...
377
      //     })
378
      //   }
379
      // }
380
      // this.$Confirm.confirm(confirm)
508
      }
509
      this.$Confirm.confirm(confirm)
381 510
    },
382 511
    cancel() {
383 512
      this.modal = false
513
      this.updateModal = false
384 514
      this.$refs['formValidate'].resetFields()
385 515
    },
386 516
    submit() {
387 517
      var that = this
388 518
      this.$refs.formValidate.validate(valid => {
389 519
        if (valid) {
520
          that.fullLoading = true
390 521
          that.$test.post(services.workEmployee.ADD_WORK_EMPLOYEE, {
391 522
            name: that.formValidate.name,
392 523
            code: that.formValidate.number,
393 524
            organizeCode: that.formValidate.department,
394
            mainJobPosition: that.formValidate.job.value,
525
            mainJobPosition: that.formValidate.job,
395 526
            birthday: that.formValidate.age,
396 527
            // cardType: "居民身份证",
397 528
            // cardNo: "43252345455412305567X",
@ -400,16 +531,47 @@ export default {
400 531
          }
401 532
          ).then(res => {
402 533
            // 请求成功处理...
403
            if (res.data) {
404
              that.$Message.success('提交成功!')
405
              that.cancel()
406
              that.getList()
407
            } else {
408
              this.$Message.danger('终端编号重复!')
409
            }
534
            that.fullLoading = false
535
            that.$Message.success('提交成功!')
536
            that.cancel()
537
            that.getList()
410 538
            // this.getList(this.table.pager.currentPage, this.table.pager.size, this.queryCondition.equipmentType, this.queryCondition.equipmentName, this.queryCondition.equipmentNumber)
411 539
          }).catch(res => {
412 540
            // 请求失败处理...
541
            that.fullLoading = false
542
          })
543
        } else {
544
          this.$Message.danger('表单验证失败!')
545
        }
546
      })
547
    },
548
    updateSubmit() {
549
      var that = this
550
      this.$refs.updateFormValidate.validate(valid => {
551
        if (valid) {
552
          that.fullLoading = true
553
          var birthday = that.updateFormValidate.age.replaceAll(' 00:00:00', '')
554
          that.$test.post(services.workEmployee.UPD_WORK_EMPLOYEE, {
555
            id: that.updateFormValidate.id,
556
            name: that.updateFormValidate.name,
557
            code: that.updateFormValidate.number,
558
            organizeCode: that.updateFormValidate.department,
559
            mainJobPosition: that.updateFormValidate.job,
560
            birthday: birthday,
561
            // cardType: "居民身份证",
562
            // cardNo: "43252345455412305567X",
563
            // gender: "男",
564
            mainWirelessCall: that.updateFormValidate.phone
565
          }
566
          ).then(res => {
567
            // 请求成功处理...
568
            this.fullLoading = false
569
            that.$Message.success('提交成功!')
570
            that.cancel()
571
            that.getList()
572
          }).catch(res => {
573
            // 请求失败处理...
574
            this.fullLoading = false
413 575
          })
414 576
        } else {
415 577
          this.$Message.danger('表单验证失败!')
@ -422,6 +584,38 @@ export default {
422 584
    addUser() {
423 585
      this.modal = true
424 586
      this.getDepartmentsList()
587
    },
588
    toBatchRemove(row) { // 批量删除
589
      if (this.selections.length === 0) {
590
        this.$Confirm.info({
591
          title: '提示',
592
          content: '请选中需要删除的人员。'
593
        })
594
      } else {
595
        var ids = ''
596
        for (let i = 0; i < this.selections.length; i++) {
597
          ids += this.selections[i].id + ','
598
        }
599
        ids = ids.substring(0, ids.length - 1)
600
        let confirm = {
601
          title: '请确认',
602
          content: '删除后不可恢复,确认删除吗?',
603
          ok: () => {
604
            this.fullLoading = true
605
            this.$test.post(services.workEmployee.DEL_WORK_EMPLOYEE, {ids: ids}
606
            ).then(res => {
607
              // 请求成功处理...
608
              this.fullLoading = false
609
              this.$Message.success('操作成功')
610
              this.getList()
611
            }).catch(res => {
612
              // 请求失败处理...
613
              this.fullLoading = false
614
            })
615
          }
616
        }
617
        this.$Confirm.confirm(confirm)
618
      }
425 619
    }
426 620
  }
427 621
}