Преглед на файлове

系统设置、用户管理

luyanan преди 6 години
родител
ревизия
d18a953fa2

+ 0 - 90
src/api/bridgeInfo.js

1
import request from '@/utils/request'
2
3
export function getBridgeList(params) { // 用户所有桥梁
4
  return request({
5
    url: '/ajax/bridge/byUser',
6
    method: 'get',
7
    params
8
  })
9
}
10
11
export function getBridgeInfo(params) { // 桥梁信息
12
  return request({
13
    url: '/ajax/bridge/qo',
14
    method: 'get',
15
    params
16
  })
17
}
18
19
export function getBridgeServers(params) { // 桥梁服务器
20
  return request({
21
    url: '/ajax/server/byBridge',
22
    method: 'get',
23
    params
24
  })
25
}
26
27
// 报警信息
28
export function getDangerList(params) {
29
  return request({
30
    url: '/ajax/alarm/msg',
31
    method: 'get',
32
    params
33
  })
34
}
35
export function getDangerDetail(params) {
36
  return request({
37
    url: '/ajax/alarm/detail',
38
    method: 'get',
39
    params
40
  })
41
}
42
// 报警信息
43
44
// 未读报警
45
export function getBridgeUnread(params) {
46
  return request({
47
    url: '/ajax/alarm/msg/unread',
48
    method: 'get',
49
    params
50
  })
51
}
52
export function setUnreadToRead(params) {
53
  return request({
54
    url: '/ajax/alarm/msg/read',
55
    method: 'post',
56
    data: params
57
  })
58
}
59
// 未读报警
60
61
// 监测信息
62
export function getMonitorByDay(params) {
63
  return request({
64
    url: '/ajax/collect/wave/server/day',
65
    method: 'get',
66
    params
67
  })
68
}
69
export function getSysTime(params) {
70
  return request({
71
    url: '/ajax/sys/serviceTime',
72
    method: 'get',
73
    params
74
  })
75
}
76
export function getMonitorByTime(params) {
77
  return request({
78
    url: '/ajax/collect/wave/server/time',
79
    method: 'get',
80
    params
81
  })
82
}
83
export function getTimingMonitor(params) {
84
  return request({
85
    url: '/ajax/collect/wave/curr',
86
    method: 'get',
87
    params
88
  })
89
}
90
// 监测信息

+ 6 - 0
src/api/platUpdate.js

1
/* 查看当前平台信息 */
2
export const queryPlat = '/ajax/platform/get'
3
/* 修改平台信息 */
4
export const updatePlat = '/ajax/platform/update'
5
/* 上传图片 */
6
export const uploadLogo = '/ajax/platform/logo'

+ 12 - 8
src/api/sysSetting.js

1
/*  分页查询用户 */
1
/* 分页查询用户 */
2
export const pageQueryUser = '/ajax/sys/pq'
2
export const pageQueryUser = '/ajax/sys/pq'
3
/*  查看用户信息 */
3
/* 查看用户信息 */
4
export const queryUserOne = '/ajax/sys/qo'
4
export const queryUserOne = '/ajax/sys/qo'
5
5
6
/*  检查账号是否注册 */
6
/* 检查账号是否注册 */
7
export const checkRegister = '/ajax/sys/check'
7
export const checkRegister = '/ajax/sys/check'
8
8
9
/*  新增用户 */
9
/* 检测用户是否存在*/
10
export const existUser = '/ajax/sys/exists'
11
/* 新增用户 */
10
export const addUser = '/ajax/sys/new'
12
export const addUser = '/ajax/sys/new'
11
/*  修改用户信息 */
13
/* 修改用户信息 */
12
export const updateUser = '/ajax/sys/renew'
14
export const updateUser = '/ajax/sys/renew'
13
/*  修改用户权限 */
15
/* 修改用户权限 */
14
export const updatePermission = '/ajax/sys/right/'
16
export const updatePermission = '/ajax/sys/right/'
15
/*  重置密码 */
17
/* 重置密码 */
16
export const resetPw = '/ajax/sys/resetpw'
18
export const resetPw = '/ajax/sys/resetpw'
17
/*  停用用户 */
19
/*  停用用户 */
18
export const banUser = '/ajax/sys/ban'
20
export const banUser = '/ajax/sys/disable'
21
/* 恢复用户 */
22
export const renewUser = '/ajax/sys/enable'

+ 14 - 0
src/api/userInfo.js

1
/* 分页查询平台正常用户列表 */
2
export const pageNormalUser = '/ajax/sys/user/pq'
3
/* 查看正常用户信息 */
4
export const queryNormalOne = '/ajax/sys/user/qo'
5
6
/* 分页查询平台拉黑用户列表 */
7
export const pageBlackUser = '/ajax/sys/user/invalid/pq'
8
/* 查看拉黑用户信息 */
9
export const queryBlackOne = '/ajax/sys/user/invalid/qo'
10
11
/* 拉黑用户 */
12
export const blackUser = '/ajax/sys/user/invalid'
13
/* 取消拉黑用户 */
14
export const cancelBlackUser = '/ajax/sys/user/valid'

+ 10 - 0
src/store/modules/user.js

76
          reject(error)
76
          reject(error)
77
        })
77
        })
78
      })
78
      })
79
    },
80
81
    // 前端退出
82
    FedLogOut({ commit }) {
83
      return new Promise(resolve => {
84
        commit('SET_USERID', '')
85
        commit('SET_NAME', '')
86
        Cookies.remove('userid')
87
        resolve()
88
      })
79
    }
89
    }
80
  }
90
  }
81
}
91
}

+ 20 - 2
src/styles/element-ui.scss

52
  }
52
  }
53
}
53
}
54
54
55
.textarea-div{
56
  line-height: 22px;
57
  margin-bottom: 10px;
58
  margin-top:10px;
59
  text-overflow: ellipsis;
60
  white-space: nowrap;
61
  overflow: hidden;
62
}
63
55
.el-select {
64
.el-select {
56
  width:100%
65
  width:100%
57
}
66
}
59
.el-date-editor.el-input, .el-date-editor.el-input__inner{
68
.el-date-editor.el-input, .el-date-editor.el-input__inner{
60
  width:100%;
69
  width:100%;
61
}
70
}
62
71
.el-table th{
72
  font-weight:bold;
73
  font-size: 16px;
74
  color: #333;
75
  background: #c6d5de;
76
}
63
.el-table .cell{
77
.el-table .cell{
64
  min-height: 23px
78
  min-height: 23px;
79
  .el-button--text {
80
    white-space: normal;
81
    line-height: 23px;
82
  }
65
}
83
}

+ 7 - 0
src/styles/index.scss

103
    background:#ffffff;
103
    background:#ffffff;
104
    padding:15px;
104
    padding:15px;
105
    overflow:hidden;
105
    overflow:hidden;
106
    .operate-row{
107
      .el-button{
108
        width:70px;
109
        padding:6px;
110
        margin:5px;
111
      }
112
    }
