Browse Source

修正bug

lipengtao 6 years ago
parent
commit
146b50d9ef

+ 34 - 0
src/api/numberDictionary.js

@ -0,0 +1,34 @@
1
import request from '@/utils/request'
2
3
/*  主缆 */
4
export function mainCable() {
5
  return request({
6
    url: '/ajax/dict/items',
7
    method: 'get',
8
    params: {
9
    	dict: 'ZLLX'
10
    }
11
  })
12
}
13
14
/*  位置 */
15
export function location() {
16
  return request({
17
    url: '/ajax/dict/items',
18
    method: 'get',
19
    params: {
20
    	dict: 'ZLWZ'
21
    }
22
  })
23
}
24
25
/*  省市区 */
26
export function provinceCityDistrict() {
27
  return request({
28
    url: '/ajax/dict/items',
29
    method: 'get',
30
    params: {
31
    	dict: 'XZQH'
32
    }
33
  })
34
}

+ 21 - 16
src/views/peoplesManage/infoManage/editUser.vue

@ -4,7 +4,7 @@
4 4
        <el-row>
5 5
          <el-col :span="12">
6 6
            <el-form-item label="账号" prop='account'>
7
              <el-input placeholder="请输入账号" v-model="ruleForm2.account"></el-input>
7
              <el-input placeholder="请输入账号" v-model="ruleForm2.account" maxlength=11></el-input>
8 8
            </el-form-item>
9 9
          </el-col>
10 10
          <el-col :span="12">
@ -66,25 +66,30 @@ export default {
66 66
  props: ['dialog', 'id'],
67 67
  data() {
68 68
    var account = (rule, value, callback) => {
69
      const regTel = /^1[3|4|5|7|8][0-9]\d{8}$/
69 70
      if (value === '') {
70 71
        callback(new Error('请输入账号'))
71 72
      } else {
72
        if (this.edit) {
73
          checkRegister({ account: value, id: this.edit }).then(response => {
74
            if (!response.data) {
75
              callback(new Error('账户已存在,请重新输入'))
76
            } else {
77
              callback()
78
            }
79
          })
73
        if (!regTel.test(value)) {
74
          callback(new Error('账号为手机号格式'))
80 75
        } else {
81
          checkRegister({ account: value }).then(response => {
82
            if (!response.data) {
83
              callback(new Error('账户已存在,请重新输入'))
84
            } else {
85
              callback()
86
            }
87
             })
76
          if (this.edit) {
77
            checkRegister({ account: value, id: this.edit }).then(response => {
78
              if (!response.data) {
79
                callback(new Error('账户已存在,请重新输入'))
80
              } else {
81
                callback()
82
                 }
83
            })
84
          } else {
85
            checkRegister({ account: value }).then(response => {
86
              if (!response.data) {
87
                callback(new Error('账户已存在,请重新输入'))
88
              } else {
89
                callback()
90
              }
91
            })
92
          }
88 93
        }
89 94
      }
90 95
    }

+ 11 - 7
src/views/peoplesManage/infoManage/editUserPermissions.vue

@ -1,5 +1,5 @@
1 1
<template>
2
  <el-dialog title="用户数据权限修改" :visible.sync="dialogTableVisible" width="80%" @close='closed'>
2
  <el-dialog title="用户数据权限修改" :visible.sync="dialogTableVisible" width="60%" @close='closed'>
3 3
    <el-form class="form-main" :model="ruleForm2"  ref="ruleForm2">
4 4
      <el-row :gutter="16">
5 5
        <el-col :xs="12" :sm="12" :lg="12">
@ -122,10 +122,6 @@ export default {
122 122
  },
123 123
  methods: {
124 124
    querySearchAsync(queryString, cb) {
125
      if (queryString === '') {
126
        cb([])
127
        return
128
      }
129 125
      clearTimeout(this.timeout)
130 126
      this.timeout = setTimeout(() => {
131 127
        DeviceOfservice({ key: this.state4, active: 1 }).then(response => {
@ -136,13 +132,19 @@ export default {
136 132
            })
137 133
            cb($data)
138 134
          } else {
139
            cb([])
135
            cb([{ 'value': '暂无数据', 'id': '' }])
136
            setTimeout(function() {
137
              cb([])
138
            }, 300)
140 139
          }
141 140
        })
142 141
      }, 3000 * Math.random())
143 142
    },
144 143
    handleSelect(item) {
145 144
      this.state4 = ''
145
      if (item.value === '暂无数据' && item.id === '') {
146
        return
147
      }
146 148
      let flag = false
147 149
      for (let i = 0; i < this.tableData3.length; i++) {
148 150
        if (item.id === this.tableData3[i].address) {
@ -211,8 +213,10 @@ export default {
211 213
    margin-bottom: 10px;
212 214
  }
213 215
  .list-item{
214
    
215 216
    margin-bottom: 20px;
216 217
    padding: 10px 15px;
217 218
  }
219
  .el-autocomplete {
220
    width: 100%
221
  }
218 222
</style>

+ 8 - 4
src/views/peoplesManage/infoManage/index.vue

@ -39,7 +39,7 @@
39 39
      </el-table-column>
40 40
      <el-table-column width="100px" align="center" label="账户状态">
41 41
        <template slot-scope="scope">
42
          <span>{{(scope.row.active) ? '未停用' : '已停用'}}</span>
42
          <span :class="{ active: !scope.row.active}">{{(scope.row.active) ? '未停用' : '已停用'}}</span>
43 43
        </template>
44 44
      </el-table-column>
45 45
      <el-table-column min-width="200px" align="center" label="所在机构">
@ -54,12 +54,13 @@
54 54
      </el-table-column>
55 55
      <el-table-column align="center" label="Actions" width="260px" class-name="small-padding fixed-width">
56 56
        <template slot-scope="scope"> 
57
          <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button> 
58
          <el-button size="mini" type="danger" @click="handleModifyStatus(scope.row,'deleted')">停用
57
          <el-button :type="((!scope.row.active) ? 'info' : 'primary')" size="mini" @click="handleUpdate(scope.row)" :disabled='!scope.row.active'>编辑</el-button> 
58
          <el-button size="mini" :type="((!scope.row.active) ? 'info' : 'danger')" @click="handleModifyStatus(scope.row,'deleted')" :disabled='!scope.row.active'>停用
59 59
          </el-button>
60
           <el-button size="mini" type="primary" @click="distribution(scope.row)">分配权限
60
           <el-button size="mini" :type="((!scope.row.active) ? 'info' : 'primary')" @click="distribution(scope.row)" :disabled='!scope.row.active'>分配权限
61 61
          </el-button>
62 62
        </template>
63
        
63 64
      </el-table-column>
64 65
    </el-table>
65 66
    <editUser :dialog="dialogTableVisible" @chilF='chilF' :id='edit'></editUser>
@ -198,4 +199,7 @@ export default {
198 199
  .editTe{
199 200
    margin: 10px 0 0 22px
200 201
  }
202
  .active{
203
    color: red
204
  }
201 205
</style>