瀏覽代碼

修正bug

lipengtao 6 年之前
父節點
當前提交
146b50d9ef

+ 34 - 0
src/api/numberDictionary.js

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
        <el-row>
4
        <el-row>
5
          <el-col :span="12">
5
          <el-col :span="12">
6
            <el-form-item label="账号" prop='account'>
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
            </el-form-item>
8
            </el-form-item>
9
          </el-col>
9
          </el-col>
10
          <el-col :span="12">
10
          <el-col :span="12">
66
  props: ['dialog', 'id'],
66
  props: ['dialog', 'id'],
67
  data() {
67
  data() {
68
    var account = (rule, value, callback) => {
68
    var account = (rule, value, callback) => {
69
      const regTel = /^1[3|4|5|7|8][0-9]\d{8}$/
69
      if (value === '') {
70
      if (value === '') {
70
        callback(new Error('请输入账号'))
71
        callback(new Error('请输入账号'))
71
      } else {
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
        } else {
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
<template>
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
    <el-form class="form-main" :model="ruleForm2"  ref="ruleForm2">
3
    <el-form class="form-main" :model="ruleForm2"  ref="ruleForm2">
4
      <el-row :gutter="16">
4
      <el-row :gutter="16">
5
        <el-col :xs="12" :sm="12" :lg="12">
5
        <el-col :xs="12" :sm="12" :lg="12">
122
  },
122
  },
123
  methods: {
123
  methods: {
124
    querySearchAsync(queryString, cb) {
124
    querySearchAsync(queryString, cb) {
125
      if (queryString === '') {
126
        cb([])
127
        return
128
      }
129
      clearTimeout(this.timeout)
125
      clearTimeout(this.timeout)
130
      this.timeout = setTimeout(() => {
126
      this.timeout = setTimeout(() => {
131
        DeviceOfservice({ key: this.state4, active: 1 }).then(response => {
127
        DeviceOfservice({ key: this.state4, active: 1 }).then(response => {
136
            })
132
            })
137
            cb($data)
133
            cb($data)
138
          } else {
134
          } else {
139
            cb([])
135
            cb([{ 'value': '暂无数据', 'id': '' }])
136
            setTimeout(function() {
137
              cb([])
138
            }, 300)
140
          }
139
          }
141
        })
140
        })
142
      }, 3000 * Math.random())
141
      }, 3000 * Math.random())
143
    },
142
    },
144
    handleSelect(item) {
143
    handleSelect(item) {
145
      this.state4 = ''
144
      this.state4 = ''
145
      if (item.value === '暂无数据' && item.id === '') {
146
        return
147
      }
146
      let flag = false
148
      let flag = false
147
      for (let i = 0; i < this.tableData3.length; i++) {
149
      for (let i = 0; i < this.tableData3.length; i++) {
148
        if (item.id === this.tableData3[i].address) {
150
        if (item.id === this.tableData3[i].address) {
211
    margin-bottom: 10px;
213
    margin-bottom: 10px;
212
  }
214
  }
213
  .list-item{
215
  .list-item{
214
    
215
    margin-bottom: 20px;
216
    margin-bottom: 20px;
216
    padding: 10px 15px;
217
    padding: 10px 15px;
217
  }
218
  }
219
  .el-autocomplete {
220
    width: 100%
221
  }
218
</style>
222
</style>

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

39
      </el-table-column>
39
      </el-table-column>
40
      <el-table-column width="100px" align="center" label="账户状态">
40
      <el-table-column width="100px" align="center" label="账户状态">
41
        <template slot-scope="scope">
41
        <template slot-scope="scope">
42
          <span>{{(scope.row.active) ? '未停用' : '已停用'}}</span>
42
          <span :class="{ active: !scope.row.active}">{{(scope.row.active) ? '未停用' : '已停用'}}</span>
43
        </template>
43
        </template>
44
      </el-table-column>
44
      </el-table-column>
45
      <el-table-column min-width="200px" align="center" label="所在机构">
45
      <el-table-column min-width="200px" align="center" label="所在机构">
54
      </el-table-column>
54
      </el-table-column>
55
      <el-table-column align="center" label="Actions" width="260px" class-name="small-padding fixed-width">
55
      <el-table-column align="center" label="Actions" width="260px" class-name="small-padding fixed-width">
56
        <template slot-scope="scope"> 
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
          </el-button>
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
          </el-button>
61
          </el-button>
62
        </template>
62
        </template>
63
        
63
      </el-table-column>
64
      </el-table-column>
64
    </el-table>
65
    </el-table>
65
    <editUser :dialog="dialogTableVisible" @chilF='chilF' :id='edit'></editUser>
66
    <editUser :dialog="dialogTableVisible" @chilF='chilF' :id='edit'></editUser>
198
  .editTe{
199
  .editTe{
199
    margin: 10px 0 0 22px
200
    margin: 10px 0 0 22px
200
  }
201
  }
202
  .active{
203
    color: red
204
  }
201
</style>
205
</style>