106
    .contain-select{
113
    .contain-select{
107
      margin-bottom:15px;
114
      margin-bottom:15px;
108
      float:right;
115
      float:right;

+ 1 - 1
src/styles/variables.scss

1
//sidebar
1
//sidebar
2
$menuBg:#20436b;
2
$menuBg:#20436b;
3
$subMenuBg:#052d5a;
3
$subMenuBg:#052d5a;
4
$menuHover:#1c3d6f;
4
$menuHover:#133c79;

+ 4 - 1
src/utils/comTable.js

7
/* eslint-disable one-var */
7
/* eslint-disable one-var */
8
var defaultPageSize = 20,
8
var defaultPageSize = 20,
9
  gapFilling = function(tData, pageS) {
9
  gapFilling = function(tData, pageS) {
10
    const pageSize = pageS ? pageS : defaultPageSize
10
    let pageSize = defaultPageSize
11
    if (pageS) {
12
      pageSize = pageS
13
    }
11
    const needNum = pageSize - tData.length % pageSize
14
    const needNum = pageSize - tData.length % pageSize
12
    for (let i = 0; i < needNum; ++i) {
15
    for (let i = 0; i < needNum; ++i) {
13
      tData.push(i)
16
      tData.push(i)

+ 9 - 0
src/utils/index.js

3
 */
3
 */
4
export const comUrl = process.env.BASE_API
4
export const comUrl = process.env.BASE_API
5
5
6
/**
7
 * default img
8
 */
9
export const defaultSet = {
10
  img: {
11
    user: '/static/comimg/default-expert.jpg'
12
  }
13
}
14
6
/**
15
/**
7
 * 解析url参数
16
 * 解析url参数
8
 * @example ?id=12345&a=b
17
 * @example ?id=12345&a=b

+ 51 - 56
src/utils/queryBase.js

4
 */
4
 */
5
/* eslint-disable one-var */
5
/* eslint-disable one-var */
6
import request from '@/utils/request'
6
import request from '@/utils/request'
7
var $req = {
7
import { queryUserOne } from '@/api/sysSetting'
8
  get: function(url, data, sh, eh) {
8
import { queryNormalOne, queryBlackOne } from '@/api/userInfo'
9
    request({
9
10
      method: 'get',
11
      url: url,
12
      params: data
13
    }).then(res => {
14
      sh(res)
15
    }).catch(err => {
16
      console.log(err)
17
      eh(err)
18
    })
19
  }
20
}
21
var objCache = {
10
var objCache = {
22
  bridge: {},
11
  adminUser: {},
23
  server: {},
12
  normalOne: {},
24
  device: {}
13
  blackOne: {}
25
}
14
}
26
var objHcache = {
15
var objHcache = {
27
  bridge: {},
16
  adminUser: {},
28
  server: {},
17
  normalOne: {},
29
  device: {}
18
  blackOne: {}
30
}
19
}
31
var objCacheHandler = {
20
var objCacheHandler = {
32
  bridge: function(id) {
21
  adminUser: function(id) {
33
    var hc = objHcache.bridge[id]
22
    var hc = objHcache.adminUser[id]
34
    $req.get('/ajax/bridge/qo?id=' + id, null, function(data) {
23
    request.get(queryUserOne, {
35
      delete objHcache.bridge[id]
24
      id: id
25
    }, function(data) {
26
      delete objHcache.adminUser[id]
36
      if (data.success) {
27
      if (data.success) {
37
        objCache.bridge[id] = data.data
28
        objCache.adminUser[id] = data.data
38
        for (let i = 0; i < hc.length; ++i) {
29
        for (let i = 0; i < hc.length; ++i) {
39
          hc[i](true, data.data)
30
          hc[i](true, data.data)
40
        }
31
        }
49
      }
40
      }
50
    })
41
    })
51
  },
42
  },
52
  server: function(id) {
43
  normalOne: function(id) {
53
    var hc = objHcache.server[id]
44
    var hc = objHcache.normalOne[id]
54
    $req.get('/ajax/server/qo?id=' + id, null, function(data) {
45
    request.get(queryNormalOne, {
55
      delete objHcache.server[id]
46
      id: id
47
    }, function(data) {
48
      delete objHcache.normalOne[id]
56
      if (data.success) {
49
      if (data.success) {
57
        objCache.server[id] = data.data
50
        objCache.normalOne[id] = data.data
58
        for (let i = 0; i < hc.length; ++i) {
51
        for (let i = 0; i < hc.length; ++i) {
59
          hc[i](true, data.data)
52
          hc[i](true, data.data)
60
        }
53
        }
69
      }
62
      }
70
    })
63
    })
71
  },
64
  },
72
  device: function(id) {
65
  blackOne: function(id) {
73
    var hc = objHcache.device[id]
66
    var hc = objHcache.blackOne[id]
74
    $req.get('/ajax/device/qo?id=' + id, null, function(data) {
67
    request.get(queryBlackOne, {
75
      delete objHcache.device[id]
68
      id: id
69
    }, function(data) {
70
      delete objHcache.blackOne[id]
76
      if (data.success) {
71
      if (data.success) {
77
        objCache.device[id] = data.data
72
        objCache.blackOne[id] = data.data
78
        for (let i = 0; i < hc.length; ++i) {
73
        for (let i = 0; i < hc.length; ++i) {
79
          hc[i](true, data.data)
74
          hc[i](true, data.data)
80
        }
75
        }
91
  }
86
  }
92
}
87
}
93
var cacheModel = {
88
var cacheModel = {
94
  getBridge: function(id, handler) {
89
  getAdminUser: function(id, handler) {
95
    var data = objCache.bridge[id]
90
    var data = objCache.adminUser[id]
96
    if (data) {
91
    if (data) {
97
      handler(true, data)
92
      handler(true, data)
98
    } else {
93
    } else {
99
      if (objHcache.bridge[id]) {
94
      if (objHcache.adminUser[id]) {
100
        objHcache.bridge[id].push(handler)
95
        objHcache.adminUser[id].push(handler)
101
      } else {
96
      } else {
102
        objHcache.bridge[id] = []
97
        objHcache.adminUser[id] = []
103
        objHcache.bridge[id].push(handler)
98
        objHcache.adminUser[id].push(handler)
104
        objCacheHandler.bridge(id)
99
        objCacheHandler.adminUser(id)
105
      }
100
      }
106
    }
101
    }
107
  },
102
  },
108
  getServer: function(id, handler) {
103
  getNormalOne: function(id, handler) {
109
    var data = objCache.server[id]
104
    var data = objCache.normalOne[id]
110
    if (data) {
105
    if (data) {
111
      handler(true, data)
106
      handler(true, data)
112
    } else {
107
    } else {
113
      if (objHcache.server[id]) {
108
      if (objHcache.normalOne[id]) {
114
        objHcache.server[id].push(handler)
109
        objHcache.normalOne[id].push(handler)
115
      } else {
110
      } else {
116
        objHcache.server[id] = []
111
        objHcache.normalOne[id] = []
117
        objHcache.server[id].push(handler)
112
        objHcache.normalOne[id].push(handler)
118
        objCacheHandler.server(id)
113
        objCacheHandler.normalOne(id)
119
      }
114
      }
120
    }
115
    }
121
  },
116
  },
122
  getDevice: function(id, handler) {
117
  getBlackOne: function(id, handler) {
123
    var data = objCache.device[id]
118
    var data = objCache.blackOne[id]
124
    if (data) {
119
    if (data) {
125
      handler(true, data)
120
      handler(true, data)
126
    } else {
121
    } else {
127
      if (objHcache.device[id]) {
122
      if (objHcache.blackOne[id]) {
128
        objHcache.device[id].push(handler)
123
        objHcache.blackOne[id].push(handler)
129
      } else {
124
      } else {
130
        objHcache.device[id] = []
125
        objHcache.blackOne[id] = []
131
        objHcache.device[id].push(handler)
126
        objHcache.blackOne[id].push(handler)
132
        objCacheHandler.device(id)
127
        objCacheHandler.blackOne(id)
133
      }
128
      }
134
    }
129
    }
135
  }
130
  }

+ 3 - 7
src/utils/queryDict.js

24
    }
24
    }
25
  },
25
  },
26
  loadDict = function(code) {
26
  loadDict = function(code) {
27
    request({
27
    request.get(uri, {
28
      url: uri,
28
      dict: code
29
      method: 'get',
29
    }, function(res) {
30
      params: {
31
        dict: code
32
      }
33
    }).then(res => {
34
      setDict(code, res.data)
30
      setDict(code, res.data)
35
    })
31
    })
36
  },
32
  },

+ 16 - 10
src/utils/request.js

1
import axios from 'axios'
1
import axios from 'axios'
2
import qs from 'qs'
2
import qs from 'qs'
3
import { Message } from 'element-ui'
3
import { Message } from 'element-ui'
4
import { comUrl } from '@/utils/index'
4
import router from '@/router'
5
import store from '@/store'
5
6
6
// 创建axios实例
7
// 创建axios实例
7
const service = axios.create({
8
const service = axios.create({
8
  baseURL: comUrl, // api的base_url
9
  baseURL: process.env.BASE_API // api的base_url
9
  // timeout: 5000, // 请求超时时间
10
  paramsSerializer: function(params) {
11
    return qs.stringify(params, { arrayFormat: 'repeat' })
12
  }
13
})
10
})
14
11
15
// request拦截器
12
// request拦截器
17
  // 配置config
14
  // 配置config
18
  config.headers.Accept = 'application/json'
15
  config.headers.Accept = 'application/json'
19
  if (config.method === 'post') {
16
  if (config.method === 'post') {
20
    config.data = qs.stringify(config.data)
17
    config.data = qs.stringify(config.data, { arrayFormat: 'repeat' })
21
    // 处理后后台无需添加RequestBody
18
    // 处理后后台无需添加RequestBody
22
    config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
19
    config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
23
  }
20
  }
30
// respone拦截器
27
// respone拦截器
31
service.interceptors.response.use(response => {
28
service.interceptors.response.use(response => {
32
  let taR = response.data
29
  let taR = response.data
33
  if (response && (response.status === 200 || response.status === 304 || response.status === 400)) {
30
  if (response && response.status === 200) {
34
    if (response.data === undefined) { // 解决IE9数据问题
31
    if (response.data === undefined) { // 解决IE9数据问题
35
      taR = response.request.responseText
32
      taR = response.request.responseText
36
    } else {
33
    } else {
39
    if (!(taR instanceof Object)) { // 判断taR不是Object时,解析成Object
36
    if (!(taR instanceof Object)) { // 判断taR不是Object时,解析成Object
40
      taR = JSON.parse(taR)
37
      taR = JSON.parse(taR)
41
    }
38
    }
39
    if (!taR.success && taR.code === 0) {
40
      Message.error(taR.msg)
41
    }
42
    if (!taR.success && taR.code === 1) {
43
      store.dispatch('FedLogOut').then(() => {
44
        Message.error('登录状态失效,请重新登录')
45
        router.push({ path: '/' })
46
      })
47
    }
42
    return taR
48
    return taR
43
  } else {
49
  } else {
44
    Message.error('2333')
50
    Message.error('请求错误1,请重试')
45
    return Promise.resolve(response)
51
    return Promise.resolve(response)
46
  }
52
  }
47
}, error => {
53
}, error => {
48
  Message.error('服务器连接失败,请重新')
54
  Message.error('请求错误2,请重')
49
  return Promise.reject(error)
55
  return Promise.reject(error)
50
})
56
})
51
57

+ 17 - 30
src/utils/validator.js

3
 * form validator rules
3
 * form validator rules
4
 */
4
 */
5
5
6
export function focusFun(rule, value, callback) {
6
export function requiredTip(str) {
7
  if (value !== '') {
7
  return `请填写${str}`
8
    if (value) {
8
}
9
      callback(new Error(`请填写${this.maxlength}字以内机构名称`))
9
export function limitNumTip(str, num) {
10
    } else {
10
  return `${str}不得超过${num}个字`
11
      callback()
11
}
12
    }
12
export function formatTip(str) {
13
  } else {
13
  return `${str}格式有误,请检查后重新填写`
14
    callback()
15
  }
16
}
14
}
17
15
18
// 邮箱,@,50个字
16
// 邮箱,@,50个字
19
export function checkEmailV(rule, value, callback) {
17
export function checkEmailV(rule, value, callback) {
20
  const reg = /^([A-Za-z0-9_\-\.\u4e00-\u9fa5])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,8})$/
18
  const reg = /^([A-Za-z0-9_\-\.\u4e00-\u9fa5])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,8})$/
21
  if (!reg.test(value)) {
19
  if (value && !reg.test(value) && value.length < 50) {
22
    return callback(new Error('请填写正确的邮箱格式'))
20
    return callback(new Error('邮箱格式有误,请检查后重新填写'))
23
  } else {
21
  } else {
24
    return callback()
22
    return callback()
25
  }
23
  }
26
  // if (value.length) {
27
  //   return callback(new Error('请填写50字以内的邮箱地址'))
28
  // }
29
}
24
}
30
25
31
// 电话,50个字
26
// 手机号码验证
32
export function checkPhoneV(rule, value, callback) {
27
export function checkPhoneV(rule, value, callback) {
33
  // const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
28
  const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
34
  if (value.length) {
29
  if (!value) {
35
    return callback(new Error('请填写50字以内的电话号码'))
30
    return callback(new Error('请填写手机号码'))
31
  } else if (!reg.test(value)) {
32
    return callback(new Error('手机号码格式有误,请检查后重新填写'))
36
  } else {
33
  } else {
37
    return callback()
34
    return callback()
38
  }
35
  }
39
}
36
}
40
37
41
// 类似金钱,首位不为0,最多2位小数
42
export function checkNumPot2(rule, value, callback) {
43
  const reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2,3})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
44
  if (value === '') {
45
    callback()
46
  } else if (!reg.test(value)) {
47
    callback(new Error('请填写数字,最多2位小数'))
48
  }
49
}
50
51
// 邮编,限制只能输入数字,20个字
38
// 邮编,限制只能输入数字,20个字
52
export function checkInterNum(rule, value, callback) {
39
export function checkInterNum(rule, value, callback) {
53
  const reg = /^[0-9]*[1-9][0-9]*$/
40
  const reg = /^[0-9]*[1-9][0-9]*$/
54
  if (!value) {
41
  if (!value) {
55
    return callback()
42
    return false
56
  } else if (!reg.test(value)) {
43
  } else if (!reg.test(value)) {
57
    return callback(new Error('请输入正确邮编'))
44
    return callback(new Error('请输入正确邮编'))
58
  } else {
45
  } else {

+ 14 - 21
src/views/companyCen/noactive/compInfo.vue

33
                  </el-form-item>
33
                  </el-form-item>
34
                </el-col>
34
                </el-col>
35
                <el-col :span="12">
35
                <el-col :span="12">
36
                  <el-form-item label="企业规模" prop="">
36
                  <el-form-item label="企业规模" prop="selectNumRanger">
37
                    <el-select v-model="selectLongTime" placeholder="请选择员工数量范围">
37
                    <el-select v-model="selectNumRanger" placeholder="请选择员工数量范围">
38
                      <el-option
38
                      <el-option
39
                        v-for="item in longTime"
39
                        v-for="item in numRanger"
40
                        :key="item.value"
40
                        :key="item.value"
41
                        :label="item.label"
41
                        :label="item.label"
42
                        :value="item.value"
42
                        :value="item.value"
46
                  </el-form-item>
46
                  </el-form-item>
47
                </el-col>
47
                </el-col>
48
                <el-col :span="12">
48
                <el-col :span="12">
49
                  <el-form-item label="企业类型" prop="createYear">
49
                  <el-form-item label="企业类型" prop="selectCompType">
50
                    <el-select v-model="selectLongTime" placeholder="请选择最符合的一项">
50
                    <el-select v-model="selectCompType" placeholder="请选择最符合的一项">
51
                      <el-option
51
                      <el-option
52
                        v-for="item in longTime"
52
                        v-for="item in compType"
53
                        :key="item.value"
53
                        :key="item.value"
54
                        :label="item.label"
54
                        :label="item.label"
55
                        :value="item.value"
55
                        :value="item.value"
115
                    <dynamicTags :tagInfo="tagSubject" :dyStr="formObj.subject" v-on:turnTags="turnSubjectTags($event)"></dynamicTags>
115
                    <dynamicTags :tagInfo="tagSubject" :dyStr="formObj.subject" v-on:turnTags="turnSubjectTags($event)"></dynamicTags>
116
                  </el-form-item>
116
                  </el-form-item>
117
                </el-col>
117
                </el-col>
118
                
119
                <!-- :labelW="80"
120
                  :widthselect="200"
121
                  :prov="province"
122
                  :city="city"
123
                  v-on:selectProv="getSelectProv($event)"
124
                  v-on:selectCity="getSelectCity($event)" -->
125
                
126
                
127
                <el-col :span="24">
118
                <el-col :span="24">
128
                  <el-form-item class="is-required" label="企业简介" prop="desc">
119
                  <el-form-item class="is-required" label="企业简介" prop="desc">
129
                    <el-input type="textarea" :rows="8" v-model="formObj.desc" placeholder="请填写一个简单的介绍,让大家更好地了解您的企业" maxlength="5000"></el-input>
120
                    <el-input type="textarea" :rows="8" v-model="formObj.desc" placeholder="请填写一个简单的介绍,让大家更好地了解您的企业" maxlength="5000"></el-input>
222
          limitCount: 15,
213
          limitCount: 15,
223
          tagsNum: 5
214
          tagsNum: 5
224
        },
215
        },
216
        numRanger: [],
217
        compType: [],
218
        selectNumRanger: '',
219
        selectCompType: '',
225
        plf_user: '',
220
        plf_user: '',
226
        plf_name: '',
221
        plf_name: '',
227
        imageUrl: '', // 临时地址
222
        imageUrl: '', // 临时地址
230
        // httpUrl.hQuery.baseInfo.upload
225
        // httpUrl.hQuery.baseInfo.upload
231
        // optionsCity: provinceAndCityData,
226
        // optionsCity: provinceAndCityData,
232
        // selectedOptions: [],
227
        // selectedOptions: [],
233
        dynamicTags: [],
234
        isShowAdd: true,
235
        inputVisible: false,
236
        inputValue: '',
237
        province: '',
228
        province: '',
238
        city: '',
229
        city: '',
239
        formObj: {
230
        formObj: {
263
      this.getDictoryData()
254
      this.getDictoryData()
264
      // this.plf_user = Cookies.get('plf_user')
255
      // this.plf_user = Cookies.get('plf_user')
265
      // this.getPlatInfo(this.plf_user)
256
      // this.getPlatInfo(this.plf_user)
257
      console.log(this.numRanger)
258
      console.log(this.compType)
266
    },
259
    },
267
    methods: {
260
    methods: {
268
      getDictoryData() {
261
      getDictoryData() {
269
        const that = this
262
        const that = this
270
        queryDict.applyDict('QYGM', function(dictData) {
263
        queryDict.applyDict('QYGM', function(dictData) {
271
          dictData.map(item => {
264
          dictData.map(item => {
272
            that.cableMain[item.code] = item.caption
265
            that.numRanger.push({ value: item.code, label: item.caption })
273
          })
266
          })
274
        }) // 企业规模
267
        }) // 企业规模
275
        queryDict.applyDict('QYLX', function(dictData) {
268
        queryDict.applyDict('QYLX', function(dictData) {
276
          dictData.map(item => {
269
          dictData.map(item => {
277
            that.addr[item.code] = item.caption
270
            that.compType.push({ value: item.code, label: item.caption })
278
          })
271
          })
279
        }) // 企业类型
272
        }) // 企业类型
280
        queryDict.applyDict('XZQH', function(dictData) {
273
        queryDict.applyDict('XZQH', function(dictData) {

+ 244 - 165
src/views/platInfo/platUpdate.vue

10
            <el-col :span="14">
10
            <el-col :span="14">
11
              <el-row :gutter="20" class="update-main">
11
              <el-row :gutter="20" class="update-main">
12
                <el-col :span="24">
12
                <el-col :span="24">
13
                  <el-form-item label="平台名称">邢台条件科技平台</el-form-item>
13
                  <el-form-item label="平台名称">{{formObj.name}}</el-form-item>
14
                </el-col>
14
                </el-col>
15
                <el-col :span="24">
15
                <el-col :span="item.span||''" v-for="item in formItem" :key="item.index">
16
                  <el-form-item class="is-required" label="平台网址" prop="website">
16
                  <el-form-item :label="item.tit" :prop="item.prop">
17
                    <el-input v-model="formObj.website" placeholder="请填写平台网址" @fousc="" maxlength="50"></el-input>
17
                    <el-input v-if="item.textarea" type="textarea" :rows="8" v-model="formObj[item.prop]" placeholder="请填写一个平台的简单介绍,让大家更好地了解平台" maxlength="5000"></el-input>
18
                  </el-form-item>
18
                    <!-- <cityPicker v-else-if="item.city" @paren="toshow" :addrCode='formObj[item.prop]'></cityPicker> -->
19
                </el-col>
19
                    <el-input v-else v-model="formObj[item.prop]" :placeholder="`请填写${item.place||''}${item.tit}`" :maxlength="item.num||''"></el-input>
20
                <el-col :span="24">
21
                  <el-form-item class="is-required" label="管理机构" prop="">
22
                    <el-input v-model="formObj.website" placeholder="请填写管理机构名称" maxlength="50"></el-input>
23
                  </el-form-item>
24
                </el-col>
25
                <el-col :span="12">
26
                  <el-form-item class="is-required" label="所在城市" prop="">
27
                    <cityPicker></cityPicker>
28
                  </el-form-item>
29
                </el-col>
30
                <el-col :span="12">
31
                  <el-form-item label="平台邮编" prop="website">
32
                    <el-input v-model="formObj.website" type="number" placeholder="请填写管理机构名称" maxlength="20"></el-input>
33
                  </el-form-item>
34
                </el-col>
35
                <el-col :span="24">
36
                  <el-form-item class="is-required" label="详细地址" prop="address">
37
                    <el-input v-model="formObj.address" placeholder="请填写管理机构详细地址" maxlength="50"></el-input>
38
                  </el-form-item>
39
                </el-col>
40
                <el-col :span="12">
41
                  <el-form-item class="is-required" label="客服电话" prop="tel">
42
                    <el-input v-model="formObj.tel" placeholder="请填写客服电话" maxlength="50"></el-input>
43
                  </el-form-item>
44
                </el-col>
45
                <el-col :span="12">
46
                  <el-form-item class="is-required" label="客服邮箱" prop="mail">
47
                    <el-input v-model="formObj.mail" placeholder="请填写客服邮箱" maxlength="50"></el-input>
48
                  </el-form-item>
49
                </el-col>
50
                <el-col :span="24">
51
                  <el-form-item class="is-required" label="工作时间" prop="linkman">
52
                    <el-input v-model="formObj.linkman" placeholder="请填写客服工作时间" maxlength="50"></el-input>
53
                  </el-form-item>
54
                </el-col>
55
                <el-col :span="12">
56
                  <el-form-item class="is-required" label="联系人" prop="linkman">
57
                    <el-input v-model="formObj.linkman" placeholder="请填写平台联系人" maxlength="10"></el-input>
58
                  </el-form-item>
59
                </el-col>
60
                <el-col :span="12">
61
                  <el-form-item class="is-required" label="职位" prop="linkman">
62
                    <el-input v-model="formObj.linkman" placeholder="请填写联系人职位" maxlength="20"></el-input>
63
                  </el-form-item>
64
                </el-col>
65
                <el-col :span="24">
66
                  <el-form-item class="is-required" label="所在机构" prop="website">
67
                    <el-input v-model="formObj.website" placeholder="请填写联系人所在机构" maxlength="50"></el-input>
68
                  </el-form-item>
69
                </el-col>
70
                <el-col :span="12">
71
                  <el-form-item class="is-required" label="联系电话" prop="tel">
72
                    <el-input v-model="formObj.tel" placeholder="请填写联系电话" maxlength="50"></el-input>
73
                  </el-form-item>
74
                </el-col>
75
                <el-col :span="12">
76
                  <el-form-item label="联系邮箱" prop="mail">
77
                    <el-input v-model="formObj.mail" placeholder="请填写联系邮箱" maxlength="50"></el-input>
78
                  </el-form-item>
79
                </el-col>
80
                <!-- :labelW="80"
81
                  :widthselect="200"
82
                  :prov="province"
83
                  :city="city"
84
                  v-on:selectProv="getSelectProv($event)"
85
                  v-on:selectCity="getSelectCity($event)" -->
86
                <el-col :span="24">
87
                  <el-form-item class="is-required" label="平台简介" prop="desc">
88
                    <el-input type="textarea" :rows="8" v-model="formObj.desc" placeholder="请填写一个平台的简单介绍,让大家更好地了解平台" maxlength="5000"></el-input>
89
                  </el-form-item>
20
                  </el-form-item>
90
                </el-col>
21
                </el-col>
91
                <el-col :span="24">
22
                <el-col :span="24">
96
              </el-row>
27
              </el-row>
97
            </el-col>
28
            </el-col>
98
            <el-col :span="10">
29
            <el-col :span="10">
99
              <div class="update-logo">
30
              <div class="fileBox" v-on:uploadfun="uploadfun">
31
                <uploadFile :uploadImg=uploadImg></uploadFile>
32
                <p class="teimg">上传封面图片</p>
33
                <p class="tetype">PNG/JPG/JPEG格式,2M以内</p>
34
              </div>
35
              <!-- <div class="update-logo">
100
                <el-upload
36
                <el-upload
101
                  class="avatar-uploader"
37
                  class="avatar-uploader"
102
                  :action="uploadUrl"
38
                  :action="uploadUrl"
108
                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
44
                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
109
                </el-upload>
45
                </el-upload>
110
                <div class="update-tip">PNG/JPG/JPEG格式<br>大小2M以内</div>
46
                <div class="update-tip">PNG/JPG/JPEG格式<br>大小2M以内</div>
111
              </div>
47
              </div> -->
112
            </el-col>
48
            </el-col>
113
            <el-col :span="24">
49
            <el-col :offset="16">
114
              <el-form-item align="right">
50
              <el-form-item>
115
                <div>最后修改人:XXXX</div>
51
                <div style="line-height: 10px;">
116
                <div>最后修改时间:2018/08/23 18:52:12</div>
52
                  <p>最后修改人: {{formObj.modifier}}</p>
53
                  <p>最后修改时间: {{formObj.modifyTime}}</p>
54
                </div>
117
              </el-form-item>
55
              </el-form-item>
118
            </el-col>
56
            </el-col>
119
          </el-row>
57
          </el-row>
124
</template>
62
</template>
125
63
126
<script>
64
<script>
65
  import {
66
    queryPlat,
67
    updatePlat,
68
    uploadLogo
69
  } from '@/api/platUpdate'
70
  import {
71
    requiredTip,
72
    limitNumTip,
73
    checkEmailV
74
  } from '@/utils/validator'
75
76
  import { parseTime } from '@/utils'
77
  import queryDict from '@/utils/queryDict'
78
  import queryBase from '@/utils/queryBase'
127
  import cityPicker from '@/components/CityPicker'
79
  import cityPicker from '@/components/CityPicker'
80
  import uploadFile from '@/components/uploadFile'
128
81
129
  export default {
82
  export default {
130
    data() {
83
    data() {
131
      return {
84
      return {
132
        plf_user: '',
85
        uploadImg: {
133
        plf_name: '',
86
          url: uploadLogo,
134
        imageUrl: '', // 临时地址
87
          width: '280px',
135
        imgName: '', // 图片的name
88
          height: '200px',
136
        uploadUrl: '',
89
          fun: 'uploadfun'
137
        dynamicTags: [],
90
        },
138
        isShowAdd: true,
91
        AllCitys: [],
139
        inputVisible: false,
92
        formItem: [
140
        inputValue: '',
93
          {
141
        province: '',
94
            span: 24,
142
        city: '',
95
            prop: 'url',
96
            tit: '平台网址',
97
            required: true
98
          },
99
          {
100
            span: 24,
101
            prop: 'manageOrg',
102
            tit: '管理机构',
103
            required: true
104
          },
105
          {
106
            span: 12,
107
            prop: 'addr',
108
            city: true,
109
            tit: '所在城市',
110
            required: true
111
          },
112
          {
113
            span: 12,
114
            prop: 'zipCode',
115
            tit: '平台邮编',
116
            num: 20
117
          },
118
          {
119
            span: 24,
120
            prop: 'location',
121
            tit: '详细地址',
122
            num: 50,
123
            place: '管理机构'
124
          },
125
          {
126
            span: 12,
127
            prop: 'servicePhone',
128
            tit: '客服电话',
129
            num: 50,
130
            required: true
131
          },
132
          {
133
            span: 12,
134
            prop: 'serviceEmail',
135
            tit: '客服邮箱',
136
            num: 50,
137
            required: true
138
          },
139
          {
140
            span: 24,
141
            prop: 'operateTime',
142
            tit: '工作时间',
143
            num: 50
144
          },
145
          {
146
            span: 12,
147
            prop: 'linkman',
148
            tit: '联系人',
149
            required: true,
150
            place: '平台',
151
            num: 10
152
          },
153
          {
154
            span: 12,
155
            prop: 'job',
156
            tit: '职位',
157
            required: true,
158
            place: '联系人',
159
            num: 20
160
          },
161
          {
162
            span: 24,
163
            prop: 'comp',
164
            tit: '所在机构',
165
            required: true,
166
            place: '联系人',
167
            num: 50
168
          },
169
          {
170
            span: 12,
171
            prop: 'linkphone',
172
            tit: '联系电话',
173
            num: 50,
174
            required: true
175
          },
176
          {
177
            span: 12,
178
            prop: 'linkemail',
179
            tit: '联系邮箱',
180
            num: 50
181
          },
182
          {
183
            span: 24,
184
            prop: 'descp',
185
            tit: '平台简介',
186
            textarea: true,
187
            required: true,
188
            num: 5000
189
          }
190
        ],
143
        formObj: {
191
        formObj: {
192
          name: '',
193
          logo: '',
194
          url: '',
195
          manageOrg: '',
196
          addr: '',
197
          location: '',
198
          zipCode: '',
199
          servicePhone: '',
200
          serviceEmail: '',
201
          operateTime: '',
144
          linkman: '',
202
          linkman: '',
145
          tel: '',
203
          job: '',
146
          mail: '',
204
          department: '',
147
          address: '',
205
          comp: '',
148
          website: '',
206
          linkphone: '',
149
          industry: '',
207
          linkemail: '',
150
          desc: ''
208
          descp: ''
151
        },
209
        },
152
        rulesObj: {
210
        rulesObj: {}
153
        }
154
      }
211
      }
155
    },
212
    },
213
    components: {
214
      cityPicker,
215
      uploadFile
216
    },
156
    computed: {
217
    computed: {
157
    },
218
    },
158
    created() {
219
    created() {
220
      this.getDictoryData()
221
      this.pushRulesFn()
222
      this.queryPlatInfo()
159
    },
223
    },
160
    methods: {
224
    methods: {
225
      getDictoryData() {
226
        const that = this
227
        queryDict.applyDict('XZQH', function(dictData) {
228
          dictData.map(item => {
229
            that.AllCitys[item.code] = item.fullCaption
230
          })
231
        }) // 城市级联
232
      },
233
      pushRulesFn() {
234
        const formItem = this.formItem
235
        const rulesObj = this.rulesObj
236
        for (let i = 0; i < formItem.length; ++i) {
237
          const ru = []
238
          if (formItem[i].required) {
239
            ru.push({ required: true, message: requiredTip(formItem[i].tit), trigger: 'blur' })
240
          }
241
          if (formItem[i].num) {
242
            ru.push({ max: formItem[i].num, message: limitNumTip(formItem[i].tit, formItem[i].num), trigger: 'blur, change' })
243
          }
244
          switch (formItem[i].prop) {
245
            case 'linkemail':
246
              ru.push({ validator: checkEmailV, trigger: 'blur' })
247
              break
248
            case 'serviceEmail':
249
              ru.push({ validator: checkEmailV, trigger: 'blur' })
250
              break
251
          }
252
          rulesObj[formItem[i].prop] = ru
253
        }
254
      },
255
      queryPlatInfo() {
256
        var that = this
257
        this.$http.get(queryPlat, {}, function(res) {
258
          if (res.success) {
259
            const obj = res.data
260
            if (obj.modifyTime) {
261
              obj.modifyTime = parseTime(obj.modifyTime)
262
            }
263
            if (obj.modifier) {
264
              queryBase.getAdminUser(obj.modifier, function(sc, value) {
265
                if (sc) {
266
                  obj.modifier = value.name
267
                }
268
              })
269
            }
270
            that.formObj = obj
271
          }
272
        })
273
      },
161
      submitForm(formName) {
274
      submitForm(formName) {
162
        this.$refs[formName].validate((valid) => {
275
        this.$refs[formName].validate((valid) => {
163
          if (valid) {
276
          if (valid) {
164
            this.$refs.uploadLogo.submit() // 确认上传图片
277
            // this.$refs.uploadLogo.submit() // 确认上传图片
165
            // if (this.province) {
278
            // if (this.province) {
166
            //   if (!this.city) {
279
            //   if (!this.city) {
167
            //     this.$alert('请您选择所在城市', '提示', {
280
            //     this.$alert('请您选择所在城市', '提示', {
172
            //     return
285
            //     return
173
            //   }
286
            //   }
174
            // }
287
            // }
175
            // let paramsData = {
288
            const form = this.formObj
176
            //   'id': this.plf_user,
289
            this.$http.put(updatePlat, {
177
            //   'name': this.plf_name,
290
              name: form.name,
178
            //   'linkman': this.formObj.linkman,
291
              logo: form.logo,
179
            //   'logo': this.imgName,
292
              url: form.url,
180
            //   'linkphone': this.formObj.tel,
293
              manageOrg: form.manageOrg,
181
            //   'linkemail': this.formObj.mail,
294
              addr: form.addr,
182
            //   'province': this.province,
295
              location: form.location,
183
            //   'city': this.city,
296
              zipCode: form.zipCode,
184
            //   'addr': this.formObj.address,
297
              servicePhone: form.servicePhone,
185
            //   'url': this.formObj.website,
298
              serviceEmail: form.serviceEmail,
186
            //   'industry': this.formObj.industry,
299
              operateTime: form.operateTime,
187
            //   'descp': this.formObj.desc
300
              linkman: form.linkman,
188
            // }
301
              job: form.job,
189
            // this.$axios.post(httpUrl.hQuery.baseInfo.update, paramsData).then((res) => {
302
              department: form.department,
190
            //   this.$message({
303
              comp: form.comp,
191
            //     message: '平台信息修改成功!',
304
              linkphone: form.linkphone,
192
            //     type: 'success'
305
              linkemail: form.linkemail,
193
            //   });
306
              descp: form.descp
194
            //   Cookies.set('plf_logo', this.imgName);
307
            }, function(res) {
195
            //   this.$router.push({path: '/WorkHome'});
308
              this.$message({
196
            //   this.reload();
309
                message: '平台信息修改成功!',
197
            // }).catch(error => {
310
                type: 'success'
198
            //   console.log(error);
311
              })
199
            // });
312
            })
200
          } else {
313
          } else {
201
            return false
314
            return false
202
          }
315
          }
203
        })
316
        })
204
      },
317
      },
205
      // upload img
318
      uploadfun(value) {
206
      handleAvatarSuccess(res, file) {
319
        console.log(value)
207
        this.imageUrl = URL.createObjectURL(file.raw)
208
        this.imgName = res.data[0].uri
209
      },
320
      },
210
      beforeAvatarUpload(file) {
321
      toshow(value) {
211
        const isJPG = file.type === 'image/jpeg'
322
        this.formObj.addr = value
212
        const isPNG = file.type === 'image/png'
213
        const isLt2M = file.size / 1024 / 1024 < 2
214
        if (!isJPG && !isPNG) {
215
          this.$message.error('请上传PNG/JPG/JPEG格式的图片')
216
        }
217
        if (!isLt2M) {
218
          this.$message.error('上传logo大小不能超过 2MB!')
219
        }
220
        return (!isJPG || !isPNG) && isLt2M
221
      }
323
      }
222
      // upload img
223
    },
224
    components: {
225
      cityPicker
226
    }
324
    }
227
  }
325
  }
228
</script>
326
</script>
229
327
230
<style rel="stylesheet/scss" lang="scss">
328
<style rel="stylesheet/scss" lang="scss">
231
  .main-info{
329
  .main-info{
232
    /*min-width: 1100px;*/
330
    padding: 0 20px;
233
    .update-logo{
331
    .update-logo{
234
      width: 280px;
332
      width: 280px;
235
      .avatar-uploader{
333
      .avatar-uploader{
259
      }
357
      }
260
    }
358
    }
261
    .update-main{
359
    .update-main{
262
      padding-left:25px;
263
      .update-title{
360
      .update-title{
264
        font-size:30px;
361
        font-size:30px;
265
        line-height:54px;
362
        line-height:54px;
266
        margin-bottom:16px;
363
        margin-bottom:16px;
267
        padding-left:10px;
364
        padding-left:10px;
268
      }
365
      }
269
270
      .el-tag + .el-tag{
271
        margin-left: 10px;
272
      }
273
      .button-new-tag{
274
        height: 32px;
275
        line-height: 30px;
276
        padding-top: 0;
277
        padding-bottom: 0;
278
      }
279
      .input-new-tag{
280
        width: 90px;
281
        margin-left: 10px;
282
        vertical-align: bottom;
283
      }
284
    }
285
    .shortW{
286
      width:300px;
287
    }
366
    }
288
  }
367
  }
289
</style>
368
</style>

+ 0 - 323
src/views/sysSetting/DemandIssue.vue

1
<template>
2
  <div class="demandIssue content-wrapper">
3
    <el-form :model="ruleFormDem" :rules="rules" ref="ruleFormDem" class="form-main">
4
      <el-form-item label="需求主题" prop="demandTit">
5
        <el-input v-model="ruleFormDem.demandTit" placeholder="请用一句话概括您的需求"></el-input>
6
      </el-form-item>
7
      <el-form-item label="需求内容" prop="demandDesc">
8
        <el-input type="textarea" :rows="4" v-model="ruleFormDem.demandDesc" placeholder="请描述您的需求背景、具体问题、对专家的要求等等"></el-input>
9
      </el-form-item>
10
      <el-col :span="12">
11
        <CityPick ref="cityPick" :widthselect="148" :prov="ruleFormDem.province" :city="ruleFormDem.city" v-on:selectProv="getSelectProv($event)" v-on:selectCity="getSelectCity($event)"></CityPick>
12
        <!-- <el-form-item label="所在城市" prop="citys">
13
          <el-cascader
14
            :options="optionsCity"
15
            v-model="ruleFormDem.citys"
16
            class="shortW"
17
            placeholder="请选择所在的城市">
18
          </el-cascader>
19
        </el-form-item> -->
20
      </el-col>
21
      <el-col :span="12">
22
        <el-form-item label="需求有效期" prop="lastDate">
23
          <el-date-picker
24
            v-model="ruleFormDem.lastDate"
25
            type="date" class="shortW"
26
            format="yyyy-MM-dd"
27
            placeholder="请选择截止日期"
28
            :picker-options="pickerOptions0">
29
          </el-date-picker>
30
        </el-form-item>
31
      </el-col>
32
      <el-col :span="12">
33
        <el-form-item label="预计合作周期" prop="longTime">
34
          <el-select v-model="selectLongTime" placeholder="请选择预计合作周期" class="shortW">
35
            <el-option
36
              v-for="item in longTime"
37
              :key="item.value"
38
              :label="item.label"
39
              :value="item.value"
40
              @current-change="item.value">
41
            </el-option>
42
          </el-select>
43
        </el-form-item>
44
      </el-col>
45
      <el-col :span="12">
46
        <el-form-item label="费用预算" prop="costRange">
47
          <el-select v-model="selectCostRange" placeholder="请选择预算范围" class="shortW">
48
            <el-option
49
              v-for="item in costRange"
50
              :key="item.value"
51
              :label="item.label"
52
              :value="item.value">
53
            </el-option>
54
          </el-select>
55
        </el-form-item>
56
      </el-col>
57
      <el-col :span="24"><div class="form-line"></div></el-col>
58
      <el-col :span="12">
59
        <el-form-item label="联系人" prop="linkman">
60
          <el-input v-model="ruleFormDem.linkman" placeholder="请填写您的姓名" class="shortW"></el-input>
61
        </el-form-item>
62
      </el-col>
63
      <el-col :span="12">
64
        <el-form-item label="您所在的企业名称" prop="orgName">
65
          <el-input v-model="ruleFormDem.orgName" placeholder="建议填写与营业执照一致的企业名称" class="shortW"></el-input>
66
        </el-form-item>
67
      </el-col>
68
      <el-col :span="12">
69
        <el-form-item label="联系电话" prop="linkTel">
70
          <el-input v-model="ruleFormDem.linkTel" placeholder="请输入您的手机号码,可用于登录科袖网" class="shortW"></el-input>
71
        </el-form-item>
72
      </el-col>
73
      <el-col :span="12">
74
        <el-form-item label="图形验证码" prop="imgVerifyCode">
75
          <el-input v-model="ruleFormDem.imgVerifyCode" placeholder="请输入图形验证码" class="shortW code-btn">
76
          <img slot="append" :src="imgVcUrl" @click="changeImgVc" /></el-input>
77
        </el-form-item>
78
      </el-col>
79
      <el-col :span="12">
80
        <el-form-item label="短信验证码" prop="msgVerifyCode">
81
          <el-input v-model="ruleFormDem.msgVerifyCode" placeholder="请输入短信验证码" class="shortW">
82
            <el-button slot="append" :disabled="phoneCodeBol" @click="getPhoneCode">
83
              <span v-if="sendMsgDisabled">{{seconds + '秒后获取'}}</span>
84
              <span v-if="!sendMsgDisabled">获取验证码</span>
85
            </el-button>
86
          </el-input>
87
        </el-form-item>
88
      </el-col>
89
      <el-col :span="24" ><el-form-item style="height:20px"></el-form-item></el-col>
90
      <el-col :span="24" >
91
        <el-form-item style="text-align:center">
92
          <el-button type="primary" @click="submitForm('ruleFormDem')" style="padding: 12px 50px">立即发布</el-button><br/>
93
          <el-checkbox checked disabled>我已阅读并同意<a :href="kexiuLink + '/privacy.html'" target="_blank">《科袖用户协议》</a></el-checkbox>
94
        </el-form-item>
95
      </el-col>
96
    </el-form>
97
  </div>
98
</template>
99
100
<script type="text/ecmascript-6">
101
  // import {
102
  //   provinceAndCityData,
103
  //   CodeToText
104
  // } from 'element-china-area-data'; // TextToCode
105
106
  import Cookies from 'js-cookie';
107
  import httpUrl from '@/libs/http';
108
  import util from '@/libs/util';
109
110
  var validPhone = (rule, value, callback) => {
111
    const reg = /^1[3|4|5|7|8][0-9]\d{8}$/;
112
    if (!value) {
113
      callback(new Error('请输入你的手机号码'));
114
    } else if (!reg.test(value)) {
115
      callback(new Error('请输入正确的手机号码'));
116
    } else {
117
      callback();
118
    };
119
  };
120
121
  export default {
122
    data() {
123
      return {
124
        pickerOptions0: {
125
          disabledDate(time) {
126
            return time.getTime() < Date.now();
127
          }
128
        },
129
        kexiuLink: util.ekexiuUrl,
130
        platSource: '',
131
        phoneCodeBol: false,
132
        sendMsgDisabled: false,
133
        seconds: 60,
134
        phoneResBack: '',
135
        imgVcUrl: httpUrl.kxQurey.sign.imgVC,
136
        // optionsCity: provinceAndCityData,
137
        selectCostRange: '',
138
        selectLongTime: '',
139
        longTime: util.Dictionary.durationTime,
140
        costRange: util.Dictionary.costRange,
141
        ruleFormDem: {
142
          demandTit: '',
143
          demandDesc: '',
144
          province: '',
145
          city: '',
146
          lastDate: '',
147
          linkman: '',
148
          orgName: '',
149
          linkTel: '',
150
          imgVerifyCode: '',
151
          msgVerifyCode: ''
152
        },
153
        rules: {
154
          demandTit: [
155
            { required: true, message: '请填写需求主题', trigger: 'blur' }
156
          ],
157
          demandDesc: [
158
            { required: true, message: '请填写需求内容', trigger: 'blur' },
159
            { max: 1000, message: '不得超过1000个字', trigger: 'blur' }
160
          ],
161
          province: [
162
            { required: true, message: '请填写所在省', trigger: 'blur' }
163
          ],
164
          city: [
165
            { required: true, message: '请填写所在城市', trigger: 'blur' }
166
          ],
167
          lastDate: [
168
            { required: true, message: '请选择截止日期', trigger: 'blur' }
169
          ],
170
          linkman: [
171
            { required: true, message: '请填写您的姓名', trigger: 'blur' },
172
            { max: 10, message: '不得超过10个字', trigger: 'blur' }
173
          ],
174
          orgName: [
175
            { required: true, message: '请填写您所在的企业名称', trigger: 'blur' },
176
            { max: 50, message: '不得超过50个字', trigger: 'blur' }
177
          ],
178
          linkTel: [
179
            { required: true, validator: validPhone, trigger: 'blur' }
180
          ],
181
          imgVerifyCode: [
182
            { required: true, message: '请输入图形验证码', trigger: 'blur' }
183
          ],
184
          msgVerifyCode: [
185
            { required: true, message: '请输入短信验证码', trigger: 'blur' }
186
          ]
187
        }
188
      };
189
    },
190
    created() {
191
      this.platSource = Cookies.get('platSource');
192
    },
193
    methods: {
194
      getSelectProv(prov) {
195
        this.ruleFormDem.province = prov;
196
      },
197
      getSelectCity(city) {
198
        this.ruleFormDem.city = city;
199
      },
200
      getPhoneCode() {
201
        if (this.ruleFormDem.linkTel && this.ruleFormDem.imgVerifyCode) {
202
          this.$axios.get(httpUrl.kxQurey.sign.msgVC, {
203
            params: {
204
              phone: this.ruleFormDem.linkTel,
205
              vcode: this.ruleFormDem.imgVerifyCode
206
            }
207
          }).then((res) => {
208
            if (res.success) {
209
              console.log(res);
210
              this.phoneResBack = res.data;
211
              this.clickMsgVc();
212
            } else {
213
              if (res.code === 20001) {
214
                this.$message.error('图形验证码错误');
215
                this.changeImgVc();
216
              };
217
            };
218
          });
219
        } else {
220
          this.$message({
221
            message: '请输入手机号和图形验证码',
222
            type: 'warning'
223
          });
224
        }
225
      },
226
      clickMsgVc() {
227
        let me = this;
228
        me.sendMsgDisabled = true;
229
        me.phoneCodeBol = true;
230
        let interval = window.setInterval(function() {
231
         if ((me.seconds--) <= 0) {
232
          me.seconds = 60;
233
          me.sendMsgDisabled = false;
234
          me.phoneCodeBol = false;
235
          window.clearInterval(interval);
236
         }
237
        }, 1000);
238
      },
239
      changeImgVc() {
240
        this.imgVcUrl = httpUrl.kxQurey.sign.imgVC + '?' + new Date().getTime();
241
      },
242
      resetForm(formName) {
243
        this.$refs.cityPick.resetProvCity();
244
        this.selectCostRange = '';
245
        this.selectLongTime = '';
246
        this.$refs[formName].resetFields();
247
      },
248
      submitForm(formName) {
249
        this.$refs[formName].validate((valid) => {
250
          if (valid) {
251
            let paramsData = {
252
              'title': this.ruleFormDem.demandTit,
253
              'descp': this.ruleFormDem.demandDesc,
254
              'province': this.ruleFormDem.province,
255
              'city': this.ruleFormDem.city,
256
              'invalidDay': util.dateFormatter(this.ruleFormDem.lastDate, false, true),
257
              'cost': this.selectCostRange,
258
              'duration': this.selectLongTime,
259
              'name': this.ruleFormDem.linkman,
260
              'orgName': this.ruleFormDem.orgName,
261
              'contactNum': this.ruleFormDem.linkTel,
262
              'vc': this.ruleFormDem.msgVerifyCode,
263
              'state': this.phoneResBack,
264
              'source': this.platSource
265
            };
266
            console.log(paramsData);
267
            this.$axios.post(httpUrl.hQuery.demand.add, paramsData).then((res) => {
268
              if (res.success) {
269
                this.$alert('我们已收到您的需求,马上为您对接合适的专家和专业机构,您可以登录科袖网与对方做进一步沟通。', '需求发布成功!', {
270
                  confirmButtonText: '进入科袖网,发现更多服务和资源',
271
                  type: 'success',
272
                  center: true,
273
                  cancelButtonText: '取消',
274
                  callback: action => {
275
                    if (action === 'confirm') {
276
                      window.open(util.ekexiuUrl, '科袖网首页');
277
                    };
278
                  }
279
                });
280
                this.resetForm(formName);
281
                this.$emit('dialogChanged', false);
282
              } else {
283
                this.$message({
284
                  message: '需求发布失败,请重新发布!',
285
                  type: 'warning'
286
                });
287
              };
288
              console.log(res);
289
            }).catch(error => {
290
              console.log(error);
291
            });
292
          } else {
293
            console.log('error submit!!');
294
            return false;
295
          }
296
        });
297
      }
298
    }
299
  };
300
</script>
301
302
<style lang="stylus" rel="stylesheet/stylus">
303
.demandIssue
304
  padding-top:10px
305
  .form-main
306
    width:100%
307
    .form-line
308
      border-top:1px dashed #ccc
309
      margin-bottom:20px
310
  .shortW
311
    width:300px
312
  .code-btn
313
    .el-input-group__append
314
      padding:0
315
      overflow:hidden
316
      img
317
        width:100px
318
        height:38px
319
        cursor: pointer
320
  .el-checkbox__label
321
    a
322
      color:#c0c4cc
323
</style>

+ 117 - 63
src/views/sysSetting/adminUser.vue

3
    <div class="box-container">
3
    <div class="box-container">
4
      <div class="contain-title">平台后台用户管理列表</div>
4
      <div class="contain-title">平台后台用户管理列表</div>
5
      <div class="contian-operate">
5
      <div class="contian-operate">
6
        <el-button type="primary" @click="handleADD">添加</el-button>
6
        <el-button type="primary" @click="handleAdd">添加</el-button>
7
      </div>
7
      </div>
8
    </div>
8
    </div>
9
    <div class="content-container">
9
    <div class="content-container">
13
          v-model="selectMode"
13
          v-model="selectMode"
14
          @change="selectChange">
14
          @change="selectChange">
15
          <el-option label="正常账号" value="1" selected></el-option>
15
          <el-option label="正常账号" value="1" selected></el-option>
16
          <el-option label="停用账号" value="2"></el-option>
16
          <el-option label="停用账号" value="0"></el-option>
17
        </el-select>
17
        </el-select>
18
      </div>
18
      </div>
19
      <el-table
19
      <el-table
29
          align="center">
29
          align="center">
30
          <template slot-scope="scope">
30
          <template slot-scope="scope">
31
            <div v-if="scope.row[item.prop]">
31
            <div v-if="scope.row[item.prop]">
32
              {{scope.row[item.prop]}}
32
              <div v-if="scope.row[item.prop]">
33
                <el-button v-if="item.link" type="text"
34
                  @click="handleEdit(scope.row.id)">{{scope.row[item.prop]}}</el-button>
35
                <span v-else>{{scope.row[item.prop]}}</span>
36
              </div>
33
            </div>
37
            </div>
34
            <div v-if="item.operate && typeof scope.row === 'object'">
38
            <div class="operate-row" v-if="item.operate && typeof scope.row === 'object'">
35
              <div class="normal" v-if="scope.row.active">
39
              <div class="normal" v-if="scope.row.actived">
36
                <el-button
40
                <el-button
37
                  size="mini"
41
                  size="medium"
38
                  type="primary"
42
                  type="primary"
39
                  @click="handleEdit(scope.row)">修改</el-button>
43
                  @click="handleEdit(scope.row.id)">修改</el-button>
40
                <el-button
44
                <el-button
41
                  size="mini"
45
                  size="medium"
42
                  type="primary"
46
                  type="primary"
43
                  @click="handleResetpw(scope.row)">重置密码</el-button>
47
                  @click="handleResetpw(scope.row)">重置密码</el-button>
44
                <el-button
48
                <el-button
45
                  size="mini"
49
                  size="medium"
46
                  type="primary"
50
                  type="primary"
47
                  @click="handleRight(scope.row)">分配权限</el-button>
51
                  @click="handleRight(scope.row.id)">分配权限</el-button>
48
                <el-button
52
                <el-button
49
                  size="mini"
53
                  size="medium"
50
                  type="danger"
54
                  type="danger"
51
                  @click="handleDelete(scope.$index, scope.row)">停用</el-button>
55
                  @click="handleBan(scope.row.id)">停用</el-button>
52
              </div>
56
              </div>
53
              <div class="forbidden" v-else>
57
              <div class="forbidden" v-else>
54
                <el-button
58
                <el-button
55
                  size="mini"
59
                  size="medium"
56
                  type="primary"
60
                  type="primary"
57
                  @click="handleEdit(scope.$index, scope.row)">恢复</el-button>
61
                  @click="handleRenew(scope.row.id)">恢复</el-button>
58
              </div>
62
              </div>
59
            </div>
63
            </div>
60
          </template>
64
          </template>
71
        </el-pagination>
75
        </el-pagination>
72
      </div>
76
      </div>
73
    </div>
77
    </div>
74
    <editUser ref="userInfoDialog"></editUser>
78
    <editUser ref="userInfoDialog" :operateM="operateM" v-on:dialogChanged="dialogChanged"></editUser>
75
  </div>
79
  </div>
76
</template>
80
</template>
77
81
80
  import comTable from '@/utils/comTable'
84
  import comTable from '@/utils/comTable'
81
  import {
85
  import {
82
    pageQueryUser,
86
    pageQueryUser,
83
    // addUser,
87
    resetPw,
84
    resetPw
88
    banUser,
85
    // updateUser,
89
    renewUser
86
    // updatePermission,
87
    // banUser
88
  } from '@/api/sysSetting'
90
  } from '@/api/sysSetting'
89
91
90
  import editUser from './editUser'
92
  import editUser from './editUser'
93
      return {
95
      return {
94
        searchText: '',
96
        searchText: '',
95
        selectMode: '1',
97
        selectMode: '1',
98
        operateM: {},
96
        pageSize: 10,
99
        pageSize: 10,
97
        pageNo: 1,
100
        pageNo: 1,
98
        total: 0,
101
        total: 0,
100
        tableItem: [
103
        tableItem: [
101
          {
104
          {
102
            prop: 'account',
105
            prop: 'account',
103
            tit: '账号'
106
            tit: '账号',
107
            link: true
104
          },
108
          },
105
          {
109
          {
106
            prop: 'id',
110
            prop: 'name',
107
            tit: '用户名'
111
            tit: '用户名'
108
          },
112
          },
109
          {
113
          {
110
            prop: 'job',
114
            prop: 'job',
111
            tit: '职位',
115
            tit: '职位'
112
            width: '160'
113
          },
116
          },
114
          {
117
          {
115
            prop: 'comp',
118
            prop: 'comp',
116
            tit: '所在部门',
119
            tit: '所在部门'
117
            width: '160'
118
          },
120
          },
119
          {
121
          {
120
            prop: 'dep',
122
            prop: 'dep',
152
      pageQueryUser() {
154
      pageQueryUser() {
153
        var that = this
155
        var that = this
154
        this.$http.get(pageQueryUser, {
156
        this.$http.get(pageQueryUser, {
155
          active: that.selectMode,
157
          actived: parseInt(that.selectMode),
156
          pageSize: that.pageSize,
158
          pageSize: that.pageSize,
157
          pageNo: that.pageNo
159
          pageNo: that.pageNo
158
        }, function(res) {
160
        }, function(res) {
159
          if (res.data.success && res.data.data) {
161
          if (res.success && res.data) {
160
            const obj = res.data.data
162
            const obj = res.data.data
161
            for (let i = 0; i < obj.length; ++i) {
163
            if (obj.length) {
162
              if (obj[i].createTime) {
164
              for (let i = 0; i < obj.length; ++i) {
163
                obj[i].createTime = parseTime(obj[i].createTime)
165
                if (obj[i].createTime) {
166
                  obj[i].createTime = parseTime(obj[i].createTime)
167
                }
168
                if (obj[i].invalidTime) {
169
                  obj[i].invalidTime = parseTime(obj[i].invalidTime)
170
                }
164
              }
171
              }
165
            }
172
            }
166
            that.total = res.data.total
173
            that.total = res.data.total
167
            that.tableData = obj
174
            that.tableData = obj
175
            comTable.gapFilling(that.tableData)
176
          } else {
177
            that.total = 0
178
            that.tableData = []
168
          }
179
          }
169
        })
180
        })
170
        comTable.gapFilling(that.tableData)
171
      },
172
      handleADD() {
173
        // this.$refs.BInfoDialog02.queryServerList()
174
        this.$refs.userInfoDialog.userDialogVisible = true
175
      },
181
      },
176
      handleCurrentChange(val) {
182
      handleCurrentChange(val) {
177
        this.pageNo = val
183
        this.pageNo = val
178
        this.pageQueryUser()
184
        this.pageQueryUser()
179
      },
185
      },
180
      selectChange(val) {
186
      selectChange(val) {
187
        this.searchText = ''
181
        this.selectMode = val
188
        this.selectMode = val
189
        this.pageNo = 1
190
        this.total = 0
191
        this.tableData = []
192
        this.addBanTimeColumn(val)
182
        this.pageQueryUser()
193
        this.pageQueryUser()
183
      },
194
      },
184
      handleEdit(row) {
195
      addBanTimeColumn(val) {
185
        var that = this
196
        var lastcol = this.tableItem.pop()
186
        this.$http.get(resetPw, {
197
        if (val === '0') {
187
          id: row.id
198
          var bancol = {
188
        }, function(res) {
199
            prop: 'invalidTime',
189
          that.$message({
200
            tit: '停用时间',
190
            type: 'success',
201
            width: '160'
191
            message: '删除成功!'
202
          }
192
          })
203
          this.tableItem.push(bancol)
193
        })
204
          this.tableItem.push(lastcol)
205
        } else {
206
          this.tableItem.pop()
207
          this.tableItem.push(lastcol)
208
        }
209
      },
210
      dialogChanged() {
211
        this.searchText = ''
212
        this.selectMode = '1'
213
        this.pageNo = 1
214
        this.total = 0
215
        this.tableData = []
216
        this.pageQueryUser()
217
      },
218
      handleAdd() {
219
        this.operateM = {
220
          type: 'add',
221
          tit: '添加用户信息'
222
        }
223
        this.$refs.userInfoDialog.getUserDetail()
224
      },
225
      handleEdit(id) {
226
        this.operateM = {
227
          type: 'edit',
228
          tit: '修改用户信息'
229
        }
230
        this.$refs.userInfoDialog.getUserDetail(id)
231
      },
232
      handleRight(id) {
233
        this.operateM = {
234
          type: 'right',
235
          tit: '用户分配权限'
236
        }
237
        this.$refs.userInfoDialog.getUserDetail(id)
194
      },
238
      },
195
      handleResetpw(row) {
239
      handleResetpw(row) {
196
        var that = this
240
        var that = this
197
        that.$confirm(`确定重置用户${row.name}的密码`, '提示', {
241
        that.$confirm(`确定重置用户 ${row.name} 的密码`, '提示信息', {
198
          confirmButtonText: '确定',
199
          cancelButtonText: '取消',
200
          type: 'warning',
242
          type: 'warning',
201
          center: true
243
          center: true
202
        }).then(() => {
244
        }).then(() => {
203
          this.$http.get(resetPw, {
245
          that.$http.get(resetPw, {
204
            id: row.id
246
            id: row.id
205
          }, function(res) {
247
          }, function(res) {
206
            that.$message({
248
            if (res.success) {
207
              type: 'success',
249
              that.$message({
208
              message: '该用户密码重置成功!'
250
                type: 'success',
209
            })
251
                message: '该用户密码重置成功!'
252
              })
253
            }
210
          })
254
          })
255
        }).catch(() => {})
256
      },
257
      handleBan(id) {
258
        var that = this
259
        this.$http.get(banUser, {
260
          id: id
261
        }, function(res) {
262
          if (res.success) {
263
            that.pageQueryUser()
264
          }
211
        })
265
        })
212
      },
266
      },
213
      handleRight(row) {
267
      handleRenew(id) {
214
        // var that = this
268
        var that = this
215
        // this.$http.get(updatePermission + row.id, {
269
        this.$http.get(renewUser, {
216
        // }, function(res) {
270
          id: id
217
        //   that.$message({
271
        }, function(res) {
218
        //     type: 'success',
272
          if (res.success) {
219
        //     message: '删除成功!'
273
            that.pageQueryUser()
220
        //   })
274
          }
221
        // })
275
        })
222
      }
276
      }
223
    }
277
    }
224
  }
278
  }

+ 266 - 120
src/views/sysSetting/editUser.vue

1
<template>
1
<template>
2
  <el-dialog title="添加用户信息" :visible.sync="userDialogVisible">
2
  <el-dialog :title="operateM.tit" :visible.sync="userDialogVisible">
3
    <el-form
3
    <el-form
4
      :model="userForm"
4
      :model="userForm"
5
      :rules="userRules"
5
      :rules="userRules"
7
      class="form-main"
7
      class="form-main"
8
      label-width="80px">
8
      label-width="80px">
9
      <el-row :gutter="20">
9
      <el-row :gutter="20">
10
        <el-col :span="12">
10
        <el-col :span="24">
11
          <!-- <el-form-item label="账号" v-if="">
11
          <el-form-item v-if="activeShow" label="账号状态">
12
            <span>{{userForm.account}}</span>
12
            <span>{{actived?'正常账号':'停用账号'}}</span>
13
          </el-form-item> -->
14
          <el-form-item class="is-required" label="账号" prop="account">
15
            <el-input v-model="userForm.account" placeholder="请填写用户账号" maxlength="20"></el-input>
16
          </el-form-item>
17
        </el-col>
18
        <el-col :span="12">
19
          <el-form-item class="is-required" label="用户名" prop="name">
20
            <el-input v-model="userForm.name" placeholder="请填写用户名"></el-input>
21
          </el-form-item>
22
        </el-col>
23
        <el-col :span="12">
24
          <el-form-item class="is-required" label="联系电话" prop="tel">
25
            <el-input v-model="userForm.tel" placeholder="请填写用户联系电话" maxlength="20"></el-input>
26
          </el-form-item>
27
        </el-col>
28
        <el-col :span="12">
29
          <el-form-item label="联系邮箱" prop="mail">
30
            <el-input v-model="userForm.mail" placeholder="请填写用户联系邮箱" maxlength="50"></el-input>
31
          </el-form-item>
13
          </el-form-item>
32
        </el-col>
14
        </el-col>
33
        <el-col :span="12">
15
        <el-col :span="item.span||''" v-for="item in formItem" :key="item.index">
34
          <el-form-item label="职位" prop="position">
16
          <el-form-item v-if="readonlyShow && !item.right" v-show="userForm[item.prop]" :label="item.tit">
35
            <el-input v-model="userForm.position" placeholder="请填写用户职位" maxlength="20"></el-input>
17
            <span>{{userForm[item.prop]}}</span>
36
          </el-form-item>
18
          </el-form-item>
37
        </el-col>
19
          <el-form-item v-if="!readonlyShow && !item.right" :label="item.tit" :prop="item.prop">
38
        <el-col :span="12">
20
            <el-input v-model="userForm[item.prop]" :placeholder="`请填写用户${item.tit}`" :maxlength="item.num||''"></el-input> 
39
          <el-form-item label="所在部门" prop="department">
40
            <el-input v-model="userForm.department" placeholder="请填写用户所在部门" maxlength="20"></el-input>
41
          </el-form-item>
21
          </el-form-item>
42
        </el-col>
22
          <el-form-item v-if="item.right" :prop="item.prop" label-width="0">
43
        <el-col :span="24">
23
            <template>
44
          <el-form-item class="is-required" label="所在机构" prop="org">
24
              <el-card shadow="never">
45
            <el-input v-model="userForm.org" placeholder="请填写联系人所在机构" maxlength="50"></el-input>
25
                <div class="card-title" slot="header">
26
                  <span>{{item.tit}}</span>
27
                </div>
28
                <el-checkbox-group
29
                  v-model="userForm[item.prop]"
30
                  :min="1"
31
                  :max="moduleOption.length"
32
                  @change="handleCheckedChange">
33
                  <el-checkbox v-for="mod in moduleOption" :label="mod.id" :key="mod.index">{{mod.name}}</el-checkbox>
34
                </el-checkbox-group>
35
              </el-card>
36
            </template>
46
          </el-form-item>
37
          </el-form-item>
47
        </el-col>
38
        </el-col>
48
        <el-col :span="24"><div class="form-line"></div></el-col>
39
        <el-col :span="24"><div class="form-line"></div></el-col>
49
        <el-col :span="24">
50
          <el-card shadow="never">
51
            <div class="card-title" slot="header">
52
              <span>分配权限</span>
53
            </div>
54
            <el-checkbox-group v-model="userForm.module">
55
              <el-checkbox v-for="item in moduleOption" :label="item.name" :key="item.index">{{item.name}}</el-checkbox>
56
            </el-checkbox-group>
57
          </el-card>
58
        </el-col>
59
        <el-col :span="24" class="el-btn-col">
40
        <el-col :span="24" class="el-btn-col">
60
          <div class="el-btn-col-box">
41
          <div class="el-btn-col-box">
61
            <el-button type="primary" @click="submitForm('userForm')">保存</el-button>
42
            <el-button type="primary" @click="submitForm('userForm')">保存</el-button>
62
          </div>
43
          </div>
63
        </el-col>
44
        </el-col>
64
        <el-col :span="24">
45
        <el-col :span="24" v-if="timeShow">
65
          <el-form-item align="right">
46
          <el-form-item align="right">
66
            <span>创建时间:2018/08/23 18:52:12</span>
47
            <span>创建时间: {{createTime}}</span>
67
          </el-form-item>
48
          </el-form-item>
68
        </el-col>
49
        </el-col>
69
      </el-row>
50
      </el-row>
72
</template>
53
</template>
73
54
74
<script>
55
<script>
75
  import { checkEmailV } from '@/utils/validator'
56
  import { parseTime } from '@/utils'
57
  import queryBase from '@/utils/queryBase'
58
  import {
59
    requiredTip,
60
    limitNumTip,
61
    checkEmailV
62
  } from '@/utils/validator'
63
  import {
64
    existUser,
65
    addUser,
66
    updateUser,
67
    updatePermission
68
  } from '@/api/sysSetting'
76
69
77
  export default {
70
  export default {
71
    props: ['operateM'],
78
    data() {
72
    data() {
79
      return {
73
      return {
80
        userDialogVisible: false,
74
        userDialogVisible: false,
81
        platSource: '',
82
        moduleOption: [
75
        moduleOption: [
76
          { id: '1', name: '内容发布' },
77
          { id: '2', name: '特约专家' },
78
          { id: '3', name: '合作机构' },
79
          { id: '4', name: '企业中心' },
80
          { id: '5', name: '平台信息' },
81
          { id: '6', name: '用户信息' }
82
        ],
83
        userId: '',
84
        actived: 0,
85
        oldAccount: '',
86
        createTime: '',
87
        formItem: [
88
          {
89
            span: 12,
90
            prop: 'account',
91
            tit: '账号',
92
            num: 20,
93
            required: true
94
          },
95
          {
96
            span: 12,
97
            prop: 'name',
98
            tit: '用户名',
99
            required: true
100
          },
83
          {
101
          {
84
            id: 0,
102
            span: 12,
85
            name: '内容发布'
103
            prop: 'phone',
104
            tit: '联系电话',
105
            num: 20,
106
            required: true
86
          },
107
          },
87
          {
108
          {
88
            id: 0,
109
            span: 12,
89
            name: '内容发布'
110
            prop: 'email',
111
            tit: '联系邮箱',
112
            num: 50
90
          },
113
          },
91
          {
114
          {
92
            id: 0,
115
            span: 12,
93
            name: '内容发布'
116
            prop: 'job',
117
            tit: '职位',
118
            num: 20
94
          },
119
          },
95
          {
120
          {
96
            id: 0,
121
            span: 12,
97
            name: '内容发布'
122
            prop: 'dep',
123
            tit: '所在部门',
124
            num: 20
125
          },
126
          {
127
            span: 24,
128
            prop: 'comp',
129
            tit: '所在机构',
130
            num: 50
131
          },
132
          {
133
            span: 24,
134
            prop: 'rightCode',
135
            tit: '分配权限',
136
            right: true,
137
            required: true
98
          }
138
          }
99
        ],
139
        ],
100
        userForm: {
140
        userForm: {
101
          account: '',
141
          account: '',
102
          name: '',
142
          name: '',
103
          tel: '',
143
          phone: '',
104
          mail: '',
144
          email: '',
105
          position: '',
145
          job: '',
106
          department: '',
146
          dep: '',
107
          org: '',
147
          comp: '',
108
          module: ''
148
          rightCode: []
109
        },
149
        },
110
        userRules: {
150
        userRules: {}
111
          mail: [{ validator: checkEmailV, trigger: 'blur' }]
151
      }
112
        }
152
    },
153
    computed: {
154
      readonlyShow() {
155
        return this.operateM.type === 'right' || false
156
      },
157
      activeShow() {
158
        return this.operateM.type === 'edit' || false
159
      },
160
      timeShow() {
161
        return this.operateM.type === 'add' || true
162
      }
163
    },
164
    watch: {
165
      userDialogVisible(val) {
166
        !val && setTimeout(() => {
167
          if (!this.operateM.type === 'right') {
168
            this.$refs['userForm'].resetFields()
169
          }
170
          this.$refs['userForm'].clearValidate()
171
        }, 0)
113
      }
172
      }
114
    },
173
    },
115
    created() {
174
    created() {
116
      // this.platSource = Cookies.get('platSource');
175
      this.pushRulesFn()
117
    },
176
    },
118
    methods: {
177
    methods: {
119
      resetForm(formName) {
178
      getUserDetail(id) {
120
        this.$refs[formName].resetFields()
179
        var that = this
180
        that.userId = id
181
        if (that.userId) {
182
          queryBase.getAdminUser(that.userId, function(sc, value) {
183
            if (sc) {
184
              const opeRow = value
185
              that.actived = opeRow.actived
186
              if (opeRow.createTime) {
187
                that.createTime = parseTime(opeRow.createTime)
188
              }
189
              that.oldAccount = opeRow.account
190
              that.userForm = {
191
                account: opeRow.account,
192
                name: opeRow.name,
193
                phone: opeRow.phone,
194
                email: opeRow.email,
195
                job: opeRow.job,
196
                dep: opeRow.dep,
197
                comp: opeRow.comp,
198
                rightCode: opeRow.rightCode ? opeRow.rightCode : []
199
              }
200
            }
201
          })
202
        } else {
203
          this.actived = 0
204
          this.createTime = ''
205
          this.userForm = {
206
            account: '',
207
            name: '',
208
            phone: '',
209
            email: '',
210
            job: '',
211
            dep: '',
212
            comp: '',
213
            rightCode: []
214
          }
215
        }
216
        setTimeout(function() {
217
          that.userDialogVisible = true
218
        }, 0)
219
      },
220
      pushRulesFn() {
221
        const formItem = this.formItem
222
        const userRules = this.userRules
223
        for (let i = 0; i < formItem.length; ++i) {
224
          const ru = []
225
          if (formItem[i].required) {
226
            ru.push({ required: true, message: requiredTip(formItem[i].tit), trigger: 'blur' })
227
          }
228
          if (formItem[i].num) {
229
            ru.push({ max: formItem[i].num, message: limitNumTip(formItem[i].tit, formItem[i].num), trigger: 'blur, change' })
230
          }
231
          switch (formItem[i].prop) {
232
            case 'email':
233
              ru.push({ validator: checkEmailV, trigger: 'blur' })
234
              break
235
          }
236
          userRules[formItem[i].prop] = ru
237
        }
238
      },
239
      isExistUserFn(fn) {
240
        var that = this
241
        var opeRow = that.userForm
242
        this.$http.get(existUser, {
243
          account: opeRow.account
244
        }, function(res) {
245
          if (res.success) {
246
            if (res.data) {
247
              that.$message({
248
                message: '账户已存在,请重新输入',
249
                type: 'warning'
250
              })
251
              return false
252
            } else {
253
              fn()
254
            }
255
          }
256
        })
121
      },
257
      },
122
      submitForm(formName) {
258
      submitForm(formName) {
259
        var that = this
123
        this.$refs[formName].validate((valid) => {
260
        this.$refs[formName].validate((valid) => {
124
          if (valid) {
261
          if (valid) {
125
            // let paramsData = {
262
            var opeRow = that.userForm
126
            //   'title': this.ruleFormDem.demandTit,
263
            var paramsData = {
127
            //   'descp': this.ruleFormDem.demandDesc,
264
              account: opeRow.account,
128
            //   'province': this.ruleFormDem.province,
265
              name: opeRow.name,
129
            //   'city': this.ruleFormDem.city,
266
              phone: opeRow.phone,
130
            //   'invalidDay': util.dateFormatter(this.ruleFormDem.lastDate, false, true),
267
              email: opeRow.email,
131
            //   'cost': this.selectCostRange,
268
              job: opeRow.job,
132
            //   'duration': this.selectLongTime,
269
              dep: opeRow.dep,
133
            //   'name': this.ruleFormDem.linkman,
270
              comp: opeRow.comp,
134
            //   'orgName': this.ruleFormDem.orgName,
271
              rightCode: opeRow.rightCode
135
            //   'contactNum': this.ruleFormDem.linkTel,
272
            }
136
            //   'vc': this.ruleFormDem.msgVerifyCode,
273
            if (that.operateM.type === 'add') {
137
            //   'state': this.phoneResBack,
274
              that.isExistUserFn(function() {
138
            //   'source': this.platSource
275
                that.$http.post(addUser, paramsData, function(res) {
139
            // };
276
                  if (res.success) {
140
            // console.log(paramsData);
277
                    that.successFun()
141
            // this.$axios.post(httpUrl.hQuery.demand.add, paramsData).then((res) => {
278
                  }
142
            //   if (res.success) {
279
                })
143
            //     this.$alert('我们已收到您的需求,马上为您对接合适的专家和专业机构,您可以登录科袖网与对方做进一步沟通。', '需求发布成功!', {
280
              })
144
            //       confirmButtonText: '进入科袖网,发现更多服务和资源',
281
            } else if (that.operateM.type === 'edit') {
145
            //       type: 'success',
282
              const paramsId = { id: that.userId }
146
            //       center: true,
283
              const obj = Object.assign(paramsId, paramsData)
147
            //       cancelButtonText: '取消',
284
              if (that.oldAccount === opeRow.account) {
148
            //       callback: action => {
285
                that.$http.put(updateUser, obj, function(res) {
149
            //         if (action === 'confirm') {
286
                  if (res.success) {
150
            //           window.open(util.ekexiuUrl, '科袖网首页');
287
                    that.successFun()
151
            //         };
288
                  }
152
            //       }
289
                })
153
            //     });
290
              } else {
154
            //     this.resetForm(formName);
291
                that.isExistUserFn(function() {
155
            //     this.$emit('dialogChanged', false);
292
                  that.$http.put(updateUser, obj, function(res) {
156
            //   } else {
293
                    if (res.success) {
157
            //     this.$message({
294
                      that.successFun()
158
            //       message: '需求发布失败,请重新发布!',
295
                    }
159
            //       type: 'warning'
296
                  })
160
            //     });
297
                })
161
            //   };
298
              }
162
            //   console.log(res);
299
            } else if (that.operateM.type === 'right') {
163
            // }).catch(error => {
300
              that.$http.put(updatePermission + that.userId, opeRow.rightCode, function(res) {
164
            //   console.log(error);
301
                if (res.success) {
165
            // });
302
                  that.successFun()
303
                }
304
              })
305
            }
166
          } else {
306
          } else {
167
            return false
307
            return false
168
          }
308
          }
169
        })
309
        })
310
      },
311
      successFun() {
312
        this.userDialogVisible = false
313
        this.$refs['userForm'].resetFields()
314
        this.$parent.dialogChanged()
315
      },
316
      handleCheckedChange(value) {
317
        this.userForm.rightCode = value
170
      }
318
      }
171
    }
319
    }
172
  }
320
  }
173
</script>
321
</script>
174
322
175
<style rel="stylesheet/scss" lang="scss">
323
<style rel="stylesheet/scss" lang="scss">
176
  .form-main{
324
  .el-card__header{
177
    width:100%;
325
    padding: 8px 15px;
178
    .form-line{
326
    .card-title{
179
      border-top:1px dashed #ccc;
327
      font-size: 18px;
180
      margin-bottom:20px;
328
      font-weight: bold;
329
      span:before{
330
        content: '*';
331
        color: #f56c6c;
332
        margin-right: 4px;
333
      }
181
    }
334
    }
182
  }
335
  }
183
  .shortW{
184
    width:300px;
185
  }
186
  .card-title{
187
    font-size: 20px;
188
    font-weight: bold;
189
  }
190
  .el-checkbox-group{
336
  .el-checkbox-group{
191
    .el-checkbox{
337
    .el-checkbox{
192
      font-size: 16px;
338
      font-size: 16px;

+ 81 - 21
src/views/userInfo/baseInfo.vue

1
<template>
1
<template>
2
  <el-dialog title="用户信息" :visible.sync="userDialogVisible">
2
  <el-dialog :title="dialogTit" :visible.sync="userDialogVisible">
3
    <el-form
3
    <el-form
4
      ref="userForm"
4
      ref="infoRow"
5
      class="form-main"
5
      class="form-main"
6
      label-width="80px">
6
      label-width="80px">
7
      <el-row :gutter="20">
7
      <el-row :gutter="20">
8
        <el-col :span="16">
8
        <el-col :span="16">
9
          <el-col :span="12">
9
          <el-col :span="12">
10
            <el-form-item label="用户名">{{userForm.name}}</el-form-item>
10
            <el-form-item label="用户名">{{infoRow.account}}</el-form-item>
11
          </el-col>
11
          </el-col>
12
          <el-col :span="12">
12
          <el-col :span="12">
13
            <el-form-item label="账号状态">正常用户</el-form-item>
13
            <el-form-item label="账号状态">{{type?'黑名单用户':'正常用户'}}</el-form-item>
14
          </el-col>
14
          </el-col>
15
          <el-col :span="12">
15
          <el-col :span="12">
16
            <el-form-item label="手机账号">{{userForm.account}}</el-form-item>
16
            <el-form-item label="手机账号">{{infoRow.loginPhone}}</el-form-item>
17
          </el-col>
17
          </el-col>
18
          <el-col :span="12">
18
          <el-col :span="12">
19
            <el-form-item label="真实姓名">{{userForm.name}}</el-form-item>
19
            <el-form-item label="真实姓名">{{infoRow.name}}</el-form-item>
20
          </el-col>
20
          </el-col>
21
          <el-col :span="12">
21
          <el-col :span="12">
22
            <el-form-item label="性别">{{userForm.sex}}</el-form-item>
22
            <el-form-item label="性别">{{infoRow.sex===0?'男':'女'}}</el-form-item>
23
          </el-col>
23
          </el-col>
24
          <el-col :span="12">
24
          <el-col :span="12">
25
            <el-form-item label="职位">{{userForm.position}}</el-form-item>
25
            <el-form-item label="职位">{{infoRow.job}}</el-form-item>
26
          </el-col>
26
          </el-col>
27
          <el-col :span="24">
27
          <el-col :span="24">
28
            <el-form-item label="所在企业">{{userForm.company}}</el-form-item>
28
            <el-form-item label="所在机构">{{infoRow.comp}}</el-form-item>
29
          </el-col>
29
          </el-col>
30
          <el-col :span="12">
30
          <el-col :span="12">
31
            <el-form-item label="联系电话">{{userForm.tel}}</el-form-item>
31
            <el-form-item label="联系电话">{{infoRow.linkPhone}}</el-form-item>
32
          </el-col>
32
          </el-col>
33
          <el-col :span="12">
33
          <el-col :span="12">
34
            <el-form-item label="联系邮箱">{{userForm.mail}}</el-form-item>
34
            <el-form-item label="联系邮箱">{{infoRow.email}}</el-form-item>
35
          </el-col>
35
          </el-col>
36
          <el-col :span="24">
36
          <el-col :span="24">
37
            <el-form-item label="所在城市">{{userForm.city}}</el-form-item>
37
            <el-form-item label="所在城市">{{AllCitys[infoRow.addr]}}</el-form-item>
38
          </el-col>
39
          <el-col :span="24" v-if="type">
40
            <el-form-item label="拉黑理由" class="el-to-block">
41
              <div class="textarea-div">{{infoRow.invalidReason}}</div>
42
            </el-form-item>
38
          </el-col>
43
          </el-col>
39
        </el-col>
44
        </el-col>
40
        <el-col :span="8">
45
        <el-col :span="8">
41
          <div class="headImg" :style="{backgroundImage:'url('+ userForm.img +')'}"></div>
46
          <div class="headImg" :style="{backgroundImage:'url('+ headUrl +')'}"></div>
42
        </el-col>
47
        </el-col>
43
        <el-col :span="24" class="el-btn-col">
48
        <el-col :span="24" class="el-btn-col">
44
          <div class="el-btn-col-box">
49
          <div class="el-btn-col-box">
45
            <el-button type="primary">确定</el-button>
50
            <el-button type="primary" @click="userDialogVisible=false">确定</el-button>
46
          </div>
51
          </div>
47
        </el-col>
52
        </el-col>
48
        <el-col :span="24">
53
        <el-col :span="24">
49
          <el-form-item align="right">
54
          <el-form-item align="right">
50
            <span>创建时间:2018/08/23 18:52:12</span>
55
            <span v-if='!type'>创建时间: {{createTime}}</span>
56
            <span v-else>拉黑时间: {{invalidTime}}</span>
51
          </el-form-item>
57
          </el-form-item>
52
        </el-col>
58
        </el-col>
53
      </el-row>
59
      </el-row>
56
</template>
62
</template>
57
63
58
<script>
64
<script>
65
  import { queryBlackOne } from '@/api/userInfo'
66
  import { defaultSet, parseTime } from '@/utils'
67
  import queryDict from '@/utils/queryDict'
68
  import queryBase from '@/utils/queryBase'
59
  export default {
69
  export default {
70
    props: ['type'],
60
    data() {
71
    data() {
61
      return {
72
      return {
62
        userDialogVisible: false,
73
        userDialogVisible: false,
63
        userForm: ''
74
        AllCitys: [],
75
        infoRow: ''
76
      }
77
    },
78
    computed: {
79
      dialogTit() {
80
        return this.type ? '黑名单用户信息' : '用户信息'
81
      },
82
      headUrl() {
83
        return this.infoRow.head ? '/data/head' + this.infoRow.head : defaultSet.img.user
84
      },
85
      createTime() {
86
        return this.infoRow.createTime ? parseTime(this.infoRow.createTime) : ''
87
      },
88
      invalidTime() {
89
        return this.infoRow.invalidTime ? parseTime(this.infoRow.invalidTime) : ''
64
      }
90
      }
65
    },
91
    },
66
    created() {
92
    created() {
93
      this.getDictoryData()
67
    },
94
    },
68
    methods: {
95
    methods: {
96
      getDictoryData() {
97
        const that = this
98
        queryDict.applyDict('XZQH', function(dictData) {
99
          dictData.map(item => {
100
            that.AllCitys[item.code] = item.fullCaption
101
          })
102
        })
103
      },
104
      queryNormalOne(id) {
105
        var that = this
106
        if (id) {
107
          queryBase.getNormalOne(id, function(sc, value) {
108
            if (sc) {
109
              that.infoRow = value
110
            }
111
          })
112
          setTimeout(function() {
113
            that.userDialogVisible = true
114
          }, 0)
115
        }
116
      },
117
      queryBlackOne(id) {
118
        var that = this
119
        if (id) {
120
          this.$http.get(queryBlackOne, {
121
            id: id
122
          }, function(res) {
123
            if (res.success) {
124
              that.infoRow = res.data
125
            }
126
          })
127
          setTimeout(function() {
128
            that.userDialogVisible = true
129
          }, 0)
130
        }
131
      }
69
    }
132
    }
70
  }
133
  }
71
</script>
134
</script>
74
  .form-main{
137
  .form-main{
75
    width:100%;
138
    width:100%;
76
  }
139
  }
77
  .shortW{
78
    width:300px;
79
  }
80
  .headImg{
140
  .headImg{
81
    width: 60px;
141
    width: 140px;
82
    height: 60px;
142
    height: 140px;
83
    background-size: cover;
143
    background-size: cover;
84
  }
144
  }
85
145

+ 137 - 47
src/views/userInfo/blackList.vue

3
    <div class="box-container">
3
    <div class="box-container">
4
      <div class="contain-title">黑名单用户</div>
4
      <div class="contain-title">黑名单用户</div>
5
      <div class="contain-search">
5
      <div class="contain-search">
6
        <el-input placeholder="搜索用户名/手机账号" v-model="searchText" class="input-with-select">
6
        <el-input placeholder="搜索用户名/手机账号" v-model="searchText" class="input-with-select"@keyup.enter.native="pageQueryUser">
7
          <el-button slot="append" icon="el-icon-search"></el-button>
7
          <el-button slot="append" icon="el-icon-search" @click="pageQueryUser"></el-button>
8
        </el-input>
8
        </el-input>
9
      </div>
9
      </div>
10
    </div>
10
    </div>
11
    <div class="content-container">
11
    <div class="content-container">
12
      <complex-table :tableData="tableData" :tableItem="tableItem"></complex-table>
12
      <el-table
13
        :data="tableData"
14
        height="630"
15
        border>
16
        <el-table-column
17
          v-for="item in tableItem"
18
          :key="item.index"
19
          :prop="item.prop ? item.prop : ''"
20
          :label="item.tit ? item.tit : ''"
21
          :width="item.width ? item.width : ''"
22
          align="center">
23
          <template slot-scope="scope">
24
            <div v-if="scope.row[item.prop]">
25
              <el-button v-if="item.link" type="text"
26
                @click="queryInfo(scope.row.id)">{{scope.row[item.prop]}}</el-button>
27
              <el-button v-else-if="item.reason" type="text"
28
                @click="blackReason(scope.row.id)">{{scope.row[item.prop]}}</el-button>
29
              <span v-else>{{scope.row[item.prop]}}</span>
30
            </div>
31
            <div class="operate-row" v-if="item.operate && typeof scope.row === 'object'">
32
              <el-button
33
                size="mini"
34
                type="primary"
35
                @click="handleRenew(scope.row.id)">恢复</el-button>
36
            </div>
37
          </template>
38
        </el-table-column>
39
      </el-table>
40
      <div class="pagination-container">
41
        <el-pagination
42
          background
43
          @current-change="handleCurrentChange"
44
          :current-page.sync="pageNo"
45
          :page-size="pageSize"
46
          layout="prev, pager, next, jumper"
47
          :total="total">
48
        </el-pagination>
49
      </div>
13
    </div>
50
    </div>
51
    <baseInfo ref="baseInfo" :type="blackType"></baseInfo>
52
    <pullBlack ref="pullBlack"></pullBlack>
14
  </div>
53
  </div>
15
</template>
54
</template>
16
55
17
<script>
56
<script>
18
import complexTable from '@/components/complexTable'
57
import {
58
  pageBlackUser,
59
  cancelBlackUser
60
} from '@/api/userInfo'
61
import { parseTime } from '@/utils'
62
import comTable from '@/utils/comTable'
63
import queryBase from '@/utils/queryBase'
64
65
import baseInfo from './baseInfo'
66
import pullBlack from './pullBlack'
19
export default {
67
export default {
20
  data() {
68
  data() {
21
    return {
69
    return {
70
      blackType: true,
22
      searchText: '',
71
      searchText: '',
23
      selectMode: '',
72
      pageSize: 10,
24
      tableData: [
73
      pageNo: 1,
25
        {
74
      total: 0,
26
          date: '2018/08/25 16:32',
75
      tableData: [],
27
          name: '关于征集企业技术创新需求的通知',
28
          class: '通知公告',
29
          owner: '张贝贝',
30
          num: '4552'
31
        }, {
32
          date: '2018/08/25 16:32',
33
          name: '关于征集企业技术创新需求的通知',
34
          class: '通知公告',
35
          owner: '张贝贝',
36
          num: '4552'
37
        }, {
38
          date: '2018/08/25 16:32',
39
          name: '关于征集企业技术创新需求的通知',
40
          class: '通知公告',
41
          owner: '张贝贝',
42
          num: '4552'
43
        }, {
44
          date: '2018/08/25 16:32',
45
          name: '关于征集企业技术创新需求的通知',
46
          class: '通知公告',
47
          owner: '张贝贝',
48
          num: '4552'
49
        }
50
      ],
51
      tableItem: [
76
      tableItem: [
52
        {
77
        {
53
          prop: 'name',
78
          prop: 'loginPhone',
54
          tit: '标题'
79
          tit: '手机账号',
80
          width: '120',
81
          link: true
55
        },
82
        },
56
        {
83
        {
57
          prop: 'class',
84
          prop: 'account',
58
          tit: '栏目分类',
85
          tit: '用户名'
59
          width: '160'
60
        },
86
        },
61
        {
87
        {
62
          prop: 'inkPhowner',
88
          prop: 'linkPhone',
63
          tit: '发布人',
89
          tit: '联系电话',
64
          width: '160'
90
          width: '120'
65
        },
91
        },
66
        {
92
        {
67
          prop: 'date',
93
          prop: 'email',
68
          tit: '发布时间',
94
          tit: '联系邮箱',
69
          width: '160'
95
          width: '160'
70
        },
96
        },
71
        {
97
        {
72
          prop: 'num',
98
          prop: 'invalidTime',
73
          tit: '浏览数量',
99
          tit: '最后拉黑时间',
74
          width: '160'
100
          width: '160'
75
        },
101
        },
76
        {
102
        {
77
          operate: 'edit',
103
          prop: 'invalidReason',
78
          width: '200'
104
          tit: '最后拉黑理由',
105
          width: '240',
106
          reason: true
107
        },
108
        {
109
          prop: 'invalidOperator',
110
          tit: '操作人'
111
        },
112
        {
113
          operate: true,
114
          width: '100'
79
        }
115
        }
80
      ]
116
      ]
81
    }
117
    }
82
  },
118
  },
83
  components: {
119
  components: {
84
    complexTable
120
    baseInfo,
121
    pullBlack
122
  },
123
  created() {
124
    this.pageQueryUser()
85
  },
125
  },
86
  methods: {
126
  methods: {
127
    pageQueryUser() {
128
      var that = this
129
      this.$http.get(pageBlackUser, {
130
        key: that.searchText,
131
        pageSize: that.pageSize,
132
        pageNo: that.pageNo
133
      }, function(res) {
134
        if (res.success && res.data) {
135
          const obj = res.data.data
136
          for (let i = 0; i < obj.length; ++i) {
137
            if (obj[i].invalidTime) {
138
              obj[i].invalidTime = parseTime(obj[i].invalidTime)
139
            }
140
            if (obj[i].invalidOperator) {
141
              queryBase.getAdminUser(obj[i].invalidOperator, function(sc, value) {
142
                if (sc) {
143
                  obj[i].invalidOperator = value.name
144
                }
145
              })
146
            }
147
          }
148
          that.total = res.data.total
149
          that.tableData = obj
150
          comTable.gapFilling(that.tableData)
151
        } else {
152
          that.total = 0
153
          that.tableData = []
154
        }
155
      })
156
    },
157
    handleCurrentChange(val) {
158
      this.pageNo = val
159
      this.pageQueryUser()
160
    },
161
    queryInfo(id) {
162
      this.$refs.baseInfo.queryBlackOne(id)
163
    },
164
    blackReason(id) {
165
      this.$refs.pullBlack.queryBlackOne(id)
166
    },
167
    handleRenew(id) {
168
      var that = this
169
      this.$http.get(cancelBlackUser, {
170
        id: id
171
      }, function(res) {
172
        if (res.success) {
173
          that.pageQueryUser()
174
        }
175
      })
176
    }
87
  }
177
  }
88
}
178
}
89
</script>
179
</script>

+ 80 - 61
src/views/userInfo/pullBlack.vue

1
<template>
1
<template>
2
  <el-dialog title="拉黑用户" :visible.sync="userDialogVisible">
2
  <el-dialog :title="dialogTit" :visible.sync="userDialogVisible">
3
    <el-form
3
    <el-form
4
      :model="userForm"
5
      ref="userForm"
6
      class="form-main"
4
      class="form-main"
7
      label-width="80px">
5
      label-width="80px">
8
      <el-row :gutter="20">
6
      <el-row :gutter="20">
9
        <el-col :span="12">
7
        <el-col :span="12">
10
          <el-form-item label="用户名">{{userForm.name}}</el-form-item>
8
          <el-form-item label="用户名">{{infoRow.account}}</el-form-item>
11
        </el-col>
9
        </el-col>
12
        <el-col :span="12">
10
        <el-col :span="12" v-if="infoPullId">
13
          <el-form-item label="真实姓名">{{userForm.name}}</el-form-item>
11
          <el-form-item label="真实姓名">{{infoRow.name}}</el-form-item>
14
        </el-col>
12
        </el-col>
15
        <el-col :span="12">
13
        <el-col :span="12">
16
          <el-form-item label="手机账号">{{userForm.account}}</el-form-item>
14
          <el-form-item label="手机账号">{{infoRow.loginPhone}}</el-form-item>
17
        </el-col>
15
        </el-col>
18
        <el-col :span="12">
16
        <el-col :span="12" v-if="infoPullId">
19
          <el-form-item label="性别">{{userForm.sex}}</el-form-item>
17
          <el-form-item label="性别">{{infoRow.sex===0?'男':'女'}}</el-form-item>
20
        </el-col>
18
        </el-col>
21
        <el-col :span="24">
19
        <el-col :span="24">
22
          <el-form-item label="所在机构">{{userForm.position}}</el-form-item>
20
          <el-form-item label="所在机构">{{infoRow.comp}}</el-form-item>
23
        </el-col>
21
        </el-col>
24
        <el-col :span="24">
22
        <el-col :span="24">
25
          <el-form-item class="is-required" label="拉黑理由" prop="desc">
23
          <el-form-item v-if="infoPullId" class="is-required" label="拉黑理由">
26
            <el-input type="textarea" :rows="8" v-model="userForm.desc" placeholder="请用一句话概括该用户拉黑理由" maxlength="100"></el-input>
24
            <el-input type="textarea" :rows="5" v-model="reason" placeholder="请用一句话概括该用户拉黑理由" maxlength="100"></el-input>
27
          </el-form-item>
25
          </el-form-item>
26
          <el-form-item v-else label="拉黑理由" class="el-to-block">
27
              <div class="textarea-div">{{infoRow.invalidReason}}</div>
28
            </el-form-item>
28
        </el-col>
29
        </el-col>
29
        <el-col :span="24" class="el-btn-col">
30
        <el-col :span="24" class="el-btn-col">
30
          <div class="el-btn-col-box">
31
          <div class="el-btn-col-box">
31
            <el-button type="primary">确定</el-button>
32
            <el-button v-if="infoPullId" type="primary" @click="submitForm">确定</el-button>
33
            <el-button v-else type="primary" @click="userDialogVisible=false">确定</el-button>
32
          </div>
34
          </div>
33
        </el-col>
35
        </el-col>
34
        <el-col :span="24">
36
        <el-col :span="24" v-if="!infoPullId">
35
          <el-form-item align="right">
37
          <el-form-item align="right">
36
            <span>创建时间:2018/08/23 18:52:12</span>
38
            <span>拉黑时间: {{invalidTime}}</span>
37
          </el-form-item>
39
          </el-form-item>
38
        </el-col>
40
        </el-col>
39
      </el-row>
41
      </el-row>
42
</template>
44
</template>
43
45
44
<script>
46
<script>
47
  import { blackUser, queryBlackOne } from '@/api/userInfo'
48
  import queryBase from '@/utils/queryBase'
49
  import { parseTime } from '@/utils'
50
45
  export default {
51
  export default {
46
    data() {
52
    data() {
47
      return {
53
      return {
54
        infoPullId: '',
48
        userDialogVisible: false,
55
        userDialogVisible: false,
49
        userForm: {
56
        infoRow: '',
50
          account: '',
57
        reason: ''
51
          name: '',
52
          tel: '',
53
          mail: '',
54
          position: '',
55
          department: '',
56
          org: '',
57
          module: ''
58
        }
59
      }
58
      }
60
    },
59
    },
61
    created() {
60
    computed: {
62
61
      dialogTit() {
62
        return this.infoPullId ? '拉黑用户' : '拉黑理由'
63
      },
64
      invalidTime() {
65
        return this.infoRow.invalidTime ? parseTime(this.infoRow.invalidTime) : ''
66
      }
63
    },
67
    },
64
    methods: {
68
    methods: {
65
      submitForm(formName) {
69
      queryNormalOne(id) {
66
        // this.$refs[formName].validate((valid) => {
70
        var that = this
67
        //   if (valid) {
71
        that.infoPullId = id
68
        //   } else {
72
        if (id) {
69
        //     return false
73
          queryBase.getNormalOne(id, function(sc, value) {
70
        //   }
74
            if (sc) {
71
        // })
75
              that.infoRow = value
76
            }
77
          })
78
          setTimeout(function() {
79
            that.userDialogVisible = true
80
          }, 0)
81
        }
82
      },
83
      queryBlackOne(id) {
84
        var that = this
85
        if (id) {
86
          this.$http.get(queryBlackOne, {
87
            id: id
88
          }, function(res) {
89
            if (res.success) {
90
              that.infoRow = res.data
91
            }
92
          })
93
          setTimeout(function() {
94
            that.userDialogVisible = true
95
          }, 0)
96
        }
97
      },
98
      submitForm() {
99
        var that = this
100
        if (this.reason.length === 0) {
101
          this.$message('请填写该需求关闭理由')
102
          return
103
        }
104
        this.$http.post(blackUser, {
105
          id: that.infoPullId,
106
          reason: that.reason
107
        }, function(res) {
108
          if (res.success) {
109
            if (res.data === 0) {
110
              that.$message('该用户已经被拉黑,不允许操作')
111
            } else {
112
              that.$parent.pageQueryUser()
113
            }
114
            that.userDialogVisible = false
115
          }
116
        })
72
      }
117
      }
73
    }
118
    }
74
  }
119
  }
81
      border-top:1px dashed #ccc;
126
      border-top:1px dashed #ccc;
82
      margin-bottom:20px;
127
      margin-bottom:20px;
83
    }
128
    }
84
  }
129
  }    
85
  .shortW{
86
    width:300px;
87
  }
88
  .card-title{
89
    font-size: 20px;
90
    font-weight: bold;
91
  }
92
  .el-checkbox-group{
93
    .el-checkbox{
94
      font-size: 16px;
95
      margin: 10px 60px;
96
      .el-checkbox__inner{
97
        width: 16px;
98
        height: 16px;
99
      }
100
      .el-checkbox__inner::after{
101
        left:5px;
102
        top:2px;
103
      }
104
      .el-checkbox__label{
105
        line-height:24px;
106
        font-size:16px;
107
      }
108
    }
109
  }
110
    
111
</style>
130
</style>

+ 109 - 52
src/views/userInfo/usingList.vue

3
    <div class="box-container">
3
    <div class="box-container">
4
      <div class="contain-title">正常用户</div>
4
      <div class="contain-title">正常用户</div>
5
      <div class="contain-search">
5
      <div class="contain-search">
6
        <el-input placeholder="搜索用户名/手机账号" v-model="searchText" class="input-with-select">
6
        <el-input placeholder="搜索用户名/手机账号" v-model="searchText" class="input-with-select" @keyup.enter.native="pageQueryUser">
7
          <el-button slot="append" icon="el-icon-search"></el-button>
7
          <el-button slot="append" icon="el-icon-search" @click="pageQueryUser"></el-button>
8
        </el-input>
8
        </el-input>
9
      </div>
9
      </div>
10
    </div>
10
    </div>
11
    <div class="content-container">
11
    <div class="content-container">
12
      <complex-table :tableData="tableData" :tableItem="tableItem"></complex-table>
12
      <el-table
13
      <span @click="queryInfo">用户信息</span>
13
        :data="tableData"
14
      <span @click="pullBlackFun">拉黑</span>
14
        height="630"
15
        border>
16
        <el-table-column
17
          v-for="item in tableItem"
18
          :key="item.index"
19
          :prop="item.prop ? item.prop : ''"
20
          :label="item.tit ? item.tit : ''"
21
          :width="item.width ? item.width : ''"
22
          align="center">
23
          <template slot-scope="scope">
24
            <div v-if="scope.row[item.prop]">
25
              <el-button v-if="item.link" type="text"
26
                @click="queryInfo(scope.row.id)">{{scope.row[item.prop]}}</el-button>
27
              <span v-else>{{scope.row[item.prop]}}</span>
28
            </div>
29
            <div class="operate-row" v-if="item.operate && typeof scope.row === 'object'">
30
              <el-button
31
                size="medium"
32
                type="danger"
33
                @click="pullBlackFun(scope.row.id)">拉黑</el-button>
34
            </div>
35
          </template>
36
        </el-table-column>
37
      </el-table>
38
      <div class="pagination-container">
39
        <el-pagination
40
          background
41
          @current-change="handleCurrentChange"
42
          :current-page.sync="pageNo"
43
          :page-size="pageSize"
44
          layout="prev, pager, next, jumper"
45
          :total="total">
46
        </el-pagination>
47
      </div>
15
    </div>
48
    </div>
16
    <baseInfo ref="baseInfo"></baseInfo>
49
    <baseInfo ref="baseInfo"></baseInfo>
17
    <pullBlack ref="pullBlack"></pullBlack>
50
    <pullBlack ref="pullBlack"></pullBlack>
19
</template>
52
</template>
20
53
21
<script>
54
<script>
22
import complexTable from '@/components/complexTable'
55
import {
56
  pageNormalUser
57
} from '@/api/userInfo'
58
import { parseTime } from '@/utils'
59
import comTable from '@/utils/comTable'
60
23
import baseInfo from './baseInfo'
61
import baseInfo from './baseInfo'
24
import pullBlack from './pullBlack'
62
import pullBlack from './pullBlack'
25
export default {
63
export default {
26
  data() {
64
  data() {
27
    return {
65
    return {
28
      searchText: '',
66
      searchText: '',
29
      selectMode: '',
67
      pageSize: 10,
30
      tableData: [
68
      pageNo: 1,
31
        {
69
      total: 0,
32
          date: '2018/08/25 16:32',
70
      tableData: [],
33
          name: '关于征集企业技术创新需求的通知',
34
          class: '通知公告',
35
          owner: '张贝贝',
36
          num: '4552'
37
        }, {
38
          date: '2018/08/25 16:32',
39
          name: '关于征集企业技术创新需求的通知',
40
          class: '通知公告',
41
          owner: '张贝贝',
42
          num: '4552'
43
        }, {
44
          date: '2018/08/25 16:32',
45
          name: '关于征集企业技术创新需求的通知',
46
          class: '通知公告',
47
          owner: '张贝贝',
48
          num: '4552'
49
        }, {
50
          date: '2018/08/25 16:32',
51
          name: '关于征集企业技术创新需求的通知',
52
          class: '通知公告',
53
          owner: '张贝贝',
54
          num: '4552'
55
        }
56
      ],
57
      tableItem: [
71
      tableItem: [
58
        {
72
        {
59
          prop: 'name',
73
          prop: 'loginPhone',
60
          tit: '标题'
74
          tit: '手机账号',
75
          width: '120',
76
          link: true
61
        },
77
        },
62
        {
78
        {
63
          prop: 'class',
79
          prop: 'account',
64
          tit: '栏目分类',
80
          tit: '用户名'
65
          width: '160'
81
        },
82
        {
83
          prop: 'job',
84
          tit: '职位'
66
        },
85
        },
67
        {
86
        {
68
          prop: 'owner',
87
          prop: 'dep',
69
          tit: '发布人',
88
          tit: '所在机构'
89
        },
90
        {
91
          prop: 'linkPhone',
92
          tit: '联系电话',
93
          width: '120'
94
        },
95
        {
96
          prop: 'email',
97
          tit: '联系邮箱',
70
          width: '160'
98
          width: '160'
71
        },
99
        },
72
        {
100
        {
73
          prop: 'date',
101
          prop: 'createTime',
74
          tit: '发布时间',
102
          tit: '创建时间',
75
          width: '160'
103
          width: '160'
76
        },
104
        },
77
        {
105
        {
78
          prop: 'num',
106
          prop: 'createTime',
79
          tit: '浏览数量',
107
          tit: '最后登录时间',
80
          width: '160'
108
          width: '160'
81
        },
109
        },
82
        {
110
        {
83
          operate: 'edit',
111
          operate: true,
84
          width: '200'
112
          width: '100'
85
        }
113
        }
86
      ]
114
      ]
87
    }
115
    }
88
  },
116
  },
89
  components: {
117
  components: {
90
    complexTable,
91
    baseInfo,
118
    baseInfo,
92
    pullBlack
119
    pullBlack
93
  },
120
  },
121
  created() {
122
    this.pageQueryUser()
123
  },
94
  methods: {
124
  methods: {
95
    queryInfo() {
125
    pageQueryUser() {
96
      this.$refs.baseInfo.userDialogVisible = true
126
      var that = this
127
      this.$http.get(pageNormalUser, {
128
        key: that.searchText,
129
        pageSize: that.pageSize,
130
        pageNo: that.pageNo
131
      }, function(res) {
132
        if (res.success && res.data) {
133
          const obj = res.data.data
134
          for (let i = 0; i < obj.length; ++i) {
135
            if (obj[i].createTime) {
136
              obj[i].createTime = parseTime(obj[i].createTime)
137
            }
138
          }
139
          that.total = res.data.total
140
          that.tableData = obj
141
          comTable.gapFilling(that.tableData)
142
        } else {
143
          that.total = 0
144
          that.tableData = []
145
        }
146
      })
147
    },
148
    queryInfo(id) {
149
      this.$refs.baseInfo.queryNormalOne(id)
150
    },
151
    pullBlackFun(id) {
152
      this.$refs.pullBlack.queryNormalOne(id)
97
    },
153
    },
98
    pullBlackFun() {
154
    handleCurrentChange(val) {
99
      this.$refs.pullBlack.userDialogVisible = true
155
      this.pageNo = val
156
      this.pageQueryUser()
100
    }
157
    }
101
  }
158
  }
102
}
159
}

BIN
static/comimg/default-expert.jpg


BIN
static/comimg/default-org.jpg


BIN
static/comimg/default-plat.jpg